/* ============================================================================
   HAUNTING FOG WEB DESIGN SYSTEM
   ============================================================================
   Professional design system aligned with the Flutter mobile app
   Colors, typography, and components match app_colors.dart and app_typography.dart
   ============================================================================ */

/* ============================================================================
   CSS VARIABLES - Color Palette
   ============================================================================ */
:root {
  /* Base Colors - Dark Theme */
  --fog-black: #0A0A0A;
  --fog-dark: #151515;
  --fog-medium: #242424;
  --fog-light: #3A3A3A;
  --fog-white: #F5F5F5;

  /* Accent Colors */
  --fog-accent: #8B7355;
  --fog-accent-hover: #9D8567;
  --fog-purple: #6A4C93;
  --fog-blue: #1E3A5F;

  /* Status Colors */
  --fog-danger: #D32F2F;
  --fog-success: #388E3C;

  /* Mist/Overlay Colors */
  --fog-mist: rgba(255, 255, 255, 0.08);
  --fog-mist-light: rgba(255, 255, 255, 0.1);
  --fog-mist-medium: rgba(255, 255, 255, 0.15);

  /* Transparent Overlays */
  --black-overlay-10: rgba(0, 0, 0, 0.1);
  --black-overlay-30: rgba(0, 0, 0, 0.3);
  --black-overlay-50: rgba(0, 0, 0, 0.5);
  --black-overlay-80: rgba(0, 0, 0, 0.8);
  --black-overlay-95: rgba(0, 0, 0, 0.95);
  --white-overlay-40: rgba(255, 255, 255, 0.4);

  /* Text Colors */
  --text-primary: var(--fog-white);
  --text-secondary: rgba(255, 255, 255, 0.6);
  --text-tertiary: rgba(255, 255, 255, 0.4);
  --text-disabled: rgba(255, 255, 255, 0.26);

  /* Spacing System (8px base unit) */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  --space-3xl: 64px;

  /* Border Radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.25);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
  --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.6);

  /* Transitions */
  --transition-fast: 150ms ease-in-out;
  --transition-base: 250ms ease-in-out;
  --transition-slow: 350ms ease-in-out;

  /* Z-Index Scale */
  --z-base: 1;
  --z-dropdown: 1000;
  --z-sticky: 1100;
  --z-fixed: 1200;
  --z-overlay: 1300;
  --z-modal: 1400;
  --z-tooltip: 1500;
}

/* ============================================================================
   TYPOGRAPHY - Inter & Crimson Text (matching Flutter app)
   ============================================================================ */

/* Font Face Declarations */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Crimson+Text:wght@400;600;700&display=swap');

/* Base Typography Styles */
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Typography Classes - UI Text (Inter) */
.text-display-lg { font-size: 32px; font-weight: 600; line-height: 1.2; }
.text-display-md { font-size: 28px; font-weight: 600; line-height: 1.2; }
.text-display-sm { font-size: 24px; font-weight: 600; line-height: 1.2; }

.text-heading-lg { font-size: 22px; font-weight: 600; line-height: 1.3; }
.text-heading-md { font-size: 20px; font-weight: 600; line-height: 1.3; }
.text-heading-sm { font-size: 18px; font-weight: 600; line-height: 1.3; }

.text-body-lg { font-size: 16px; font-weight: 400; line-height: 1.5; }
.text-body-md { font-size: 14px; font-weight: 400; line-height: 1.5; }
.text-body-sm { font-size: 12px; font-weight: 400; line-height: 1.5; color: var(--text-secondary); }

.text-label-lg { font-size: 14px; font-weight: 500; line-height: 1.2; }
.text-label-md { font-size: 12px; font-weight: 500; line-height: 1.2; color: var(--text-secondary); }
.text-label-sm { font-size: 10px; font-weight: 500; line-height: 1.2; color: var(--text-tertiary); }

/* Typography Classes - Story Text (Crimson Text) */
.text-story-title { font-family: 'Crimson Text', Georgia, serif; font-size: 32px; font-weight: 600; line-height: 1.2; }
.text-story-body { font-family: 'Crimson Text', Georgia, serif; font-size: 18px; font-weight: 400; line-height: 1.6; }

