/**
 * Muratov.io - Shared Styles
 *
 * Synced with Yusagi AI Assistant design system
 * Emerald + Cyan accent for consistent branding
 * Subtle glassmorphism, modern micro-interactions
 * Slide-in panel system (Oracle APEX style)
 */

/* ============================================
   CSS VARIABLES - EMERALD COLOR PALETTE
   (Synced with Yusagi AI Assistant)
   ============================================ */

:root {
  /* Light mode - clean, professional */
  --bg: #FAFBFC;
  --fg: #0F172A;
  --muted: #5B6876; /* WCAG AA compliant: 4.9:1 contrast on light bg */
  --border: #E2E8F0;
  --surface: #FFFFFF;
  --surface-elevated: #FFFFFF;

  /* Refined Emerald + Cyan system */
  --accent: #059669;
  --accent-soft: #10B981;
  --accent-muted: #D1FAE5;
  --accent-text: #047857;
  --secondary: #06B6D4;
  --secondary-soft: #22D3EE;
  --secondary-muted: #CFFAFE;

  /* Semantic - softer tones */
  --success: #059669;
  --warning: #D97706;
  --error: #DC2626;

  /* Shadows - 2026 softer, more natural */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.07), 0 2px 4px -2px rgb(0 0 0 / 0.07);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.08), 0 4px 6px -4px rgb(0 0 0 / 0.08);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.08), 0 8px 10px -6px rgb(0 0 0 / 0.08);
  --shadow-glow: 0 0 20px rgb(5 150 105 / 0.15);

  /* Typography - 2026 larger, more readable */
  --text-xs: 0.8125rem;
  --text-sm: 0.9375rem;
  --text-base: 1.0625rem;
  --text-lg: 1.1875rem;
  --text-xl: 1.375rem;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace;

  /* Spacing scale */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;

  /* Border radius - 2026 squircle-inspired */
  --radius-sm: 0.5rem;
  --radius-md: 0.75rem;
  --radius-lg: 1rem;
  --radius-xl: 1.25rem;
  --radius-2xl: 1.5rem;
  --radius-full: 9999px;

  /* Transitions - spring-like easing */
  --ease-out: cubic-bezier(0.33, 1, 0.68, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --duration-fast: 150ms;
  --duration-normal: 250ms;
  --duration-slow: 400ms;

  color-scheme: light;
}

.dark {
  /* Dark mode - richer, deeper tones */
  --bg: #0B0F14;
  --fg: #F1F5F9;
  --muted: #B8C5D6; /* WCAG AA compliant: 5.3:1 contrast on dark bg */
  --border: #1E293B;
  --surface: #111827;
  --surface-elevated: #1F2937;

  /* Brighter accents for dark mode */
  --accent: #10B981;
  --accent-soft: #34D399;
  --accent-muted: #064E3B;
  --accent-text: #6EE7B7;
  --secondary: #22D3EE;
  --secondary-soft: #67E8F9;
  --secondary-muted: #164E63;

  /* Semantic - adjusted for dark */
  --success: #34D399;
  --warning: #FBBF24;
  --error: #F87171;

  /* Shadows - glow-focused for dark mode */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.3);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.4), 0 2px 4px -2px rgb(0 0 0 / 0.4);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.5), 0 4px 6px -4px rgb(0 0 0 / 0.5);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.6), 0 8px 10px -6px rgb(0 0 0 / 0.6);
  --shadow-glow: 0 0 30px rgb(16 185 129 / 0.2);

  color-scheme: dark;
}

/* ============================================
   BASE LAYOUT
   ============================================ */

html,
body {
  height: 100%;
}

html {
  scroll-behavior: smooth;
  font-size: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* Force scrollbar on all pages for consistent viewport width */
  overflow-y: scroll;
}

/* Background Noise - more subtle for 2026 */
.noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="200" height="200" viewBox="0 0 200 200"><filter id="n"><feTurbulence type="fractalNoise" baseFrequency="0.9" numOctaves="3" stitchTiles="stitch"/></filter><rect width="100%" height="100%" filter="url(%23n)" opacity="0.02"/></svg>');
  opacity: 0.3;
}

