/**
 * Dark Professional Minimalism Design Tokens (Linear / Vercel Palette)
 * DuyDev Studio PWA
 */

@import './card-tiers-10.css';

:root {
  color-scheme: light;
  /* Light Mode Palette - Apple Ceramic Quartz */
  --canvas: #F5F5F7;
  --surface-base: #FFFFFF;
  --surface-elevated: #FAFAFC;
  --surface-hover: #F0F0F2;
  
  --border-subtle: rgba(0, 0, 0, 0.06);
  --border-hover: rgba(0, 0, 0, 0.12);
  --border-active: rgba(0, 0, 0, 0.28);

  --text-primary: #1D1D1F;
  --text-secondary: #424245;
  --text-muted: #86868B;

  --accent: #4F46E5;
  --accent-light: #6366F1;

  --glass-dock: rgba(255, 255, 255, 0.78);
  --glass-panel: rgba(248, 249, 250, 0.72);
  --glass-card: rgba(255, 255, 255, 0.76);
  --dock-shadow: 0 12px 32px rgba(0, 0, 0, 0.08);
}

html.dark {
  color-scheme: dark;
  /* Dark Mode Palette (Apple Midnight Obsidian & Smoke Quartz) */
  --canvas: #0B0B0E;
  --surface-base: #111115;
  --surface-elevated: #16161C;
  --surface-hover: #1C1C24;
  
  --border-subtle: rgba(255, 255, 255, 0.07);
  --border-hover: rgba(255, 255, 255, 0.14);
  --border-active: rgba(255, 255, 255, 0.28);

  --text-primary: #F5F5F7;
  --text-secondary: #A1A1A6;
  --text-muted: #86868B;

  --accent: #4F46E5;
  --accent-light: #6366F1;

  --glass-dock: rgba(16, 16, 21, 0.78);
  --glass-panel: rgba(11, 11, 15, 0.82);
  --glass-card: rgba(18, 18, 23, 0.75);
  --dock-shadow: 0 12px 32px rgba(0, 0, 0, 0.60);
}

/* Form Controls & Native OS Popup Menu Theme Enforcement */
select,
input,
textarea {
  color-scheme: light;
}

html.dark select,
html.dark input,
html.dark textarea {
  color-scheme: dark;
}

/* Fix for Select & Option elements in Dark Mode */
select {
  background-color: #FFFFFF;
  color: #09090B;
}

html.dark select {
  background-color: #18181B !important;
  color: #FAFAFA !important;
}

select option,
select optgroup {
  background-color: #FFFFFF !important;
  color: #09090B !important;
}

html.dark select option,
html.dark select optgroup {
  background-color: #18181B !important;
  color: #FAFAFA !important;
}

/* Ensure text contrast for form inputs */
html.dark input[type="text"],
html.dark input[type="number"],
html.dark input[type="password"],
html.dark input[type="url"],
html.dark input[type="email"],
html.dark input[type="search"],
html.dark textarea {
  background-color: #18181B;
  color: #FAFAFA;
}

html.dark input::placeholder,
html.dark textarea::placeholder {
  color: #71717A;
}

/* Global Commercial Typography, Box Sizing & Viewport Containment */
*, *::before, *::after {
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

html {
  font-family: 'Plus Jakarta Sans', 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  letter-spacing: -0.011em;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  height: auto;
  min-height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  width: 100%;
  max-width: 100vw;
  scroll-behavior: auto;
  overscroll-behavior-y: auto;
  -webkit-overflow-scrolling: touch;
}

body {
  background-color: var(--canvas);
  color: var(--text-primary);
  font-family: inherit;
  font-weight: 450;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  height: auto;
  min-height: 100%;
  width: 100%;
  max-width: 100vw;
  margin: 0;
  padding: 0;
  overflow-x: clip;
  overflow-y: visible;
  overscroll-behavior-y: auto;
  -webkit-overflow-scrolling: touch;
}

#app {
  overflow-x: clip;
  overflow-y: visible;
  width: 100%;
  max-width: 100vw;
  min-height: 100vh;
}

.overflow-x-clip {
  overflow-x: clip !important;
}

html.dark body {
  font-weight: 400;
}

