/* ==========================================================================
   MahaAbhyas AI (GradeUP PRO) — Adaptive Dual-Mode Presentation Stylesheet
   State of Maharashtra • Department of Higher & Technical Education / DPDC
   Mode 1: Desktop Keynote Presentation (Large, Highly Readable Tabs & Typography)
   Mode 2: Mobile Interactive Story-Card Deck (100dvh Touch App for Mobile)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800;900&family=Noto+Sans+Devanagari:wght@400;500;600;700;800&display=swap');

:root {
  --primary-950: #090d16;
  --primary-900: #0f172a;
  --primary-850: #131f38;
  --primary-800: #1e3a8a;
  --primary-700: #1d4ed8;
  --primary-600: #2563eb;
  --primary-500: #3b82f6;
  --primary-400: #60a5fa;
  --primary-100: #dbeafe;
  --primary-50: #eff6ff;

  --maha-saffron: #ea580c;
  --maha-saffron-light: #ffedd5;
  --maha-saffron-dark: #c2410c;

  --accent-cyan: #06b6d4;
  --accent-emerald: #10b981;
  --accent-amber: #f59e0b;
  --accent-rose: #f43f5e;
  --accent-purple: #8b5cf6;

  --text-dark: #0f172a;
  --text-muted: #475569;
  --text-light: #94a3b8;

  --glass-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.08), 0 8px 10px -6px rgba(15, 23, 42, 0.04);
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;

  --transition-smooth: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  height: 100%;
  font-family: 'Plus Jakarta Sans', 'Noto Sans Devanagari', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--primary-950);
  color: var(--text-dark);
  overflow: hidden;
  user-select: none;
}

/* ================= Global Utilities ================= */
.desktop-only {
  display: block;
}
.mobile-only {
  display: none;
}

/* ================= Background Container ================= */
.deck-container {
  position: relative;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  background: 
    radial-gradient(circle at 10% 10%, rgba(234, 88, 12, 0.22) 0%, transparent 40%),
    radial-gradient(circle at 90% 90%, rgba(37, 99, 235, 0.25) 0%, transparent 40%),
    linear-gradient(180deg, #0f172a 0%, #090d16 100%);
  overflow: hidden;
}

/* ================= Top Navigation Bar ================= */
.top-navbar {
  height: 64px;
  min-height: 64px;
  background: rgba(15, 23, 42, 0.96);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 2px solid var(--primary-600);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.75rem;
  z-index: 100;
  color: #ffffff;
}

.brand-badge {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}

.brand-emblem {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--primary-600) 0%, var(--primary-800) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  font-weight: 900;
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.45);
  border: 1.5px solid rgba(255, 255, 255, 0.25);
}

.brand-text h1 {
  font-size: 1.05rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 6px;
}

.brand-text p {
  font-size: 0.72rem;
  color: #cbd5e1;
}

.nav-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-ctrl {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #e2e8f0;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 7px 13px;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition-smooth);
  text-decoration: none;
}

.btn-ctrl:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.35);
  color: #ffffff;
}

.btn-ctrl.primary {
  background: var(--primary-600);
  border-color: var(--primary-500);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
}

.btn-ctrl.primary:hover {
  background: var(--primary-700);
}

.lang-switch-wrap {
  display: flex;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  padding: 2px;
}

.lang-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.lang-btn.active {
  background: var(--primary-600);
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.45);
}

/* ================= Presentation Stage ================= */
.presentation-stage {
  flex: 1;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem 2rem 5rem 2rem;
}

/* Slides */
.slide {
  position: absolute;
  top: 1.25rem;
  bottom: 5rem;
  left: 2rem;
  right: 2rem;
  max-width: 1420px;
  margin: 0 auto;
  background: #ffffff;
  border-radius: var(--radius-lg);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.45);
  padding: 1.75rem 2.25rem;
  display: flex;
  flex-direction: column;
  opacity: 0;
  pointer-events: none;
  transform: scale(0.96) translateY(20px);
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  overflow-y: auto;
}

.slide.active {
  opacity: 1;
  pointer-events: auto;
  transform: scale(1) translateY(0);
  z-index: 10;
}

.slide.prev {
  transform: scale(0.96) translateX(-40px);
}

.slide.next {
  transform: scale(0.96) translateX(40px);
}

/* Slide Header */
.slide-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.1rem;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 0.75rem;
  flex-shrink: 0;
}

.slide-category-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--primary-800);
  background: var(--primary-50);
  border: 1px solid #bfdbfe;
  padding: 3px 10px;
  border-radius: 9999px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}

.slide-title {
  font-size: 1.55rem;
  font-weight: 900;
  color: #0f172a;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.slide-subtitle {
  font-size: 0.88rem;
  color: #64748b;
  margin-top: 3px;
  line-height: 1.35;
}

.slide-badge-tag {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  padding: 4px 12px;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 700;
  color: #475569;
  white-space: nowrap;
}

/* Slide Body */
.slide-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.85rem;
  min-height: 0;
}

/* Grids */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.85rem;
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.85rem;
}

/* Cards & Containers */
.card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-md);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: var(--transition-smooth);
}

.card:hover {
  border-color: #cbd5e1;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.card-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: #1e3a8a;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.card-desc {
  font-size: 0.78rem;
  color: #475569;
  line-height: 1.45;
}