.dark .noise {
  opacity: 0.4;
}

/* ============================================
   SECTION BACKGROUNDS & TRANSITIONS
   ============================================ */

/* Smooth section background transitions on scroll */
section {
  position: relative;
  transition: background-color 0.3s ease;
}

/* Section divider line for visual separation */
section::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: min(90%, 1100px);
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border), transparent);
  opacity: 0;
  pointer-events: none;
}

/* Show divider between same-background sections */
section[class*="bg-"]:has(+ section:not([class*="bg-"]))::after,
section:not([class*="bg-"]):has(+ section[class*="bg-"])::after {
  opacity: 0;
}

/* Icon container styles - consistent across all cards */
.icon-container {
  width: 56px;
  height: 56px;
  border-radius: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-lg);
  transition: transform 0.3s var(--ease-spring);
}

.icon-container.accent {
  background: linear-gradient(to bottom right, var(--accent), rgba(5, 150, 105, 0.7));
}

.icon-container.secondary {
  background: linear-gradient(to bottom right, var(--secondary), rgba(6, 182, 212, 0.7));
}

.icon-container.mixed {
  background: linear-gradient(to bottom right, var(--accent), var(--secondary));
}

.icon-container svg {
  width: 28px;
  height: 28px;
  color: white;
}

.group:hover .icon-container {
  transform: scale(1.1);
}

/* ============================================
   GLASSMORPHISM - REFINED 2026
   ============================================ */

.glass {
  backdrop-filter: saturate(150%) blur(8px);
  -webkit-backdrop-filter: saturate(150%) blur(8px);
  background: rgba(250, 251, 252, 0.85);
  border-bottom: 1px solid rgba(226, 232, 240, 0.8);
}

.dark .glass {
  background: rgba(11, 15, 20, 0.8);
  border-bottom: 1px solid rgba(30, 41, 59, 0.6);
}

/* ============================================
   GRADIENT BACKGROUNDS - 2026 SOFTER
   ============================================ */

.grad {
  background-image:
    radial-gradient(ellipse 1200px 700px at 15% 5%, rgba(5, 150, 105, 0.08), transparent 60%),
    radial-gradient(ellipse 900px 600px at 85% 15%, rgba(6, 182, 212, 0.06), transparent 60%),
    radial-gradient(ellipse 700px 500px at 50% 95%, rgba(5, 150, 105, 0.04), transparent 60%);
}

.dark .grad {
  background-image:
    radial-gradient(ellipse 1200px 700px at 15% 5%, rgba(16, 185, 129, 0.15), transparent 60%),
    radial-gradient(ellipse 900px 600px at 85% 15%, rgba(34, 211, 238, 0.10), transparent 60%),
    radial-gradient(ellipse 700px 500px at 50% 95%, rgba(16, 185, 129, 0.06), transparent 60%);
}

@media (max-width: 768px) {
  .grad {
    background-image:
      radial-gradient(ellipse 500px 400px at 20% 10%, rgba(5, 150, 105, 0.08), transparent 60%),
      radial-gradient(ellipse 400px 300px at 80% 20%, rgba(6, 182, 212, 0.06), transparent 60%);
  }

  .dark .grad {
    background-image:
      radial-gradient(ellipse 500px 400px at 20% 10%, rgba(16, 185, 129, 0.15), transparent 60%),
      radial-gradient(ellipse 400px 300px at 80% 20%, rgba(34, 211, 238, 0.10), transparent 60%);
  }
}

/* ============================================
   ACCENT UNDERLINE - 2026 SMOOTHER
   ============================================ */

.accent-underline {
  background: linear-gradient(90deg, var(--accent), var(--secondary), transparent);
  height: 3px;
  width: 56px;
  border-radius: var(--radius-full);
  animation: slideInLeft var(--duration-slow) var(--ease-out);
}

@keyframes slideInLeft {
  from {
    width: 0;
    opacity: 0;
  }
  to {
    width: 56px;
    opacity: 1;
  }
}

/* ============================================
   CARD COMPONENT - 2026 MODERN
   ============================================ */

