/* =====================================================
   DocManager Modern Theme 2025
   Implementing glassmorphism, sophisticated dark mode,
   and modern UI/UX patterns
   ===================================================== */

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

/* =====================================================
   CSS Custom Properties (Design Tokens)
   ===================================================== */

:root {
  /* ===== Colors ===== */
  /* Primary Palette */
  --primary-900: #0f172a;
  --primary-800: #1e293b;
  --primary-700: #334155;
  --primary-600: #475569;
  --primary-500: #64748b;
  --primary-400: #94a3b8;
  --primary-300: #cbd5e1;
  --primary-200: #e2e8f0;
  --primary-100: #f1f5f9;
  --primary-50: #f8fafc;

  /* Accent Colors */
  --accent-blue: #3b82f6;
  --accent-blue-light: #60a5fa;
  --accent-purple: #8b5cf6;
  --accent-purple-light: #a78bfa;
  --accent-emerald: #10b981;
  --accent-emerald-light: #34d399;
  --accent-amber: #f59e0b;
  --accent-amber-light: #fbbf24;

  /* Semantic Colors */
  --success: #10b981;
  --success-light: #34d399;
  --warning: #f59e0b;
  --warning-light: #fbbf24;
  --error: #ef4444;
  --error-light: #f87171;
  --info: #3b82f6;
  --info-light: #60a5fa;

  /* Background Colors */
  --bg-primary: #0f172a;
  --bg-secondary: #1e293b;
  --bg-tertiary: #334155;
  --bg-surface: rgba(255, 255, 255, 0.05);
  --bg-overlay: rgba(0, 0, 0, 0.6);
  --bg-card: rgba(255, 255, 255, 0.08);
  --bg-input: rgba(255, 255, 255, 0.05);

  /* Text Colors */
  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-tertiary: #94a3b8;
  --text-inverse: #0f172a;

  /* Border Colors */
  --border-primary: rgba(255, 255, 255, 0.1);
  --border-secondary: rgba(255, 255, 255, 0.05);
  --border-accent: rgba(59, 130, 246, 0.3);

  /* ===== Typography ===== */
  --font-family-primary: 'Inter', system-ui, -apple-system, sans-serif;
  --font-family-mono: 'JetBrains Mono', 'Courier New', monospace;

  /* Font Sizes */
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 1.875rem;
  --text-4xl: 2.25rem;
  --text-5xl: 3rem;

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

  /* Line Heights */
  --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;
  --space-24: 6rem;

  /* ===== Border Radius ===== */
  --radius-sm: 0.25rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-2xl: 1.5rem;
  --radius-3xl: 2rem;
  --radius-full: 9999px;

  /* ===== Shadows ===== */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
  --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  --shadow-inner: inset 0 2px 4px 0 rgba(0, 0, 0, 0.05);

  /* ===== Glassmorphism ===== */
  --glass-bg: rgba(255, 255, 255, 0.05);
  --glass-bg-hover: rgba(255, 255, 255, 0.08);
  --glass-border: rgba(255, 255, 255, 0.1);
  --glass-border-hover: rgba(255, 255, 255, 0.2);
  --glass-backdrop: blur(16px);
  --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);

  /* ===== Animations ===== */
  --transition-fast: 150ms ease;
  --transition-normal: 300ms ease;
  --transition-slow: 500ms ease;
  --transition-bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);

  /* ===== Layout ===== */
  --sidebar-width: 280px;
  --sidebar-width-collapsed: 80px;
  --topbar-height: 72px;
  --container-max-width: 1280px;

  /* ===== Z-Index ===== */
  --z-dropdown: 1000;
  --z-modal: 1050;
  --z-tooltip: 1100;
  --z-toast: 1200;
}

/* =====================================================
   Base Styles
   ===================================================== */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

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

/* =====================================================
   Utility Classes
   ===================================================== */

/* Glassmorphism Effects */
.glass {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-backdrop);
  -webkit-backdrop-filter: var(--glass-backdrop);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
}

.glass-hover {
  transition: all var(--transition-normal);
}

.glass-hover:hover {
  background: var(--glass-bg-hover);
  border-color: var(--glass-border-hover);
  transform: translateY(-2px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

/* Gradient Utilities */
.gradient-primary {
  background: linear-gradient(135deg, var(--accent-blue) 0%, var(--accent-purple) 100%);
}

.gradient-success {
  background: linear-gradient(135deg, var(--accent-emerald) 0%, var(--success-light) 100%);
}

.gradient-warning {
  background: linear-gradient(135deg, var(--accent-amber) 0%, var(--warning-light) 100%);
}

.gradient-text {
  background: linear-gradient(135deg, var(--accent-blue) 0%, var(--accent-purple) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Animation Utilities */
.animate-fade-in {
  animation: fadeIn 0.5s ease-out;
}

.animate-slide-up {
  animation: slideUp 0.5s ease-out;
}

.animate-slide-in-right {
  animation: slideInRight 0.5s ease-out;
}

.animate-pulse {
  animation: pulse 2s infinite;
}

/* Hover Effects */
.hover-lift {
  transition: transform var(--transition-normal);
}

.hover-lift:hover {
  transform: translateY(-4px);
}

.hover-scale {
  transition: transform var(--transition-normal);
}

.hover-scale:hover {
  transform: scale(1.02);
}

.hover-glow {
  transition: box-shadow var(--transition-normal);
}

.hover-glow:hover {
  box-shadow: 0 0 20px rgba(59, 130, 246, 0.3);
}

/* =====================================================
   Keyframe Animations
   ===================================================== */

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

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

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

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

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

@keyframes bounce {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

/* =====================================================
   Responsive Breakpoints
   ===================================================== */

/* Mobile First Approach */
@media (max-width: 640px) {
  :root {
    --sidebar-width: 100%;
    --text-base: 0.875rem;
    --space-4: 0.75rem;
    --space-6: 1rem;
    --space-8: 1.5rem;
  }
}

@media (max-width: 768px) {
  :root {
    --sidebar-width: 100%;
    --topbar-height: 64px;
  }
}

@media (min-width: 1024px) {
  :root {
    --sidebar-width: 280px;
  }
}

@media (min-width: 1280px) {
  :root {
    --sidebar-width: 320px;
  }
}

/* =====================================================
   Focus & Accessibility
   ===================================================== */

/* Focus Styles */
:focus {
  outline: 2px solid var(--accent-blue);
  outline-offset: 2px;
}

:focus:not(:focus-visible) {
  outline: none;
}

:focus-visible {
  outline: 2px solid var(--accent-blue);
  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;
  }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
  :root {
    --text-primary: #ffffff;
    --text-secondary: #ffffff;
    --border-primary: rgba(255, 255, 255, 0.3);
    --glass-border: rgba(255, 255, 255, 0.3);
  }
}

/* =====================================================
   Print Styles
   ===================================================== */

@media print {
  body {
    background: white;
    color: black;
  }
  
  .sidebar,
  .topbar,
  .modal,
  .toast {
    display: none !important;
  }
  
  .main-content {
    margin-left: 0 !important;
    padding: 0 !important;
  }
}
