/* ============================================
   DIGIKODER SPIRIT - THEME STYLES
   This file uses CSS variables defined by ThemeContext
   ============================================ */

/* Reset and Base Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-family, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif);
  color: var(--color-text-primary);
  transition: background 0.5s ease, color 0.3s ease;
  min-height: 100vh;
}

/* Vision Theme Specific - Add glassmorphism to body */
body[data-theme="v2-vision"] {
  background-attachment: fixed;
  background: var(--color-background);
}

/* Main App Container */
#root {
  min-height: 100vh;
}

/* ============================================
   VISION THEME
   
   IMPORTANT:
   - We keep Vision styling in `vision-theme.css` (loaded only when v2 is active)
   - `theme-styles.css` remains a lightweight base + classic theme tweaks.
   ============================================ */

/* ============================================
   CLASSIC THEME ENHANCEMENTS
   ============================================ */

/* Keep dark theme sharp and clean */
body[data-theme="v1-classic"] .content-card {
  transition: all 0.2s ease;
}

body[data-theme="v1-classic"] .content-card:hover {
  background: var(--color-surface-hover);
}

/* Modal backdrop for Classic theme */
body[data-theme="v1-classic"] .modal-backdrop {
  background: rgba(0, 0, 0, 0.7);
}

/* ============================================
   SCROLLBAR STYLING
   ============================================ */

/* Vision theme scrollbar */
body[data-theme="v2-vision"] ::-webkit-scrollbar {
  width: 14px;
  height: 14px;
}

body[data-theme="v2-vision"] ::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.02);
  border-radius: 10px;
}

body[data-theme="v2-vision"] ::-webkit-scrollbar-thumb {
  background: rgba(99, 102, 241, 0.3);
  border-radius: 10px;
  border: 4px solid transparent;
  background-clip: content-box;
}

body[data-theme="v2-vision"] ::-webkit-scrollbar-thumb:hover {
  background-color: rgba(99, 102, 241, 0.6);
}

/* Classic theme scrollbar */
body[data-theme="v1-classic"] ::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

body[data-theme="v1-classic"] ::-webkit-scrollbar-track {
  background: #1a1a1a;
}

body[data-theme="v1-classic"] ::-webkit-scrollbar-thumb {
  background: #3b82f6;
  border-radius: 5px;
}

body[data-theme="v1-classic"] ::-webkit-scrollbar-thumb:hover {
  background: #2563eb;
}

/* ============================================
   ANIMATIONS
   ============================================ */

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

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

/* Apply animations to Vision theme */
body[data-theme="v2-vision"] .content-card {
  animation: fadeIn 0.4s ease-out;
}

body[data-theme="v2-vision"] .modal-content {
  animation: scaleIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

.glassmorphism {
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.5);
}

.card-shadow {
  box-shadow: var(--card-shadow, 0 4px 6px rgba(0, 0, 0, 0.1));
}

.card-shadow-hover:hover {
  box-shadow: var(--card-hover-shadow, 0 8px 16px rgba(0, 0, 0, 0.15));
}

.smooth-transition {
  transition: var(--effect-transition, all 0.3s ease);
}

/* ============================================
   RESPONSIVE ADJUSTMENTS
   ============================================ */

@media (max-width: 768px) {
  body[data-theme="v2-vision"] .content-card:hover {
    transform: none;
  }

  body[data-theme="v2-vision"] button:hover {
    transform: none;
  }
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  body[data-theme="v2-vision"] .content-card:hover,
  body[data-theme="v2-vision"] button:hover {
    transform: none;
  }
}
