/* ==========================================================================
   Chatib Premium Blog Design System & Luxury Editorial Theme
   Covers both Dark Mode (default) and Light Mode
   ========================================================================== */

:root {
  /* Dark Mode Tokens (Luxury Editorial) */
  --bg-base: #06070d;
  --bg-surface: rgba(18, 19, 30, 0.7);
  --bg-card: rgba(255, 255, 255, 0.02);
  --text-main: #e2e8f0;
  --text-muted: #94a3b8;
  --text-lead: #f8fafc;
  --border-soft: rgba(255, 255, 255, 0.05);
  --border-accent: rgba(108, 92, 231, 0.2);
  --accent-color: #6c5ce7;
  --accent-gradient: linear-gradient(135deg, #6c5ce7 0%, #a855f7 100%);
  --accent-secondary: #ff7675;
  --accent-success: #55efc4;
  --accent-warn: #ffeaa7;
  --card-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
  --glass-blur: 16px;
  --font-editorial: 'Playfair Display', Georgia, serif;
  --font-interface: 'Outfit', sans-serif;
  --glow-color: rgba(108, 92, 231, 0.15);
}

body.light-theme {
  /* Light Mode Tokens (Elegant Premium Editorial) */
  --bg-base: #f7f9fc;
  --bg-surface: rgba(255, 255, 255, 0.8);
  --bg-card: rgba(0, 0, 0, 0.02);
  --text-main: #334155;
  --text-muted: #64748b;
  --text-lead: #0f172a;
  --border-soft: rgba(0, 0, 0, 0.06);
  --border-accent: rgba(108, 92, 231, 0.15);
  --accent-color: #5f27cd;
  --accent-gradient: linear-gradient(135deg, #5f27cd 0%, #a55eea 100%);
  --accent-secondary: #d63031;
  --accent-success: #10ac84;
  --accent-warn: #ff9f43;
  --card-shadow: 0 20px 40px rgba(108, 92, 231, 0.05);
  --glass-blur: 20px;
  --glow-color: rgba(95, 39, 205, 0.05);
}

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

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  background-color: var(--bg-base);
  color: var(--text-main);
  font-family: var(--font-interface);
  overflow-x: hidden;
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.5s ease, color 0.5s ease;
}

/* Animated Floating Orbs in Background */
.bg-decorations {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.12;
  transition: opacity 0.5s ease;
}

.orb-1 {
  top: -10%;
  right: -10%;
  width: 50vw;
  height: 50vw;
  background: var(--accent-color);
  animation: floatOrb 25s infinite alternate ease-in-out;
}

.orb-2 {
  bottom: 10%;
  left: -20%;
  width: 60vw;
  height: 60vw;
  background: #a855f7;
  animation: floatOrb 30s infinite alternate-reverse ease-in-out;
}

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

/* Scroll Progress Bar */
.scroll-progress-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: transparent;
  z-index: 1010;
}

.scroll-progress-bar {
  height: 100%;
  width: 0%;
  background: var(--accent-gradient);
  box-shadow: 0 0 10px var(--accent-color);
  transition: width 0.1s ease;
}

/* Premium Glassmorphic Navbar */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 80px;
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  background: rgba(var(--bg-base) == #06070d ? "6, 7, 13, 0.7" : "247, 249, 252, 0.7");
  border-bottom: 1px solid var(--border-soft);
  z-index: 1000;
  display: flex;
  align-items: center;
  transition: background 0.3s ease, border 0.3s ease;
}

.nav-container {
  width: 100%;
  max-width: 1300px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  font-size: 1.65rem;
  font-weight: 900;
  color: var(--text-lead);
  letter-spacing: -0.5px;
}

.logo-icon {
  height: 42px;
  margin-right: 12px;
  width: auto;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav-link {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  transition: color 0.3s ease, transform 0.2s ease;
}

.nav-link:hover {
  color: var(--text-lead);
  transform: translateY(-1px);
}

.btn {
  padding: 10px 26px;
  border-radius: 9999px;
  font-weight: 600;
  text-decoration: none;
  font-size: 0.9rem;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.btn-outline {
  border: 1px solid var(--border-soft);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-lead);
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--text-muted);
}