.metric-box {
  background: linear-gradient(135deg, #f8fafc 0%, #eff6ff 100%);
  border: 1px solid #bfdbfe;
  border-radius: var(--radius-md);
  padding: 0.9rem;
  text-align: center;
}

.metric-value {
  font-size: 1.6rem;
  font-weight: 900;
  color: var(--primary-700);
  line-height: 1.1;
}

.metric-value.saffron {
  color: var(--maha-saffron);
}

.metric-label {
  font-size: 0.74rem;
  font-weight: 700;
  color: #64748b;
  margin-top: 4px;
}

/* Media Frame */
.media-frame {
  width: 100%;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1.5px solid #cbd5e1;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
  background: #0f172a;
}

.media-frame img {
  width: 100%;
  height: auto;
  max-height: 290px;
  object-fit: cover;
  display: block;
}

.media-caption {
  font-size: 0.72rem;
  color: #64748b;
  font-weight: 600;
  margin-top: 5px;
  text-align: center;
}

/* Bottom Controls */
.bottom-dock {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 56px;
  background: rgba(15, 23, 42, 0.94);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  z-index: 90;
}

.slide-dots {
  display: flex;
  align-items: center;
  gap: 6px;
}

.slide-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  cursor: pointer;
  transition: all 0.25s;
}

.slide-dot.active {
  width: 24px;
  border-radius: 12px;
  background: var(--primary-500);
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.65);
}

.slide-counter {
  font-size: 0.82rem;
  font-weight: 800;
  color: #94a3b8;
}

/* Drawer */
.slide-drawer {
  position: fixed;
  top: 64px;
  right: 0;
  width: 340px;
  bottom: 56px;
  background: rgba(15, 23, 42, 0.98);
  backdrop-filter: blur(20px);
  border-left: 1px solid rgba(255, 255, 255, 0.15);
  padding: 1.25rem;
  z-index: 120;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  overflow-y: auto;
}

.slide-drawer.open {
  transform: translateX(0);
  box-shadow: -15px 0 35px rgba(0, 0, 0, 0.5);
}

.drawer-item {
  padding: 9px 12px;
  border-radius: 8px;
  color: #cbd5e1;
  font-size: 0.8rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  margin-bottom: 5px;
  transition: all 0.15s;
}

.drawer-item:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.drawer-item.active {
  background: var(--primary-600);
  color: #ffffff;
  font-weight: 800;
}

/* Review, Feature & OER Enhancements */
.review-card {
  background: #ffffff;
  border: 1px solid #dbeafe;
  border-top: 3.5px solid #2563eb;
  border-radius: var(--radius-md);
  padding: 0.8rem 0.9rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 6px;
  box-shadow: 0 4px 12px rgba(30, 64, 175, 0.05);
}
.review-stars {
  color: #f59e0b;
  font-size: 0.78rem;
  letter-spacing: 1px;
  font-weight: 800;
}
.review-quote {
  font-size: 0.72rem;
  color: #334155;
  line-height: 1.4;
}
.review-author {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-top: 1px solid #f1f5f9;
  padding-top: 5px;
  font-size: 0.69rem;
}
.oer-pill {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1e40af;
  border-radius: 9999px;
  padding: 2px 8px;
  font-size: 0.66rem;
  font-weight: 800;
  display: inline-block;
}
.feature-highlight-strip {
  background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 100%);
  color: #ffffff;
  border-radius: var(--radius-md);
  padding: 10px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.feature-highlight-strip * {
  color: #ffffff;
}

.drawer-num {
  font-size: 0.72rem;
  font-weight: 800;
  background: rgba(255, 255, 255, 0.15);
  padding: 2px 6px;
  border-radius: 4px;
}

/* Responsive Mobile Layout (<= 991.98px) */
@media (max-width: 991.98px) {
  .desktop-only { display: none !important; }
  .mobile-only { display: flex !important; }

  .top-navbar {
    padding: 0 1rem;
    height: 54px;
    min-height: 54px;
  }

  .presentation-stage {
    padding: 0.5rem 0.5rem 64px 0.5rem;
  }

  .slide {
    top: 0.5rem;
    bottom: 60px;
    left: 0.5rem;
    right: 0.5rem;
    padding: 1rem;
    border-radius: 12px;
  }

  .slide-title {
    font-size: 1.15rem;
  }

  .grid-2, .grid-3, .grid-4 {
    grid-template-columns: 1fr;
    gap: 0.6rem;
  }

  .media-frame img {
    max-height: 180px;
  }

  .bottom-dock {
    height: 52px;
    padding: 0 1rem;
  }

  .slide-drawer {
    width: 85vw;
    top: 54px;
    bottom: 52px;
  }
}

/* Print Stylesheet for Instant PDF Generation */
@media print {
  body, html, .deck-container {
    overflow: visible !important;
    height: auto !important;
    background: #ffffff !important;
  }
  .top-navbar, .bottom-dock, .slide-drawer {
    display: none !important;
  }
  .presentation-stage {
    padding: 0 !important;
    display: block !important;
  }
  .slide {
    position: static !important;
    opacity: 1 !important;
    transform: none !important;
    page-break-after: always;
    box-shadow: none !important;
    border: 1px solid #e2e8f0;
    margin-bottom: 2rem;
    width: 100% !important;
    max-width: 100% !important;
  }
}
