/* ==========================================================================
   Easy2Siksha - "What's New" Onboarding & Guided Tour Styles
   Compatible with Desktop, Tablet, and Mobile Viewports
   ========================================================================== */

:root {
  --e2s-primary: #19C8A1;
  --e2s-primary-dark: #129a7c;
  --e2s-primary-light: #e6f9f5;
  --e2s-accent: #ff6b6b;
  --e2s-dark: #071224;
  --e2s-card-bg: #ffffff;
  --e2s-text-main: #1e293b;
  --e2s-text-muted: #64748b;
  --e2s-border: #e2e8f0;
  --e2s-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
  --e2s-radius: 16px;
  --e2s-z-modal: 999990;
  --e2s-z-tour: 999995;
}

/* --------------------------------------------------------------------------
   1. Reusable "NEW" Badges
   -------------------------------------------------------------------------- */
.e2s-new-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: linear-gradient(135deg, #19C8A1 0%, #0d9488 100%);
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 20px;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  vertical-align: middle;
  box-shadow: 0 2px 8px rgba(25, 200, 161, 0.3);
  animation: e2sBadgePulse 2.5s infinite ease-in-out;
  line-height: 1.2;
}

.e2s-new-badge--reward {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
}

.e2s-new-badge--feature {
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

.e2s-new-badge--pill {
  font-size: 10px;
  padding: 2px 6px;
}

@keyframes e2sBadgePulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 2px 8px rgba(25, 200, 161, 0.3);
  }
  50% {
    transform: scale(1.05);
    box-shadow: 0 4px 14px rgba(25, 200, 161, 0.5);
  }
}

/* --------------------------------------------------------------------------
   2. Main "What's New" Backdrop & Modal
   -------------------------------------------------------------------------- */
.e2s-onboarding-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(7, 18, 36, 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: var(--e2s-z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}

.e2s-onboarding-backdrop.is-visible {
  opacity: 1;
  visibility: visible;
}

.e2s-onboarding-dialog {
  background: #ffffff;
  width: 100%;
  max-width: 860px;
  max-height: 90vh;
  border-radius: var(--e2s-radius);
  box-shadow: var(--e2s-shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  transform: translateY(24px) scale(0.97);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  border: 1px solid rgba(25, 200, 161, 0.25);
}

.e2s-onboarding-backdrop.is-visible .e2s-onboarding-dialog {
  transform: translateY(0) scale(1);
}

/* Dialog Header */
.e2s-dialog-header {
  padding: 24px 28px 18px;
  background: linear-gradient(135deg, #071224 0%, #0f2744 100%);
  color: #ffffff;
  position: relative;
  border-bottom: 2px solid var(--e2s-primary);
}

.e2s-dialog-header h2 {
  margin: 0 0 6px 0;
  font-size: 24px;
  font-weight: 800;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: inherit;
}

.e2s-dialog-header p {
  margin: 0;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.82);
  line-height: 1.5;
}

.e2s-dialog-close {
  position: absolute;
  top: 18px;
  right: 20px;
  background: rgba(255, 255, 255, 0.12);
  border: none;
  color: #ffffff;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, transform 0.2s;
}

.e2s-dialog-close:hover {
  background: var(--e2s-primary);
  transform: rotate(90deg);
}

/* Dialog Content Area (Scrollable) */
.e2s-dialog-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
  background: #f8fafc;
}

.e2s-updates-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

/* Update Card Item */
.e2s-update-card {
  background: #ffffff;
  border: 1px solid var(--e2s-border);
  border-radius: 12px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
  position: relative;
}

.e2s-update-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.06);
  border-color: var(--e2s-primary);
}

.e2s-card-top {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 10px;
}

.e2s-card-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: var(--e2s-primary-light);
  color: var(--e2s-primary-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.e2s-card-head {
  flex: 1;
}

.e2s-card-title {
  margin: 0 0 4px 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--e2s-text-main);
  line-height: 1.3;
}

.e2s-card-desc {
  margin: 0 0 14px 0;
  font-size: 13px;
  color: var(--e2s-text-muted);
  line-height: 1.5;
}