.btn-primary {
  background: var(--accent-gradient);
  color: white;
  border: none;
  box-shadow: 0 8px 24px rgba(108, 92, 231, 0.25);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(108, 92, 231, 0.45);
}

/* Post Header: Cinematic Magazine Look */
.post-header {
  padding: 160px 24px 60px;
  max-width: 1000px;
  margin: 0 auto;
  text-align: center;
  position: relative;
  z-index: 2;
}

.post-category {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(108, 92, 231, 0.08);
  border: 1px solid var(--border-accent);
  color: var(--accent-color);
  padding: 8px 20px;
  border-radius: 9999px;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 32px;
  box-shadow: 0 4px 15px rgba(108, 92, 231, 0.05);
}

.post-title {
  font-family: var(--font-editorial);
  font-size: clamp(2.2rem, 6vw, 4.2rem);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -1.5px;
  margin-bottom: 36px;
  color: var(--text-lead);
}

.post-meta-strip {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 36px;
  color: var(--text-muted);
  font-size: 0.95rem;
  border-top: 1px solid var(--border-soft);
  border-bottom: 1px solid var(--border-soft);
  padding: 22px 0;
  max-width: 800px;
  margin: 0 auto;
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 10px;
}

.meta-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 0.88rem;
  font-weight: 800;
  box-shadow: 0 4px 12px rgba(108, 92, 231, 0.3);
}

/* Immersive Layout Grid */
.article-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 64px;
  max-width: 1240px;
  margin: 0 auto;
  padding: 40px 24px 100px;
  position: relative;
  z-index: 2;
}

@media (max-width: 1024px) {
  .article-layout {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  .toc-column {
    display: none;
  }
}

/* Floating Table of Contents */
.toc-column {
  position: sticky;
  top: 120px;
  height: fit-content;
  align-self: start;
  padding-right: 16px;
}

.toc-title {
  font-size: 0.8rem;
  text-transform: uppercase;
  font-weight: 800;
  color: var(--text-lead);
  letter-spacing: 2px;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-soft);
}

.toc-list {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.toc-link {
  display: block;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
  border-left: 2px solid transparent;
  padding-left: 14px;
  line-height: 1.5;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.toc-link:hover, .toc-link.active {
  color: var(--accent-color);
  border-left-color: var(--accent-color);
  transform: translateX(6px);
}

/* Content Layout & Glassmorphic Content Cards */
.post-content {
  max-width: 860px;
}

.content-card {
  background: var(--bg-surface);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--border-soft);
  border-radius: 28px;
  padding: 56px;
  margin-bottom: 48px;
  box-shadow: var(--card-shadow);
  position: relative;
  overflow: hidden;
  transition: border-color 0.3s ease, box-shadow 0.3s ease, transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.content-card:hover {
  border-color: var(--border-accent);
  box-shadow: 0 30px 60px var(--glow-color);
}

.content-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 5px;
  background: var(--accent-gradient);
}

.content-card.green-top::before {
  background: linear-gradient(90deg, var(--accent-success), #00b894);
}

.content-card.warn-top::before {
  background: linear-gradient(90deg, var(--accent-warn), #fd9644);
}

/* Editorial Typography */
p {
  color: var(--text-main);
  font-size: 1.15rem;
  line-height: 1.9;
  margin-bottom: 28px;
}

p.lead {
  font-family: var(--font-editorial);
  font-size: 1.45rem;
  color: var(--text-lead);
  font-weight: 400;
  line-height: 1.75;
  border-left: 4px solid var(--accent-color);
  padding-left: 24px;
  margin-bottom: 40px;
}

h2 {
  font-family: var(--font-editorial);
  color: var(--text-lead);
  font-size: 2.15rem;
  font-weight: 700;
  margin: 56px 0 24px;
  line-height: 1.3;
  scroll-margin-top: 110px;
  letter-spacing: -0.5px;
}

h3 {
  font-family: var(--font-interface);
  color: var(--text-lead);
  font-size: 1.4rem;
  font-weight: 800;
  margin: 38px 0 16px;
  letter-spacing: -0.2px;
}

/* Beautiful Interactive Lists */
ul, ol {
  margin-bottom: 32px;
  padding-left: 28px;
}

li {
  color: var(--text-main);
  font-size: 1.12rem;
  margin-bottom: 12px;
}

/* Premium Highlight Callout Boxes */
.highlight-box {
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-left: 5px solid var(--accent-color);
  border-radius: 16px;
  padding: 24px 28px;
  margin: 36px 0;
  font-size: 1.05rem;
  color: var(--text-lead);
  line-height: 1.75;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.02);
}

.highlight-box.green {
  border-left-color: var(--accent-success);
}

.highlight-box.warn {
  border-left-color: var(--accent-warn);
}

.tip-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  font-weight: 800;
  letter-spacing: 1.5px;
  margin-bottom: 8px;
  display: block;
}

.tip-label.purple { color: #a855f7; }
.tip-label.green { color: var(--accent-success); }
.tip-label.warn { color: #fd9644; }

/* Interactive Step-by-Step Lists */
.steps-list {
  list-style: none;
  padding: 0;
  counter-reset: steps;
}

.steps-list li {
  counter-increment: steps;
  display: flex;
  gap: 20px;
  align-items: flex-start;
  margin-bottom: 24px;
  padding: 24px 28px;
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: 18px;
  transition: all 0.3s ease;
}

.steps-list li:hover {
  border-color: var(--border-accent);
  transform: translateX(4px);
}

.steps-list li::before {
  content: counter(steps);
  min-width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent-gradient);
  color: white;
  font-weight: 900;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(108, 92, 231, 0.3);
}

.steps-list li strong {
  display: block;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-lead);
  margin-bottom: 6px;
}

.steps-list li span {
  font-size: 1rem;
  color: var(--text-muted);
  line-height: 1.7;
}

/* Premium Custom Tables */
.comparison-table-wrapper {
  overflow-x: auto;
  margin: 36px 0;
  border: 1px solid var(--border-soft);
  border-radius: 20px;
  box-shadow: var(--card-shadow);
}

.comparison-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 1rem;
}

