/**
 * Mortgage Wealth Calculator - CrossCountry Mortgage Style
 * Professional, clean, corporate aesthetic with warm accents
 */

/* ===== COLOR PALETTE (CrossCountry Black & White) ===== */
:root {
  /* Primary Colors - Black and White */
  --ccm-black: #000000;
  --ccm-dark-gray: #1a1a1a;
  --ccm-charcoal: #333333;
  
  /* Neutral Grays */
  --ccm-gray-50: #f9fafb;
  --ccm-gray-100: #f5f5f5;
  --ccm-gray-200: #e5e5e5;
  --ccm-gray-300: #d4d4d4;
  --ccm-gray-400: #a3a3a3;
  --ccm-gray-600: #525252;
  --ccm-gray-700: #404040;
  --ccm-gray-800: #262626;
  
  /* White */
  --ccm-white: #ffffff;
  
  /* Minimal accent for interactive states only */
  --ccm-accent: #0066cc;
}

/* ===== TYPOGRAPHY (Corporate Sans-Serif) ===== */
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
  color: var(--ccm-charcoal);
  line-height: 1.6;
  letter-spacing: -0.01em;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ccm-black);
}

h1 {
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1.2;
}

h2 {
  font-size: 1.875rem;
  font-weight: 700;
  line-height: 1.3;
}

h3 {
  font-size: 1.5rem;
  font-weight: 700;
}

/* Large stats/numbers */
.stat-number {
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--ccm-black);
}

/* ===== HEADER STYLING ===== */
.ccm-header {
  background: var(--ccm-black);
  border-bottom: 1px solid var(--ccm-gray-300);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.ccm-header h1 {
  color: white;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.ccm-header p {
  color: rgba(255, 255, 255, 0.9);
  font-size: 1.125rem;
  font-weight: 400;
}

/* ===== BUTTONS & CTAs ===== */
.btn-primary {
  background: var(--ccm-black);
  color: white;
  font-weight: 600;
  padding: 0.75rem 1.5rem;
  border-radius: 0.375rem;
  border: none;
  transition: all 0.2s ease;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.875rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.btn-primary:hover {
  background: var(--ccm-gray-800);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.btn-secondary {
  background: white;
  color: var(--ccm-black);
  font-weight: 600;
  padding: 0.75rem 1.5rem;
  border-radius: 0.375rem;
  border: 2px solid var(--ccm-black);
  transition: all 0.2s ease;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.875rem;
}

.btn-secondary:hover {
  background: var(--ccm-black);
  color: white;
}

/* ===== CARD STYLING ===== */
.ccm-card {
  background: white;
  border-radius: 0.5rem;
  border: 1px solid var(--ccm-gray-200);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
}

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

.ccm-card-header {
  background: var(--ccm-gray-50);
  border-bottom: 1px solid var(--ccm-gray-200);
  padding: 1.25rem 1.5rem;
  border-radius: 0.5rem 0.5rem 0 0;
}

.ccm-card-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--ccm-black);
  margin: 0;
}

/* ===== INPUT STYLING ===== */
input[type="number"],
input[type="text"],
select {
  border: 2px solid var(--ccm-gray-200);
  border-radius: 0.375rem;
  padding: 0.625rem 1rem;
  font-size: 1rem;
  font-weight: 500;
  color: var(--ccm-navy);
  transition: all 0.2s ease;
  background: white;
}

input[type="number"]:focus,
input[type="text"]:focus,
select:focus {
  outline: none;
  border-color: var(--ccm-black);
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.1);
}

/* Range sliders */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: var(--ccm-gray-200);
  outline: none;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--ccm-black);
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

input[type="range"]::-webkit-slider-thumb:hover {
  background: var(--ccm-gray-700);
  transform: scale(1.1);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.4);
}

input[type="range"]::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--ccm-black);
  cursor: pointer;
  border: none;
  transition: all 0.15s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

input[type="range"]::-moz-range-thumb:hover {
  background: var(--ccm-gray-700);
  transform: scale(1.1);
}

/* ===== SECTION STYLING ===== */
.ccm-section {
  padding: 3rem 0;
  border-bottom: 1px solid var(--ccm-gray-100);
}

.ccm-section-title {
  text-align: center;
  margin-bottom: 2.5rem;
  position: relative;
}

.ccm-section-title::after {
  content: '';
  display: block;
  width: 60px;
  height: 3px;
  background: var(--ccm-black);
  margin: 1rem auto 0;
  border-radius: 2px;
}

