/**
 * JEET Education — Web Push Notification Opt-In UI Styles
 * Institute: JEET COMPUTER EDUCATION, Pali, Rajasthan
 * Positioning: Bottom-Left (Preserves bottom-right AiSensy widget without conflict)
 */

/* 1. Floating Bell Trigger Button */
.jwp-bell-widget {
  position: fixed;
  bottom: 24px;
  left: 24px;
  z-index: 99990;
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
}

.jwp-bell-btn {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0d6efd 0%, #0a58ca 100%);
  color: #ffffff;
  border: 2px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 8px 24px rgba(13, 110, 253, 0.35), 0 2px 6px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  outline: none;
}

.jwp-bell-btn:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 12px 28px rgba(13, 110, 253, 0.45), 0 4px 10px rgba(0, 0, 0, 0.15);
  background: linear-gradient(135deg, #0b5ed7 0%, #084298 100%);
}

.jwp-bell-btn:focus-visible {
  outline: 3px solid #60a5fa;
  outline-offset: 3px;
}

.jwp-bell-btn i {
  font-size: 20px;
  transition: transform 0.3s ease;
}

.jwp-bell-btn:hover i {
  animation: jwp-bell-ring 0.6s ease-in-out infinite alternate;
}

@keyframes jwp-bell-ring {
  0% { transform: rotate(-12deg); }
  100% { transform: rotate(12deg); }
}

/* Status Indicator Dot on Bell */
.jwp-badge-dot {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background-color: #22c55e;
  border: 2px solid #ffffff;
  display: none;
}

.jwp-bell-widget.is-subscribed .jwp-badge-dot {
  display: block;
  background-color: #22c55e; /* Green active */
}

.jwp-bell-widget.is-denied .jwp-badge-dot {
  display: block;
  background-color: #ef4444; /* Red blocked */
}

/* Pulse animation for unsubscribed visitors */
.jwp-bell-widget.has-prompt .jwp-bell-btn::after {
  content: '';
  position: absolute;
  top: -4px;
  left: -4px;
  right: -4px;
  bottom: -4px;
  border-radius: 50%;
  border: 2px solid #3b82f6;
  opacity: 0.8;
  animation: jwp-pulse 2.2s infinite ease-out;
  pointer-events: none;
}

@keyframes jwp-pulse {
  0% { transform: scale(1); opacity: 0.8; }
  100% { transform: scale(1.35); opacity: 0; }
}

/* 2. Flyout Opt-In Panel Card */
.jwp-panel {
  display: none;
  position: absolute;
  bottom: 64px;
  left: 0;
  width: 340px;
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.18), 0 4px 12px rgba(15, 23, 42, 0.08);
  border: 1px solid rgba(226, 232, 240, 0.9);
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px) scale(0.96);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  transform-origin: bottom left;
}

.jwp-panel.is-open {
  display: block;
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

/* Panel Header */
.jwp-panel-header {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  color: #ffffff;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.jwp-header-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.jwp-header-title i {
  color: #60a5fa;
  font-size: 15px;
}

.jwp-close-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 14px;
}

.jwp-close-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

/* Panel Body */
.jwp-panel-body {
  padding: 16px;
}

.jwp-desc {
  font-size: 13px;
  line-height: 1.5;
  color: #475569;
  margin: 0 0 14px 0;
}

/* Status Banner within Card */
.jwp-status-box {
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 12px;
  line-height: 1.45;
  margin-bottom: 14px;
  display: none;
}

.jwp-status-box.show {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.jwp-status-box.info {
  background-color: #eff6ff;
  color: #1e40af;
  border: 1px solid #bfdbfe;
}

.jwp-status-box.success {
  background-color: #f0fdf4;
  color: #166534;
  border: 1px solid #bbf7d0;
}

.jwp-status-box.warning {
  background-color: #fffbeb;
  color: #92400e;
  border: 1px solid #fde68a;
}

.jwp-status-box.error {
  background-color: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.jwp-status-box i {
  font-size: 14px;
  margin-top: 2px;
  flex-shrink: 0;
}

/* Action Buttons */
.jwp-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.jwp-btn {
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  border-radius: 8px;
  padding: 9px 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
  text-decoration: none;
}

.jwp-btn-primary {
  flex: 1;
  background: #0d6efd;
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(13, 110, 253, 0.25);
}

.jwp-btn-primary:hover:not(:disabled) {
  background: #0b5ed7;
  box-shadow: 0 4px 10px rgba(13, 110, 253, 0.35);
}

.jwp-btn-primary:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  box-shadow: none;
}

.jwp-btn-ghost {
  background: #f1f5f9;
  color: #475569;
}

.jwp-btn-ghost:hover {
  background: #e2e8f0;
  color: #1e293b;
}

.jwp-btn-danger {
  flex: 1;
  background: #fee2e2;
  color: #b91c1c;
  border: 1px solid #fca5a5;
}

.jwp-btn-danger:hover {
  background: #fecaca;
  color: #991b1b;
}

/* Mobile Responsiveness */
@media (max-width: 600px) {
  .jwp-bell-widget {
    bottom: 20px;
    left: 16px;
  }
  .jwp-panel {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.15);
    transform: translateY(100%);
    z-index: 99995;
  }
  .jwp-panel.is-open {
    transform: translateY(0);
  }
}
