/* ========================================
   WINDSTOKE GLOBAL STYLES v2.0
   Based on Forecast Page Design
   Modern Dark Theme with Data Visualization
   ======================================== */

/* Fonts: loaded via <link> tags in HTML for better performance (no render-blocking @import) */

/* ========================================
   CSS VARIABLES - DESIGN SYSTEM V2
   ======================================== */

:root {
  /* Brand Colors - Updated */
  --ws-primary-blue: #0EA5E9;
  --ws-primary-blue-hover: #0284C7;
  --ws-primary-blue-light: #38BDF8;
  --ws-primary-blue-glow: rgba(14, 165, 233, 0.3);
  
  --ws-teal: #14B8A6;
  --ws-teal-light: #2DD4BF;
  --ws-teal-glow: rgba(20, 184, 166, 0.2);
  
  --ws-accent-coral: #F97316;
  --ws-accent-coral-hover: #EA580C;
  
  /* Navy Backgrounds */
  --ws-navy: #0F172A;
  --ws-navy-light: #1E293B;
  --ws-navy-lighter: #334155;
  
  /* Status Colors */
  --ws-success: #10B981;
  --ws-success-bg: rgba(16, 185, 129, 0.1);
  --ws-warning: #FBBF24;
  --ws-warning-bg: rgba(251, 191, 36, 0.1);
  --ws-error: #EF4444;
  --ws-info: #3B82F6;
  
  /* Condition Quality Colors */
  --ws-forecast-good: #10B981;
  --ws-forecast-marginal: #FBBF24;
  --ws-forecast-poor: #64748B;
  
  /* Grays - Slate Scale */
  --ws-gray-50: #F8FAFC;
  --ws-gray-100: #F1F5F9;
  --ws-gray-200: #E2E8F0;
  --ws-gray-300: #CBD5E1;
  --ws-gray-400: #94A3B8;
  --ws-gray-500: #64748B;
  --ws-gray-600: #475569;
  --ws-gray-700: #334155;
  --ws-gray-800: #1E293B;
  --ws-gray-900: #0F172A;
  
  /* Card & Surface Colors */
  --ws-card-bg: rgba(255, 255, 255, 0.95);
  --ws-card-bg-dark: rgba(15, 23, 42, 0.8);
  --ws-glass-bg: rgba(255, 255, 255, 0.05);
  --ws-glass-border: rgba(255, 255, 255, 0.1);
  
  /* Typography */
  --ws-font-family: 'Space Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --ws-font-mono: 'JetBrains Mono', 'Courier New', monospace;
  
  /* Spacing */
  --ws-space-xs: 0.25rem;
  --ws-space-sm: 0.5rem;
  --ws-space-md: 1rem;
  --ws-space-lg: 1.5rem;
  --ws-space-xl: 2rem;
  --ws-space-2xl: 3rem;
  --ws-space-3xl: 4rem;
  
  /* Border Radius */
  --ws-radius-sm: 0.375rem;
  --ws-radius-md: 0.5rem;
  --ws-radius-lg: 0.75rem;
  --ws-radius-xl: 1rem;
  --ws-radius-2xl: 1.25rem;
  --ws-radius-3xl: 1.5rem;
  --ws-radius-full: 9999px;
  
  /* Shadows */
  --ws-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --ws-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --ws-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  --ws-shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
  --ws-shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  --ws-shadow-dark: 0 10px 40px rgba(0, 0, 0, 0.3);
  
  /* Transitions */
  --ws-transition: all 0.3s ease;
  --ws-transition-fast: all 0.15s ease;
}

/* ========================================
   BASE STYLES
   ======================================== */

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

body {
  font-family: var(--ws-font-family);
  background: linear-gradient(135deg, var(--ws-navy) 0%, var(--ws-navy-light) 50%, var(--ws-navy) 100%);
  min-height: 100vh;
  color: var(--ws-gray-200);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  position: relative;
}

