/* ==========================================================================
   BambooStats Platform - Main Stylesheet
   Architecture-first approach with utility classes and components
   ========================================================================== */

/* CSS Reset and Base Styles */
*, *::before, *::after {
  box-sizing: border-box;
}

* {
  margin: 0;
  padding: 0;
}

html {
  font-family: 'Quicksand', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

:root {
  /* Spacing Scale - 4px base unit */
  --space-1: 0.25rem;   /* 4px */
  --space-2: 0.5rem;    /* 8px */
  --space-3: 0.75rem;   /* 12px */
  --space-4: 1rem;      /* 16px */
  --space-5: 1.25rem;   /* 20px */
  --space-6: 1.5rem;    /* 24px */
  --space-8: 2rem;      /* 32px */
  --space-10: 2.5rem;   /* 40px */
  --space-12: 3rem;     /* 48px */
  --space-16: 4rem;     /* 64px */
  --space-20: 5rem;     /* 80px */
  --space-24: 6rem;     /* 96px */

  /* Brand Colors */
  --color-brand-green: #3CA95B;
  --color-white: #ffffff;
  --color-black: #000000;
  
  /* Neutral Colors */
  --color-neutral-50: #f9fafb;
  --color-neutral-100: #f3f4f6;
  --color-neutral-200: #e5e7eb;
  --color-neutral-300: #d1d5db;
  --color-neutral-400: #9ca3af;
  --color-neutral-500: #6b7280;
  --color-neutral-600: #4b5563;
  --color-neutral-700: #374151;
  --color-neutral-800: #1f2937;
  --color-neutral-900: #111827;
  
  /* Primary Blue for CTAs */
  --color-primary-50: #f0f7ff;
  --color-primary-500: #3b82f6;
  --color-primary-600: #2563eb;
  --color-primary-700: #1d4ed8;
  
  /* Semantic Colors */
  --color-success: #10b981;
  --color-warning: #f59e0b;
  --color-error: #ef4444;
  
  /* Typography Scale */
  --text-xs: 0.75rem;    /* 12px */
  --text-sm: 0.875rem;   /* 14px */
  --text-base: 1rem;     /* 16px */
  --text-lg: 1.125rem;   /* 18px */
  --text-xl: 1.25rem;    /* 20px */
  --text-2xl: 1.5rem;    /* 24px */
  --text-3xl: 1.875rem;  /* 30px */
  --text-4xl: 2.25rem;   /* 36px */
  --text-5xl: 3rem;      /* 48px */
  
  /* Font Weights */
  --font-normal: 400;
  --font-medium: 500;
  --font-semibold: 600;
  --font-bold: 700;
  
  /* Border Radius */
  --radius-sm: 0.125rem;
  --radius: 0.25rem;
  --radius-md: 0.375rem;
  --radius-lg: 0.5rem;
  --radius-xl: 0.75rem;
  --radius-2xl: 1rem;
  --radius-full: 9999px;
  
  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1);
  
  /* Z-index Scale */
  --z-dropdown: 1000;
  --z-sticky: 1020;
  --z-modal: 1050;
}

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

body {
  font-family: 'Quicksand', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: var(--text-base);
  font-weight: var(--font-normal);
  line-height: 1.6;
  color: var(--color-neutral-900);
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 50%, #f1f3f4 100%);
  min-height: 100vh;
}

/* ==========================================================================
   Layout Utilities
   ========================================================================== */

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-8);
}

.container-sm { max-width: 640px; }
.container-md { max-width: 768px; }
.container-lg { max-width: 1024px; }

.content-section {
  padding: var(--space-20) 0;
}

.content-section-sm {
  padding: var(--space-12) 0;
}

/* Grid System */
.grid {
  display: grid;
  gap: var(--space-4);
}

.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }

/* Flexbox Utilities */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }

/* Gap Utilities */
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }

/* Spacing Utilities */
.mt-4 { margin-top: var(--space-4); }
.mb-4 { margin-bottom: var(--space-4); }

/* ==========================================================================
   Typography Utilities
   ========================================================================== */

.text-xs { font-size: var(--text-xs); }
.text-sm { font-size: var(--text-sm); }
.text-base { font-size: var(--text-base); }
.text-lg { font-size: var(--text-lg); }
.text-xl { font-size: var(--text-xl); }
.text-2xl { font-size: var(--text-2xl); }
.text-3xl { font-size: var(--text-3xl); }
.text-4xl { font-size: var(--text-4xl); }
.text-5xl { font-size: var(--text-5xl); }

.font-normal { font-weight: var(--font-normal); }
.font-medium { font-weight: var(--font-medium); }
.font-semibold { font-weight: var(--font-semibold); }
.font-bold { font-weight: var(--font-bold); }

.text-center { text-align: center; }
.text-left { text-align: left; }

.text-primary { color: var(--color-primary-600); }
.text-muted { color: var(--color-neutral-600); }

/* ==========================================================================
   Platform Header - Scroll Transition
   ========================================================================== */

.platform-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: var(--z-sticky);
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  transition: all 0.3s ease;
}

.platform-header.scrolled {
  background: var(--color-white);
  backdrop-filter: none;
  border-bottom: 1px solid var(--color-neutral-200);
  box-shadow: var(--shadow-sm);
}

.platform-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) var(--space-8);
  min-height: 80px;
}

.platform-logo {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: var(--text-xl);
  font-weight: var(--font-bold);
  color: var(--color-neutral-900);
  text-decoration: none;
  transition: color 0.15s ease;
}

.platform-logo:hover {
  color: var(--color-brand-green);
}

.platform-logo img {
  width: auto;
  height: 48px;
  max-height: 48px;
}

.platform-nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-6);
}

