/* ========================================================
   CINEMORA — Official Visual Identity & Design System
   Domain: cinemora-app.com
   ======================================================== */

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

:root {
  /* Brand Palette Extracted from Cinemora 3D Infinity Ribbon */
  --bg-midnight: #090b10;
  --bg-canvas: #0e121a;
  --bg-surface: #141924;
  --bg-surface-elevated: #1a2232;
  --bg-card: rgba(22, 27, 38, 0.7);
  --border-surface: rgba(46, 58, 78, 0.6);
  --border-glow: rgba(16, 217, 245, 0.3);

  /* Signature Brand Colors */
  --neon-cyan: #10D9F5;
  --cyan-glow: rgba(16, 217, 245, 0.45);
  --electric-indigo: #4F58E8;
  --indigo-glow: rgba(79, 88, 232, 0.45);
  --center-violet: #8F49C5;
  --rose-coral: #E86584;
  --rose-glow: rgba(232, 101, 132, 0.45);

  /* Typography Colors */
  --text-primary: #F8FAFC;
  --text-secondary: #94A3B8;
  --text-muted: #64748B;

  /* Spacing & Radii */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-full: 9999px;
}

/* Global Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-family: 'Vazirmatn', 'Plus Jakarta Sans', system-ui, sans-serif;
  background-color: var(--bg-midnight);
  color: var(--text-primary);
  overflow-x: hidden;
  width: 100%;
  max-width: 100%;
  touch-action: pan-y;
}

body {
  min-height: 100vh;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  position: relative;
  background-color: var(--bg-midnight);
  background-image: 
    radial-gradient(ellipse at 20% -10%, rgba(79, 88, 232, 0.15) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 20%, rgba(16, 217, 245, 0.12) 0%, transparent 50%),
    radial-gradient(circle at 50% 60%, rgba(143, 73, 197, 0.08) 0%, transparent 70%);
  background-attachment: fixed;
  color: var(--text-primary);
  line-height: 1.6;
}

body.modal-open {
  overflow: hidden !important;
}

/* Enforce absolute horizontal containment across all viewports */
html, body {
  overflow-x: hidden !important;
  max-width: 100% !important;
}

/* RTL / LTR text direction helpers */
[dir="rtl"] {
  direction: rtl;
  text-align: right;
}
[dir="ltr"] {
  direction: ltr;
  text-align: left;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 9px;
}
::-webkit-scrollbar-track {
  background: var(--bg-midnight);
}
::-webkit-scrollbar-thumb {
  background: #252e42;
  border-radius: var(--radius-full);
  border: 2px solid var(--bg-midnight);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--neon-cyan);
}

/* Ambient Floating Glow Lights */
.ambient-glow-1 {
  position: absolute;
  width: min(500px, 90vw);
  height: min(500px, 90vw);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(16, 217, 245, 0.18) 0%, transparent 70%);
  filter: blur(80px);
  pointer-events: none;
  z-index: 0;
  max-width: 100%;
  animation: floatPulse 12s ease-in-out infinite alternate;
}

.ambient-glow-2 {
  position: absolute;
  width: min(550px, 90vw);
  height: min(550px, 90vw);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(79, 88, 232, 0.2) 0%, transparent 70%);
  filter: blur(90px);
  pointer-events: none;
  z-index: 0;
  max-width: 100%;
  animation: floatPulse 16s ease-in-out infinite alternate-reverse;
}

@keyframes floatPulse {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(40px, -30px) scale(1.1); }
  100% { transform: translate(-30px, 40px) scale(0.95); }
}

