/* ==========================================================================
   GPA CALCULATOR STYLES (VANILLA CSS)
   Mobile-First Responsive Architecture
   ========================================================================== */

/* Hero Header */
.gpa-hero-header {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-default);
  padding: clamp(2rem, 5vw, 3rem) 0 clamp(1.5rem, 4vw, 2rem);
  position: relative;
  overflow: hidden;
  width: 100%;
}

.gpa-hero-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--accent-amber), var(--accent-emerald));
}

.gpa-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.85rem;
  background: var(--bg-surface-subtle);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-full);
  font-size: clamp(0.75rem, 1.8vw, 0.825rem);
  font-weight: 700;
  color: var(--accent-amber);
  margin-bottom: 0.85rem;
}

.gpa-hero-title {
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  font-weight: 900;
  color: var(--text-main);
  margin-bottom: 0.5rem;
  line-height: 1.25;
}

.gpa-hero-desc {
  font-size: clamp(0.9rem, 2vw, 1.05rem);
  color: var(--text-muted);
  max-width: 780px;
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

/* Mode Switcher Tabs */
.gpa-mode-tabs {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  width: 100%;
}

.gpa-tab-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-lg);
  font-size: clamp(0.825rem, 1.8vw, 0.95rem);
  font-weight: 700;
  background: var(--bg-surface-subtle);
  border: 1px solid var(--border-default);
  color: var(--text-muted);
  cursor: pointer;
  min-height: 44px;
  box-sizing: border-box;
  touch-action: manipulation;
  transition: all var(--transition-fast);
}

.gpa-tab-btn:hover {
  background: var(--bg-surface);
  color: var(--text-main);
}

.gpa-tab-btn.active {
  background: var(--primary-slate);
  color: #FFFFFF;
  border-color: var(--accent-amber);
  box-shadow: var(--shadow-sm);
}

.gpa-tab-btn.active i {
  color: var(--accent-amber);
}

/* Main GPA Content */
.gpa-main-content {
  padding-top: clamp(1.5rem, 3vw, 2rem);
  padding-bottom: 4rem;
  flex: 1;
  width: 100%;
}

/* Sticky Cumulative Stats Card */
.gpa-summary-card {
  background: var(--bg-surface);
  border: 1.5px solid var(--border-default);
  border-radius: var(--radius-xl);
  padding: clamp(1.25rem, 3vw, 1.75rem) clamp(1rem, 3vw, 2rem);
  display: grid;
  grid-template-columns: 1.25fr 1.25fr 1fr auto;
  gap: clamp(1rem, 2.5vw, 2rem);
  align-items: center;
  box-shadow: var(--shadow-md);
  margin-bottom: 1.5rem;
  position: sticky;
  top: 72px;
  z-index: 100;
  backdrop-filter: blur(12px);
  width: 100%;
  box-sizing: border-box;
}

.summary-col {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.sum-label {
  font-size: clamp(0.75rem, 1.6vw, 0.8rem);
  font-weight: 700;
  color: var(--text-subtle);
}

.sum-big-number {
  font-family: var(--font-mono);
  font-size: clamp(2rem, 5vw, 2.5rem);
  font-weight: 900;
  color: var(--accent-amber);
  line-height: 1;
}

.eval-badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 800;
  width: fit-content;
}

.hours-val {
  font-size: clamp(1rem, 2.2vw, 1.15rem);
  color: var(--text-main);
}

.hours-val strong {
  color: var(--accent-emerald);
  font-family: var(--font-mono);
  font-size: clamp(1.2rem, 2.5vw, 1.4rem);
}

.hours-progress-track {
  width: 100%;
  height: 8px;
  background: var(--bg-surface-subtle);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin: 0.35rem 0;
}

.hours-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-emerald) 0%, var(--accent-teal) 100%);
  border-radius: var(--radius-full);
  transition: width 0.3s ease;
}

.points-val {
  font-family: var(--font-mono);
  font-size: clamp(1.3rem, 3vw, 1.6rem);
  font-weight: 800;
  color: var(--accent-teal);
}

