/* ============================================
   COMPONENTS - Cards, Badges, Accordions, Tabs
   ============================================ */

/* ---- CARDS ---- */
.card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: var(--space-5);
  box-shadow: var(--shadow-card);
  transition: box-shadow var(--transition-base), transform var(--transition-base);
}

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

.card-icon {
  width: 40px;
  height: 40px;
  margin-bottom: var(--space-3);
  color: var(--color-teal);
}

.card-title {
  font-size: var(--text-lg);
  font-weight: var(--weight-semibold);
  margin-bottom: var(--space-2);
  color: var(--text-heading);
}

.card-desc {
  font-size: var(--text-sm);
  color: var(--text-muted);
  line-height: var(--leading-normal);
}

/* Nav card grid (homepage) */
.nav-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-4);
  margin: var(--space-6) 0;
}

.nav-card {
  text-decoration: none;
  color: inherit;
}

.nav-card:hover {
  color: inherit;
}

.nav-card:hover .card-title {
  color: var(--color-teal);
}

@media (max-width: 1024px) {
  .nav-cards {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .nav-cards {
    grid-template-columns: 1fr;
  }
}

/* ---- BADGES ---- */
.badge {
  display: inline-block;
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  line-height: 1;
}

.badge-tier1    { background: #d4edda; color: #155724; }
.badge-tier15   { background: #cce5ff; color: #004085; }
.badge-tier2    { background: #fff3cd; color: #856404; }
.badge-tier25   { background: #e2e3e5; color: #383d41; }
.badge-urgent   { background: var(--color-coral); color: white; }
.badge-upcoming { background: #fff3cd; color: #856404; }
.badge-ongoing  { background: #d4edda; color: #155724; }
.badge-passed   { background: var(--color-light-gray); color: var(--color-mid-gray); }

/* ---- ALERT BANNER ---- */
.alert-banner {
  background: linear-gradient(90deg, #fff3cd 0%, #ffe0b2 100%);
  border-bottom: 2px solid #f0c040;
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: #856404;
  text-align: center;
}

.alert-banner a {
  color: #664d03;
  font-weight: var(--weight-semibold);
  text-decoration: underline;
}

/* ---- HERO SECTION ---- */
.hero {
  background: var(--bg-hero);
  border-radius: var(--radius-lg);
  padding: var(--space-10) var(--space-8);
  margin-bottom: var(--space-6);
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 60'%3E%3Cpath d='M0 30 Q150 0 300 30 T600 30 T900 30 T1200 30 V60 H0Z' fill='rgba(255,255,255,0.05)'/%3E%3C/svg%3E") repeat-x bottom;
}

.hero-title {
  font-size: var(--text-4xl);
  font-weight: var(--weight-bold);
  color: var(--text-on-dark);
  margin-bottom: var(--space-3);
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.hero-subtitle {
  font-size: var(--text-md);
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: var(--space-6);
  max-width: 600px;
  line-height: var(--leading-relaxed);
}

.hero-buttons {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
}

@media (max-width: 768px) {
  .hero {
    padding: var(--space-8) var(--space-5);
  }

  .hero-title {
    font-size: var(--text-3xl);
  }
}

@media (max-width: 480px) {
  .hero {
    padding: var(--space-6) var(--space-4);
  }

  .hero-title {
    font-size: var(--text-2xl);
  }

  .hero-buttons {
    flex-direction: column;
  }
}

/* ---- BUTTONS ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  text-decoration: none;
  transition: all var(--transition-fast);
  cursor: pointer;
  border: 2px solid transparent;
}

.btn-primary {
  background: var(--color-teal);
  color: white;
}

.btn-primary:hover {
  background: #11725f;
  color: white;
}

.btn-secondary {
  background: transparent;
  color: white;
  border-color: rgba(255, 255, 255, 0.4);
}

.btn-secondary:hover {
  border-color: white;
  background: rgba(255, 255, 255, 0.1);
  color: white;
}

.btn-outline {
  background: transparent;
  color: var(--color-teal);
  border-color: var(--color-teal);
}

.btn-outline:hover {
  background: var(--color-teal);
  color: white;
}

.btn-sm {
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-xs);
}

/* ---- CALLOUT BOX ---- */
.callout {
  background: var(--bg-callout);
  border-radius: var(--radius-md);
  padding: var(--space-5);
  margin: var(--space-5) 0;
  border-left: 4px solid #d4a76a;
}

.callout-title {
  font-weight: var(--weight-semibold);
  margin-bottom: var(--space-2);
}

.callout p:last-child {
  margin-bottom: 0;
}

/* ---- ACCORDION ---- */
.accordion {
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-3);
  overflow: hidden;
  background: var(--bg-card);
}

.accordion-header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
  padding: var(--space-4) var(--space-5);
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
  color: var(--text-heading);
  text-align: left;
  transition: background var(--transition-fast);
}

.accordion-header:hover {
  background: var(--color-off-white);
}

.accordion-header .badge {
  flex-shrink: 0;
}

.accordion-chevron {
  width: 16px;
  height: 16px;
  margin-left: auto;
  color: var(--text-muted);
  transition: transform var(--transition-base);
  flex-shrink: 0;
}

.accordion.open .accordion-chevron {
  transform: rotate(180deg);
}

.accordion-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease;
}

.accordion-body-inner {
  padding: 0 var(--space-5) var(--space-5);
}

/* ---- TABS ---- */
.tabs {
  margin: var(--space-5) 0;
}

.tab-list {
  display: flex;
  gap: var(--space-1);
  border-bottom: 2px solid var(--border-default);
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.tab-list::-webkit-scrollbar {
  display: none;
}

.tab-button {
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--text-muted);
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all var(--transition-fast);
}

.tab-button:hover {
  color: var(--text-heading);
}

.tab-button.active {
  color: var(--color-teal);
  border-bottom-color: var(--color-teal);
  font-weight: var(--weight-semibold);
}

.tab-panel {
  display: none;
  padding-top: var(--space-5);
}

.tab-panel.active {
  display: block;
}

@media (max-width: 768px) {
  .tab-list {
    flex-wrap: nowrap;
    padding-bottom: var(--space-2);
  }

  .tab-button {
    font-size: var(--text-xs);
    padding: var(--space-2) var(--space-3);
  }
}

/* ---- SORTABLE TABLES ---- */
.table-sortable th {
  cursor: pointer;
  user-select: none;
  position: relative;
  padding-right: var(--space-6);
}

.table-sortable th::after {
  content: '\2195';
  position: absolute;
  right: var(--space-2);
  opacity: 0.3;
  font-size: var(--text-xs);
}

.table-sortable th.sorted-asc::after  { content: '\2191'; opacity: 1; }
.table-sortable th.sorted-desc::after { content: '\2193'; opacity: 1; }

.table-sortable th:hover {
  background: var(--color-light-gray);
}

/* Star ratings in tables */
.stars {
  color: #f0c040;
  letter-spacing: 1px;
}

/* ---- CHECKLIST ---- */
.checklist-section {
  margin-bottom: var(--space-6);
}

.checklist-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-3);
}

.progress-bar {
  width: 100%;
  height: 6px;
  background: var(--color-light-gray);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: var(--space-4);
}

.progress-fill {
  height: 100%;
  background: var(--color-teal);
  border-radius: var(--radius-full);
  transition: width var(--transition-base);
}

.checklist-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--border-default);
}

.checklist-item:last-child {
  border-bottom: none;
}

.checklist-item input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--color-teal);
  cursor: pointer;
  flex-shrink: 0;
}