.card {
  border: 1px solid var(--border);
  background: var(--surface);
  padding: var(--space-lg);
  border-radius: var(--radius-xl);
  transition:
    border-color var(--duration-normal) var(--ease-out),
    box-shadow var(--duration-normal) var(--ease-out),
    transform var(--duration-normal) var(--ease-spring);
  position: relative;
  box-shadow: var(--shadow-sm);
}

.card:hover {
  border-color: color-mix(in srgb, var(--accent) 30%, var(--border));
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.dark .card {
  background: rgba(17, 24, 39, 0.6);
  border: 1px solid rgba(30, 41, 59, 0.8);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.dark .card:hover {
  border-color: rgba(16, 185, 129, 0.3);
  box-shadow:
    var(--shadow-lg),
    0 0 20px rgba(16, 185, 129, 0.08);
}

/* ============================================
   TABLE STYLING
   ============================================ */

#isaTable tr,
.table-hover tr {
  transition: background var(--duration-fast) var(--ease-out);
}

#isaTable tr:hover,
.table-hover tr:hover {
  background: rgba(5, 150, 105, 0.04);
}

.dark #isaTable tr:hover,
.dark .table-hover tr:hover {
  background: rgba(16, 185, 129, 0.08);
}

/* ============================================
   FOCUS STATES - WCAG 2.2 COMPLIANT
   ============================================ */

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: var(--radius-md);
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(5, 150, 105, 0.12);
}

.dark input:focus,
.dark textarea:focus,
.dark select:focus {
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.15);
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* ============================================
   DETAILS/SUMMARY (FAQ)
   ============================================ */

details summary {
  list-style: none;
  cursor: pointer;
  transition: color var(--duration-fast) var(--ease-out);
}

details summary::-webkit-details-marker {
  display: none;
}

details summary:hover {
  color: var(--accent);
}

details[open] summary::after {
  content: '\2212';
  transform: rotate(0deg);
}

details summary::after {
  content: '+';
  float: right;
  font-size: 1.25rem;
  font-weight: 600;
  transition: transform var(--duration-normal) var(--ease-spring);
}

/* ============================================
   SCROLL PROGRESS BAR - 2026 SUBTLE
   ============================================ */

#scrollProgress {
  height: 2px;
  box-shadow: var(--shadow-glow);
  transition: width 80ms linear;
}

/* ============================================
   ANIMATIONS - 2026 SPRING EASING
   ============================================ */

#stickyCTA {
  animation: slideInUp var(--duration-slow) var(--ease-spring);
}