/* Animated Background Gradient */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    radial-gradient(ellipse at 20% 20%, rgba(14, 165, 233, 0.15) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 80%, rgba(20, 184, 166, 0.1) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

/* Light theme body (for dashboard, forms, etc.) */
body.light-theme {
  background: var(--ws-gray-50);
  color: var(--ws-gray-900);
}

body.light-theme::before {
  display: none;
}

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

h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: var(--ws-space-md);
  color: var(--ws-gray-200);
}

body.light-theme h1,
body.light-theme h2,
body.light-theme h3,
body.light-theme h4,
body.light-theme h5,
body.light-theme h6 {
  color: var(--ws-navy);
}

h1 { font-size: 2.5rem; font-weight: 700; }
h2 { font-size: 2rem; font-weight: 700; }
h3 { font-size: 1.5rem; font-weight: 600; }
h4 { font-size: 1.25rem; font-weight: 600; }
h5 { font-size: 1.125rem; font-weight: 600; }
h6 { font-size: 1rem; font-weight: 600; }

/* Gradient Text */
.ws-gradient-text {
  background: linear-gradient(135deg, var(--ws-primary-blue), var(--ws-teal));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

p {
  margin-bottom: var(--ws-space-md);
  color: var(--ws-gray-400);
}

body.light-theme p {
  color: var(--ws-gray-600);
}

.ws-text-primary { color: var(--ws-primary-blue); }
.ws-text-teal { color: var(--ws-teal); }
.ws-text-coral { color: var(--ws-accent-coral); }
.ws-text-navy { color: var(--ws-navy); }
.ws-text-gray { color: var(--ws-gray-400); }
.ws-text-white { color: white; }

.ws-text-mono {
  font-family: var(--ws-font-mono);
  letter-spacing: -0.02em;
}

/* ========================================
   BUTTONS
   ======================================== */

.ws-btn {
  display: inline-block;
  padding: 0.875rem 1.75rem;
  border-radius: var(--ws-radius-xl);
  font-weight: 600;
  font-size: 0.9375rem;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: var(--ws-transition);
  text-align: center;
  font-family: var(--ws-font-family);
  position: relative;
  overflow: hidden;
}

.ws-btn-primary {
  background: linear-gradient(135deg, var(--ws-primary-blue), var(--ws-teal));
  color: white;
  box-shadow: 0 4px 12px rgba(14, 165, 233, 0.3);
}

.ws-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(14, 165, 233, 0.4);
}

.ws-btn-secondary {
  background: transparent;
  border: 2px solid var(--ws-primary-blue);
  color: var(--ws-primary-blue);
}

.ws-btn-secondary:hover {
  background: rgba(14, 165, 233, 0.1);
  border-color: var(--ws-teal);
  color: var(--ws-teal);
}

.ws-btn-coral {
  background: var(--ws-accent-coral);
  color: white;
  box-shadow: 0 4px 12px rgba(249, 115, 22, 0.3);
}

.ws-btn-coral:hover {
  background: var(--ws-accent-coral-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(249, 115, 22, 0.4);
}

.ws-btn-glass {
  background: var(--ws-glass-bg);
  border: 2px solid var(--ws-glass-border);
  color: var(--ws-gray-200);
  backdrop-filter: blur(10px);
}

.ws-btn-glass:hover {
  background: rgba(14, 165, 233, 0.1);
  border-color: rgba(14, 165, 233, 0.5);
  color: white;
}

.ws-btn-lg {
  padding: 1.125rem 2.25rem;
  font-size: 1.0625rem;
}

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

/* ========================================
   CARDS - GLASS MORPHISM STYLE
   ======================================== */

.ws-card {
  background: var(--ws-card-bg);
  border-radius: var(--ws-radius-3xl);
  padding: var(--ws-space-2xl);
  box-shadow: var(--ws-shadow-dark);
  border: 1px solid var(--ws-gray-200);
  transition: var(--ws-transition);
  position: relative;
  overflow: hidden;
}

body.light-theme .ws-card {
  background: white;
  border-color: var(--ws-gray-200);
}

.ws-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 15px 50px rgba(0, 0, 0, 0.35);
}

.ws-card-glass {
  background: var(--ws-glass-bg);
  backdrop-filter: blur(10px);
  border: 1px solid var(--ws-glass-border);
}