.gpa-btn-solid {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.1rem;
  border-radius: var(--radius-md);
  background: var(--accent-amber);
  color: #0F172A;
  font-size: 0.85rem;
  font-weight: 800;
  border: none;
  cursor: pointer;
  min-height: 44px;
  box-sizing: border-box;
  touch-action: manipulation;
  transition: all var(--transition-fast);
}

.gpa-btn-solid:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.gpa-btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.6rem 1rem;
  border-radius: var(--radius-md);
  background: var(--bg-surface-subtle);
  border: 1px solid var(--border-default);
  color: var(--text-main);
  font-size: 0.825rem;
  font-weight: 700;
  cursor: pointer;
  min-height: 44px;
  box-sizing: border-box;
  touch-action: manipulation;
}

.gpa-instructions-note {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1.25rem;
  background: rgba(14, 165, 233, 0.1);
  border: 1px solid rgba(14, 165, 233, 0.25);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-size: 0.875rem;
  margin-bottom: 1.5rem;
  width: 100%;
  box-sizing: border-box;
}

/* Semesters Accordion Box */
.plan-semesters-list {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  width: 100%;
}

.sem-calc-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  width: 100%;
  box-sizing: border-box;
}

.sem-calc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem clamp(0.85rem, 2vw, 1.5rem);
  background: var(--bg-surface-subtle);
  cursor: pointer;
  user-select: none;
  min-height: 52px;
  touch-action: manipulation;
}

.sem-num-badge {
  font-size: 0.75rem;
  font-weight: 800;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-sm);
  background: var(--primary-slate);
  color: #FFFFFF;
}

.sem-live-gpa {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.sem-live-gpa strong {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  color: var(--accent-emerald);
}

.sem-fill-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.75rem;
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  min-height: 38px;
  touch-action: manipulation;
}

/* Courses Table Wrapper for Responsive Scrolling */
.sem-calc-body {
  padding: 0.5rem clamp(0.75rem, 2vw, 1.5rem) 1.25rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  width: 100%;
  box-sizing: border-box;
}

.courses-table {
  width: 100%;
  min-width: 520px;
  border-collapse: collapse;
}

.courses-table th {
  padding: 0.75rem 0.5rem;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-subtle);
  border-bottom: 1px solid var(--border-subtle);
  text-align: right;
  white-space: nowrap;
}

.courses-table td {
  padding: 0.75rem 0.5rem;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 0.875rem;
  vertical-align: middle;
}

.grade-input {
  width: 86px;
  padding: 0.5rem 0.65rem;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border-default);
  background: var(--bg-surface);
  color: var(--text-main);
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 800;
  text-align: center;
  outline: none;
  min-height: 40px;
}

.grade-input:focus {
  border-color: var(--accent-amber);
  box-shadow: 0 0 0 3px var(--accent-amber-glow);
}

.weighted-value {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--accent-teal);
}

.quick-btn-group {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
}

.quick-btn-group button {
  padding: 0.35rem 0.5rem;
  border-radius: var(--radius-sm);
  background: var(--bg-surface-subtle);
  border: 1px solid var(--border-default);
  color: var(--text-subtle);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  min-height: 36px;
  touch-action: manipulation;
}

/* Mode B What-If */
.whatif-result-banner {
  background: var(--bg-surface);
  border: 1.5px solid var(--border-default);
  border-radius: var(--radius-xl);
  padding: clamp(1.25rem, 3vw, 1.75rem) clamp(1rem, 3vw, 2rem);
  display: flex;
  align-items: center;
  justify-content: space-around;
  box-shadow: var(--shadow-md);
  margin-bottom: 2rem;
  width: 100%;
  box-sizing: border-box;
}

.whatif-res-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  text-align: center;
}

.w-number {
  font-family: var(--font-mono);
  font-size: clamp(2.2rem, 5vw, 2.8rem);
  font-weight: 900;
  line-height: 1;
}

.text-amber { color: var(--accent-amber); }
.text-emerald { color: var(--accent-emerald); }

.w-diff-badge {
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 800;
}