/* Gradients */
.gradient-cinemora-text {
  background: linear-gradient(135deg, #10D9F5 0%, #7A8FEA 35%, #8F49C5 70%, #E86584 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
}

.gradient-cyan-indigo-text {
  background: linear-gradient(135deg, #10D9F5 0%, #4F58E8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
}

.gradient-gold-text {
  background: linear-gradient(135deg, #F59E0B 0%, #FBBF24 50%, #FCD34D 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
}

/* Glassmorphism Card Containers */
.glass-panel {
  background: rgba(20, 25, 36, 0.65);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-xl);
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.glass-panel:hover {
  border-color: rgba(16, 217, 245, 0.25);
  box-shadow: 0 16px 40px -10px rgba(16, 217, 245, 0.15);
}

/* Buttons */
.btn-primary-gradient {
  background: linear-gradient(135deg, #10D9F5 0%, #4F58E8 100%);
  color: #0b0e17;
  font-weight: 700;
  padding: 14px 28px;
  border-radius: var(--radius-full);
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-decoration: none;
  font-size: 1rem;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 20px rgba(16, 217, 245, 0.35);
  position: relative;
  overflow: hidden;
}

.btn-primary-gradient::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  transition: left 0.6s ease;
}

.btn-primary-gradient:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(16, 217, 245, 0.5);
  color: #000;
}

.btn-primary-gradient:hover::before {
  left: 100%;
}

.btn-secondary-glass {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(12px);
  color: var(--text-primary);
  font-weight: 600;
  padding: 14px 28px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(255, 255, 255, 0.15);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-decoration: none;
  font-size: 1rem;
  transition: all 0.25s ease;
}

.btn-secondary-glass:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--neon-cyan);
  color: #fff;
  transform: translateY(-2px);
}

/* Navigation Bar */
.navbar-sticky {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  background: rgba(11, 14, 23, 0.82);
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

/* Badge Pills */
.pill-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 600;
  background: rgba(16, 217, 245, 0.08);
  border: 1px solid rgba(16, 217, 245, 0.25);
  color: var(--neon-cyan);
}

.pill-tag.purple {
  background: rgba(143, 73, 197, 0.12);
  border-color: rgba(143, 73, 197, 0.3);
  color: #c084fc;
}

.pill-tag.coral {
  background: rgba(232, 101, 132, 0.12);
  border-color: rgba(232, 101, 132, 0.3);
  color: #fb7185;
}

/* Interactive Flashcard 3D Simulator */
.flashcard-3d-wrapper {
  perspective: 1200px;
  width: 100%;
  max-width: 540px;
  margin: 0 auto;
}

.flashcard-inner {
  position: relative;
  width: 100%;
  min-height: 480px;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  transform-style: preserve-3d;
}

.flashcard-inner.flipped {
  transform: rotateY(180deg);
}

.flashcard-front, .flashcard-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: var(--radius-xl);
  overflow: hidden;
  background: #141924;
  border: 1px solid rgba(46, 58, 78, 0.8);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
}

.flashcard-back {
  transform: rotateY(180deg);
  background: #161c28;
}

/* SM-2 Review Rating Buttons */
.sm2-btn-again {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #f87171;
}
.sm2-btn-again:hover {
  background: rgba(239, 68, 68, 0.3);
}

.sm2-btn-hard {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: #fbbf24;
}
.sm2-btn-hard:hover {
  background: rgba(245, 158, 11, 0.3);
}

.sm2-btn-good {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #34d399;
}
.sm2-btn-good:hover {
  background: rgba(16, 185, 129, 0.3);
}

.sm2-btn-easy {
  background: rgba(16, 217, 245, 0.15);
  border: 1px solid rgba(16, 217, 245, 0.4);
  color: #38bdf8;
}
.sm2-btn-easy:hover {
  background: rgba(16, 217, 245, 0.3);
}

/* Filmstrip Ticker */
.filmstrip-strip {
  display: flex;
  overflow: hidden;
  user-select: none;
  gap: 20px;
  padding: 12px 0;
  border-top: 1px dashed rgba(255, 255, 255, 0.1);
  border-bottom: 1px dashed rgba(255, 255, 255, 0.1);
  background: rgba(10, 13, 20, 0.6);
  width: 100%;
  max-width: 100%;
  contain: paint;
}

