/* ============================================================
   🧺 RafiCihuy969 — Design System & Global Styles
   Theme: "Aqua Fresh" Dark Glassmorphism
   ============================================================ */

/* ======================== IMPORTS ======================== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap');

/* ======================== CSS CUSTOM PROPERTIES ======================== */
:root {
  /* Colors — Background */
  --bg-primary: #0a0e27;
  --bg-secondary: #111638;
  --bg-tertiary: #171d4a;
  --bg-glass: rgba(17, 22, 56, 0.7);
  --bg-glass-light: rgba(25, 32, 72, 0.5);
  --bg-glass-heavy: rgba(10, 14, 39, 0.85);
  --bg-surface: rgba(23, 29, 74, 0.4);

  /* Colors — Accent */
  --accent-primary: #00d4ff;
  --accent-primary-rgb: 0, 212, 255;
  --accent-secondary: #7b61ff;
  --accent-secondary-rgb: 123, 97, 255;
  --accent-success: #00e676;
  --accent-success-rgb: 0, 230, 118;
  --accent-warning: #ffab00;
  --accent-warning-rgb: 255, 171, 0;
  --accent-danger: #ff5252;
  --accent-danger-rgb: 255, 82, 82;
  --accent-info: #448aff;
  --accent-info-rgb: 68, 138, 255;

  /* Colors — Text */
  --text-primary: #ffffff;
  --text-secondary: #a0aec0;
  --text-tertiary: #636e85;
  --text-inverse: #0a0e27;

  /* Colors — Border */
  --border-subtle: rgba(255, 255, 255, 0.06);
  --border-light: rgba(255, 255, 255, 0.1);
  --border-medium: rgba(255, 255, 255, 0.15);
  --border-accent: rgba(0, 212, 255, 0.3);

  /* Gradients */
  --gradient-primary: linear-gradient(135deg, #00d4ff, #7b61ff);
  --gradient-primary-hover: linear-gradient(135deg, #33ddff, #9580ff);
  --gradient-success: linear-gradient(135deg, #00e676, #00b0ff);
  --gradient-danger: linear-gradient(135deg, #ff5252, #ff1744);
  --gradient-warning: linear-gradient(135deg, #ffab00, #ff6d00);
  --gradient-bg: linear-gradient(180deg, #0a0e27 0%, #0f1535 50%, #111638 100%);
  --gradient-glow: radial-gradient(ellipse at 50% 0%, rgba(0, 212, 255, 0.15) 0%, transparent 60%);

  /* Typography */
  --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  --text-xs: 0.75rem;
  --text-sm: 0.8125rem;
  --text-base: 0.9375rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 1.875rem;
  --text-4xl: 2.25rem;

  --leading-tight: 1.25;
  --leading-normal: 1.5;
  --leading-relaxed: 1.75;

  /* Spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;

  /* Border Radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.625rem;
  --radius-lg: 0.875rem;
  --radius-xl: 1.25rem;
  --radius-2xl: 1.5rem;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.4);
  --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.5);
  --shadow-glow-primary: 0 0 20px rgba(0, 212, 255, 0.3);
  --shadow-glow-secondary: 0 0 20px rgba(123, 97, 255, 0.3);
  --shadow-glow-success: 0 0 20px rgba(0, 230, 118, 0.3);

  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-spring: 500ms cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Z-index */
  --z-dropdown: 100;
  --z-sidebar: 200;
  --z-modal-backdrop: 300;
  --z-modal: 400;
  --z-toast: 500;

  /* Layout */
  --sidebar-width: 260px;
  --sidebar-collapsed: 72px;
  --header-height: 64px;
  --content-max-width: 1200px;
}

/* ======================== RESET & BASE ======================== */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-primary);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--text-secondary);
  background: var(--gradient-bg);
  min-height: 100vh;
  overflow-x: hidden;
}

/* Background ambient glow */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 60vh;
  background: var(--gradient-glow);
  pointer-events: none;
  z-index: 0;
}

h1, h2, h3, h4, h5, h6 {
  color: var(--text-primary);
  font-weight: 700;
  line-height: var(--leading-tight);
}

h1 { font-size: var(--text-4xl); }
h2 { font-size: var(--text-3xl); }
h3 { font-size: var(--text-2xl); }
h4 { font-size: var(--text-xl); }
h5 { font-size: var(--text-lg); }

a {
  color: var(--accent-primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--accent-secondary);
}

img {
  max-width: 100%;
  display: block;
}

button {
  cursor: pointer;
  font-family: var(--font-primary);
  border: none;
  outline: none;
}

input, select, textarea {
  font-family: var(--font-primary);
  font-size: var(--text-base);
  outline: none;
}

/* ======================== SCROLLBAR ======================== */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
  background: var(--bg-tertiary);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 212, 255, 0.3);
}