/* Tool Accents with Automatic High-Contrast for Light/Dark Modes */
.tool-accent-text {
  color: var(--accent-contrast, var(--accent));
}
html.dark .tool-accent-text {
  color: var(--accent);
}

.tool-accent-box {
  background: linear-gradient(145deg, color-mix(in srgb, var(--accent) 18%, rgba(255, 255, 255, 0.95)), color-mix(in srgb, var(--accent) 8%, rgba(255, 255, 255, 0.70)));
  border: 1px solid color-mix(in srgb, var(--accent) 26%, rgba(0, 0, 0, 0.08));
  color: var(--accent-contrast, var(--accent));
  box-shadow: 0 4px 14px -2px color-mix(in srgb, var(--accent) 30%, transparent),
              inset 0 1.5px 1px 0 rgba(255, 255, 255, 0.95),
              inset 0 -1px 1px 0 rgba(0, 0, 0, 0.06);
  border-radius: 14px;
}
html.dark .tool-accent-box {
  background: linear-gradient(150deg, color-mix(in srgb, var(--accent) 22%, #1E1E26) 0%, color-mix(in srgb, var(--accent) 10%, #131318) 100%);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, rgba(255, 255, 255, 0.14));
  color: var(--accent);
  box-shadow: 0 4px 14px -2px rgba(0, 0, 0, 0.6),
              0 1px 3px 0 rgba(0, 0, 0, 0.4),
              inset 0 1px 0 0 rgba(255, 255, 255, 0.22),
              inset 0 -1px 0 0 rgba(0, 0, 0, 0.5);
  border-radius: 14px;
}

/* Glassmorphism & Depth Layers (120Hz Dedicated GPU Compositor Layers) */
.glass-dock {
  background: var(--glass-dock);
  backdrop-filter: blur(12px) saturate(180%);
  -webkit-backdrop-filter: blur(12px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: var(--dock-shadow),
              inset 0 1px 0 0 rgba(255, 255, 255, 0.16);
  transform: translateZ(0);
  will-change: transform;
  backface-visibility: hidden;
  transition: background-color 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
  bottom: calc(0.75rem + env(safe-area-inset-bottom, 0px));
}

html:not(.dark) .glass-dock {
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: var(--dock-shadow),
              inset 0 1px 0 0 rgba(255, 255, 255, 0.9);
}

.glass-panel {
  background: var(--glass-panel);
  backdrop-filter: blur(12px) saturate(180%);
  -webkit-backdrop-filter: blur(12px) saturate(180%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
  box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.25),
              inset 0 -1px 0 0 rgba(255, 255, 255, 0.06),
              inset 0 1px 0 0 rgba(255, 255, 255, 0.12);
  transform: translateZ(0);
  will-change: transform;
  backface-visibility: hidden;
  transition: background-color 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

html:not(.dark) .glass-panel {
  border-bottom: 1px solid rgba(0, 0, 0, 0.07);
  box-shadow: 0 2px 12px -2px rgba(0, 0, 0, 0.04),
              inset 0 -1px 0 0 rgba(0, 0, 0, 0.02),
              inset 0 1px 0 0 rgba(255, 255, 255, 0.85);
}

/* ==============================================================================
   Power & Battery Optimization: Global Sleep Governor
   Completely suspends all animations, transitions and GPU repaint loops when backgrounded
   ============================================================================== */
html.app-backgrounded *,
html.app-backgrounded *::before,
html.app-backgrounded *::after {
  animation-play-state: paused !important;
  transition: none !important;
}

/* Global Task Dock Layer */
#globalTaskDockCapsule,
.global-task-dock-layer {
  transform: translateZ(0);
  backface-visibility: hidden;
}

/* ==============================================================================
   Glassmorphic Task Micro-Dock (iOS HUD / macOS Task Indicator Aesthetic)
   ============================================================================== */
.task-micro-dock {
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12),
              0 2px 8px rgba(0, 0, 0, 0.04),
              inset 0 1px 0 0 rgba(255, 255, 255, 0.9);
  transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1),
              box-shadow 0.22s ease,
              border-color 0.2s ease,
              background-color 0.2s ease;
}

html.dark .task-micro-dock {
  background: rgba(15, 15, 20, 0.70);
  backdrop-filter: blur(16px) saturate(190%) brightness(102%);
  -webkit-backdrop-filter: blur(16px) saturate(190%) brightness(102%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45),
              0 2px 8px rgba(0, 0, 0, 0.30),
              inset 0 1px 0 0 rgba(255, 255, 255, 0.12);
}

@media (hover: hover) and (pointer: fine) {
  .task-micro-dock:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.18),
                0 4px 12px rgba(0, 0, 0, 0.06);
  }
  html.dark .task-micro-dock:hover {
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.55),
                0 4px 12px rgba(0, 0, 0, 0.35);
  }
}