/* ===== SCENARIO CARDS ===== */
.scenario-card-accent-1 {
  border-left: 4px solid var(--ccm-black);
}

.scenario-card-accent-2 {
  border-left: 4px solid var(--ccm-gray-600);
}

.scenario-header-1 {
  background: var(--ccm-black);
}

.scenario-header-2 {
  background: var(--ccm-gray-700);
}

/* ===== STATS & NUMBERS ===== */
.stat-card {
  background: white;
  padding: 1.5rem;
  border-radius: 0.5rem;
  border: 1px solid var(--ccm-gray-200);
  text-align: center;
  transition: all 0.3s ease;
}

.stat-card:hover {
  border-color: var(--ccm-black);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.stat-label {
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ccm-gray-600);
  margin-bottom: 0.5rem;
}

.stat-value {
  font-size: 2rem;
  font-weight: 800;
  color: var(--ccm-black);
}

/* ===== ALERTS & CALLOUTS ===== */
.ccm-alert {
  padding: 1rem 1.25rem;
  border-radius: 0.5rem;
  border-left: 4px solid;
  font-size: 0.875rem;
  font-weight: 500;
}

.ccm-alert-warning {
  background: #fef3c7;
  border-color: var(--ccm-warning);
  color: #78350f;
}

.ccm-alert-danger {
  background: #fee2e2;
  border-color: var(--ccm-accent-red);
  color: #7f1d1d;
}

.ccm-alert-success {
  background: #d1fae5;
  border-color: var(--ccm-success);
  color: #064e3b;
}

.ccm-alert-info {
  background: #dbeafe;
  border-color: var(--ccm-info);
  color: #1e3a8a;
}

/* ===== TABLE STYLING ===== */
.ccm-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.875rem;
}

.ccm-table thead {
  background: var(--ccm-black);
  color: white;
  position: sticky;
  top: 0;
  z-index: 10;
}

.ccm-table thead th {
  padding: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.75rem;
  text-align: left;
  border-bottom: 2px solid var(--ccm-black);
}

.ccm-table tbody tr {
  transition: all 0.2s ease;
  border-bottom: 1px solid var(--ccm-gray-200);
}

.ccm-table tbody tr:hover {
  background: var(--ccm-gray-50);
}

.ccm-table tbody td {
  padding: 0.875rem 1rem;
}

/* ===== LOADING OVERLAY ===== */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(26, 35, 50, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.spinner {
  border: 4px solid rgba(255, 255, 255, 0.3);
  border-top: 4px solid var(--ccm-white);
  border-radius: 50%;
  width: 50px;
  height: 50px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* ===== CHART CONTAINER ===== */
.chart-container {
  position: relative;
  height: 400px;
  width: 100%;
  background: white;
  padding: 1.5rem;
  border-radius: 0.5rem;
  border: 1px solid var(--ccm-gray-200);
}

/* ===== BADGE STYLES ===== */
.ccm-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 0.875rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.ccm-badge-success {
  background: #d1fae5;
  color: #065f46;
}

.ccm-badge-warning {
  background: #fef3c7;
  color: #92400e;
}

.ccm-badge-danger {
  background: #fee2e2;
  color: #991b1b;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
  h1 {
    font-size: 2rem;
  }
  
  h2 {
    font-size: 1.5rem;
  }
  
  h3 {
    font-size: 1.25rem;
  }
  
  .stat-value {
    font-size: 1.5rem;
  }
  
  .ccm-section {
    padding: 2rem 0;
  }
}

/* ===== PRINT STYLES ===== */
@media print {
  .no-print {
    display: none !important;
  }
  
  body {
    font-size: 12pt;
    color: black;
  }
  
  .ccm-card {
    border: 1px solid #ccc;
    break-inside: avoid;
  }
  
  .chart-container {
    page-break-inside: avoid;
  }
}

/* ===== UTILITY CLASSES ===== */
.text-black {
  color: var(--ccm-black);
}

.text-gray {
  color: var(--ccm-gray-600);
}

.bg-black {
  background-color: var(--ccm-black);
}

.bg-white {
  background-color: var(--ccm-white);
}

.border-black {
  border-color: var(--ccm-black);
}

/* ===== ANIMATIONS ===== */
.fade-in {
  animation: fadeIn 0.5s ease-in;
}

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

.slide-in-right {
  animation: slideInRight 0.6s ease-out;
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}