.ws-card-dark {
  background: linear-gradient(135deg, var(--ws-navy), var(--ws-navy-light));
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.ws-card-header {
  margin-bottom: var(--ws-space-lg);
  padding-bottom: var(--ws-space-lg);
  border-bottom: 2px solid var(--ws-gray-100);
}

body.light-theme .ws-card-header {
  border-bottom-color: var(--ws-gray-200);
}

.ws-card-dark .ws-card-header {
  border-bottom-color: rgba(255, 255, 255, 0.1);
}

.ws-card-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--ws-navy);
  margin-bottom: var(--ws-space-sm);
}

body.light-theme .ws-card-title {
  color: var(--ws-navy);
}

.ws-card-dark .ws-card-title {
  color: white;
}

/* ========================================
   BADGES & STATUS
   ======================================== */

.ws-badge {
  display: inline-block;
  padding: 0.375rem 0.875rem;
  border-radius: var(--ws-radius-full);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.025em;
}

.ws-badge-success {
  background: var(--ws-success-bg);
  color: var(--ws-success);
}

.ws-badge-warning {
  background: var(--ws-warning-bg);
  color: var(--ws-warning);
}

.ws-badge-info {
  background: rgba(14, 165, 233, 0.1);
  color: var(--ws-primary-blue);
}

.ws-badge-coral {
  background: rgba(249, 115, 22, 0.1);
  color: var(--ws-accent-coral);
}

.ws-badge-glass {
  background: var(--ws-glass-bg);
  border: 1px solid var(--ws-glass-border);
  color: var(--ws-gray-300);
  backdrop-filter: blur(10px);
}

/* Status Dot Indicator */
.ws-status-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 8px;
}

.ws-status-dot.good {
  background: var(--ws-forecast-good);
  box-shadow: 0 0 10px var(--ws-forecast-good);
}

.ws-status-dot.marginal {
  background: var(--ws-forecast-marginal);
  box-shadow: 0 0 10px var(--ws-forecast-marginal);
}

.ws-status-dot.poor {
  background: var(--ws-forecast-poor);
}

/* ========================================
   INPUTS & FORMS
   ======================================== */

.ws-input {
  width: 100%;
  padding: 0.875rem 1rem;
  border: 2px solid var(--ws-gray-200);
  border-radius: var(--ws-radius-lg);
  font-family: var(--ws-font-family);
  font-size: 0.9375rem;
  transition: var(--ws-transition);
  background: white;
  color: var(--ws-navy);
}

.ws-input:focus {
  outline: none;
  border-color: var(--ws-primary-blue);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
}

.ws-input-dark {
  background: var(--ws-glass-bg);
  border-color: var(--ws-glass-border);
  color: white;
}

.ws-input-dark:focus {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--ws-primary-blue);
}

.ws-label {
  display: block;
  margin-bottom: var(--ws-space-sm);
  font-weight: 600;
  color: var(--ws-navy);
  font-size: 0.875rem;
  letter-spacing: 0.025em;
}

body:not(.light-theme) .ws-label {
  color: var(--ws-gray-300);
}

.ws-select {
  width: 100%;
  padding: 0.875rem 1rem;
  border: 2px solid var(--ws-gray-200);
  border-radius: var(--ws-radius-lg);
  font-family: var(--ws-font-family);
  font-size: 0.9375rem;
  background: white;
  cursor: pointer;
  transition: var(--ws-transition);
  color: var(--ws-navy);
}

.ws-select:focus {
  outline: none;
  border-color: var(--ws-primary-blue);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
}

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

.ws-nav {
  background: var(--ws-card-bg);
  box-shadow: var(--ws-shadow-md);
  position: sticky;
  top: 0;
  z-index: 1000;
  backdrop-filter: blur(10px);
}

.ws-nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.ws-nav-logo {
  height: 40px;
}

.ws-nav-links {
  display: flex;
  gap: 2rem;
  align-items: center;
}

.ws-nav-link {
  color: var(--ws-gray-400);
  text-decoration: none;
  font-weight: 600;
  transition: var(--ws-transition);
  font-size: 0.9375rem;
}

