/* ============================================================
 * PPT Design — Design System Tokens
 * Based on OBS design system, remapped from purple → blue palette
 * Supports dark/light themes via [data-theme] attribute
 * ============================================================ */

/* ── Base Reset ─────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
}

/* Global body font — Poppins for body, Clash Display for headings */
body {
  font-family: var(--font-sans) !important;
  color: var(--color-text-primary);
  background: var(--color-bg-base);
  margin: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
h1, h2, h3, h4, h5, h6, .brand-font {
  font-family: var(--font-display) !important;
}

/* ── Light Theme (default) ──────────────────────────────────── */
:root,
[data-theme="light"] {
  /* Brand colors — blue palette (full shade scale) */
  --color-brand-50: #eff6ff;
  --color-brand-100: #dbeafe;
  --color-brand-200: #bfdbfe;
  --color-brand-300: #93c5fd;
  --color-brand-400: #60a5fa;
  --color-brand-500: #3b82f6;
  --color-brand-600: #2563eb;
  --color-brand-700: #1d4ed8;
  --color-brand-800: #1e40af;
  --color-brand-900: #1e3a8a;
  --color-brand-dark: #0a1628;
  --color-brand-primary: #1e40af;
  --color-brand-secondary: #1d4ed8;
  --color-brand-light: #60a5fa;

  /* Transition shorthand */
  --transition-normal: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);

  /* Background — OBS-style lavender tint */
  --color-bg-base: #FAFBFF;
  --color-bg-subtle: #F0EDFA;
  --color-bg-muted: #E8E5F0;
  --color-bg-elevated: #ffffff;
  --color-bg-overlay: rgba(0, 0, 0, 0.5);
  --color-bg-card: #ffffff;
  --color-bg-card-hover: #f8fafc;
  --color-bg-input: #ffffff;
  --color-bg-dark: #0f1d3a;

  /* Text */
  --color-text-primary: #0f172a;
  --color-text-secondary: #475569;
  --color-text-tertiary: #94a3b8;
  --color-text-inverse: #ffffff;
  --color-text-link: #1e40af;
  --color-text-link-hover: #1d4ed8;
  --color-text-on-brand: #ffffff;

  /* Border */
  --color-border-default: #e2e8f0;
  --color-border-muted: #f1f5f9;
  --color-border-strong: #cbd5e1;
  --color-border-brand: #1e40af;

  /* Accent (CTA glow, badges) */
  --t-accent: #1e40af;
  --t-accent-hover: #1d4ed8;
  --t-accent-muted: rgba(30, 64, 175, 0.1);

  /* Theme tokens (mapped from OBS --t-* system) */
  --t-purple: #2563eb;
  --t-purple-light: #60a5fa;
  --t-purple-bg: rgba(37, 99, 235, 0.1);
  --t-purple-border: rgba(37, 99, 235, 0.2);

  /* Gradients */
  --t-gradient-hero: linear-gradient(180deg, #F0EDFA 0%, #FAFBFF 50%, #FAFBFF 100%);
  --t-gradient-cta: linear-gradient(135deg, #F0EDFA 0%, #E8E0F8 50%, #F0EDFA 100%);
  --t-gradient-card: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  --t-gradient-button: linear-gradient(135deg, #1e40af 0%, #2563eb 100%);
  --t-gradient-button-hover: linear-gradient(135deg, #1d4ed8 0%, #3b82f6 100%);

  /* Glass morphism — OBS-style clean cards */
  --t-glass-bg: rgba(255, 255, 255, 0.85);
  --t-glass-border: #E0DBF0;
  --t-glass-border-hover: rgba(37, 99, 235, 0.25);
  --t-glass-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);

  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07), 0 2px 4px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.08), 0 4px 6px rgba(0, 0, 0, 0.04);
  --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.08), 0 8px 10px rgba(0, 0, 0, 0.03);
  --shadow-card: 0 2px 8px rgba(0, 0, 0, 0.06), 0 0 1px rgba(0, 0, 0, 0.1);
  --shadow-card-hover: 0 8px 24px rgba(0, 0, 0, 0.1), 0 0 1px rgba(0, 0, 0, 0.12);
  --shadow-button: 0 2px 4px rgba(30, 64, 175, 0.2);

  /* Status colors */
  --color-success: #16a34a;
  --color-success-bg: #f0fdf4;
  --color-warning: #ca8a04;
  --color-warning-bg: #fefce8;
  --color-error: #dc2626;
  --color-error-bg: #fef2f2;
  --color-info: #2563eb;
  --color-info-bg: #eff6ff;

  /* Premium badge */
  --color-premium: #ca8a04;
  --color-premium-bg: #fef9c3;
  --color-free: #16a34a;
  --color-free-bg: #dcfce7;

  color-scheme: light;
}