.filmstrip-track {
  display: flex;
  gap: 24px;
  animation: scrollTrack 30s linear infinite;
  white-space: nowrap;
}

@keyframes scrollTrack {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* Pricing Card Featured Glow */
.pricing-card-featured {
  position: relative;
  border: 2px solid transparent;
  background: linear-gradient(#141924, #141924) padding-box,
              linear-gradient(135deg, #10D9F5, #4F58E8, #8F49C5, #E86584) border-box;
  box-shadow: 0 0 35px rgba(79, 88, 232, 0.25);
}

.pricing-card-featured::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  background: linear-gradient(135deg, #10D9F5, #4F58E8, #8F49C5, #E86584);
  z-index: -1;
  filter: blur(14px);
  opacity: 0.3;
}

/* Phone Mockup Frame */
.phone-mockup-frame {
  position: relative;
  width: min(310px, 86vw);
  height: 620px;
  background: #000;
  border-radius: 46px;
  border: 10px solid #232b3c;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.8), 0 0 40px rgba(16, 217, 245, 0.15);
  overflow: hidden;
  margin: 0 auto;
}

.phone-dynamic-island {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  width: 90px;
  height: 22px;
  background: #000;
  border-radius: 20px;
  z-index: 40;
}

/* Comparison Forgetting Curve Visual */
.curve-chart-box {
  background: #11151f;
  border: 1px solid rgba(46, 58, 78, 0.7);
  border-radius: var(--radius-lg);
  padding: 24px;
  overflow: hidden;
  max-width: 100%;
}

/* Lightbox Modal */
.lightbox-modal {
  position: fixed;
  inset: 0;
  z-index: 999;
  background: rgba(4, 6, 10, 0.92);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.lightbox-modal.active {
  opacity: 1;
  pointer-events: auto;
}
.lightbox-content {
  max-width: 90vw;
  max-height: 88vh;
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8), 0 0 35px rgba(16, 217, 245, 0.25);
  border: 1px solid rgba(16, 217, 245, 0.3);
}
.lightbox-img {
  width: auto;
  max-height: 82vh;
  object-fit: contain;
  display: block;
}

/* 3D Book Showcase Perspective */
.book-card-3d {
  perspective: 1000px;
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.book-card-3d:hover {
  transform: translateY(-8px) scale(1.02);
}
.book-cover-img {
  transition: all 0.5s ease;
  filter: drop-shadow(0 15px 25px rgba(0, 0, 0, 0.7));
}
.book-card-3d:hover .book-cover-img {
  filter: drop-shadow(0 20px 35px rgba(16, 217, 245, 0.35));
}

/* Screenshot Tab Buttons */
.tab-pill {
  padding: 10px 18px;
  border-radius: 14px;
  background: rgba(20, 25, 36, 0.7);
  border: 1px solid rgba(46, 58, 78, 0.6);
  color: #94A3B8;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}
.tab-pill:hover {
  color: #FFF;
  border-color: rgba(16, 217, 245, 0.4);
}
.tab-pill.active {
  background: rgba(16, 217, 245, 0.15);
  border-color: var(--neon-cyan);
  color: var(--neon-cyan);
  box-shadow: 0 0 20px rgba(16, 217, 245, 0.2);
}

/* Video Player Frame with Glowing Edge */
.video-feature-frame {
  position: relative;
  border-radius: 24px;
  overflow: hidden;
  border: 1px solid rgba(16, 217, 245, 0.3);
  box-shadow: 0 20px 50px -10px rgba(0, 0, 0, 0.9), 0 0 30px rgba(79, 88, 232, 0.25);
  background: #000;
  width: 100%;
  max-width: 100%;
}

/* Responsive tweaks */
@media (max-width: 768px) {
  .phone-mockup-frame {
    width: min(270px, 84vw);
    height: 540px;
  }
  .flashcard-inner {
    min-height: 440px;
  }
  .tab-pill {
    padding: 8px 12px;
    font-size: 12px;
  }
}