.platform-nav-link {
  color: var(--color-neutral-600);
  text-decoration: none;
  font-weight: var(--font-medium);
  padding: var(--space-2) var(--space-4);
  border: 1px solid var(--color-neutral-300);
  border-radius: var(--radius);
  transition: all 0.15s ease;
}

.platform-nav-link:hover {
  color: var(--color-brand-green);
  border-color: var(--color-brand-green);
  background: var(--color-neutral-50);
}

/* ==========================================================================
   Status Indicator
   ========================================================================== */

.status-indicator {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  background: var(--color-success);
  color: white;
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: var(--font-medium);
}

.status-indicator::before {
  content: '';
  width: 8px;
  height: 8px;
  background: currentColor;
  border-radius: 50%;
  animation: pulse 2s infinite;
}

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

/* Hide full text on mobile */
@media (max-width: 767px) {
  .status-indicator {
    font-size: var(--text-xs);
    padding: var(--space-1) var(--space-2);
  }
  
  .status-text-full {
    display: none;
  }
  
  .status-text-short {
    display: inline;
  }
}

/* Show full text on desktop */
@media (min-width: 768px) {
  .status-text-full {
    display: inline;
  }
  
  .status-text-short {
    display: none;
  }
}

/* ==========================================================================
   Platform Hero Section
   ========================================================================== */

.platform-hero {
  padding: calc(80px + var(--space-24)) 0 0;
  text-align: center;
}

.platform-hero-content {
  max-width: 1000px;
  margin: 0 auto;
}

.platform-hero-title {
  font-size: var(--text-5xl);
  font-weight: var(--font-bold);
  color: var(--color-neutral-900);
  margin-bottom: var(--space-4);
}

.platform-hero-subtitle {
  font-size: var(--text-xl);
  color: var(--color-neutral-600);
  margin-bottom: var(--space-12);
}

.hero-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-8);
  max-width: 800px;
  margin: 0 auto;
}

/* ==========================================================================
   Card Components
   ========================================================================== */

.card {
  background: var(--color-white);
  border: 1px solid var(--color-neutral-200);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.15s ease;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.card:hover {
  box-shadow: var(--shadow-md);
}

.card-header {
  margin-bottom: var(--space-4);
}

.card-title {
  font-size: var(--text-lg);
  font-weight: var(--font-semibold);
  color: var(--color-neutral-900);
  margin-bottom: var(--space-2);
}

.card-body {
  color: var(--color-neutral-600);
  flex: 1;
  display: flex;
  flex-direction: column;
  font-size: var(--text-base);
}

.card-body .platform-nav-link {
  margin-top: auto;
  align-self: center;
}

/* ==========================================================================
   Authentication Components
   ========================================================================== */

.auth-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.auth-form-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.auth-form-label {
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--color-neutral-700);
}

.auth-form-input {
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-base);
  border: 1px solid var(--color-neutral-300);
  border-radius: var(--radius);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.auth-form-input:focus {
  outline: none;
  border-color: var(--color-primary-500);
  box-shadow: 0 0 0 3px rgb(59 130 246 / 0.1);
}

.auth-links {
  text-align: center;
  margin-top: var(--space-3);
}

/* ==========================================================================
   Button Components
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-3) var(--space-5);
  font-size: var(--text-base);
  font-weight: var(--font-medium);
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
  line-height: 1;
}

.btn-primary {
  background: var(--color-brand-green);
  color: white;
  border-color: var(--color-brand-green);
}

.btn-primary:hover {
  background: #339650;
  border-color: #339650;
}

.btn-secondary {
  background: white;
  color: var(--color-neutral-700);
  border-color: var(--color-neutral-300);
}

.btn-secondary:hover {
  background: var(--color-neutral-50);
}

.btn-block {
  width: 100%;
}

/* ==========================================================================
   Feature List
   ========================================================================== */

.feature-list {
  list-style: none;
  margin: var(--space-4) 0;
}

.feature-list li {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-2);
}

.feature-list li::before {
  content: '✓';
  color: var(--color-brand-green);
  font-weight: var(--font-bold);
}


/* ==========================================================================
   Status Metrics
   ========================================================================== */

.status-metric {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: var(--space-4);
}

.metric-value {
  font-size: var(--text-3xl);
  font-weight: var(--font-bold);
  color: var(--color-brand-green);
}

.metric-label {
  font-size: var(--text-sm);
  color: var(--color-neutral-600);
  margin-top: var(--space-1);
}


/* ==========================================================================
   Footer
   ========================================================================== */

.platform-footer {
  background: var(--color-white);
  border-top: 1px solid var(--color-neutral-200);
  padding: var(--space-8) 0;
  margin-top: var(--space-20);
}

.footer-content {
  text-align: center;
}

.footer-content a {
  color: var(--color-neutral-600);
  text-decoration: none;
  transition: color 0.15s ease;
}

.footer-content a:hover {
  color: var(--color-brand-green);
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

@media (max-width: 767px) {
  .hero-actions {
    grid-template-columns: 1fr;
    gap: var(--space-6);
  }
  
  .grid-cols-md-3 {
    grid-template-columns: 1fr;
  }
  
  .platform-hero-title {
    font-size: var(--text-3xl);
  }
  
  .platform-hero-subtitle {
    font-size: var(--text-lg);
  }
  
  .portal-access-form {
    flex-direction: column;
  }
  
  .subdomain-input-group {
    flex-direction: column;
  }
  
  .subdomain-suffix {
    border-top: 1px solid var(--color-neutral-300);
  }
}

@media (min-width: 768px) {
  .grid-cols-md-3 {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .portal-access-form {
    flex-direction: row;
    align-items: end;
  }
}