/* Text Color Utilities */
.text-primary { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-tertiary { color: var(--text-tertiary); }
.text-accent { color: var(--fog-accent); }
.text-danger { color: var(--fog-danger); }
.text-success { color: var(--fog-success); }

/* Text Alignment */
.text-left { text-align: left; }
.text-center { text-align: center; }
.text-right { text-align: right; }

/* ============================================================================
   RESET & BASE STYLES
   ============================================================================ */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  background: linear-gradient(135deg, var(--fog-black) 0%, var(--fog-dark) 100%);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ============================================================================
   LAYOUT COMPONENTS
   ============================================================================ */

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

.container-sm {
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

.container-xs {
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

/* Section Spacing */
.section {
  padding: var(--space-3xl) 0;
}

.section-sm {
  padding: var(--space-2xl) 0;
}

/* ============================================================================
   BUTTON COMPONENTS
   ============================================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-lg);
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.2;
  text-decoration: none;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-base);
  min-height: 48px;
  white-space: nowrap;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* Button Variants */
.btn-primary {
  background: var(--fog-accent);
  color: var(--fog-white);
  box-shadow: var(--shadow-md);
}

.btn-primary:hover:not(:disabled) {
  background: var(--fog-accent-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn-secondary {
  background: var(--fog-medium);
  color: var(--text-primary);
  border: 1px solid var(--fog-light);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--fog-light);
  border-color: var(--fog-accent);
}

.btn-outline {
  background: transparent;
  color: var(--fog-accent);
  border: 2px solid var(--fog-accent);
}

.btn-outline:hover:not(:disabled) {
  background: var(--fog-accent);
  color: var(--fog-white);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}

.btn-ghost:hover:not(:disabled) {
  color: var(--fog-accent);
  background: var(--fog-mist);
}

/* Button Sizes */
.btn-sm {
  padding: var(--space-sm) var(--space-md);
  font-size: 12px;
  min-height: 36px;
}

.btn-lg {
  padding: var(--space-lg) var(--space-xl);
  font-size: 16px;
  min-height: 56px;
}

/* Full Width Button */
.btn-block {
  width: 100%;
}

/* ============================================================================
   CARD COMPONENTS
   ============================================================================ */

.card {
  background: var(--fog-medium);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  box-shadow: var(--shadow-md);
  transition: all var(--transition-base);
}

.card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
}

.card-flat {
  box-shadow: none;
}

.card-bordered {
  border: 1px solid var(--fog-light);
}

/* ============================================================================
   FORM COMPONENTS
   ============================================================================ */

.form-group {
  margin-bottom: var(--space-lg);
}

.form-label {
  display: block;
  margin-bottom: var(--space-sm);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
}

.form-input,
.form-textarea,
.form-select {
  width: 100%;
  padding: var(--space-md);
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  color: var(--text-primary);
  background: var(--fog-dark);
  border: 1px solid var(--fog-light);
  border-radius: var(--radius-md);
  transition: all var(--transition-base);
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  outline: none;
  border-color: var(--fog-accent);
  box-shadow: 0 0 0 3px rgba(139, 115, 85, 0.2);
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--text-tertiary);
}

.form-textarea {
  min-height: 120px;
  resize: vertical;
}

.form-helper {
  display: block;
  margin-top: var(--space-xs);
  font-size: 12px;
  color: var(--text-secondary);
}

.form-error {
  display: block;
  margin-top: var(--space-xs);
  font-size: 12px;
  color: var(--fog-danger);
}

/* ============================================================================
   BADGE & TAG COMPONENTS
   ============================================================================ */

.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.2;
  border-radius: var(--radius-sm);
  background: var(--fog-light);
  color: var(--text-primary);
}

.badge-accent {
  background: var(--fog-accent);
  color: var(--fog-white);
}

.badge-success {
  background: var(--fog-success);
  color: var(--fog-white);
}

.badge-danger {
  background: var(--fog-danger);
  color: var(--fog-white);
}

/* ============================================================================
   ALERT COMPONENTS
   ============================================================================ */

.alert {
  padding: var(--space-md);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-lg);
}

.alert-info {
  background: rgba(30, 58, 95, 0.2);
  border-left: 4px solid var(--fog-blue);
  color: var(--text-primary);
}

.alert-success {
  background: rgba(56, 142, 60, 0.2);
  border-left: 4px solid var(--fog-success);
  color: var(--text-primary);
}

.alert-warning {
  background: rgba(139, 115, 85, 0.2);
  border-left: 4px solid var(--fog-accent);
  color: var(--text-primary);
}

.alert-danger {
  background: rgba(211, 47, 47, 0.2);
  border-left: 4px solid var(--fog-danger);
  color: var(--text-primary);
}

/* ============================================================================
   LOADING & SPINNER COMPONENTS
   ============================================================================ */

.spinner {
  display: inline-block;
  width: 40px;
  height: 40px;
  border: 3px solid var(--fog-mist);
  border-top-color: var(--fog-accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.spinner-sm {
  width: 20px;
  height: 20px;
  border-width: 2px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ============================================================================
   UTILITY CLASSES
   ============================================================================ */

/* Display */
.hidden { display: none !important; }
.block { display: block; }
.inline-block { display: inline-block; }
.flex { display: flex; }
.inline-flex { display: inline-flex; }
.grid { display: grid; }

/* Flex Utilities */
.flex-row { flex-direction: row; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-around { justify-content: space-around; }
.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); }

/* Spacing Utilities */
.m-0 { margin: 0; }
.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-sm { padding: var(--space-sm); }
.p-md { padding: var(--space-md); }
.p-lg { padding: var(--space-lg); }
.p-xl { padding: var(--space-xl); }

/* Responsive Utilities */
@media (max-width: 768px) {
  .container,
  .container-sm,
  .container-xs {
    padding: 0 var(--space-md);
  }

  .section {
    padding: var(--space-2xl) 0;
  }

  .text-display-lg { font-size: 28px; }
  .text-display-md { font-size: 24px; }
  .text-heading-lg { font-size: 20px; }
  .text-heading-md { font-size: 18px; }
}