/* ======================== SKELETON LOADING ======================== */
@keyframes shimmer {
  0% {
    background-position: -1000px 0;
  }
  100% {
    background-position: 1000px 0;
  }
}

.skeleton {
  background: linear-gradient(
    90deg,
    var(--bg-tertiary) 0%,
    rgba(30, 38, 85, 0.8) 40%,
    rgba(40, 50, 110, 0.6) 50%,
    rgba(30, 38, 85, 0.8) 60%,
    var(--bg-tertiary) 100%
  );
  background-size: 2000px 100%;
  animation: shimmer 2s infinite linear;
  border-radius: var(--radius-md);
  position: relative;
  overflow: hidden;
}

.skeleton-text {
  height: 14px;
  margin-bottom: var(--space-3);
  width: 100%;
}

.skeleton-text.short {
  width: 60%;
}

.skeleton-text.shorter {
  width: 40%;
}

.skeleton-title {
  height: 24px;
  margin-bottom: var(--space-4);
  width: 50%;
}

.skeleton-avatar {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
}

.skeleton-card {
  height: 180px;
  border-radius: var(--radius-xl);
}

.skeleton-badge {
  height: 24px;
  width: 80px;
  border-radius: var(--radius-full);
}

.skeleton-row {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4);
}

/* ======================== ANIMATIONS ======================== */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

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

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 5px rgba(0, 212, 255, 0.3); }
  50% { box-shadow: 0 0 20px rgba(0, 212, 255, 0.6); }
}

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

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

@keyframes toastSlideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes toastSlideOut {
  from { transform: translateX(0); opacity: 1; }
  to { transform: translateX(100%); opacity: 0; }
}

.animate-fade-in { animation: fadeIn var(--transition-base) ease-out; }
.animate-fade-in-up { animation: fadeInUp var(--transition-slow) ease-out; }
.animate-fade-in-down { animation: fadeInDown var(--transition-slow) ease-out; }
.animate-slide-in-left { animation: slideInLeft var(--transition-slow) ease-out; }
.animate-slide-in-right { animation: slideInRight var(--transition-slow) ease-out; }
.animate-scale-in { animation: scaleIn var(--transition-spring) ease-out; }

/* Stagger children animations */
.stagger-children > * {
  animation: fadeInUp var(--transition-slow) ease-out both;
}

.stagger-children > *:nth-child(1) { animation-delay: 0ms; }
.stagger-children > *:nth-child(2) { animation-delay: 60ms; }
.stagger-children > *:nth-child(3) { animation-delay: 120ms; }
.stagger-children > *:nth-child(4) { animation-delay: 180ms; }
.stagger-children > *:nth-child(5) { animation-delay: 240ms; }
.stagger-children > *:nth-child(6) { animation-delay: 300ms; }
.stagger-children > *:nth-child(7) { animation-delay: 360ms; }
.stagger-children > *:nth-child(8) { animation-delay: 420ms; }

/* ======================== UTILITIES ======================== */
.glass {
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-light);
}

.glass-light {
  background: var(--bg-glass-light);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-subtle);
}

.glass-heavy {
  background: var(--bg-glass-heavy);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  border: 1px solid var(--border-medium);
}

.text-gradient {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* Container */
.container {
  max-width: var(--content-max-width);
  margin: 0 auto;
  padding: 0 var(--space-6);
}

/* Page transition */
.page {
  display: none;
  position: relative;
  z-index: 1;
}

.page.active {
  display: block;
  animation: fadeIn 300ms ease-out;
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: var(--space-16) var(--space-8);
}

.empty-state .empty-icon {
  font-size: 4rem;
  margin-bottom: var(--space-6);
  opacity: 0.5;
}

.empty-state .empty-title {
  font-size: var(--text-xl);
  color: var(--text-primary);
  margin-bottom: var(--space-2);
}

.empty-state .empty-desc {
  color: var(--text-tertiary);
  font-size: var(--text-sm);
}

/* Loading spinner */
.spinner {
  width: 24px;
  height: 24px;
  border: 3px solid var(--border-light);
  border-top-color: var(--accent-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.spinner-lg {
  width: 40px;
  height: 40px;
  border-width: 4px;
}
