/* PCC Yield Optimizer - Main Styles */
/* Design System: Colors, Typography, Spacing, Layout */

/* === CSS Custom Properties === */
:root {
  /* Brand Colors */
  --color-brand-blue: #005DAA;
  --color-brand-red: #ED1C24;
  --color-secondary-navy: #1D3557;
  --color-secondary-gray: #6C757D;

  /* Semantic Colors */
  --color-success: #10B981;
  --color-warning: #F59E0B;
  --color-danger: #EF4444;
  --color-info: #3B82F6;
  --color-neutral: #6B7280;

  /* Background & Neutrals */
  --color-bg-page: #F9FAFB;
  --color-bg-card: #FFFFFF;
  --color-border-default: #E5E7EB;
  --color-border-hover: #D1D5DB;

  /* Text Colors */
  --color-text-primary: #111827;
  --color-text-secondary: #6B7280;
  --color-text-disabled: #9CA3AF;

  /* Gray Scale */
  --color-gray-50: #F9FAFB;
  --color-gray-100: #F3F4F6;
  --color-gray-200: #E5E7EB;
  --color-gray-300: #D1D5DB;
  --color-gray-400: #9CA3AF;
  --color-gray-500: #6B7280;
  --color-gray-600: #4B5563;
  --color-gray-700: #374151;
  --color-gray-800: #1F2937;
  --color-gray-900: #111827;
  --color-white: #FFFFFF;

  /* Blue Scale */
  --color-blue-50: #F0F9FF;
  --color-blue-100: #E0F2FE;
  --color-blue-500: #3B82F6;
  --color-blue-800: #1E40AF;
  --color-blue-900: #1E3A8A;

  /* Green Scale */
  --color-green-50: #ECFDF5;
  --color-green-100: #D1FAE5;
  --color-green-900: #065F46;

  /* Warning Variants */
  --color-warning-light: #FEF3C7;
  --color-warning-lighter: #FDE68A;

  /* Primary Colors (alias for brand blue) */
  --color-primary: var(--color-brand-blue);
  --color-primary-dark: #004488;

  /* Typography Scale */
  --font-size-micro: 11px;
  --font-size-caption: 12px;
  --font-size-body-sm: 13px;
  --font-size-body: 14px;
  --font-size-body-lg: 16px;
  --font-size-h3: 18px;
  --font-size-xl: 20px;
  --font-size-h2: 24px;
  --font-size-2xl: 28px;
  --font-size-h1: 32px;
  --font-size-3xl: 36px;
  --font-size-display: 48px;

  /* Font Weights */
  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;

  /* Border Radius */
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;
  --radius-xl: 12px;
  --radius-full: 50%;

  /* Box Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 1px 3px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 4px 12px rgba(0, 0, 0, 0.15);
  --shadow-xl: 0 10px 25px rgba(0, 0, 0, 0.2);
  --shadow-2xl: 0 20px 50px rgba(0, 0, 0, 0.3);

  /* Spacing (8px base unit) */
  --space-3xs: 2px;
  --space-2xs: 4px;
  --space-xs: 6px;
  --space-sm: 8px;
  --space-md: 12px;
  --space-lg: 16px;
  --space-xl: 20px;
  --space-2xl: 24px;
  --space-3xl: 32px;
  --space-4xl: 40px;
  --space-5xl: 48px;
  --space-6xl: 64px;

  /* Layout */
  --sidebar-width: 280px;
  --content-max-width: 1920px;
}

/* === Reset & Base Styles === */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
  font-size: var(--font-size-body);
  line-height: 1.5;
  color: var(--color-text-primary);
  background: var(--color-bg-page);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* === Typography === */
.text-display {
  font-size: var(--font-size-h1);
  line-height: var(--space-5xl);
  font-weight: var(--font-weight-bold);
  color: var(--color-text-primary);
}

.text-h1 {
  font-size: var(--font-size-h2);
  line-height: 36px;
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-primary);
}

.text-h2 {
  font-size: var(--font-size-h3);
  line-height: 28px;
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-primary);
}

.text-h3 {
  font-size: var(--font-size-body-lg);
  line-height: var(--space-2xl);
  font-weight: var(--font-weight-medium);
  color: var(--color-text-primary);
}

.text-body {
  font-size: var(--font-size-body);
  line-height: var(--space-xl);
  font-weight: var(--font-weight-normal);
  color: var(--color-gray-700);
}

.text-caption {
  font-size: var(--font-size-caption);
  line-height: 18px;
  font-weight: var(--font-weight-normal);
  color: var(--color-text-secondary);
}

.text-data {
  font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Courier New', monospace;
  font-size: var(--font-size-body);
  line-height: var(--space-xl);
  font-weight: var(--font-weight-medium);
}

/* === Layout === */

/* Sprint 10: Sticky Header & Banner Redesign */
.app-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background-color: #FFFFFF;
  border-bottom: 1px solid #E5E7EB;
  padding: 12px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.app-logo {
  height: 48px;
  width: auto;
}

.header-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.header-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-title {
  font-size: 24px;
  font-weight: 600;
  color: #004a87;
}

.header-subtitle {
  font-size: 13px;
  color: #005DAA;
}

.beta-tag {
  font-size: 12px;
  background-color: #DBEAFE;
  color: #1E40AF;
  padding: 4px 8px;
  border-radius: 4px;
  font-weight: 500;
}

.copy-link-btn {
  background-color: #FFFFFF !important;
  color: #005DAA !important;
  border: 1px solid #BFDBFE !important;
  margin-right: 0;
}

.copy-link-btn:hover {
  background-color: #F9FAFB !important;
  border-color: #93C5FD !important;
}

/* Legacy app-title for backwards compatibility */
.app-title {
  font-size: var(--font-size-h2);
  font-weight: var(--font-weight-semibold);
  color: var(--color-brand-blue);
}

.dashboard {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  gap: var(--space-lg);
  max-width: var(--content-max-width);
  margin: 0 auto;
  padding: var(--space-lg);
  padding-top: 90px; /* Sprint 10: Account for sticky header height (~72px) + spacing */
  min-height: calc(100vh - 88px);
}

.sidebar {
  position: sticky;
  top: 90px; /* Sprint 10: Stick below the header */
  height: calc(100vh - 110px); /* Adjust height for header + spacing */
  overflow-y: auto;
}

.main-content {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

/* === Focus States === */
*:focus-visible {
  outline: var(--space-3xs) solid var(--color-brand-blue);
  outline-offset: var(--space-3xs);
}

button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: var(--space-3xs) solid var(--color-brand-blue);
  outline-offset: var(--space-3xs);
  border-radius: var(--radius-sm);
}

/* === Animations === */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

.fade-in {
  animation: fadeIn 300ms ease;
}

.slide-up {
  animation: slideUp 400ms ease;
}

/* === Responsive Design === */
@media (max-width: 1024px) {
  .dashboard {
    grid-template-columns: 240px 1fr;
  }
}

@media (max-width: 767px) {
  .dashboard {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
  }
}

/* === Utility Classes === */
.hidden {
  display: none !important;
}

.visible {
  display: block !important;
}