/* ── Dark Theme ─────────────────────────────────────────────── */
[data-theme="dark"] {
  /* Brand colors — blue palette (brighter for dark bg) */
  --color-brand-dark: #0a1628;
  --color-brand-primary: #3b82f6;
  --color-brand-secondary: #2563eb;
  --color-brand-light: #93c5fd;

  /* Background */
  --color-bg-base: #0a1628;
  --color-bg-subtle: #0f1d3a;
  --color-bg-muted: #141e33;
  --color-bg-elevated: #1a2740;
  --color-bg-overlay: rgba(0, 0, 0, 0.7);
  --color-bg-card: #141e33;
  --color-bg-card-hover: #1a2740;
  --color-bg-input: #141e33;
  --color-bg-dark: #0f1d3a;

  /* Text */
  --color-text-primary: #f1f5f9;
  --color-text-secondary: #a1b0c4;
  --color-text-tertiary: #8392a7;
  --color-text-inverse: #0f172a;
  --color-text-link: #60a5fa;
  --color-text-link-hover: #93c5fd;

  /* Brand (improved contrast for dark backgrounds) */
  --color-brand-600: #4f93f8;
  --color-text-on-brand: #ffffff;

  /* Border */
  --color-border-default: rgba(148, 163, 184, 0.15);
  --color-border-muted: rgba(148, 163, 184, 0.08);
  --color-border-strong: rgba(148, 163, 184, 0.25);
  --color-border-brand: #3b82f6;

  /* Accent (CTA glow) — sky-400 for dark mode */
  --t-accent: #38bdf8;
  --t-accent-hover: #7dd3fc;
  --t-accent-muted: rgba(56, 189, 248, 0.15);

  /* Theme tokens */
  --t-purple: #3b82f6;
  --t-purple-light: #93c5fd;
  --t-purple-bg: rgba(59, 130, 246, 0.15);
  --t-purple-border: rgba(59, 130, 246, 0.25);

  /* Gradients */
  --t-gradient-hero: linear-gradient(180deg, #0f1d3a 0%, #0a1628 50%, #0a1628 100%);
  --t-gradient-cta: linear-gradient(135deg, #0f1d3a 0%, #0a2647 50%, #0f1d3a 100%);
  --t-gradient-card: linear-gradient(135deg, #141e33 0%, #1a2740 100%);
  --t-gradient-button: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%);
  --t-gradient-button-hover: linear-gradient(135deg, #3b82f6 0%, #60a5fa 100%);

  /* Glass morphism — blue-tinted */
  --t-glass-bg: rgba(20, 30, 51, 0.6);
  --t-glass-border: rgba(59, 130, 246, 0.12);
  --t-glass-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);

  /* Shadows — darker for dark mode */
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.2);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3), 0 1px 2px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.3), 0 2px 4px rgba(0, 0, 0, 0.2);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.35), 0 4px 6px rgba(0, 0, 0, 0.2);
  --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.35), 0 8px 10px rgba(0, 0, 0, 0.15);
  --shadow-card: 0 2px 8px rgba(0, 0, 0, 0.3), 0 0 1px rgba(59, 130, 246, 0.1);
  --shadow-card-hover: 0 8px 24px rgba(0, 0, 0, 0.4), 0 0 1px rgba(59, 130, 246, 0.2);
  --shadow-button: 0 2px 8px rgba(59, 130, 246, 0.3);

  /* Status colors (darker backgrounds) */
  --color-success: #22c55e;
  --color-success-bg: rgba(34, 197, 94, 0.1);
  --color-warning: #eab308;
  --color-warning-bg: rgba(234, 179, 8, 0.1);
  --color-error: #ef4444;
  --color-error-bg: rgba(239, 68, 68, 0.1);
  --color-info: #3b82f6;
  --color-info-bg: rgba(59, 130, 246, 0.1);

  /* Premium badge */
  --color-premium: #eab308;
  --color-premium-bg: rgba(234, 179, 8, 0.15);
  --color-free: #22c55e;
  --color-free-bg: rgba(34, 197, 94, 0.15);

  color-scheme: dark;
}