.ws-nav-link:hover {
  color: var(--ws-primary-blue);
}

.ws-nav-link.active {
  color: var(--ws-primary-blue);
}

/* ========================================
   CONTAINERS & LAYOUT
   ======================================== */

.ws-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  position: relative;
  z-index: 1;
}

.ws-container-narrow {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 2rem;
}

.ws-section {
  padding: 4rem 0;
}

/* ========================================
   TIMELINE / CHART COMPONENTS
   ======================================== */

.ws-timeline {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  padding: 1rem 0;
  scrollbar-width: thin;
  scrollbar-color: var(--ws-primary-blue) transparent;
}

.ws-timeline::-webkit-scrollbar {
  height: 6px;
}

.ws-timeline::-webkit-scrollbar-track {
  background: transparent;
}

.ws-timeline::-webkit-scrollbar-thumb {
  background: var(--ws-primary-blue);
  border-radius: 3px;
}

.ws-hour-block {
  flex: 0 0 50px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.ws-hour-time {
  font-size: 0.6875rem;
  color: var(--ws-gray-500);
  font-family: var(--ws-font-mono);
  letter-spacing: -0.02em;
}

.ws-hour-bar {
  width: 100%;
  height: 120px;
  background: rgba(100, 116, 139, 0.1);
  border-radius: 4px;
  position: relative;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}

.ws-hour-fill {
  width: 100%;
  border-radius: 4px 4px 0 0;
  transition: var(--ws-transition);
  position: relative;
}

.ws-hour-fill.good {
  background: linear-gradient(180deg, var(--ws-forecast-good) 0%, rgba(16, 185, 129, 0.7) 100%);
  box-shadow: 0 -2px 8px rgba(16, 185, 129, 0.3);
}

.ws-hour-fill.marginal {
  background: linear-gradient(180deg, var(--ws-forecast-marginal) 0%, rgba(251, 191, 36, 0.7) 100%);
  box-shadow: 0 -2px 8px rgba(251, 191, 36, 0.3);
}

.ws-hour-fill.poor {
  background: linear-gradient(180deg, var(--ws-forecast-poor) 0%, rgba(100, 116, 139, 0.7) 100%);
}

.ws-hour-wind,
.ws-hour-wave {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--ws-gray-300);
  font-family: var(--ws-font-mono);
}

.ws-hour-dir {
  font-size: 0.6875rem;
  color: var(--ws-gray-500);
  font-family: var(--ws-font-mono);
}

/* ========================================
   PEAK SUMMARY COMPONENT
   ======================================== */

.ws-peak-summary {
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
}

.ws-peak-item {
  text-align: center;
}

.ws-peak-label {
  font-size: 0.75rem;
  color: var(--ws-gray-500);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.25rem;
}

.ws-peak-value {
  font-size: 1.5rem;
  font-weight: 700;
  font-family: var(--ws-font-mono);
  color: var(--ws-gray-400);
}

.ws-peak-value.good {
  color: var(--ws-forecast-good);
}

/* ========================================
   DAY SELECTOR COMPONENT
   ======================================== */

.ws-day-selector {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.ws-day-btn {
  padding: 0.75rem 1.25rem;
  background: var(--ws-glass-bg);
  border: 2px solid var(--ws-glass-border);
  border-radius: var(--ws-radius-xl);
  color: var(--ws-gray-400);
  cursor: pointer;
  transition: var(--ws-transition);
  min-width: 100px;
  text-align: center;
  position: relative;
}

.ws-day-btn:hover {
  background: rgba(14, 165, 233, 0.1);
  border-color: rgba(14, 165, 233, 0.5);
  color: white;
}

.ws-day-btn.active {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.2), rgba(20, 184, 166, 0.2));
  border-color: var(--ws-primary-blue);
  color: white;
}

.ws-day-btn.has-conditions::after {
  content: '';
  position: absolute;
  top: 8px;
  right: 8px;
  width: 10px;
  height: 10px;
  background: var(--ws-forecast-good);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--ws-forecast-good);
}