.comparison-table th, .comparison-table td {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border-soft);
  text-align: left;
}

.comparison-table th {
  background: var(--bg-card);
  font-weight: 800;
  color: var(--text-lead);
  letter-spacing: 0.5px;
}

.comparison-table tr:last-child td {
  border-bottom: none;
}

.check {
  color: var(--accent-success);
  font-weight: 900;
}

.cross {
  color: var(--accent-secondary);
  font-weight: 900;
}

/* Elegant Accordions (FAQ Section) */
.faq-block {
  margin-bottom: 16px;
  border: 1px solid var(--border-soft);
  border-radius: 18px;
  overflow: hidden;
  background: var(--bg-card);
  transition: all 0.3s ease;
}

.faq-block:hover {
  border-color: var(--border-accent);
}

.faq-question {
  width: 100%;
  background: transparent;
  border: none;
  padding: 24px 28px;
  text-align: left;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-lead);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  transition: color 0.3s ease;
}

.faq-question:hover {
  color: var(--accent-color);
}

.faq-answer {
  padding: 0 28px;
  max-height: 0;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  font-size: 1.05rem;
  color: var(--text-muted);
  line-height: 1.8;
}

.faq-answer.open {
  padding: 0 28px 24px;
  max-height: 500px;
}

.faq-icon {
  font-size: 1.3rem;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  flex-shrink: 0;
  color: var(--accent-color);
}

.faq-icon.rotated {
  transform: rotate(45deg);
}

/* Dynamic Interactive Cards Grid */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  margin: 36px 0;
}

.tool-card {
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: 20px;
  padding: 32px;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.tool-card:hover {
  border-color: var(--accent-color);
  transform: translateY(-4px);
  box-shadow: 0 16px 36px var(--glow-color);
}

.tool-card-icon {
  font-size: 2.2rem;
  margin-bottom: 20px;
  display: inline-block;
}

/* Luxury Magazine Figures and Images */
figure {
  margin: 48px 0;
  border-radius: 24px;
  overflow: hidden;
  border: 1px solid var(--border-soft);
  box-shadow: var(--card-shadow);
  transition: transform 0.3s ease;
}

figure:hover {
  transform: scale(1.01);
}

figcaption {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-top: 14px;
  font-style: italic;
  padding: 0 24px 14px;
}

/* Premium Call To Action Box */
.cta-box {
  background: linear-gradient(135deg, rgba(108, 92, 231, 0.08), rgba(168, 85, 247, 0.08));
  border: 1px solid var(--border-accent);
  border-radius: 28px;
  padding: 56px;
  text-align: center;
  margin-top: 60px;
  position: relative;
  overflow: hidden;
}

.cta-box::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(108, 92, 231, 0.05) 0%, transparent 60%);
  pointer-events: none;
}