/* Logo text inherits theme color automatically via currentColor */
.pptd-logo-text { font-family: var(--font-sans); font-size: 1.125rem; font-weight: 700; color: var(--color-text-primary); letter-spacing: -0.01em; text-decoration: none; white-space: nowrap; }
.pptd-logo-mark { width: 32px; height: 32px; flex-shrink: 0; }
.pptd-logo { display: inline-flex; align-items: center; gap: 0.5rem; text-decoration: none; }

/* ── Typography ─────────────────────────────────────────────── */
:root {
  /* Font families */
  --font-sans: 'Poppins', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Clash Display', 'Poppins', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  /* Font sizes — fluid scale */
  --text-xs: 0.75rem;      /* 12px */
  --text-sm: 0.875rem;     /* 14px */
  --text-base: 1rem;       /* 16px */
  --text-lg: 1.125rem;     /* 18px */
  --text-xl: 1.25rem;      /* 20px */
  --text-2xl: 1.5rem;      /* 24px */
  --text-3xl: 1.875rem;    /* 30px */
  --text-4xl: 2.25rem;     /* 36px */
  --text-5xl: 3rem;        /* 48px */
  --text-6xl: 3.75rem;     /* 60px */

  /* Line heights */
  --leading-tight: 1.15;
  --leading-snug: 1.3;
  --leading-normal: 1.5;
  --leading-relaxed: 1.625;

  /* Font weights */
  --font-light: 300;
  --font-normal: 400;
  --font-medium: 500;
  --font-semibold: 600;
  --font-bold: 700;
  --font-extrabold: 800;

  /* Letter spacing */
  --tracking-tight: -0.025em;
  --tracking-normal: 0;
  --tracking-wide: 0.025em;
  --tracking-wider: 0.05em;
}

/* ── Spacing ────────────────────────────────────────────────── */
:root {
  --space-0: 0;
  --space-1: 0.25rem;    /* 4px */
  --space-2: 0.5rem;     /* 8px */
  --space-3: 0.75rem;    /* 12px */
  --space-4: 1rem;       /* 16px */
  --space-5: 1.25rem;    /* 20px */
  --space-6: 1.5rem;     /* 24px */
  --space-8: 2rem;       /* 32px */
  --space-10: 2.5rem;    /* 40px */
  --space-12: 3rem;      /* 48px */
  --space-16: 4rem;      /* 64px */
  --space-20: 5rem;      /* 80px */
  --space-24: 6rem;      /* 96px */
  --space-32: 8rem;      /* 128px */
}

/* ── Layout ─────────────────────────────────────────────────── */
:root {
  --container-sm: 640px;
  --container-md: 768px;
  --container-lg: 1024px;
  --container-xl: 1280px;
  --container-2xl: 1400px;
  --content-max: 1230px;

  --radius-sm: 0.25rem;   /* 4px */
  --radius-md: 0.5rem;    /* 8px */
  --radius-lg: 0.75rem;   /* 12px */
  --radius-xl: 1rem;      /* 16px */
  --radius-2xl: 1.5rem;   /* 24px */
  --radius-full: 9999px;

  --z-dropdown: 100;
  --z-sticky: 200;
  --z-fixed: 300;
  --z-modal-backdrop: 400;
  --z-modal: 500;
  --z-popover: 600;
  --z-tooltip: 700;
  --z-toast: 800;
}