.checklist-item.checked label {
  text-decoration: line-through;
  color: var(--text-muted);
}

.checklist-item label {
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
  cursor: pointer;
}

/* ---- DEADLINE CARD ---- */
.deadline-card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  box-shadow: var(--shadow-card);
  margin-bottom: var(--space-3);
  display: flex;
  align-items: flex-start;
  gap: var(--space-4);
}

.deadline-card .badge {
  flex-shrink: 0;
  margin-top: var(--space-1);
}

.deadline-info {
  flex: 1;
}

.deadline-name {
  font-weight: var(--weight-semibold);
  margin-bottom: var(--space-1);
}

.deadline-details {
  font-size: var(--text-sm);
  color: var(--text-muted);
}

.deadline-date {
  font-weight: var(--weight-semibold);
  font-size: var(--text-sm);
  text-align: right;
  white-space: nowrap;
}

.deadline-days {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

/* ---- INFO BOXES ---- */
.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-3);
  margin: var(--space-4) 0;
}

.info-box {
  background: var(--color-off-white);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  border-left: 3px solid var(--color-teal);
}

.info-box-label {
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: var(--space-1);
}

.info-box-value {
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
}

/* ---- TWO COLUMN COMPARISON ---- */
.comparison-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
  margin: var(--space-5) 0;
}

.comparison-col {
  border-radius: var(--radius-md);
  padding: var(--space-5);
}

.comparison-col-for {
  background: rgba(39, 174, 96, 0.08);
  border: 1px solid rgba(39, 174, 96, 0.2);
}

.comparison-col-against {
  background: rgba(231, 76, 60, 0.06);
  border: 1px solid rgba(231, 76, 60, 0.15);
}

@media (max-width: 768px) {
  .comparison-cols {
    grid-template-columns: 1fr;
  }
}

/* ---- TIMELINE ---- */
.timeline {
  position: relative;
  padding-left: var(--space-8);
}

.timeline::before {
  content: '';
  position: absolute;
  left: 12px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--color-light-gray);
}

.timeline-item {
  position: relative;
  margin-bottom: var(--space-6);
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: calc(-1 * var(--space-8) + 8px);
  top: 4px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--color-teal);
  border: 2px solid var(--bg-page);
}

.timeline-title {
  font-weight: var(--weight-semibold);
  margin-bottom: var(--space-2);
}

/* ---- FILTER CHIPS ---- */
.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin: var(--space-4) 0;
}

.filter-chip {
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  color: var(--text-muted);
  transition: all var(--transition-fast);
}

.filter-chip:hover {
  border-color: var(--color-teal);
  color: var(--color-teal);
}

.filter-chip.active {
  background: var(--color-teal);
  border-color: var(--color-teal);
  color: white;
}

/* ---- SECTION EXPAND/COLLAPSE ALL ---- */
.section-controls {
  display: flex;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.section-controls button {
  font-size: var(--text-sm);
  color: var(--color-teal);
  font-weight: var(--weight-medium);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  transition: background var(--transition-fast);
}

.section-controls button:hover {
  background: rgba(20, 143, 119, 0.08);
}

/* ---- SCHOOL PROFILE SUBSECTIONS ---- */
.profile-section {
  margin-bottom: var(--space-5);
}

.profile-section h4 {
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
  color: var(--color-ocean);
  margin-bottom: var(--space-3);
  padding-bottom: var(--space-2);
  border-bottom: 1px solid var(--border-default);
}

.faculty-list {
  list-style: none;
  padding: 0;
}

.faculty-list li {
  padding: var(--space-2) 0;
  border-bottom: 1px solid rgba(0,0,0,0.04);
  font-size: var(--text-sm);
}

.faculty-list li:last-child {
  border-bottom: none;
}

.faculty-name {
  font-weight: var(--weight-semibold);
}