@keyframes slideInUp {
  from {
    transform: translateY(100px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.fade-in {
  animation: fadeIn 0.7s var(--ease-out);
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.6;
    transform: scale(0.95);
  }
}

.animate-pulse {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes bounce {
  0%, 100% {
    transform: translateY(-20%);
    animation-timing-function: cubic-bezier(0.8, 0, 1, 1);
  }
  50% {
    transform: translateY(0);
    animation-timing-function: cubic-bezier(0, 0, 0.2, 1);
  }
}

.animate-bounce {
  animation: bounce 1.2s infinite;
}

/* Glow pulse animation (Emerald) */
@keyframes glow-pulse {
  0%, 100% {
    box-shadow:
      0 0 15px rgba(5, 150, 105, 0.2),
      0 0 30px rgba(5, 150, 105, 0.1);
  }
  50% {
    box-shadow:
      0 0 25px rgba(5, 150, 105, 0.35),
      0 0 50px rgba(5, 150, 105, 0.15);
  }
}

.animate-glow {
  animation: glow-pulse 2.5s ease-in-out infinite;
}

/* ============================================
   SCREEN READER ONLY
   ============================================ */

.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;
}

/* ============================================
   RESPONSIVE TYPOGRAPHY - 2026
   ============================================ */

@media (max-width: 768px) {
  main h1,
  section h1 {
    font-size: 2rem;
    line-height: 1.15;
  }

  main h2,
  section h2 {
    font-size: 1.625rem;
  }

  main h3,
  section h3 {
    font-size: 1.25rem;
  }
}

/* ============================================
   TABLE SCROLL INDICATOR
   ============================================ */

.table-container {
  position: relative;
}

.table-container::after {
  content: 'Scroll \2192';
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  padding: 8px 16px;
  background: linear-gradient(to left, var(--surface), transparent);
  font-size: var(--text-xs);
  color: var(--muted);
  pointer-events: none;
  opacity: 1;
  transition: opacity var(--duration-normal) var(--ease-out);
}

.table-container.scrolled::after {
  opacity: 0;
}

/* ============================================
   FORM ELEMENTS - 2026 REFINED
   ============================================ */

input[type="number"] {
  -moz-appearance: textfield;
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: inner-spin-button;
  width: 22px;
  height: 100%;
  cursor: pointer;
  opacity: 0.4;
  transition: opacity var(--duration-fast) var(--ease-out);
}

input[type="number"]:hover::-webkit-outer-spin-button,
input[type="number"]:hover::-webkit-inner-spin-button {
  opacity: 0.7;
}

input[type="number"]:focus::-webkit-outer-spin-button,
input[type="number"]:focus::-webkit-inner-spin-button {
  opacity: 1;
}

.dark input[type="number"]::-webkit-outer-spin-button,
.dark input[type="number"]::-webkit-inner-spin-button {
  filter: brightness(2) saturate(0.5);
}

/* Select Dropdown - 2026 cleaner */
select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url('data:image/svg+xml;charset=UTF-8,%3csvg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="%2364748B" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"%3e%3cpolyline points="6 9 12 15 18 9"%3e%3c/polyline%3e%3c/svg%3e');
  background-repeat: no-repeat;
  background-position: right 0.875rem center;
  background-size: 1.125em 1.125em;
  padding-right: 3rem;
  cursor: pointer;
}

select:hover {
  border-color: var(--accent);
}

select option {
  background: var(--bg);
  color: var(--fg);
  padding: 0.875rem;
}

.dark select {
  background-image: url('data:image/svg+xml;charset=UTF-8,%3csvg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="%2394A3B8" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"%3e%3cpolyline points="6 9 12 15 18 9"%3e%3c/polyline%3e%3c/svg%3e');
}

.dark select option {
  background: var(--surface);
}

/* ============================================
   MOBILE SAFE AREAS (iOS/Android)
   ============================================ */

@supports (padding: env(safe-area-inset-bottom)) {
  .pb-safe {
    padding-bottom: calc(var(--space-lg) + env(safe-area-inset-bottom));
  }

  .pt-safe {
    padding-top: calc(var(--space-lg) + env(safe-area-inset-top));
  }
}

/* ============================================
   MOBILE MENU ANIMATION - 2026
   ============================================ */

#mobileMenu {
  transition:
    opacity var(--duration-normal) var(--ease-out),
    transform var(--duration-normal) var(--ease-spring);
}

#mobileMenu.hidden {
  opacity: 0;
  transform: translateY(-12px);
  pointer-events: none;
}

#mobileMenu:not(.hidden) {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* ============================================
   REDUCED MOTION (Accessibility)
   ============================================ */

@media (prefers-reduced-motion: reduce) {
  .fade-in,
  .accent-underline,
  #stickyCTA,
  #mobileMenu,
  .animate-glow,
  .animate-pulse,
  .animate-bounce {
    animation: none !important;
  }

  * {
    transition-duration: 0.01ms !important;
  }

  html {
    scroll-behavior: auto;
  }
}

/* ============================================
   PRINT STYLES
   ============================================ */

@media print {
  header,
  #mobileMenu,
  #stickyCTA,
  #scrollProgress,
  .noise,
  footer nav,
  .accent-underline,
  button {
    display: none !important;
  }

  body {
    background: white !important;
    color: black !important;
    font-size: 12pt;
  }

  .card {
    border: 1px solid #ddd !important;
    background: white !important;
    break-inside: avoid;
    box-shadow: none !important;
  }

  a {
    color: #000 !important;
    text-decoration: underline !important;
  }

  a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-size: 0.75em;
    color: #666;
  }

  main {
    padding-top: 0 !important;
  }

  h1, h2, h3 {
    color: black !important;
    break-after: avoid;
  }

  @page {
    margin: 2cm;
  }
}