/* ── Transitions ────────────────────────────────────────────── */
:root {
  --duration-fast: 150ms;
  --duration-normal: 250ms;
  --duration-slow: 400ms;
  --ease-default: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-in: cubic-bezier(0.4, 0, 1, 1);
  --ease-out: cubic-bezier(0, 0, 0.2, 1);
  --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ============================================================
 * Component Classes
 * ============================================================ */

/* ── Glass Card ─────────────────────────────────────────────── */
.glass-card {
  background: var(--t-glass-bg);
  border: 1px solid var(--t-glass-border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: var(--radius-xl);
  box-shadow: var(--t-glass-shadow);
  transition: box-shadow var(--duration-normal) var(--ease-default),
              transform var(--duration-normal) var(--ease-default),
              border-color var(--duration-normal) var(--ease-default);
}
.glass-card:hover {
  box-shadow: var(--shadow-card-hover);
  border-color: var(--t-glass-border-hover, var(--t-purple-border));
}

/* ── OBS-style Section Badge ───────────────────────────────── */
.landing-section-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 16px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: var(--t-accent-muted);
  color: var(--color-brand-600);
  border: 1px solid rgba(37, 99, 235, 0.15);
  font-family: var(--font-sans);
}

/* ── Animations ────────────────────────────────────────────── */
@keyframes pptd-fade-in-up {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}
.animate-fade-in-up {
  animation: pptd-fade-in-up 0.6s ease-out both;
}

/* ── Card ───────────────────────────────────────────────────── */
.pptd-card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border-default);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  transition: box-shadow var(--duration-normal) var(--ease-default),
              transform var(--duration-normal) var(--ease-default);
  overflow: hidden;
}
.pptd-card:hover {
  box-shadow: var(--shadow-card-hover);
  transform: translateY(-2px);
}

/* ── Buttons ────────────────────────────────────────────────── */
.pptd-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-5);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  line-height: var(--leading-snug);
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-default);
  text-decoration: none;
  white-space: nowrap;
}
.pptd-btn:focus-visible {
  outline: 2px solid var(--color-brand-primary);
  outline-offset: 2px;
}
.pptd-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Primary */
.pptd-btn-primary {
  background: var(--t-gradient-button);
  color: var(--color-text-on-brand);
  box-shadow: var(--shadow-button);
}
.pptd-btn-primary:hover:not(:disabled) {
  background: var(--t-gradient-button-hover);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

/* Secondary */
.pptd-btn-secondary {
  background: transparent;
  color: var(--color-brand-primary);
  border-color: var(--color-brand-primary);
}
.pptd-btn-secondary:hover:not(:disabled) {
  background: var(--t-accent-muted);
}

/* Ghost */
.pptd-btn-ghost {
  background: transparent;
  color: var(--color-text-secondary);
}
.pptd-btn-ghost:hover:not(:disabled) {
  background: var(--color-bg-muted);
  color: var(--color-text-primary);
}

/* Sizes */
.pptd-btn-sm {
  padding: var(--space-1) var(--space-3);
  font-size: var(--text-xs);
}
.pptd-btn-lg {
  padding: var(--space-3) var(--space-8);
  font-size: var(--text-base);
}

/* ── Badges ─────────────────────────────────────────────────── */
.pptd-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 2px var(--space-2);
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  line-height: var(--leading-snug);
  border-radius: var(--radius-full);
  white-space: nowrap;
}
.pptd-badge-premium {
  background: var(--color-premium-bg);
  color: var(--color-premium);
}
.pptd-badge-free {
  background: var(--color-free-bg);
  color: var(--color-free);
}
.pptd-badge-brand {
  background: var(--t-purple-bg);
  color: var(--t-purple);
}

/* ── Input ──────────────────────────────────────────────────── */
.pptd-input {
  width: 100%;
  padding: var(--space-2) var(--space-3);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
  color: var(--color-text-primary);
  background: var(--color-bg-input);
  border: 1px solid var(--color-border-default);
  border-radius: var(--radius-md);
  transition: border-color var(--duration-fast) var(--ease-default),
              box-shadow var(--duration-fast) var(--ease-default);
}
.pptd-input:focus {
  outline: none;
  border-color: var(--color-brand-primary);
  box-shadow: 0 0 0 3px var(--t-accent-muted);
}
.pptd-input::placeholder {
  color: var(--color-text-tertiary);
}

/* ── Checkbox ──────────────────────────────────────────────── */
input[type="checkbox"] {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  border-radius: 5px;
  border: 2px solid var(--color-border-default);
  background: var(--color-bg-default);
  cursor: pointer;
  position: relative;
  transition: all 0.15s ease;
  vertical-align: middle;
}
input[type="checkbox"]:hover {
  border-color: var(--color-brand-400);
}
input[type="checkbox"]:checked {
  background: var(--color-brand-600);
  border-color: var(--color-brand-600);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}
input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  left: 5px;
  top: 2px;
  width: 5px;
  height: 9px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
input[type="checkbox"]:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