/* Sub-pixel Progress Thread with Subtle Shimmer */
.dock-progress-thread {
  height: 2px;
  background: linear-gradient(90deg, #6366f1 0%, #a855f7 50%, #ec4899 100%);
  background-size: 200% 100%;
  animation: dockProgressShimmer 2.5s ease-in-out infinite;
  box-shadow: 0 0 8px rgba(99, 102, 241, 0.5);
  transition: width 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes dockProgressShimmer {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

#globalTaskDockCapsule {
  bottom: calc(72px + env(safe-area-inset-bottom, 0px));
}

@media (min-width: 640px) {
  #globalTaskDockCapsule {
    bottom: 1.25rem !important;
  }
}

.glass-panel-contained {
  background: var(--glass-card, rgba(255, 255, 255, 0.96));
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 4px 16px -2px rgba(0, 0, 0, 0.05),
              inset 0 1px 0 0 rgba(255, 255, 255, 0.85);
  transition: background-color 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

html.dark .glass-panel-contained {
  background: linear-gradient(165deg, rgba(22, 22, 26, 0.96) 0%, rgba(14, 14, 16, 0.98) 100%);
  border: 1px solid rgba(255, 255, 255, 0.11);
  box-shadow: 0 10px 32px -4px rgba(0, 0, 0, 0.55);
}

.glass-pill {
  background: var(--glass-card, rgba(255, 255, 255, 0.95));
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04),
              inset 0 1px 0 0 rgba(255, 255, 255, 0.85);
  transition: transform 0.18s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.18s ease, background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.18s ease;
}

html.dark .glass-pill {
  background: linear-gradient(165deg, rgba(24, 24, 28, 0.95) 0%, rgba(16, 16, 20, 0.98) 100%);
  border: 1px solid rgba(255, 255, 255, 0.10);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.30),
              inset 0 1px 0 0 rgba(255, 255, 255, 0.15);
}

/* Dedicated Grounded Surface for Recent Activity Cards */
.recent-activity-card {
  transition: transform 0.18s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.18s ease, background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.18s ease;
}