/* ============================================
   BACKDROP FILTER FALLBACK
   ============================================ */

@supports not (backdrop-filter: blur(8px)) {
  .glass {
    background: var(--bg) !important;
  }
}

/* ============================================
   UTILITY CLASSES - 2026
   ============================================ */

/* Glow effects */
.glow-emerald {
  box-shadow: 0 0 20px rgba(5, 150, 105, 0.25);
}

.glow-emerald-lg {
  box-shadow:
    0 0 25px rgba(5, 150, 105, 0.3),
    0 0 50px rgba(5, 150, 105, 0.15);
}

.glow-cyan {
  box-shadow: 0 0 20px rgba(6, 182, 212, 0.25);
}

/* Text glow */
.text-glow {
  text-shadow: 0 0 20px rgba(16, 185, 129, 0.35);
}

/* Border glow */
.border-glow {
  border: 1px solid rgba(5, 150, 105, 0.25);
  box-shadow:
    inset 0 0 8px rgba(5, 150, 105, 0.08),
    0 0 12px rgba(5, 150, 105, 0.15);
}

/* Hover glow */
.hover-glow {
  transition:
    box-shadow var(--duration-normal) var(--ease-out),
    transform var(--duration-normal) var(--ease-spring);
}

.hover-glow:hover {
  box-shadow: var(--shadow-glow);
  transform: translateY(-2px);
}

/* Gradient text */
.gradient-text {
  background: linear-gradient(135deg, var(--accent), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Gradient line */
.gradient-line {
  background: linear-gradient(90deg, var(--accent), var(--secondary));
  height: 2px;
}

/* Button shine effect - 2026 subtler */
.btn-glow {
  position: relative;
  overflow: hidden;
  transition:
    box-shadow var(--duration-normal) var(--ease-out),
    transform var(--duration-fast) var(--ease-spring);
}

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

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

.btn-glow:hover {
  box-shadow: var(--shadow-glow);
  transform: translateY(-1px);
}

.btn-glow:active {
  transform: translateY(0);
}

/* ============================================
   SCROLL-DRIVEN ANIMATIONS (2026)
   ============================================ */

@supports (animation-timeline: scroll()) {
  .scroll-fade-in {
    animation: scrollFadeIn linear;
    animation-timeline: view();
    animation-range: entry 0% entry 40%;
  }

  @keyframes scrollFadeIn {
    from {
      opacity: 0;
      transform: translateY(40px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
}

/* ============================================
   LINK STYLES - 2026 REFINED
   ============================================ */

.link-hover {
  position: relative;
  transition: color var(--duration-fast) var(--ease-out);
}

.link-hover::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: width var(--duration-normal) var(--ease-out);
}

.link-hover:hover::after {
  width: 100%;
}

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

/* ============================================
   PRIMARY BUTTON - GRADIENT (matches Yusagi)
   ============================================ */

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--secondary));
  color: white;
  font-weight: 600;
  transition:
    box-shadow var(--duration-normal) var(--ease-out),
    transform var(--duration-fast) var(--ease-spring);
}

.btn-primary:hover {
  box-shadow: var(--shadow-glow);
}

/* ============================================
   BADGE STYLES - 2026
   ============================================ */

.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: 0.375rem 0.875rem;
  font-size: var(--text-sm);
  font-weight: 500;
  border-radius: var(--radius-full);
  background: var(--accent-muted);
  color: var(--accent-text);
  border: 1px solid transparent;
  transition:
    background var(--duration-fast) var(--ease-out),
    border-color var(--duration-fast) var(--ease-out);
}

.dark .badge {
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-soft);
}

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

/* ============================================
   ICON CONTAINER - 2026
   ============================================ */

.icon-container {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3.5rem;
  height: 3.5rem;
  border-radius: var(--radius-xl);
  transition:
    transform var(--duration-normal) var(--ease-spring),
    box-shadow var(--duration-normal) var(--ease-out);
}

.icon-container:hover {
  transform: scale(1.08);
}

