/* Aviation Intelligence Platform - Professional Styling */

/* ========== NEW DESIGN SYSTEM IMPORTS ========== */
@import url('design-tokens.css');
@import url('typography.css');
@import url('components.css');
@import url('utilities.css');

/* ========== LEGACY STYLES (To be gradually migrated) ========== */

/* Modern CSS Reset & Variables */
:root {
  --primary-blue: #1e3c72;
  --secondary-blue: #2a5298;
  --accent-blue: #4a90e2;
  --success-green: #28a745;
  --warning-orange: #fd7e14;
  --danger-red: #dc3545;
  --dark-navy: #0f1419;
  --light-gray: #f8f9fa;
  --border-gray: #e9ecef;
  --text-dark: #2c3e50;
  --text-muted: #6c757d;
  --shadow-light: 0 2px 10px rgba(30, 60, 114, 0.1);
  --shadow-medium: 0 4px 20px rgba(30, 60, 114, 0.15);
  --shadow-heavy: 0 8px 32px rgba(30, 60, 114, 0.2);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* This body styling is overridden by design-tokens.css */
/* Keeping for login page compatibility only */
body.login-page {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.6;
  color: var(--text-dark);
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  overflow-x: hidden;
}

/* Login Page Styles */
.login-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  position: relative;
}

.login-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="20" cy="20" r="2" fill="white" opacity="0.1"><animate attributeName="opacity" values="0.1;0.3;0.1" dur="3s" repeatCount="indefinite"/></circle><circle cx="80" cy="40" r="1.5" fill="white" opacity="0.1"><animate attributeName="opacity" values="0.1;0.25;0.1" dur="4s" repeatCount="indefinite"/></circle><circle cx="40" cy="80" r="2" fill="white" opacity="0.1"><animate attributeName="opacity" values="0.1;0.2;0.1" dur="5s" repeatCount="indefinite"/></circle></svg>') repeat;
  pointer-events: none;
}

.login-card {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  border-radius: var(--radius-lg);
  padding: 48px;
  max-width: 480px;
  width: 100%;
  box-shadow: var(--shadow-heavy);
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.2);
  position: relative;
  z-index: 1;
}

.login-header {
  margin-bottom: 40px;
}

.login-header h1 {
  font-size: 2.5rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--primary-blue) 0%, var(--secondary-blue) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 12px;
  letter-spacing: -0.02em;
}

.login-header .subtitle {
  color: var(--text-muted);
  font-size: 1.1rem;
  font-weight: 500;
}

.form-group {
  margin-bottom: 24px;
  text-align: left;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: var(--text-dark);
  font-size: 0.95rem;
}

.form-control {
  width: 100%;
  padding: 16px 20px;
  border: 2px solid var(--border);  /* Theme-aware border */
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-weight: 500;
  background: var(--bg-subtle);  /* Theme-aware background */
  color: var(--text-primary);  /* Theme-aware text */
  transition: var(--transition-smooth);
  outline: none;
}

.form-control:focus {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px 32px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: var(--transition-smooth);
  outline: none;
  position: relative;
  overflow: hidden;
}

.btn-primary {
  background: linear-gradient(135deg, var(--success-green) 0%, #20c997 100%);
  color: white;
  width: 100%;
  box-shadow: var(--shadow-light);
}

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

.btn-primary:active {
  transform: translateY(0);
}

/* Dashboard Styles */
.dashboard {
  min-height: 100vh;
  background: var(--light-gray);
}

.navbar {
  background: linear-gradient(135deg, var(--primary-blue) 0%, var(--secondary-blue) 100%);
  color: white;
  padding: 20px 0;
  box-shadow: var(--shadow-medium);
  position: sticky;
  top: 0;
  z-index: 100;
}

.navbar-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.navbar-brand h1 {
  font-size: 1.8rem;
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.02em;
}

.navbar-subtitle {
  font-size: 0.95rem;
  opacity: 0.9;
  margin: 0;
}

.navbar-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.btn-outline {
  background: rgba(255, 255, 255, 0.1);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.3);
  padding: 10px 20px;
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: none;
}

/* Main Content */
.main-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 24px;
}

.page-header {
  margin-bottom: 40px;
}

.page-title {
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}

.page-description {
  color: var(--text-muted);
  font-size: 1.1rem;
}

/* Card Components - Legacy styles (migrated to use theme variables) */
.card {
  background: var(--surface);  /* Use theme-aware surface color instead of white */
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-light);
  border: 1px solid var(--border);  /* Use theme-aware border */
  overflow: hidden;
  transition: var(--transition-smooth);
}

.card:hover {
  box-shadow: var(--shadow-medium);
  background: var(--surface-hover);  /* Use theme-aware hover state */
  border-color: var(--border-light);
}

.card-header {
  padding: 24px 28px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-subtle);  /* Use theme-aware subtle background */
}

.card-title {
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--text-primary);  /* Use theme-aware text color */
  margin: 0;
}

.card-body {
  padding: 28px;
}

/* Form Styles */
.form-row {
  display: flex;
  gap: 20px;
  margin-bottom: 24px;
  align-items: end;
}

.form-row .form-group {
  flex: 1;
  margin-bottom: 0;
}

.select-control {
  appearance: none;
  background: var(--bg-subtle) url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="%236c757d" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="6,9 12,15 18,9"></polyline></svg>') no-repeat right 16px center;
  background-size: 16px;
  padding-right: 48px;
}

/* Report Display */
.report-container {
  margin-top: 32px;
}

.report-card {
  background: linear-gradient(135deg, #f8f9fa 0%, white 100%);
  border-left: 4px solid var(--accent-blue);
  transition: var(--transition-smooth);
}

.report-content {
  font-family: 'JetBrains Mono', 'Monaco', 'Consolas', monospace;
  font-size: 0.9rem;
  line-height: 1.8;
  white-space: pre-line;
  background: #f8f9fa;
  padding: 24px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-gray);
  color: var(--text-dark);
}

.report-meta {
  margin-top: 20px;
  padding: 16px;
  background: rgba(74, 144, 226, 0.05);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(74, 144, 226, 0.1);
}

.report-sources {
  font-size: 0.9rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* Loading States */
.loading {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--accent-blue);
  font-weight: 500;
  padding: 20px;
  text-align: center;
  justify-content: center;
}

.loading-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(74, 144, 226, 0.2);
  border-left-color: var(--accent-blue);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

/* Status Indicators */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 100px;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.status-success {
  background: rgba(40, 167, 69, 0.1);
  color: var(--success-green);
}

.status-warning {
  background: rgba(253, 126, 20, 0.1);
  color: var(--warning-orange);
}

/* Responsive Design */
@media (max-width: 768px) {
  .login-card {
    padding: 32px 24px;
    margin: 20px;
  }
  
  .login-header h1 {
    font-size: 2rem;
  }
  
  .navbar-content {
    padding: 0 20px;
    flex-direction: column;
    gap: 16px;
  }
  
  .main-content {
    padding: 24px 20px;
  }
  
  .page-title {
    font-size: 1.8rem;
  }
  
  .form-row {
    flex-direction: column;
    gap: 0;
  }
  
  .form-row .form-group {
    margin-bottom: 20px;
  }
  
  .card-body {
    padding: 20px;
  }
}

@media (max-width: 480px) {
  .login-card {
    padding: 24px 20px;
  }
  
  .btn {
    padding: 14px 24px;
  }
}