html.dark .recent-activity-card {
  background: linear-gradient(165deg, #16161A 0%, #121215 100%);
  border: 1px solid rgba(255, 255, 255, 0.11);
  box-shadow: 0 4px 16px -2px rgba(0, 0, 0, 0.40),
              inset 0 1px 0 0 rgba(255, 255, 255, 0.16);
}

/* Apple Sequoia Search Capsule (Solid Native Compositor Surface) */
.glass-search {
  background: #FFFFFF;
  border: 1px solid rgba(0, 0, 0, 0.09);
  box-shadow: 0 2px 8px -2px rgba(0, 0, 0, 0.05),
              inset 0 1px 0 0 rgba(255, 255, 255, 0.95);
  transition: transform 0.18s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.18s ease, background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.18s ease;
}

html.dark .glass-search {
  background: rgba(22, 22, 28, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.09);
  box-shadow: 0 2px 8px -2px rgba(0, 0, 0, 0.40),
              inset 0 1px 0 0 rgba(255, 255, 255, 0.12);
}

@media (hover: hover) and (pointer: fine) {
  .glass-pill:hover {
    background: rgba(255, 255, 255, 0.98);
    border-color: rgba(0, 0, 0, 0.15);
  }

  html.dark .glass-pill:hover {
    background: linear-gradient(165deg, rgba(30, 30, 36, 0.98) 0%, rgba(20, 20, 24, 1) 100%);
    border-color: rgba(255, 255, 255, 0.20);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.40),
                inset 0 1px 0 0 rgba(255, 255, 255, 0.22);
  }

  html.dark .recent-activity-card:hover {
    background: linear-gradient(165deg, #1E1E24 0%, #16161A 100%);
    border-color: rgba(255, 255, 255, 0.22);
    box-shadow: 0 8px 24px -3px rgba(0, 0, 0, 0.55),
                inset 0 1px 0 0 rgba(255, 255, 255, 0.24);
  }

  .glass-search:hover {
    background: #FFFFFF;
    border-color: rgba(0, 0, 0, 0.16);
    box-shadow: 0 4px 14px -2px rgba(0, 0, 0, 0.08),
                inset 0 1px 0 0 rgba(255, 255, 255, 1);
  }

  html.dark .glass-search:hover {
    background: rgba(28, 28, 36, 0.85);
    border-color: rgba(255, 255, 255, 0.16);
    box-shadow: 0 4px 16px -2px rgba(0, 0, 0, 0.50),
                inset 0 1px 0 0 rgba(255, 255, 255, 0.16);
  }
}

.glass-search:focus {
  border-color: color-mix(in srgb, var(--accent) 60%, rgba(255, 255, 255, 0.20)) !important;
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 20%, transparent),
              0 4px 14px -2px rgba(0, 0, 0, 0.25),
              inset 0 1px 0 0 rgba(255, 255, 255, 0.20) !important;
}

/* Touch Friendly Targets */
.touch-target {
  min-height: 44px;
  min-width: 44px;
}

.safe-bottom {
  padding-bottom: env(safe-area-inset-bottom, 12px);
}

/* Clean Custom Scrollbar */
.custom-scrollbar::-webkit-scrollbar {
  width: 4px;
  height: 4px;
}
.custom-scrollbar::-webkit-scrollbar-track {
  background: transparent;
}
.custom-scrollbar::-webkit-scrollbar-thumb {
  background: rgba(120, 120, 120, 0.2);
  border-radius: 9999px;
}
.custom-scrollbar::-webkit-scrollbar-thumb:hover {
  background: rgba(120, 120, 120, 0.35);
}

/* Animated Moving Gradient Border for Quiz Result & Telemetry Cards */
.quiz-animated-box {
  position: relative;
  border-radius: 1rem;
  padding: 1.5px;
  overflow: hidden;
  background-color: #e4e4e7;
}

html.dark .quiz-animated-box {
  background-color: #18181b;
}

.quiz-border-completed,
.quiz-border-processing {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 320%;
  aspect-ratio: 1 / 1;
  transform: translate(-50%, -50%) rotate(0deg);
  pointer-events: none;
  z-index: 0;
}

.quiz-border-completed {
  background: conic-gradient(
    from 0deg,
    #3b82f6 0deg,
    #6366f1 72deg,
    #10b981 144deg,
    #059669 216deg,
    #3b82f6 288deg,
    #6366f1 360deg
  );
  animation: none;
}

.quiz-border-processing {
  background: conic-gradient(
    from 0deg,
    #3b82f6 0deg,
    #6366f1 72deg,
    #8b5cf6 144deg,
    #a855f7 216deg,
    #3b82f6 288deg,
    #6366f1 360deg
  );
  will-change: transform;
  animation: quiz-border-rotate 4s linear infinite;
}

@keyframes quiz-border-rotate {
  from {
    transform: translate(-50%, -50%) rotate(0deg);
  }
  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .quiz-border-completed,
  .quiz-border-processing {
    animation: none;
  }
}

/* ==============================================================================
   Ambient Canvas Lighting Mesh (Apple Sequoia Frosted Refraction Atmosphere)
   Multi-zone ambient lighting mesh shining through header, cards & bottom dock
   ============================================================================== */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-repeat: no-repeat;
  transform: translateZ(0);
  /* Mobile Default: Flowing smoothly through translucent frost glass */
  background-image: 
    radial-gradient(circle 480px at -5% -5%, rgba(99, 102, 241, 0.28) 0%, rgba(79, 70, 229, 0.14) 40%, transparent 75%),
    radial-gradient(circle 440px at 105% -5%, rgba(244, 63, 94, 0.20) 0%, rgba(225, 29, 72, 0.08) 40%, transparent 70%),
    radial-gradient(circle 500px at 10% 55%, rgba(14, 165, 233, 0.16) 0%, transparent 70%),
    radial-gradient(circle 480px at 90% 65%, rgba(16, 185, 129, 0.15) 0%, transparent 70%);
}