/* ============================================
   TOOLTIP - 2026 MINIMAL
   ============================================ */

[data-tooltip] {
  position: relative;
}

[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(-8px);
  padding: 0.5rem 0.875rem;
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--fg);
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity var(--duration-fast) var(--ease-out),
    visibility var(--duration-fast) var(--ease-out),
    transform var(--duration-fast) var(--ease-spring);
  pointer-events: none;
  z-index: 50;
}

[data-tooltip]:hover::after {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(-4px);
}

/* ============================================
   SKELETON LOADING - 2026
   ============================================ */

.skeleton {
  background: linear-gradient(
    90deg,
    var(--surface) 25%,
    var(--border) 50%,
    var(--surface) 75%
  );
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
  border-radius: var(--radius-md);
}

@keyframes skeleton-loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* ============================================
   TOAST NOTIFICATIONS - 2026
   ============================================ */

.toast {
  position: fixed;
  top: 5rem;
  right: 1.5rem;
  padding: 1rem 1.5rem;
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  transform: translateX(120%);
  transition: transform var(--duration-normal) var(--ease-spring);
  z-index: 100;
  max-width: 360px;
}

.toast.show {
  transform: translateX(0);
}

.toast.success {
  border-left: 4px solid var(--success);
}

.toast.error {
  border-left: 4px solid var(--error);
}

.toast.warning {
  border-left: 4px solid var(--warning);
}

.toast.info {
  border-left: 4px solid var(--accent);
}

/* Enhanced toast notification (2026 UX) */
.toast-notification {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.toast-icon {
  flex-shrink: 0;
}

.toast-notification.success .toast-icon {
  color: var(--success);
}

.toast-notification.error .toast-icon {
  color: var(--error);
}

.toast-notification.warning .toast-icon {
  color: var(--warning);
}

.toast-notification.info .toast-icon {
  color: var(--accent);
}

.toast-close {
  flex-shrink: 0;
  padding: var(--space-xs);
  color: var(--muted);
  background: transparent;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
  margin-left: auto;
}

.toast-close:hover {
  background: var(--border);
  color: var(--fg);
}

/* Mobile toast positioning */
@media (max-width: 480px) {
  .toast,
  .toast-notification {
    top: auto;
    bottom: 1.5rem;
    right: 1rem;
    left: 1rem;
    transform: translateY(calc(100% + 2rem));
    max-width: none;
  }

  .toast.show,
  .toast-notification.show {
    transform: translateY(0);
  }
}

/* ============================================
   2026 UX - BUTTON LOADING STATE
   ============================================ */

button.loading {
  position: relative;
  pointer-events: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

button.loading svg.animate-spin {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* ============================================
   2026 UX - BUTTON PRESS ANIMATION
   ============================================ */

@keyframes buttonPress {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(0.97);
  }
  100% {
    transform: scale(1);
  }
}

button:active:not(:disabled),
.btn-primary:active:not(:disabled) {
  animation: buttonPress 150ms var(--ease-out);
}

/* ============================================
   2026 UX - ENHANCED FOCUS STATES
   ============================================ */

input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(5, 150, 105, 0.15);
}

.dark input:focus-visible,
.dark textarea:focus-visible,
.dark select:focus-visible {
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.2);
}

/* ============================================
   2026 UX - SMOOTH PAGE TRANSITIONS
   ============================================ */

/* Fade in animation for page content */
.fade-in-up {
  animation: fadeInUp 0.5s var(--ease-out);
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Stagger animation for lists */
.stagger-item {
  opacity: 0;
  animation: fadeInUp 0.4s var(--ease-out) forwards;
}

.stagger-item:nth-child(1) { animation-delay: 0.05s; }
.stagger-item:nth-child(2) { animation-delay: 0.1s; }
.stagger-item:nth-child(3) { animation-delay: 0.15s; }
.stagger-item:nth-child(4) { animation-delay: 0.2s; }
.stagger-item:nth-child(5) { animation-delay: 0.25s; }
.stagger-item:nth-child(6) { animation-delay: 0.3s; }

/* ============================================
   SLIDE-IN PANEL SYSTEM (Oracle APEX Style)
   ============================================ */

/* Panel Overlay - backdrop with blur */
.panel-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0);
  backdrop-filter: blur(0px);
  -webkit-backdrop-filter: blur(0px);
  z-index: 100;
  transition: background 0.3s ease, backdrop-filter 0.3s ease;
}

