/**
 * LUMAVINE.AI - CORE DESIGN SYSTEM
 * Version: 1.0.0
 *
 * This is the master CSS file that defines the complete Lumavine design system.
 * All pages across the website should import this file for consistent styling.
 *
 * Philosophy: Turn Pain Into Gain
 * Design Goals: Professional, Healing, Futuristic, Accessible
 *
 * NOTE: Design tokens (CSS custom properties) are defined in design-tokens.css
 * Import that file before this one for complete functionality.
 */

/* Import design tokens - single source of truth for all CSS variables */
@import url('./design-tokens.css');

/* ============================================
   RESET & BASE STYLES
   ============================================ */

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

/* ============================================
   HTML & BODY BASE
   ============================================ */

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

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--void);
  overflow-x: hidden;
  min-height: 100vh;
}

/* ============================================
   TYPOGRAPHY SYSTEM
   ============================================ */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.2;
  margin-bottom: 0.5em;
  color: var(--text-primary);
}

h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  letter-spacing: -0.02em;
}

h2 {
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  letter-spacing: -0.01em;
}

h3 {
  font-size: clamp(1.25rem, 3vw, 2rem);
}

h4 {
  font-size: clamp(1.125rem, 2.5vw, 1.5rem);
}

h5 {
  font-size: 1.125rem;
}

h6 {
  font-size: 1rem;
}

p {
  margin-bottom: 1em;
  color: var(--text-secondary);
}

a {
  color: var(--neon-blue);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--cyan);
  text-decoration: underline;
}

strong, b {
  font-weight: 600;
  color: var(--text-primary);
}

em, i {
  font-style: italic;
}

code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  padding: 0.125em 0.375em;
  background: var(--surface-light);
  border-radius: var(--radius-xs);
  color: var(--cyan);
}

pre {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  padding: var(--space-md);
  background: var(--surface-dark);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow-x: auto;
  margin-bottom: 1em;
}

blockquote {
  padding: var(--space-md) var(--space-lg);
  margin: var(--space-lg) 0;
  border-left: 4px solid var(--lumavine-primary);
  background: var(--surface-mid);
  border-radius: var(--radius-md);
  font-style: italic;
  color: var(--text-secondary);
}

::selection {
  background: var(--lumavine-primary);
  color: white;
}

/* ============================================
   LAYOUT UTILITIES
   ============================================ */