html.dark body::before {
  /* Apple Midnight Nebula: Serene, unified, optical depth wash (Zero RGB chaos) */
  background-image: 
    radial-gradient(circle 580px at 20% -10%, rgba(99, 102, 241, 0.08) 0%, rgba(79, 70, 229, 0.03) 40%, transparent 70%),
    radial-gradient(circle 500px at 80% 5%, rgba(59, 130, 246, 0.05) 0%, transparent 65%),
    radial-gradient(circle 550px at 50% 105%, rgba(99, 102, 241, 0.04) 0%, transparent 70%);
}

@media (min-width: 641px) {
  body::before {
    background-image: 
      radial-gradient(circle 900px at 5% -8%, rgba(99, 102, 241, 0.22) 0%, rgba(79, 70, 229, 0.10) 45%, transparent 75%),
      radial-gradient(circle 800px at 95% -8%, rgba(244, 63, 94, 0.16) 0%, rgba(225, 29, 72, 0.06) 45%, transparent 70%),
      radial-gradient(circle 850px at 8% 50%, rgba(14, 165, 233, 0.14) 0%, transparent 65%),
      radial-gradient(circle 800px at 92% 62%, rgba(16, 185, 129, 0.12) 0%, transparent 65%),
      radial-gradient(circle 850px at 50% 100%, rgba(99, 102, 241, 0.12) 0%, transparent 70%);
  }

  html.dark body::before {
    /* Desktop Apple Sequoia Pro: Velvet Midnight Sapphire & Obsidian Atmosphere */
    background-image: 
      radial-gradient(circle 1000px at 30% -15%, rgba(99, 102, 241, 0.09) 0%, rgba(79, 70, 229, 0.03) 40%, transparent 75%),
      radial-gradient(circle 850px at 85% 0%, rgba(59, 130, 246, 0.06) 0%, transparent 70%),
      radial-gradient(circle 900px at 50% 105%, rgba(99, 102, 241, 0.04) 0%, transparent 70%);
  }
}

#app {
  position: relative;
  z-index: 1;
}

/* ==============================================================================
   Apple Sequoia Pure Frost Glass Card Surface (Grounded Translucent Foundation)
   ============================================================================== */
.linear-card {
  position: relative;
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.92) 0%, rgba(247, 248, 252, 0.84) 100%);
  border: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02),
              0 4px 12px rgba(0, 0, 0, 0.03),
              0 16px 36px -4px rgba(0, 0, 0, 0.05),
              inset 0 1px 0 0 rgba(255, 255, 255, 1);
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1),
              opacity 0.18s ease,
              background 0.20s ease,
              border-color 0.20s ease,
              box-shadow 0.22s ease;
}

html.dark .linear-card {
  background: linear-gradient(165deg, rgba(24, 24, 30, 0.82) 0%, rgba(15, 15, 19, 0.90) 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.50),
              0 14px 36px -4px rgba(0, 0, 0, 0.65),
              inset 0 1px 0 0 rgba(255, 255, 255, 0.12);
}

@media (hover: hover) and (pointer: fine) {
  .linear-card:hover {
    background: linear-gradient(165deg, rgba(255, 255, 255, 0.98) 0%, rgba(250, 251, 255, 0.92) 100%);
    border-color: color-mix(in srgb, var(--accent) 45%, rgba(0, 0, 0, 0.14));
    box-shadow: 0 20px 44px -8px rgba(0, 0, 0, 0.10),
                0 4px 12px -2px rgba(0, 0, 0, 0.03),
                inset 0 1px 0 0 #FFFFFF,
                0 0 22px -4px color-mix(in srgb, var(--accent) 24%, transparent);
    transform: translateY(-3px) scale(1.004);
  }

  html.dark .linear-card:hover {
    background: linear-gradient(165deg, rgba(30, 30, 38, 0.90) 0%, rgba(18, 18, 23, 0.95) 100%);
    border-color: rgba(255, 255, 255, 0.16);
    box-shadow: 0 20px 48px -8px rgba(0, 0, 0, 0.75),
                0 4px 16px -2px rgba(0, 0, 0, 0.50),
                inset 0 1px 0 0 rgba(255, 255, 255, 0.20),
                0 0 20px -4px color-mix(in srgb, var(--accent) 20%, transparent);
    transform: translateY(-3px) scale(1.004);
  }
}