.cta-box h3 {
  font-family: var(--font-editorial);
  font-size: 2rem;
  color: var(--text-lead);
  margin-bottom: 16px;
  margin-top: 0;
}

.cta-box p {
  font-size: 1.1rem;
  color: var(--text-muted);
  margin-bottom: 36px;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

/* Footer Section */
.footer {
  border-top: 1px solid var(--border-soft);
  padding: 80px 24px 40px;
  background: rgba(var(--bg-base) == #06070d ? "4, 5, 10, 0.8" : "240, 244, 248, 0.8");
  backdrop-filter: blur(var(--glass-blur));
  position: relative;
  z-index: 2;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 48px;
}

.footer-brand p {
  color: var(--text-muted);
  margin-top: 18px;
  font-size: 0.95rem;
  line-height: 1.6;
  max-width: 300px;
}

.footer-col h4 {
  color: var(--text-lead);
  font-weight: 700;
  font-size: 1.05rem;
  margin-bottom: 20px;
  letter-spacing: 0.5px;
}

.footer-col a {
  display: block;
  color: var(--text-muted);
  font-size: 0.92rem;
  margin-bottom: 12px;
  text-decoration: none;
  transition: all 0.3s ease;
}

.footer-col a:hover {
  color: var(--accent-color);
  transform: translateX(4px);
}

.footer-bottom {
  text-align: center;
  padding-top: 36px;
  border-top: 1px solid var(--border-soft);
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 60px;
}

/* Motion Reveal Animation Classes */
.reveal-on-scroll {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-on-scroll.active {
  opacity: 1;
  transform: translateY(0);
}


/* ==========================================================================
   PREMIUM CINEMATIC ANIMATIONS & INTERACTIVE STATES
   ========================================================================== */

/* 1. Cinematic Scroll Fade-ins */
.reveal-on-scroll {
  opacity: 0;
  transform: translateY(40px) scale(0.98);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

.reveal-on-scroll.active {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* Stagger delays for multiple items */
.reveal-on-scroll:nth-child(1) { transition-delay: 0s; }
.reveal-on-scroll:nth-child(2) { transition-delay: 0.1s; }
.reveal-on-scroll:nth-child(3) { transition-delay: 0.2s; }

/* 2. Parallax Image Wrappers */
.parallax-wrapper {
  overflow: hidden;
  border-radius: 12px;
  position: relative;
  box-shadow: 0 10px 30px rgba(0,0,0,0.15);
  margin-bottom: 2rem;
  /* Keep container stable while image translates inside */
}

.parallax-img {
  width: 100%;
  height: 120%; /* Taller than wrapper to allow Z-axis translation */
  object-fit: cover;
  display: block;
  transform: translateY(-10%); /* Starting offset */
  transition: transform 0.1s ease-out;
  will-change: transform;
}

/* 3. Cinematic Image Zoom Reveal */
.zoom-reveal-wrapper {
  overflow: hidden;
  border-radius: 8px;
  margin: 24px 0;
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
  position: relative;
}

.zoom-reveal-wrapper img {
  width: 100%;
  height: auto;
  display: block;
  transform: scale(1.15);
  transition: transform 1.5s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform;
}

.zoom-reveal-wrapper.active img {
  transform: scale(1);
}

/* 4. Luxury Hover States for Tables & Highlight Boxes */
.comparison-table tbody tr {
  transition: all 0.3s ease;
}

.comparison-table tbody tr:hover {
  background: rgba(108, 92, 231, 0.05);
  transform: scale(1.01);
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
  position: relative;
  z-index: 2;
}

.highlight-box {
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.highlight-box:hover {
  transform: translateY(-2px) scale(1.01);
  box-shadow: 0 12px 24px rgba(0,0,0,0.08);
  border-color: var(--accent-color);
}

/* 5. Glowing Magnetic CTA Box */
.cta-box {
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.cta-box:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 50px rgba(108, 92, 231, 0.2);
}

.magnetic-btn {
  display: inline-block;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