.e2s-card-footer {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.e2s-update-cta {
  background: linear-gradient(135deg, #19C8A1 0%, #14b8a6 100%);
  color: #ffffff;
  border: none;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
  text-decoration: none;
}

.e2s-update-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(25, 200, 161, 0.4);
  color: #ffffff;
  text-decoration: none;
}

/* Dialog Footer */
.e2s-dialog-footer {
  padding: 16px 28px;
  background: #ffffff;
  border-top: 1px solid var(--e2s-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.e2s-visit-counter {
  font-size: 13px;
  font-weight: 500;
  color: var(--e2s-text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.e2s-visit-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--e2s-primary);
  display: inline-block;
}

.e2s-footer-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.e2s-btn-skip {
  background: transparent;
  border: 1px solid var(--e2s-border);
  color: var(--e2s-text-muted);
  padding: 9px 18px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.e2s-btn-skip:hover {
  background: #f1f5f9;
  color: var(--e2s-text-main);
}

.e2s-btn-tour {
  background: var(--e2s-dark);
  color: #ffffff;
  border: none;
  padding: 9px 20px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background 0.2s, transform 0.2s;
}

.e2s-btn-tour:hover {
  background: #0f2744;
  transform: translateY(-1px);
}

/* --------------------------------------------------------------------------
   3. Guided Feature Tour Overlay & Tooltip
   -------------------------------------------------------------------------- */
.e2s-tour-spotlight-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(7, 18, 36, 0.65);
  z-index: var(--e2s-z-tour);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  pointer-events: auto;
}

.e2s-tour-spotlight-backdrop.is-active {
  opacity: 1;
  visibility: visible;
}

.e2s-tour-highlight-box {
  position: absolute;
  border-radius: 10px;
  box-shadow: 0 0 0 4px var(--e2s-primary), 0 0 25px rgba(25, 200, 161, 0.6);
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: calc(var(--e2s-z-tour) + 1);
  animation: e2sSpotlightPulse 2s infinite ease-in-out;
}

@keyframes e2sSpotlightPulse {
  0%, 100% {
    box-shadow: 0 0 0 4px var(--e2s-primary), 0 0 20px rgba(25, 200, 161, 0.5);
  }
  50% {
    box-shadow: 0 0 0 7px var(--e2s-primary), 0 0 32px rgba(25, 200, 161, 0.8);
  }
}

.e2s-tour-tooltip {
  position: absolute;
  width: 320px;
  background: #ffffff;
  border-radius: 12px;
  padding: 18px;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.22);
  border: 1px solid var(--e2s-primary);
  z-index: calc(var(--e2s-z-tour) + 2);
  transition: all 0.3s ease;
  font-family: inherit;
}

.e2s-tour-arrow {
  position: absolute;
  width: 14px;
  height: 14px;
  background: #ffffff;
  border-style: solid;
  border-color: var(--e2s-primary);
  transform: rotate(45deg);
}

.e2s-tour-tooltip[data-popper-placement^='top'] .e2s-tour-arrow {
  bottom: -7px;
  left: calc(50% - 7px);
  border-width: 0 1px 1px 0;
}

.e2s-tour-tooltip[data-popper-placement^='bottom'] .e2s-tour-arrow {
  top: -7px;
  left: calc(50% - 7px);
  border-width: 1px 0 0 1px;
}

.e2s-tour-tooltip[data-popper-placement^='left'] .e2s-tour-arrow {
  right: -7px;
  top: calc(50% - 7px);
  border-width: 1px 1px 0 0;
}

.e2s-tour-tooltip[data-popper-placement^='right'] .e2s-tour-arrow {
  left: -7px;
  top: calc(50% - 7px);
  border-width: 0 0 1px 1px;
}

.e2s-tour-step-badge {
  font-size: 11px;
  font-weight: 700;
  color: var(--e2s-primary-dark);
  text-transform: uppercase;
  margin-bottom: 6px;
  display: block;
}

.e2s-tour-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--e2s-text-main);
  margin: 0 0 6px 0;
}

.e2s-tour-body {
  font-size: 13px;
  color: var(--e2s-text-muted);
  line-height: 1.5;
  margin-bottom: 14px;
}

.e2s-tour-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.e2s-tour-btn {
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
}

.e2s-tour-btn--next {
  background: var(--e2s-primary);
  color: #ffffff;
}

.e2s-tour-btn--next:hover {
  background: var(--e2s-primary-dark);
}

.e2s-tour-btn--skip {
  background: transparent;
  color: var(--e2s-text-muted);
}

.e2s-tour-btn--skip:hover {
  color: var(--e2s-text-main);
}

/* --------------------------------------------------------------------------
   4. Mobile & Responsive Layout Adjustments
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
  .e2s-onboarding-backdrop {
    align-items: flex-end;
    padding: 0;
  }

  .e2s-onboarding-dialog {
    max-width: 100%;
    max-height: 85vh;
    border-radius: 20px 20px 0 0;
    transform: translateY(100%);
  }

  .e2s-onboarding-backdrop.is-visible .e2s-onboarding-dialog {
    transform: translateY(0);
  }

  .e2s-updates-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .e2s-dialog-header {
    padding: 20px 20px 14px;
  }

  .e2s-dialog-header h2 {
    font-size: 20px;
  }

  .e2s-dialog-body {
    padding: 16px;
  }

  .e2s-dialog-footer {
    padding: 14px 20px;
    flex-direction: column;
    gap: 12px;
  }

  .e2s-footer-actions {
    width: 100%;
    justify-content: space-between;
  }

  .e2s-btn-skip, .e2s-btn-tour {
    flex: 1;
    text-align: center;
    justify-content: center;
  }

  .e2s-tour-tooltip {
    width: 280px;
    padding: 14px;
  }
}