.ws-day-name {
  font-weight: 600;
  font-size: 0.875rem;
  margin-bottom: 0.25rem;
}

.ws-day-date {
  font-size: 0.75rem;
  opacity: 0.7;
}

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

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

.ws-mt-xs { margin-top: var(--ws-space-xs); }
.ws-mt-sm { margin-top: var(--ws-space-sm); }
.ws-mt-md { margin-top: var(--ws-space-md); }
.ws-mt-lg { margin-top: var(--ws-space-lg); }
.ws-mt-xl { margin-top: var(--ws-space-xl); }

.ws-mb-xs { margin-bottom: var(--ws-space-xs); }
.ws-mb-sm { margin-bottom: var(--ws-space-sm); }
.ws-mb-md { margin-bottom: var(--ws-space-md); }
.ws-mb-lg { margin-bottom: var(--ws-space-lg); }
.ws-mb-xl { margin-bottom: var(--ws-space-xl); }

.ws-grid {
  display: grid;
  gap: var(--ws-space-lg);
}

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

.ws-flex {
  display: flex;
  gap: var(--ws-space-md);
}

.ws-flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.ws-flex-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

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

@media (max-width: 768px) {
  h1 { font-size: 2rem; }
  h2 { font-size: 1.75rem; }
  h3 { font-size: 1.5rem; }
  
  .ws-grid-2,
  .ws-grid-3,
  .ws-grid-4 {
    grid-template-columns: 1fr;
  }
  
  .ws-nav-container {
    flex-direction: column;
    gap: 1rem;
  }
  
  .ws-nav-links {
    gap: 1rem;
  }
  
  .ws-btn {
    width: 100%;
  }
  
  .ws-day-selector {
    gap: 0.375rem;
  }
  
  .ws-day-btn {
    min-width: 80px;
    padding: 0.625rem 1rem;
  }
}

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

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

.ws-fade-in {
  animation: ws-fade-in 0.6s ease-out;
}

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

.ws-pulse {
  animation: ws-pulse 2s ease-in-out infinite;
}

@keyframes ws-glow {
  0%, 100% {
    box-shadow: 0 0 10px currentColor;
  }
  50% {
    box-shadow: 0 0 20px currentColor;
  }
}

.ws-glow {
  animation: ws-glow 2s ease-in-out infinite;
}

/* ========================================
   LOADING STATES
   ======================================== */

.ws-loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(14, 165, 233, 0.3);
  border-top-color: var(--ws-primary-blue);
  border-radius: 50%;
  animation: ws-spin 0.8s linear infinite;
}

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

.ws-skeleton {
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.05) 0%,
    rgba(255, 255, 255, 0.1) 50%,
    rgba(255, 255, 255, 0.05) 100%
  );
  background-size: 200% 100%;
  animation: ws-skeleton-loading 1.5s ease-in-out infinite;
  border-radius: var(--ws-radius-md);
}

@keyframes ws-skeleton-loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ==========================================
   LIGHT MODE OVERRIDES
   ========================================== */
[data-theme="light"] .ws-card-dark {
  background: #FFFFFF;
  color: var(--ws-text-primary);
  border-color: #E2E8F0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .ws-card-dark .ws-card-title {
  color: var(--ws-text-heading);
}

[data-theme="light"] .ws-card-dark .ws-card-header {
  border-bottom-color: #E2E8F0;
}

[data-theme="light"] .ws-input-dark {
  background: #F1F5F9;
  border-color: #E2E8F0;
  color: var(--ws-text-primary);
}

[data-theme="light"] .ws-input-dark:focus {
  background: #FFFFFF;
  border-color: rgba(14, 165, 233, 0.4);
}

[data-theme="light"] .ws-day-btn:hover {
  color: var(--ws-text-bright);
}

[data-theme="light"] .ws-day-btn.active {
  color: #FFFFFF;
}

[data-theme="light"] .ws-skeleton {
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.04) 0%, rgba(0, 0, 0, 0.08) 50%, rgba(0, 0, 0, 0.04) 100%);
  background-size: 200% 100%;
}