.container {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

.container-sm {
  max-width: 800px;
}

.container-lg {
  max-width: 1800px;
}

.section {
  padding: var(--space-3xl) 0;
}

.section-sm {
  padding: var(--space-2xl) 0;
}

.section-lg {
  padding: 5rem 0;
}

/* ============================================
   GLASS MORPHISM COMPONENTS
   ============================================ */

.glass {
  background: var(--glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
}

.glass-card {
  background: var(--glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  transition: all var(--transition-base);
}

.glass-card:hover {
  background: var(--glass-hover);
  border-color: var(--border-active);
  transform: translateY(-2px);
}

/* ============================================
   BUTTON SYSTEM
   ============================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 0.75rem 1.5rem;
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 500;
  line-height: 1;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-base);
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--gradient-btn-primary);
  color: white;
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3);
}

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

.btn-secondary {
  background: var(--surface-mid);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
}

.btn-secondary:hover {
  background: var(--surface-light);
  border-color: var(--border-active);
}

.btn-outline {
  background: transparent;
  color: var(--neon-blue);
  border: 2px solid var(--neon-blue);
}

.btn-outline:hover {
  background: rgba(0, 212, 255, 0.1);
  box-shadow: var(--shadow-glow-cyan);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}

.btn-ghost:hover {
  background: var(--surface-light);
  color: var(--text-primary);
}

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
}

.btn-lg {
  padding: 1rem 2rem;
  font-size: 1.125rem;
}

.btn-icon {
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border-radius: var(--radius-md);
}

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

/* ============================================
   FORM ELEMENTS
   ============================================ */

.input,
.textarea,
.select {
  width: 100%;
  padding: 0.75rem 1rem;
  font-family: var(--font-body);
  font-size: 0.9375rem;
  color: var(--text-primary);
  background: var(--surface-dark);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  outline: none;
}

.input:focus,
.textarea:focus,
.select:focus {
  border-color: var(--border-active);
  box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.1);
}

.input::placeholder,
.textarea::placeholder {
  color: var(--text-muted);
}

.textarea {
  resize: vertical;
  min-height: 120px;
  line-height: 1.6;
}

.label {
  display: block;
  margin-bottom: var(--space-sm);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.form-group {
  margin-bottom: var(--space-lg);
}

.checkbox,
.radio {
  appearance: none;
  width: 20px;
  height: 20px;
  border: 2px solid var(--border-subtle);
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.radio {
  border-radius: var(--radius-full);
}

.checkbox:checked,
.radio:checked {
  background: var(--lumavine-primary);
  border-color: var(--lumavine-primary);
}

/* ============================================
   CARD COMPONENTS
   ============================================ */

.card {
  background: var(--surface-mid);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  transition: all var(--transition-base);
}

.card:hover {
  background: var(--surface-light);
  border-color: var(--border-medium);
  transform: translateY(-4px);
}

.card-header {
  margin-bottom: var(--space-md);
  padding-bottom: var(--space-md);
  border-bottom: 1px solid var(--border-subtle);
}

.card-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
}

.card-body {
  color: var(--text-secondary);
}

.card-footer {
  margin-top: var(--space-md);
  padding-top: var(--space-md);
  border-top: 1px solid var(--border-subtle);
}

/* ============================================
   NAVIGATION COMPONENTS
   ============================================ */

.nav {
  display: flex;
  gap: var(--space-md);
  list-style: none;
}

.nav-link {
  padding: var(--space-sm) var(--space-md);
  color: var(--text-secondary);
  font-size: 0.9375rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.nav-link:hover,
.nav-link.active {
  color: var(--text-primary);
  background: var(--surface-light);
  text-decoration: none;
}

/* ============================================
   BADGE & TAG COMPONENTS
   ============================================ */

.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge-primary {
  background: rgba(124, 58, 237, 0.2);
  color: var(--lumavine-accent);
  border: 1px solid var(--lumavine-primary);
}

.badge-success {
  background: rgba(16, 185, 129, 0.2);
  color: var(--hope-green);
  border: 1px solid var(--hope-green);
}

.badge-warning {
  background: rgba(245, 158, 11, 0.2);
  color: var(--warning-amber);
  border: 1px solid var(--warning-amber);
}

.badge-danger {
  background: rgba(239, 68, 68, 0.2);
  color: var(--alert-red);
  border: 1px solid var(--alert-red);
}

.badge-info {
  background: rgba(0, 212, 255, 0.2);
  color: var(--cyan);
  border: 1px solid var(--cyan);
}

/* ============================================
   ALERT COMPONENTS
   ============================================ */

.alert {
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--radius-md);
  border-left: 4px solid;
  margin-bottom: var(--space-lg);
}

.alert-success {
  background: rgba(16, 185, 129, 0.1);
  border-color: var(--hope-green);
  color: var(--text-primary);
}

.alert-warning {
  background: rgba(245, 158, 11, 0.1);
  border-color: var(--warning-amber);
  color: var(--text-primary);
}

.alert-danger {
  background: rgba(239, 68, 68, 0.1);
  border-color: var(--alert-red);
  color: var(--text-primary);
}

.alert-info {
  background: rgba(0, 212, 255, 0.1);
  border-color: var(--cyan);
  color: var(--text-primary);
}

/* ============================================
   LOADING & PROGRESS
   ============================================ */

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid var(--border-subtle);
  border-top-color: var(--lumavine-primary);
  border-radius: var(--radius-full);
  animation: spin 0.8s linear infinite;
}

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

.progress-bar {
  width: 100%;
  height: 8px;
  background: var(--surface-dark);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--gradient-progress-primary);
  border-radius: var(--radius-full);
  transition: width var(--transition-base);
}

/* ============================================
   ANIMATIONS & EFFECTS
   ============================================ */

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

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

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

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

@keyframes neonPulse {
  0%, 100% {
    box-shadow:
      0 0 20px var(--neon-blue-glow),
      0 0 40px var(--neon-blue-glow);
  }
  50% {
    box-shadow:
      0 0 30px var(--neon-blue-intense),
      0 0 60px var(--neon-blue-glow),
      0 0 80px rgba(0, 212, 255, 0.3);
  }
}

.fade-in {
  animation: fadeIn 0.5s ease-in;
}

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

.slide-down {
  animation: slideDown 0.5s ease-out;
}

.float {
  animation: float 3s ease-in-out infinite;
}

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

/* Display */
.d-none { display: none; }
.d-block { display: block; }
.d-inline { display: inline; }
.d-inline-block { display: inline-block; }
.d-flex { display: flex; }
.d-grid { display: grid; }

/* Flexbox */
.flex-row { flex-direction: row; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.flex-center { justify-content: center; align-items: center; }
.justify-start { justify-content: flex-start; }
.justify-center { justify-content: center; }
.justify-end { justify-content: flex-end; }
.justify-between { justify-content: space-between; }
.align-start { align-items: flex-start; }
.align-center { align-items: center; }
.align-end { align-items: flex-end; }
.gap-xs { gap: var(--space-xs); }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }
.gap-xl { gap: var(--space-xl); }

/* Text Alignment */
.text-left { text-align: left; }
.text-center { text-align: center; }
.text-right { text-align: right; }

/* Text Utilities */
.text-primary { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-muted { color: var(--text-muted); }
.text-cyan { color: var(--cyan); }
.text-purple { color: var(--lumavine-primary); }
.text-green { color: var(--hope-green); }

.font-display { font-family: var(--font-display); }
.font-body { font-family: var(--font-body); }
.font-mono { font-family: var(--font-mono); }

.font-light { font-weight: 300; }
.font-normal { font-weight: 400; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

.text-xs { font-size: 0.75rem; }
.text-sm { font-size: 0.875rem; }
.text-base { font-size: 1rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }
.text-3xl { font-size: 2rem; }

/* Spacing Utilities */
.m-0 { margin: 0; }
.m-auto { margin: auto; }
.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mt-xl { margin-top: var(--space-xl); }
.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.mb-xl { margin-bottom: var(--space-xl); }

.p-0 { padding: 0; }
.p-sm { padding: var(--space-sm); }
.p-md { padding: var(--space-md); }
.p-lg { padding: var(--space-lg); }
.p-xl { padding: var(--space-xl); }

/* Width & Height */
.w-full { width: 100%; }
.h-full { height: 100%; }
.w-screen { width: 100vw; }
.h-screen { height: 100vh; }

/* Positioning */
.relative { position: relative; }
.absolute { position: absolute; }
.fixed { position: fixed; }
.sticky { position: sticky; }

/* Overflow */
.overflow-hidden { overflow: hidden; }
.overflow-auto { overflow: auto; }
.overflow-scroll { overflow: scroll; }

/* Cursor */
.cursor-pointer { cursor: pointer; }
.cursor-not-allowed { cursor: not-allowed; }

/* ============================================
   BACKGROUND EFFECTS
   ============================================ */

.bg-gradient-primary {
  background: var(--gradient-primary);
}

.bg-gradient-cyan {
  background: var(--gradient-btn-cyan);
}

.bg-gradient-green {
  background: var(--gradient-btn-green);
}

/* Lumavine Signature Background */
.lumavine-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background: var(--gradient-bg-void);
}

.gradient-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.3;
  animation: float 20s ease-in-out infinite;
}

.grid-overlay {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(0, 212, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 212, 255, 0.03) 1px, transparent 1px);
  background-size: 50px 50px;
  mask-image: radial-gradient(ellipse at center, black 0%, transparent 70%);
}

/* ============================================
   RESPONSIVE DESIGN
   Note: Spacing variable overrides are in design-tokens.css
   ============================================ */

@media (max-width: 900px) {
  .container {
    padding: 0 var(--space-md);
  }
}

@media (max-width: 600px) {
  h1 { font-size: 2rem; }
  h2 { font-size: 1.5rem; }
  h3 { font-size: 1.25rem; }

  .btn {
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
  }
}

/* ============================================
   ACCESSIBILITY
   ============================================ */

/* Focus Visible */
*:focus-visible {
  outline: 2px solid var(--lumavine-primary);
  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;
  }
}

/* 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;
}

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

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: var(--surface-dark);
}

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

::-webkit-scrollbar-thumb:hover {
  background: var(--border-medium);
}

/* Firefox */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--border-subtle) var(--surface-dark);
}

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

@media print {
  body {
    background: white;
    color: black;
  }

  .no-print {
    display: none !important;
  }
}