.panel-overlay.active {
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.panel-overlay.closing {
  background: rgba(0, 0, 0, 0);
  backdrop-filter: blur(0px);
  -webkit-backdrop-filter: blur(0px);
}

/* Panel Container - slides from right */
.slide-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  max-width: 560px;
  background: var(--surface);
  box-shadow: -8px 0 30px rgba(0, 0, 0, 0.15);
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
  display: flex;
  flex-direction: column;
  z-index: 101;
  border-radius: 0;
}

.slide-panel.open {
  transform: translateX(0);
}

.slide-panel.closing {
  transform: translateX(100%);
}

.dark .slide-panel {
  background: var(--surface);
  box-shadow: -8px 0 40px rgba(0, 0, 0, 0.4);
}

/* Body scroll lock when panel open */
body.panel-open {
  overflow: hidden;
}

/* Panel Header - sticky with breadcrumb */
.panel-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md) var(--space-lg);
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  min-height: 64px;
  gap: var(--space-md);
}

.panel-header-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.panel-breadcrumb {
  font-size: var(--text-xs);
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.panel-breadcrumb-sep {
  color: var(--border);
  margin: 0 var(--space-xs);
}

.panel-title {
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--fg);
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Panel close button */
.panel-close-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.panel-close-btn:hover {
  background: var(--border);
  color: var(--fg);
  border-color: transparent;
}

.panel-close-btn svg {
  width: 20px;
  height: 20px;
}

/* Panel icon badge */
.panel-icon-badge {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* Panel Body - scrollable content area */
.panel-body {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-lg);
  overscroll-behavior: contain;
}

/* Panel Footer - sticky action buttons */
.panel-footer {
  position: sticky;
  bottom: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-lg);
  border-top: 1px solid var(--border);
  background: var(--surface);
}

/* Panel sizes */
.slide-panel.panel-sm {
  max-width: 420px;
}

.slide-panel.panel-lg {
  max-width: 760px;
}

.slide-panel.panel-xl {
  max-width: 900px;
}

/* Confirmation panel styles */
.slide-panel.confirm-panel {
  max-width: 420px;
}

.confirm-panel .panel-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--space-xl) var(--space-lg);
}

/* Success panel styles */
.slide-panel.success-panel {
  max-width: 440px;
}

.success-panel .panel-body {
  padding: var(--space-xl) var(--space-lg);
}

/* Mobile Responsive - Full screen panel */
@media (max-width: 640px) {
  .slide-panel {
    max-width: 100%;
    width: 100%;
    border-radius: 0;
  }

  .panel-header {
    padding: var(--space-sm) var(--space-md);
    min-height: 56px;
  }

  .panel-title {
    font-size: var(--text-base);
  }

  .panel-body {
    padding: var(--space-md);
  }

  .panel-footer {
    padding: var(--space-sm) var(--space-md);
    padding-bottom: calc(var(--space-sm) + env(safe-area-inset-bottom, 0px));
    flex-direction: column-reverse;
    gap: var(--space-xs);
  }

  .panel-footer button {
    width: 100%;
    justify-content: center;
    min-height: 48px;
  }
}

/* Tablet - optimize for content */
@media (min-width: 641px) and (max-width: 1024px) {
  .slide-panel {
    max-width: 520px;
  }

  .slide-panel.panel-lg {
    max-width: 680px;
  }

  .slide-panel.panel-xl {
    max-width: 800px;
  }
}

/* Desktop large screens - wider panels */
@media (min-width: 1280px) {
  .slide-panel {
    max-width: 640px;
  }

  .slide-panel.panel-lg {
    max-width: 880px;
  }

  .slide-panel.panel-xl {
    max-width: 1100px;
  }
}

/* ============================================
   UX FIX: Scroll Progress Bar Thicker
   ============================================ */
#scrollProgress {
  height: 3px;
}