.w-diff-badge.diff-up {
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-emerald);
}

.w-diff-badge.diff-down {
  background: rgba(239, 68, 68, 0.15);
  color: #EF4444;
}

.whatif-prev-box,
.whatif-courses-box,
.cw-table-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xl);
  padding: clamp(1.25rem, 3vw, 1.5rem) clamp(1rem, 3vw, 1.75rem);
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.5rem;
  width: 100%;
  box-sizing: border-box;
}

.prev-box-header,
.whatif-courses-header,
.cw-table-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-subtle);
  flex-wrap: wrap;
  gap: 1rem;
}

.prev-inputs-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
  width: 100%;
  box-sizing: border-box;
}

.prev-input,
.hypo-name-input {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border-default);
  background: var(--bg-surface-subtle);
  color: var(--text-main);
  font-size: 0.95rem;
  outline: none;
  min-height: 44px;
  box-sizing: border-box;
}

/* Mode C Classwork Converter */
.cw-summary-banner {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xl);
  padding: clamp(1.25rem, 3vw, 1.75rem) clamp(1rem, 3vw, 2rem);
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 1.5rem;
  align-items: center;
  margin-bottom: 1.5rem;
  width: 100%;
  box-sizing: border-box;
}

.cw-big-stat {
  font-family: var(--font-mono);
  font-size: clamp(1.8rem, 4vw, 2.2rem);
  font-weight: 900;
  color: var(--accent-emerald);
}

.equiv-grade-chip {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--accent-amber);
  background: rgba(245, 158, 11, 0.1);
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
}

@media print {
  @page {
    margin: 1cm;
    size: A4 portrait;
  }

  body {
    background: #FFFFFF !important;
    color: #000000 !important;
    font-size: 10pt !important;
  }

  .unified-navbar,
  .desktop-subnav,
  .gpa-hero-header,
  .gpa-mode-tabs,
  .actions-col,
  .sem-fill-btn,
  .quick-btn-group,
  .engineering-footer,
  .sidebar-backdrop,
  .collapsible-sidebar,
  .modal-overlay,
  .theme-toggle-btn,
  .gpa-btn-solid,
  .gpa-btn-outline,
  .gpa-instructions-note,
  button {
    display: none !important;
  }

  .gpa-content-area {
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  .gpa-summary-card {
    position: static !important;
    display: flex !important;
    flex-direction: row !important;
    justify-content: space-around !important;
    border: 2px solid #000000 !important;
    border-radius: 8px !important;
    background: #FFFFFF !important;
    box-shadow: none !important;
    margin-bottom: 20px !important;
    padding: 12px !important;
    page-break-inside: avoid;
  }

  .gpa-summary-card * {
    color: #000000 !important;
  }

  .gpa-table-scroll-wrap {
    overflow: visible !important;
    width: 100% !important;
  }

  .gpa-table {
    width: 100% !important;
    border-collapse: collapse !important;
    page-break-inside: auto;
  }

  .gpa-table th,
  .gpa-table td {
    padding: 4px 6px !important;
    border: 1px solid #94A3B8 !important;
    color: #000000 !important;
    font-size: 9pt !important;
  }

  .gpa-table tr {
    page-break-inside: avoid;
  }

  .grade-input {
    border: none !important;
    background: transparent !important;
    color: #000000 !important;
    font-weight: bold !important;
    font-size: 9.5pt !important;
    width: auto !important;
    text-align: center !important;
  }

  .sem-accordion-body {
    display: block !important;
  }
}

@media (max-width: 960px) {
  .gpa-summary-card {
    grid-template-columns: repeat(2, 1fr);
  }
  .cw-summary-banner {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .gpa-summary-card {
    grid-template-columns: 1fr;
    position: relative;
    top: 0;
  }
  .prev-inputs-grid {
    grid-template-columns: 1fr;
  }
  .whatif-result-banner {
    flex-direction: column;
    gap: 1.25rem;
  }
  .gpa-mode-tabs {
    flex-direction: column;
  }
  .gpa-tab-btn {
    width: 100%;
    justify-content: flex-start;
  }
}