/* Themed Browser Text Selection */
::selection {
  background: rgba(99, 102, 241, 0.40);
  color: #FFFFFF;
}

/* Vertical Slide Transitions for Multimedia Viewport */
@keyframes slideUpIn {
  from {
    opacity: 0;
    transform: translateY(28px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideDownIn {
  from {
    opacity: 0;
    transform: translateY(-28px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-slideUp {
  animation: slideUpIn 0.22s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.animate-slideDown {
  animation: slideDownIn 0.22s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Horizontal Tab Slide Transitions for Mobile Gestures */
@keyframes tabSlideFromRight {
  from {
    opacity: 0.55;
    transform: translate3d(28px, 0, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

@keyframes tabSlideFromLeft {
  from {
    opacity: 0.55;
    transform: translate3d(-28px, 0, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

.animate-tab-slide-right {
  animation: tabSlideFromRight 0.22s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.animate-tab-slide-left {
  animation: tabSlideFromLeft 0.22s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* ==========================================================================
   PDF Viewer v2.0 TextLayer & Reading Modes
   ========================================================================== */
.textLayer {
  position: absolute;
  inset: 0;
  overflow: hidden;
  opacity: 1;
  line-height: 1;
  text-size-adjust: none;
  forced-color-adjust: none;
  transform-origin: 0 0;
  z-index: 2;
  user-select: text;
  -webkit-user-select: text;
}

.textLayer span {
  color: transparent;
  position: absolute;
  white-space: pre;
  cursor: text;
  transform-origin: 0 0;
}

.textLayer ::selection {
  background: rgba(99, 102, 241, 0.35);
}

.textLayer .highlight {
  position: relative !important;
  display: inline !important;
  background: rgba(250, 204, 21, 0.45);
  border-radius: 2px;
}

.textLayer .highlight.selected {
  background: rgba(249, 115, 22, 0.65);
}

/* Eye-Care Reading Filters for PDF Viewport */
.pdf-mode-sepia {
  filter: sepia(0.45) contrast(0.96) brightness(0.97);
}

.pdf-mode-dark {
  filter: invert(0.92) hue-rotate(180deg) contrast(1.05) brightness(0.95);
}

.pdf-mode-dark img,
.pdf-mode-dark .pdf-image-preserved {
  filter: invert(1) hue-rotate(180deg);
}

/* ==========================================================================
   Zero-Flicker Double-Buffered PDF Canvas & Paper Frame
   ========================================================================== */
.pdf-page-box {
  background-color: #ffffff !important;
  will-change: width, height;
}

.pdf-canvas {
  width: 100% !important;
  height: 100% !important;
  image-rendering: auto;
  image-rendering: -webkit-optimize-contrast;
  transform: translateZ(0);
  backface-visibility: hidden;
}

.pdf-page-box .textLayer {
  width: 100% !important;
  height: 100% !important;
}

/* ==============================================================================
   3-Layer Specular Glowing Orbs (Zero-Redraw Living Status Dots)
   Layers: 1. Intense Core + 2. Translucent Halo Ring + 3. Multi-Stage Ambient Glow
   ============================================================================== */
.specular-status-dot {
  position: relative;
  display: inline-block;
  border-radius: 9999px;
  flex-shrink: 0;
  transform: translateZ(0);
}

/* Emerald (Online / Success / Safe) */
.specular-status-dot-emerald {
  width: 9px;
  height: 9px;
  background-color: #10b981;
  background-image: radial-gradient(circle at 35% 35%, #6ee7b7 0%, #10b981 60%, #047857 100%);
  box-shadow: 
    0 0 0 2px rgba(16, 185, 129, 0.20),
    0 0 8px 1px rgba(16, 185, 129, 0.65),
    0 0 16px 2px rgba(16, 185, 129, 0.25);
}

/* Indigo (Target Format / Processing / Pro) */
.specular-status-dot-indigo {
  width: 9px;
  height: 9px;
  background-color: #6366f1;
  background-image: radial-gradient(circle at 35% 35%, #a5b4fc 0%, #6366f1 60%, #4338ca 100%);
  box-shadow: 
    0 0 0 2px rgba(99, 102, 241, 0.22),
    0 0 8px 1px rgba(99, 102, 241, 0.70),
    0 0 18px 2px rgba(99, 102, 241, 0.25);
}

/* Cyan (ViewSplit Active / Precision Loupe) */
.specular-status-dot-cyan {
  width: 9px;
  height: 9px;
  background-color: #06b6d4;
  background-image: radial-gradient(circle at 35% 35%, #67e8f9 0%, #06b6d4 60%, #0e7490 100%);
  box-shadow: 
    0 0 0 2px rgba(6, 182, 212, 0.22),
    0 0 8px 1px rgba(6, 182, 212, 0.70),
    0 0 18px 2px rgba(6, 182, 212, 0.25);
}

/* Amber (Pending / Active Jobs / Warning) */
.specular-status-dot-amber {
  width: 9px;
  height: 9px;
  background-color: #f59e0b;
  background-image: radial-gradient(circle at 35% 35%, #fde68a 0%, #f59e0b 60%, #b45309 100%);
  box-shadow: 
    0 0 0 2px rgba(245, 158, 11, 0.22),
    0 0 8px 1px rgba(245, 158, 11, 0.70),
    0 0 18px 2px rgba(245, 158, 11, 0.25);
}

/* Rose (Error / Difference Diff / Offline) */
.specular-status-dot-rose {
  width: 9px;
  height: 9px;
  background-color: #f43f5e;
  background-image: radial-gradient(circle at 35% 35%, #fecdd3 0%, #f43f5e 60%, #be123c 100%);
  box-shadow: 
    0 0 0 2px rgba(244, 63, 94, 0.22),
    0 0 8px 1px rgba(244, 63, 94, 0.70),
    0 0 18px 2px rgba(244, 63, 94, 0.25);
}

/* ==============================================================================
   120Hz Fluidity: Tactile Spring Micro-Physics on Touch & Click
   Apple / Linear grade tactile feedback on Android touch and mouse press
   ============================================================================== */
button:not(:disabled):active,
.btn:not(:disabled):active,
[role="button"]:not([aria-disabled="true"]):active,
.btn-hero-paste:not(:disabled):active,
.btn-converter-cat:active,
.tool-card:active,
.stitch-tab:active {
  transform: scale(0.975) translateZ(0);
  transition: transform 0.14s cubic-bezier(0.22, 1, 0.36, 1) !important;
}

/* ==============================================================================
   Converter Pro: Completed State Ambient Emerald Glow Frame
   ============================================================================== */
.converter-result-completed-glow {
  border-color: rgba(16, 185, 129, 0.45) !important;
  box-shadow: 0 0 25px rgba(16, 185, 129, 0.15), 0 8px 24px -4px rgba(16, 185, 129, 0.10) !important;
  outline: 2px solid rgba(16, 185, 129, 0.25) !important;
  outline-offset: -1px;
}

html.dark .converter-result-completed-glow,
:root.dark .converter-result-completed-glow {
  border-color: rgba(16, 185, 129, 0.5) !important;
  box-shadow: 0 0 35px rgba(16, 185, 129, 0.22), 0 8px 28px -4px rgba(16, 185, 129, 0.15) !important;
  outline: 2px solid rgba(16, 185, 129, 0.3) !important;
  outline-offset: -1px;
}

/* ==============================================================================
   User Profile & Avatar Dialog Animations
   ============================================================================== */
.animate-fade-in {
  animation: dsProfileFadeIn 0.22s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes dsProfileFadeIn {
  from {
    opacity: 0;
    transform: scale(0.96);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}


