/* ============================================================================
   COLLEGE EXAM PORTAL — STYLESHEET (Tool #15)
   Modern, responsive, touch-ergonomic design for Intermediate, Degree, PG & CETs
   ============================================================================ */

:root {
  --portal-blue: #0284c7;
  --portal-blue-dark: #0369a1;
  --portal-blue-light: #f0f9ff;
  --portal-blue-line: #bae6fd;
  --ink: #0f172a;
  --muted: #475569;
  --subtle: #64748b;
  --line: #e2e8f0;
  --card-bg: #ffffff;
  --bg-page: #f8fafc;
}

body {
  background: var(--bg-page);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  margin: 0;
  padding: 0;
}

main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem 1rem 3rem;
}

/* Breadcrumb Navigation */
.tool-back-nav {
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
}
.back-to-menu-link {
  color: var(--subtle);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.15s;
}
.back-to-menu-link:hover {
  color: var(--portal-blue-dark);
}

/* Hero Section */
.hero {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--line);
}
.hero .eyebrow {
  display: inline-block;
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--portal-blue-dark);
  background: var(--portal-blue-light);
  border: 1px solid var(--portal-blue-line);
  padding: 4px 10px;
  border-radius: 999px;
  margin-bottom: 0.75rem;
}
.hero h1 {
  margin: 0 0 0.75rem;
  font: 700 clamp(1.9rem, 4vw, 2.8rem) / 1.15 Georgia, serif;
  color: var(--ink);
  letter-spacing: -0.02em;
}
.hero h1 em {
  font-style: normal;
  color: var(--portal-blue);
}
.hero p {
  margin: 0;
  font-size: 1.05rem;
  color: var(--muted);
  max-width: 780px;
  line-height: 1.6;
}

/* Category Quick Filter Pills */
.sector-pills {
  display: flex;
  gap: 10px;
  margin-bottom: 1.5rem;
  overflow-x: auto;
  padding: 4px 2px 8px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}
.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 8px 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: white;
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 650;
  cursor: pointer;
  white-space: nowrap;
  touch-action: manipulation;
  transition: all 0.15s ease;
}
.pill:hover {
  border-color: var(--portal-blue);
  background: var(--portal-blue-light);
  color: var(--portal-blue-dark);
}
.pill.active {
  background: var(--portal-blue-dark);
  color: white;
  border-color: var(--portal-blue-dark);
  box-shadow: 0 2px 6px rgba(2, 132, 199, 0.25);
}

/* Multi-Parameter Filters Toolbar */
.filter-card {
  background: white;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1.25rem;
  margin-bottom: 1.75rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}
.filter-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr auto;
  gap: 12px;
  align-items: end;
}
@media (max-width: 900px) {
  .filter-grid {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 600px) {
  .filter-grid {
    grid-template-columns: 1fr;
  }
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.filter-group label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--subtle);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.filter-group input,
.filter-group select {
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--ink);
  font-size: 1rem;
  outline: none;
  touch-action: manipulation;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.filter-group input:focus,
.filter-group select:focus {
  border-color: var(--portal-blue);
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}

.btn-clear-filters {
  min-height: 44px;
  padding: 8px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  touch-action: manipulation;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.btn-clear-filters:hover {
  background: #e2e8f0;
  color: var(--ink);
}

/* Results Header Bar */
.results-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
  gap: 12px;
  flex-wrap: wrap;
}
.result-count-text {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--muted);
  margin: 0;
}
.sort-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  color: var(--muted);
}
.sort-wrap select {
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
  color: var(--ink);
  font-size: 0.85rem;
  font-weight: 600;
}

/* Exam Cards Grid */
.exam-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 20px;
}
@media (max-width: 480px) {
  .exam-grid {
    grid-template-columns: 1fr;
  }
}

