/**
 * Tokens CSS - Variables unificadas para desktop
 * Define todos los tokens de diseño: colores, espaciado, tipografía, sombras, efectos
 * Archivo: public/styles/desktop/tokens.css
 * 
 * Requisitos cubiertos:
 * - 8.3: Color tokens with theme (#b39bff), secondary (#ff9ec7), surfaces
 * - 8.4: Shadows with rgba and correct opacity
 * - 11.1-11.7: All tokens used in cascading CSS variables
 * 
 * Criterios de aceptación:
 * ✓ Todos los tokens prefijados con `--`
 * ✓ Variables de tema utilizable en cascada
 * ✓ Valores de sombras utilizan rgba con opacidad correcta
 */

:root {
  /* ==================== THEME COLOR TOKENS ==================== */
  /* Primary theme color - Purple */
  --theme: #b39bff;
  --theme-dark: #8b5cf6;
  --theme-light: #d8b4ff;
  
  /* Secondary theme color - Pink */
  --theme-pk: #ff9ec7;
  --theme-pk-dark: #f472b6;
  --theme-pk-light: #fbcfe8;

  /* ==================== GLOW & ACCENT EFFECTS ==================== */
  /* Purple glow for primary elements */
  --theme-glow: rgba(179, 155, 255, 0.35);
  --theme-glow-soft: rgba(179, 155, 255, 0.15);
  --theme-glow-strong: rgba(179, 155, 255, 0.55);
  
  /* Pink glow for secondary elements */
  --theme-glow2: rgba(255, 158, 199, 0.25);
  --theme-glow2-soft: rgba(255, 158, 199, 0.10);
  --theme-glow2-strong: rgba(255, 158, 199, 0.45);

  /* ==================== SURFACE COLOR TOKENS ==================== */
  /* Base background - Dark theme foundation */
  --surface: #0a0b10;
  
  /* Elevated surfaces for layers and depth */
  --surface2: rgba(255, 255, 255, 0.03);
  --surface3: rgba(255, 255, 255, 0.06);
  --surface-hover: rgba(255, 255, 255, 0.08);
  
  /* Additional surface variations for complex layouts */
  --surface-elevated: rgba(20, 20, 30, 0.4);
  --surface-overlay: rgba(10, 10, 12, 0.8);

  /* ==================== TEXT COLOR TOKENS ==================== */
  /* Primary text - Full contrast */
  --tx: #ffffff;
  
  /* Secondary text - Reduced contrast for hierarchy */
  --tx2: rgba(255, 255, 255, 0.75);
  
  /* Tertiary text - Lower hierarchy */
  --tx3: rgba(255, 255, 255, 0.50);
  
  /* Disabled/muted text */
  --tx-disabled: rgba(255, 255, 255, 0.30);
  --tx-muted: rgba(255, 255, 255, 0.40);

  /* ==================== BORDER COLOR TOKENS ==================== */
  /* Default border - Subtle dividers */
  --border: rgba(255, 255, 255, 0.08);
  
  /* Emphasized border - More visible separations */
  --border2: rgba(255, 255, 255, 0.12);
  
  /* Light borders - Subtle suggestions */
  --border-light: rgba(255, 255, 255, 0.04);
  
  /* Strong borders - Clear separations */
  --border-strong: rgba(255, 255, 255, 0.16);

  /* ==================== SEMANTIC COLORS ==================== */
  --color-success: #10b981;
  --color-warning: #f59e0b;
  --color-error: #ef4444;
  --color-info: #3b82f6;
  
  /* Semantic backgrounds */
  --color-success-bg: rgba(16, 185, 129, 0.10);
  --color-warning-bg: rgba(245, 158, 11, 0.10);
  --color-error-bg: rgba(239, 68, 68, 0.10);
  --color-info-bg: rgba(59, 130, 246, 0.10);

  /* ==================== SPACING TOKENS ==================== */
  /* Small spacing unit */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 24px;
  --sp-8: 32px;
  --sp-10: 40px;
  --sp-12: 48px;

  /* Grid gap tokens by breakpoint */
  --gap: 16px; /* Default desktop gap */
  --gap-sm: 14px; /* Mobile gap */
  --gap-md: 16px; /* Desktop 1200px gap */
  --gap-lg: 18px; /* FullHD 1920px gap */
  --gap-xl: 24px; /* Extra large gaps for premium spacing */

  /* Padding tokens by breakpoint */
  --pad-h: 24px; /* Default horizontal padding */
  --pad-h-sm: 20px; /* Tablet 1024px */
  --pad-h-md: 24px; /* Desktop 1200px */
  --pad-h-lg: 28px; /* FullHD 1920px */
  
  --pad-v: 16px; /* Default vertical padding */
  --pad-v-sm: 12px; /* Small vertical padding */
  --pad-v-md: 16px; /* Medium vertical padding */
  --pad-v-lg: 20px; /* Large vertical padding */

  /* Topbar padding tokens */
  --topbar-pad-h: 18px;
  --topbar-pad-v: 12px;
  --topbar-height: 54px;

  /* Sidebar padding */
  --sidebar-pad: 16px;
  --sidebar-width-expanded: 280px;
  --sidebar-width-collapsed: 80px;

  /* ==================== TYPOGRAPHY TOKENS ==================== */
  /* Font family stack */
  --font-primary: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
    'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Menlo', monospace;

  /* Font sizes */
  --text-xs: 0.75rem; /* 12px */
  --text-sm: 0.875rem; /* 14px */
  --text-base: 0.9375rem; /* 15px */
  --text-md: 1rem; /* 16px */
  --text-lg: 1.125rem; /* 18px */
  --text-xl: 1.25rem; /* 20px */
  --text-2xl: 1.45rem; /* 23px - Card titles */
  --text-3xl: 1.75rem; /* 28px */

  /* Font sizes - Specific roles */
  --title-size: 1.45rem; /* Card titles */
  --title-size-large: 1.75rem;
  --subtitle-size: 0.95rem; /* Card subtitles */
  --subtitle-size-large: 1.125rem;
  --body-size: 0.88rem; /* Body text */
  --body-size-large: 1rem;
  --label-size: 0.8125rem; /* Labels and badges */

  /* Font weights */
  --weight-regular: 400;
  --weight-medium: 500;
  --weight-semibold: 600;
  --weight-bold: 700;

  /* Specific font weight combinations */
  --title-weight: 700; /* Bold titles */
  --subtitle-weight: 600; /* Semibold subtitles */
  --body-weight: 400; /* Regular body */
  --label-weight: 500; /* Medium labels */

  /* Line heights */
  --line-height-tight: 1.2;
  --line-height-snug: 1.3;
  --line-height-normal: 1.5;
  --line-height-relaxed: 1.625;
  --line-height-loose: 1.75;

  /* Letter spacing */
  --letter-spacing-tight: -0.02em;
  --letter-spacing-normal: 0em;
  --letter-spacing-wide: 0.02em;

  /* ==================== SHADOW & ELEVATION TOKENS ==================== */
  /* Elevation shadows using rgba with proper opacity */
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.10);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.15);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.20);
  --shadow-xl: 0 12px 32px rgba(0, 0, 0, 0.50); /* Hover state */
  --shadow-2xl: 0 16px 48px rgba(0, 0, 0, 0.60);

  /* Specific shadow use cases */
  --shadow-topbar: 0 4px 24px rgba(0, 0, 0, 0.50);
  --shadow-card: 0 4px 16px rgba(0, 0, 0, 0.30);
  --shadow-card-hover: 0 12px 32px rgba(0, 0, 0, 0.50);
  --shadow-sidebar: 0 8px 32px rgba(0, 0, 0, 0.40);
  
  /* Accent shadows with theme colors */
  --shadow-accent: 0 4px 20px rgba(179, 155, 255, 0.25);
  --shadow-accent-pk: 0 4px 20px rgba(255, 158, 199, 0.20);

  /* ==================== BLUR & GLASSMORPHISM TOKENS ==================== */
  /* Backdrop filter values */
  --glass-blur: blur(24px);
  --glass-blur-sm: blur(12px);
  --glass-blur-lg: blur(32px);
  --glass-saturate: saturate(180%);
  
  /* Glassmorphic backgrounds */
  --glass-bg: rgba(10, 10, 12, 0.65);
  --glass-bg-light: rgba(10, 10, 12, 0.45);
  --glass-bg-strong: rgba(10, 10, 12, 0.80);

  /* ==================== BORDER RADIUS TOKENS ==================== */
  --r-xs: 4px; /* Minimal radius */
  --r-sm: 8px; /* Small radius */
  --r-md: 12px; /* Medium radius */
  --r: 16px; /* Default radius */
  --r-lg: 20px; /* Large radius */
  --r-xl: 24px; /* Extra large radius */
  --r-2xl: 32px; /* 2XL radius */
  --r-full: 9999px; /* Fully rounded */

  /* ==================== TRANSITIONS & TIMING FUNCTIONS ==================== */
  /* Easing functions - Material Design inspired */
  --ease: 0.2s cubic-bezier(0.4, 0, 0.2, 1); /* Standard easing */
  --ease-in: 0.2s cubic-bezier(0.4, 0, 1, 1); /* Ease in */
  --ease-out: 0.2s cubic-bezier(0, 0, 0.2, 1); /* Ease out */
  --ease-in-out: 0.2s cubic-bezier(0.4, 0, 0.2, 1); /* Ease in-out */
  --ease-long: 0.3s cubic-bezier(0.4, 0, 0.2, 1); /* Longer easing (sidebar) */
  --ease-slow: 0.35s cubic-bezier(0.4, 0, 0.2, 1); /* Slow easing */

  /* Spring-like easing */
  --spring: 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  --spring-tight: 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  --spring-loose: 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Raw timing functions without duration (for use with custom durations) */
  --timing-ease: cubic-bezier(0.4, 0, 0.2, 1);
  --timing-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --timing-bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);
  --timing-elastic: cubic-bezier(0.175, 0.885, 0.32, 1.275);

  /* Transition durations */
  --duration-fast: 0.1s;
  --duration-normal: 0.2s;
  --duration-slow: 0.3s;
  --duration-slower: 0.5s;

  /* ==================== Z-INDEX SCALE ==================== */
  --z-base: 1;
  --z-dropdown: 5;
  --z-sticky: 8;
  --z-sidebar: 9;
  --z-topbar: 10;
  --z-overlay: 20;
  --z-modal: 30;
  --z-popover: 40;
  --z-tooltip: 50;
  --z-toast: 100;
  --z-max: 9999;

  /* ==================== BREAKPOINT TOKENS (for reference) ==================== */
  /* Note: Breakpoints are used in media queries, not as CSS values */
  --bp-mobile: 320px;
  --bp-tablet: 1024px;
  --bp-desktop: 1200px;
  --bp-fullhd: 1920px;
  --bp-4k: 2560px;

  /* ==================== SIDEBAR TOKENS ==================== */
  --sidebar-bg: rgba(10, 10, 12, 0.65);
  --sidebar-border: rgba(255, 255, 255, 0.08);
  --sidebar-item-pad: 12px 16px;
  --sidebar-item-gap: 12px;
  --sidebar-item-height: 40px;

  /* ==================== ANIMATION & EFFECT TOKENS ==================== */
  /* For use in animation properties */
  --anim-fade-in: 0.3s var(--timing-ease) 0s 1 normal both forwards;
  --anim-slide-in: 0.3s var(--timing-ease) 0s 1 normal both forwards;
  --anim-scale-in: 0.3s var(--timing-spring) 0s 1 normal both forwards;

  /* Backdrop filter combinations */
  --backdrop: var(--glass-blur) var(--glass-saturate);
}

/* ==================== RESPONSIVE ADJUSTMENTS ==================== */
/* These media queries override base tokens for different breakpoints */

/* Tablet breakpoint (1024px+) */
@media (min-width: 1024px) {
  :root {
    /* Spacing adjustments for tablet view */
    --gap: 14px;
    --gap-md: 14px;
    --pad-h: 20px;
    --pad-h-sm: 20px;
  }
}

/* Desktop breakpoint (1200px+) */
@media (min-width: 1200px) {
  :root {
    /* Standard desktop spacing */
    --gap: 16px;
    --gap-md: 16px;
    --pad-h: 24px;
    --pad-h-md: 24px;
  }
}

/* FullHD breakpoint (1920px+) */
@media (min-width: 1920px) {
  :root {
    /* Generous spacing for FullHD displays */
    --gap: 18px;
    --gap-lg: 18px;
    --pad-h: 28px;
    --pad-h-lg: 28px;
  }
}

/* 4K displays (2560px+) */
@media (min-width: 2560px) {
  :root {
    /* Extra padding for ultra-wide displays */
    --gap: 24px;
    --pad-h: 40px;
  }
}
