/* ===========================
   CSS Variables - Color System
   =========================== */
:root {
  /* Primary Brand Colors */
  --color-primary: #0066CC;
  --color-primary-light: #3385DD;
  --color-primary-dark: #004C99;

  /* Semantic Colors */
  --color-success: #28A745;
  --color-warning: #FFA500;
  --color-danger: #DC3545;
  --color-info: #17A2B8;

  /* Status Colors - WCAG AA Compliant (4.5:1 contrast with white text) */
  --status-new: #495057;          /* Dark gray - not started */
  --status-applied: #0056B3;       /* Darker blue - in progress */
  --status-interviewing: #CC7A00;  /* Darker orange - active */
  --status-offer: #7D3C98;         /* Darker purple - special */
  --status-accepted: #1E7E34;      /* Darker green - success */
  --status-rejected: #C82333;      /* Darker red - rejected */
  --status-declined: #495057;      /* Dark gray - user action */
  --status-withdrawn: #495057;     /* Dark gray - user action */
  --status-no-response: #5A6268;   /* Medium gray - inactive */

  /* Neutral Palette */
  --color-gray-50: #F8F9FA;
  --color-gray-100: #E9ECEF;
  --color-gray-200: #DEE2E6;
  --color-gray-700: #495057;
  --color-gray-900: #212529;

  /* Backgrounds */
  --bg-primary: #FFFFFF;
  --bg-secondary: #F8F9FA;
  --bg-accent: #F0F7FF;
}

/* ===========================
   Typography Scale
   =========================== */
h1, .h1 {
  font-size: 2.5rem;
  font-weight: 700;
  line-height: 1.2;
}

h2, .h2 {
  font-size: 2rem;
  font-weight: 600;
  line-height: 1.3;
}

h3, .h3 {
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.4;
}

h4, .h4 {
  font-size: 1.25rem;
  font-weight: 500;
  line-height: 1.4;
}

body {
  font-size: 1rem;
  line-height: 1.6;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.text-small {
  font-size: 0.875rem;
}

.text-tiny {
  font-size: 0.75rem;
}

.label {
  font-size: 0.875rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ===========================
   Elevation & Shadows
   =========================== */
.elevation-1 {
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.elevation-2 {
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.15);
}

.elevation-3 {
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
}

.elevation-hover {
  transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.elevation-hover:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transform: translateY(-2px);
}

/* ===========================
   Enhanced KPI Cards
   =========================== */
.kpi-card {
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
  cursor: pointer;
}

.kpi-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  opacity: 0.05;
  z-index: 0;
}

.kpi-card.border-primary::before {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-light) 100%);
}

.kpi-card.border-danger::before {
  background: linear-gradient(135deg, var(--color-danger) 0%, #FF6B6B 100%);
}

.kpi-card.border-warning::before {
  background: linear-gradient(135deg, var(--color-warning) 0%, #FFD700 100%);
}

.kpi-card.border-success::before {
  background: linear-gradient(135deg, var(--color-success) 0%, #5CB85C 100%);
}

.kpi-card .card-body {
  position: relative;
  z-index: 1;
}

.kpi-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

/* ===========================
   Status Badges
   =========================== */
.status-badge {
  padding: 0.35rem 0.65rem;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 0.25rem;
}

.status-new {
  background-color: var(--status-new);
  color: white;
}

.status-applied {
  background-color: var(--status-applied);
  color: white;
}

.status-interviewing {
  background-color: var(--status-interviewing);
  color: white;
}

.status-offer-received {
  background-color: var(--status-offer);
  color: white;
}

.status-accepted {
  background-color: var(--status-accepted);
  color: white;
}

.status-rejected {
  background-color: var(--status-rejected);
  color: white;
}

.status-declined {
  background-color: var(--status-declined);
  color: white;
}

.status-withdrawn {
  background-color: var(--status-withdrawn);
  color: white;
}

.status-no-response {
  background-color: var(--status-no-response);
  color: white;
}

/* ===========================
   Focus Indicators (Accessibility)
   =========================== */
*:focus {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.btn:focus,
.form-control:focus,
.form-select:focus {
  box-shadow: 0 0 0 0.25rem rgba(0, 102, 204, 0.25);
  border-color: var(--color-primary);
}

/* Skip to main content link for keyboard navigation */
.skip-to-main {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--color-primary);
  color: white;
  padding: 8px;
  text-decoration: none;
  z-index: 9999;
}

.skip-to-main:focus {
  top: 0;
}

/* ===========================
   Form Enhancements
   =========================== */
.form-label {
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.form-control,
.form-select {
  min-height: 44px;
}

.required-field::after {
  content: ' *';
  color: var(--color-danger);
}

/* Character counter for textareas */
.char-counter {
  font-size: 0.875rem;
  color: var(--color-gray-700);
  text-align: right;
  margin-top: 0.25rem;
}

/* ===========================
   Navigation Enhancements
   =========================== */
.navbar .btn.active {
  background-color: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.3);
}

/* ===========================
   Empty States
   =========================== */
.empty-state {
  padding: 3rem 2rem;
  text-align: center;
  background-color: var(--bg-secondary);
  border-radius: 0.5rem;
  border: 2px dashed var(--color-gray-200);
}

.empty-state-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

.empty-state-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--color-gray-700);
  margin-bottom: 0.5rem;
}

.empty-state-text {
  color: var(--color-gray-700);
  margin-bottom: 1.5rem;
}

/* ===========================
   Touch Targets (Accessibility)
   =========================== */
.btn-sm {
  min-height: 44px;
  padding: 0.5rem 1rem;
}

.list-group-item {
  min-height: 44px;
}

/* ===========================
   Utility Classes
   =========================== */
.card-interactive {
  transition: all 0.2s ease;
  cursor: pointer;
}

.card-interactive:hover {
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

/* ===========================
   Reduced Motion (Accessibility)
   =========================== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