.exam-card {
  background: white;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.exam-card:hover {
  border-color: var(--portal-blue-line);
  box-shadow: 0 6px 16px rgba(2, 132, 199, 0.08);
  transform: translateY(-2px);
}

/* Top bar with category & state */
.card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 0.75rem;
}
.badge-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.badge {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.badge-state-ap { background: #dbeafe; color: #1e40af; border: 1px solid #bfdbfe; }
.badge-state-tg { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; }
.badge-state-nat { background: #e0e7ff; color: #3730a3; border: 1px solid #c7d2fe; }

.badge-cat {
  background: #f1f5f9;
  color: #334155;
  border: 1px solid #e2e8f0;
}
.badge-schedule-tentative {
  background: #fffbeb;
  color: #92400e;
  border: 1px solid #fde68a;
  text-transform: none;
}

/* Status Badges */
.status-badge {
  font-size: 0.78rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
}
.status-open { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.status-closing-soon { background: #fff1f2; color: #9f1239; border: 1px solid #fecdd3; animation: pulse 2s infinite; }
.status-hall-ticket { background: #faf5ff; color: #6b21a8; border: 1px solid #e9d5ff; }
.status-exam { background: #f0f9ff; color: #0369a1; border: 1px solid #bae6fd; }
.status-completed { background: #f8fafc; color: #475569; border: 1px solid #e2e8f0; }
.status-answer-key { background: #fefce8; color: #854d0e; border: 1px solid #fef08a; }
.status-results { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; font-weight: 800; }
.status-counselling { background: #ecfdf5; color: #047857; border: 1px solid #6ee7b7; }
.status-upcoming { background: #f8fafc; color: #64748b; border: 1px solid #e2e8f0; }

@keyframes pulse {
  0% { opacity: 1; }
  50% { opacity: 0.8; }
  100% { opacity: 1; }
}

/* Card Header */
.exam-title {
  margin: 0 0 0.35rem;
  font-size: 1.12rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.35;
}
.exam-authority {
  margin: 0 0 0.5rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--portal-blue-dark);
}
.exam-courses {
  margin: 0 0 0.85rem;
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.4;
  background: #f8fafc;
  padding: 6px 10px;
  border-radius: 6px;
  border-left: 3px solid var(--portal-blue);
}

/* Milestones Timeline Grid */
.exam-timeline {
  margin: 0.75rem 0 1rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  background: #fdfdfd;
  border: 1px solid #f1f5f9;
  border-radius: 8px;
  padding: 10px 12px;
}
.timeline-item {
  display: flex;
  flex-direction: column;
}
.timeline-item.full-width {
  grid-column: 1 / -1;
}
.timeline-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--subtle);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.timeline-val {
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--ink);
}
.timeline-val.highlight {
  color: var(--portal-blue-dark);
  font-weight: 700;
}

/* Notes & Instructions */
.exam-notes {
  margin: 0 0 1rem;
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.45;
}

/* Card Actions */
.card-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  padding-top: 0.75rem;
  border-top: 1px solid var(--line);
}
.btn-action-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 8px 14px;
  border-radius: 8px;
  background: var(--portal-blue-dark);
  color: white;
  font-size: 0.84rem;
  font-weight: 650;
  text-decoration: none;
  touch-action: manipulation;
  transition: background 0.15s;
}
.btn-action-primary:hover {
  background: #0284c7;
}

.btn-action-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: white;
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  touch-action: manipulation;
  transition: all 0.15s;
}
.btn-action-secondary:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

.btn-save-exam {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: white;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  touch-action: manipulation;
  transition: all 0.15s;
}
.btn-save-exam:hover {
  border-color: #f59e0b;
  color: #b45309;
}
.btn-save-exam.is-saved {
  background: #fef3c7;
  border-color: #f59e0b;
  color: #b45309;
  font-weight: 700;
}

/* ============================================================================
   Pagination Bar (10-Item Batches)
   ============================================================================ */
.pagination-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 2rem 0 1rem;
  padding: 1.25rem 0.5rem;
  border-top: 1px solid var(--line);
}

.pagination-pages {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.btn-pagination-nav,
.btn-page-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: 0.4rem 0.85rem;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: white;
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  touch-action: manipulation;
  transition: all 0.15s ease;
  user-select: none;
}

.btn-pagination-nav:hover:not(:disabled),
.btn-page-number:hover:not(.active) {
  border-color: var(--portal-blue);
  color: var(--portal-blue-dark);
  background: var(--portal-blue-light);
}

.btn-page-number.active {
  background: var(--portal-blue);
  border-color: var(--portal-blue-dark);
  color: white;
  font-weight: 700;
  cursor: default;
  box-shadow: 0 2px 4px rgba(2, 132, 199, 0.25);
}

.btn-pagination-nav:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  border-color: var(--line);
  background: #f1f5f9;
}

.pagination-ellipsis {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 44px;
  color: var(--muted);
  font-weight: 700;
  user-select: none;
}

@media (max-width: 480px) {
  .pagination-bar {
    gap: 0.25rem;
    padding: 1rem 0.15rem;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .pagination-pages {
    gap: 0.2rem;
    flex-wrap: nowrap;
  }
  .btn-pagination-nav {
    padding: 0.35rem 0.55rem;
    font-size: 0.8rem;
    min-height: 40px;
    white-space: nowrap;
  }
  .btn-page-number {
    min-width: 36px;
    min-height: 40px;
    padding: 0.35rem 0.4rem;
    font-size: 0.82rem;
  }
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
  background: white;
  border: 1px dashed var(--line);
  border-radius: 12px;
  color: var(--muted);
}
.empty-state h3 {
  margin: 0 0 0.5rem;
  color: var(--ink);
  font-size: 1.2rem;
}

/* Educational Practical Guide Section */
.content-section {
  margin-top: 3.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--line);
}
.content-section h2 {
  font: 700 1.6rem Georgia, serif;
  color: var(--ink);
  margin: 0 0 0.75rem;
}
.content-section p {
  color: var(--muted);
  line-height: 1.6;
  margin: 0 0 1.25rem;
}
.guide-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin-top: 1.5rem;
}
.guide-card {
  background: white;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1.25rem;
}
.guide-card h4 {
  margin: 0 0 0.5rem;
  color: var(--portal-blue-dark);
  font-size: 1.05rem;
}
.guide-card p {
  margin: 0;
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.5;
}