/* ── Modal / Overlay ────────────────────────────────────────── */
.pptd-overlay {
  position: fixed;
  inset: 0;
  background: var(--color-bg-overlay);
  z-index: var(--z-modal-backdrop);
  opacity: 0;
  transition: opacity var(--duration-normal) var(--ease-default);
  pointer-events: none;
}
.pptd-overlay.active {
  opacity: 1;
  pointer-events: auto;
}
.pptd-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.95);
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border-default);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  z-index: var(--z-modal);
  max-width: 90vw;
  max-height: 90vh;
  overflow-y: auto;
  opacity: 0;
  transition: opacity var(--duration-normal) var(--ease-default),
              transform var(--duration-normal) var(--ease-default);
  pointer-events: none;
}
.pptd-modal.active {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
  pointer-events: auto;
}

/* ── Container ──────────────────────────────────────────────── */
.pptd-container {
  max-width: var(--content-max);
  margin-left: auto;
  margin-right: auto;
  width: 100%;
  padding-left: var(--space-4);
  padding-right: var(--space-4);
}

/* ── Section ────────────────────────────────────────────────── */
.pptd-section {
  padding-top: var(--space-16);
  padding-bottom: var(--space-16);
}
@media (max-width: 768px) {
  .pptd-section {
    padding-top: var(--space-10);
    padding-bottom: var(--space-10);
  }
}

/* ── Hero ───────────────────────────────────────────────────── */
.pptd-hero {
  background: var(--t-gradient-hero);
  padding-top: var(--space-20);
  padding-bottom: var(--space-20);
  position: relative;
  overflow: hidden;
}
@media (max-width: 768px) {
  .pptd-hero {
    padding-top: var(--space-12);
    padding-bottom: var(--space-12);
  }
}

/* ── Divider ────────────────────────────────────────────────── */
.pptd-divider {
  border: none;
  height: 1px;
  background: var(--color-border-default);
  margin: var(--space-6) 0;
}

/* ── Pagination ─────────────────────────────────────────────── */
.pptd-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
  padding: var(--space-4) 0;
}
.pptd-pagination a,
.pptd-pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.25rem;
  height: 2.25rem;
  padding: 0 var(--space-2);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: all var(--duration-fast) var(--ease-default);
}
.pptd-pagination a {
  color: var(--color-text-secondary);
  background: var(--color-bg-card);
  border: 1px solid var(--color-border-default);
}
.pptd-pagination a:hover {
  color: var(--color-brand-primary);
  background: var(--t-accent-muted);
  border-color: var(--color-brand-primary);
}
.pptd-pagination .active {
  color: var(--color-text-on-brand);
  background: var(--t-gradient-button);
  border: 1px solid transparent;
  box-shadow: var(--shadow-button);
}

/* ── Template Grid ──────────────────────────────────────────── */
.pptd-template-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-6);
}
@media (max-width: 1024px) {
  .pptd-template-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 640px) {
  .pptd-template-grid {
    grid-template-columns: 1fr;
    gap: var(--space-4);
  }
}

/* ── Template Card ──────────────────────────────────────────── */
.pptd-template-card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border-default);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  transition: box-shadow var(--duration-normal) var(--ease-default),
              transform var(--duration-normal) var(--ease-default);
}
.pptd-template-card:hover {
  box-shadow: var(--shadow-card-hover);
  transform: translateY(-3px);
}
.pptd-template-card .card-image {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: var(--color-bg-muted);
}
.pptd-template-card .card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--duration-slow) var(--ease-default);
}
.pptd-template-card:hover .card-image img {
  transform: scale(1.03);
}
.pptd-template-card .card-image .card-badges {
  position: absolute;
  top: var(--space-2);
  left: var(--space-2);
  display: flex;
  gap: var(--space-1);
}
.pptd-template-card .card-image .card-fav {
  position: absolute;
  top: var(--space-2);
  right: var(--space-2);
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--t-glass-bg);
  backdrop-filter: blur(8px);
  border-radius: var(--radius-full);
  border: 1px solid var(--t-glass-border);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-default);
  color: var(--color-text-secondary);
}
.pptd-template-card .card-image .card-fav:hover,
.pptd-template-card .card-image .card-fav.active {
  color: var(--color-error);
  background: var(--color-error-bg);
}
.pptd-template-card .card-body {
  padding: var(--space-3) var(--space-4);
}
.pptd-template-card .card-title {
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  color: var(--color-text-primary);
  line-height: var(--leading-snug);
  margin: 0 0 var(--space-1) 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pptd-template-card .card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: var(--text-xs);
  color: var(--color-text-tertiary);
}
.pptd-template-card .card-meta .card-category {
  color: var(--color-text-link);
  text-decoration: none;
}
.pptd-template-card .card-meta .card-category:hover {
  text-decoration: underline;
}
.pptd-template-card .card-meta .card-downloads {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* ── Filter Sidebar ─────────────────────────────────────────── */
.pptd-filter-sidebar {
  position: sticky;
  top: var(--space-4);
  background: var(--color-bg-card);
  border: 1px solid var(--color-border-default);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  box-shadow: var(--shadow-sm);
}
.pptd-filter-group {
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--color-border-muted);
}
.pptd-filter-group:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}
.pptd-filter-group-title {
  font-size: var(--text-xs);
  font-weight: var(--font-bold);
  color: var(--color-text-tertiary);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
  margin-bottom: var(--space-3);
}

/* Toggle pills (Free/Premium, sort options) */
.pptd-toggle-pills {
  display: flex;
  gap: var(--space-1);
  background: var(--color-bg-muted);
  border-radius: var(--radius-md);
  padding: 2px;
}
.pptd-toggle-pill {
  flex: 1;
  padding: var(--space-1) var(--space-3);
  font-size: var(--text-xs);
  font-weight: var(--font-medium);
  text-align: center;
  border-radius: calc(var(--radius-md) - 2px);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-default);
  color: var(--color-text-secondary);
  background: transparent;
  border: none;
}
.pptd-toggle-pill.active {
  background: var(--color-bg-elevated);
  color: var(--color-brand-primary);
  box-shadow: var(--shadow-xs);
  font-weight: var(--font-semibold);
}

/* ── Toast / Notification ───────────────────────────────────── */
.pptd-toast {
  position: fixed;
  bottom: var(--space-6);
  right: var(--space-6);
  min-width: 300px;
  max-width: 420px;
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border-default);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  z-index: var(--z-toast);
  padding: var(--space-4);
  transform: translateY(100px);
  opacity: 0;
  transition: transform var(--duration-normal) var(--ease-bounce),
              opacity var(--duration-normal) var(--ease-default);
}
.pptd-toast.visible {
  transform: translateY(0);
  opacity: 1;
}

/* ── Skeleton Loader ────────────────────────────────────────── */
.pptd-skeleton {
  background: linear-gradient(
    90deg,
    var(--color-bg-muted) 25%,
    var(--color-bg-subtle) 50%,
    var(--color-bg-muted) 75%
  );
  background-size: 200% 100%;
  animation: pptd-shimmer 1.5s infinite;
  border-radius: var(--radius-md);
}
@keyframes pptd-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── Tooltip ────────────────────────────────────────────────── */
[data-tooltip] {
  position: relative;
}
[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) scale(0.9);
  background: var(--color-bg-dark);
  color: var(--color-text-inverse);
  font-size: var(--text-xs);
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--duration-fast) var(--ease-default),
              transform var(--duration-fast) var(--ease-default);
  z-index: var(--z-tooltip);
}
[data-tooltip]:hover::after {
  opacity: 1;
  transform: translateX(-50%) scale(1);
}

/* ── Scrollbar ──────────────────────────────────────────────── */
.pptd-scrollbar::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
.pptd-scrollbar::-webkit-scrollbar-track {
  background: var(--color-bg-muted);
  border-radius: var(--radius-full);
}
.pptd-scrollbar::-webkit-scrollbar-thumb {
  background: var(--color-border-strong);
  border-radius: var(--radius-full);
}
.pptd-scrollbar::-webkit-scrollbar-thumb:hover {
  background: var(--color-text-tertiary);
}

/* ── Accessibility ──────────────────────────────────────────── */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* Focus ring for keyboard users */
:focus-visible {
  outline: 2px solid var(--color-brand-primary);
  outline-offset: 2px;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ── Print ──────────────────────────────────────────────────── */
@media print {
  .pptd-hero,
  .pptd-toast,
  .pptd-overlay,
  .pptd-modal {
    display: none !important;
  }
  body {
    background: #fff !important;
    color: #000 !important;
  }
}
