/* ==========================================================================
   homepage.css — TNCareerHub Phase 1
   All new styles for the redesigned homepage sections.
   Does NOT override anything in style.min.css.
   ========================================================================== */

/* ── CSS Variables ─────────────────────────────────────────────────────── */
:root {
  --tnch-primary:    #1a56db;
  --tnch-primary-dk: #1342b0;
  --tnch-accent:     #f59e0b;
  --tnch-success:    #10b981;
  --tnch-danger:     #ef4444;
  --tnch-text:       #1f2937;
  --tnch-muted:      #6b7280;
  --tnch-border:     #e5e7eb;
  --tnch-bg-alt:     #f9fafb;
  --tnch-radius:     0.5rem;
  --tnch-radius-lg:  0.75rem;
  --tnch-shadow:     0 1px 3px rgba(0,0,0,.10), 0 1px 2px rgba(0,0,0,.06);
  --tnch-shadow-md:  0 4px 6px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.05);
}

/* ── TNPSC Quick Bar ───────────────────────────────────────────────────── */
.tnpsc-quickbar {
  background: var(--tnch-primary);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.tnpsc-quickbar::-webkit-scrollbar { display: none; }
.quickbar-inner {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 0 1rem;
  white-space: nowrap;
  min-width: max-content;
}
.quickbar-inner a {
  color: rgba(255,255,255,.9);
  text-decoration: none;
  font-size: .78rem;
  font-weight: 500;
  padding: .45rem .75rem;
  border-right: 1px solid rgba(255,255,255,.15);
  transition: background .15s;
}
.quickbar-inner a:first-child { border-left: none; }
.quickbar-inner a:hover { background: rgba(255,255,255,.12); color: #fff; }
.quickbar-divider {
  color: rgba(255,255,255,.4);
  padding: 0 .5rem;
  font-size: .7rem;
}

/* ── Hero Section ──────────────────────────────────────────────────────── */
.hero-section {
  background: linear-gradient(135deg, #0f2a6e 0%, var(--tnch-primary) 60%, #1a73e8 100%);
  color: #fff;
  padding: 3.5rem 0 3rem;
  text-align: center;
}
.hero-title {
  font-size: clamp(1.5rem, 4vw, 2.4rem);
  font-weight: 700;
  margin-bottom: .75rem;
  line-height: 1.2;
}
.hero-subtitle {
  font-size: 1rem;
  color: rgba(255,255,255,.85);
  margin-bottom: 2rem;
}

/* Search box */
.search-box-wrapper { max-width: 640px; margin: 0 auto 1.75rem; }
.search-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  justify-content: center;
  margin-bottom: .6rem;
}
.search-tab {
  background: rgba(255,255,255,.15);
  border: 1px solid rgba(255,255,255,.3);
  color: rgba(255,255,255,.9);
  border-radius: 2rem;
  padding: .25rem .85rem;
  font-size: .78rem;
  cursor: pointer;
  transition: all .15s;
}
.search-tab:hover,
.search-tab.active {
  background: #fff;
  color: var(--tnch-primary);
  border-color: #fff;
  font-weight: 600;
}
.search-input-row {
  display: flex;
  border-radius: var(--tnch-radius);
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0,0,0,.25);
}
.hero-search-input {
  flex: 1;
  border: none;
  padding: .85rem 1.1rem;
  font-size: 1rem;
  outline: none;
  color: var(--tnch-text);
}
.hero-search-btn {
  background: var(--tnch-accent);
  border: none;
  color: #fff;
  padding: 0 1.25rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  transition: background .15s;
}
.hero-search-btn:hover { background: #d97706; }

/* Hero CTAs */
.hero-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
  justify-content: center;
}
.btn-hero-primary {
  background: var(--tnch-accent);
  color: #fff;
  font-weight: 600;
  padding: .6rem 1.4rem;
  border-radius: var(--tnch-radius);
  text-decoration: none;
  font-size: .9rem;
  transition: background .15s, transform .1s;
}
.btn-hero-primary:hover { background: #d97706; color: #fff; transform: translateY(-1px); }
.btn-hero-outline {
  background: rgba(255,255,255,.12);
  color: #fff;
  font-weight: 500;
  padding: .6rem 1.4rem;
  border-radius: var(--tnch-radius);
  text-decoration: none;
  font-size: .9rem;
  border: 1px solid rgba(255,255,255,.4);
  transition: background .15s;
}
.btn-hero-outline:hover { background: rgba(255,255,255,.22); color: #fff; }

/* ── Generic Section Wrappers ──────────────────────────────────────────── */
.section-wrap { padding: 3rem 0; }
.section-alt   { background: var(--tnch-bg-alt); }
.section-heading {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--tnch-text);
  margin-bottom: 1.25rem;
}
.section-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}
.section-header-row .section-heading { margin-bottom: 0; }
.section-view-all {
  font-size: .85rem;
  font-weight: 600;
  color: var(--tnch-primary);
  text-decoration: none;
}
.section-view-all:hover { text-decoration: underline; }

/* ── Section 1: Exam Cards ─────────────────────────────────────────────── */
.exam-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.25rem;
}
.exam-card {
  background: #fff;
  border: 1px solid var(--tnch-border);
  border-radius: var(--tnch-radius-lg);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: .75rem;
  box-shadow: var(--tnch-shadow);
  transition: box-shadow .2s, transform .15s;
}
.exam-card:hover { box-shadow: var(--tnch-shadow-md); transform: translateY(-2px); }
.exam-card-header { display: flex; align-items: flex-start; gap: .6rem; }
.exam-badge {
  background: var(--tnch-primary);
  color: #fff;
  font-size: .7rem;
  font-weight: 700;
  padding: .2rem .6rem;
  border-radius: 2rem;
  white-space: nowrap;
  flex-shrink: 0;
  margin-top: .15rem;
}
.exam-card-title { font-size: .95rem; font-weight: 600; margin: 0; color: var(--tnch-text); }
.exam-card-desc { font-size: .83rem; color: var(--tnch-muted); line-height: 1.5; margin: 0; }
.exam-chip-row { display: flex; flex-wrap: wrap; gap: .35rem; }
.exam-chip {
  background: #eff6ff;
  color: var(--tnch-primary);
  font-size: .72rem;
  font-weight: 600;
  padding: .2rem .55rem;
  border-radius: .3rem;
  text-decoration: none;
  border: 1px solid #bfdbfe;
  transition: background .12s;
}
.exam-chip:hover { background: #dbeafe; color: var(--tnch-primary-dk); }
.exam-status-line {
  font-size: .78rem;
  color: var(--tnch-muted);
  display: flex;
  align-items: center;
  gap: .4rem;
}
.status-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--tnch-success);
  flex-shrink: 0;
}
.exam-card-link {
  font-size: .82rem;
  font-weight: 600;
  color: var(--tnch-primary);
  text-decoration: none;
  margin-top: auto;
}
.exam-card-link:hover { text-decoration: underline; }

/* ── Section 2: Current Affairs ────────────────────────────────────────── */
.ca-featured-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}
@media (max-width: 680px) { .ca-featured-layout { grid-template-columns: 1fr; } }

.ca-card {
  background: #fff;
  border: 1px solid var(--tnch-border);
  border-radius: var(--tnch-radius-lg);
  padding: 1.25rem;
  box-shadow: var(--tnch-shadow);
  display: flex;
  flex-direction: column;
  gap: .5rem;
}
.ca-small-stack { display: flex; flex-direction: column; gap: 1.25rem; }
.ca-small-stack .ca-card { flex: 1; }

.ca-category-tag {
  background: #fef3c7;
  color: #92400e;
  font-size: .68rem;
  font-weight: 700;
  padding: .15rem .5rem;
  border-radius: .25rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  display: inline-block;
}
.ca-date { font-size: .75rem; color: var(--tnch-muted); }
.ca-card-title a,
.ca-card-title-small a {
  color: var(--tnch-text);
  text-decoration: none;
  font-weight: 600;
}
.ca-card-title { font-size: 1rem; margin: 0; }
.ca-card-title-small { font-size: .88rem; margin: 0; }
.ca-card-title a:hover, .ca-card-title-small a:hover { color: var(--tnch-primary); }
.ca-excerpt { font-size: .83rem; color: var(--tnch-muted); line-height: 1.55; margin: 0; }
.ca-exam-tags { display: flex; flex-wrap: wrap; gap: .3rem; }
.ca-exam-tag {
  background: #ede9fe;
  color: #5b21b6;
  font-size: .67rem;
  font-weight: 700;
  padding: .1rem .45rem;
  border-radius: .25rem;
}
.ca-read-more {
  font-size: .82rem;
  font-weight: 600;
  color: var(--tnch-primary);
  text-decoration: none;
  margin-top: auto;
}
.ca-read-more:hover { text-decoration: underline; }

/* ── Section 3: Quiz Banner ─────────────────────────────────────────────── */
.quiz-banner-section {
  background: linear-gradient(135deg, #1e3a8a 0%, var(--tnch-primary) 100%);
  padding: 2.5rem 0;
  color: #fff;
}
.quiz-banner-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}
.quiz-banner-label {
  background: var(--tnch-accent);
  color: #fff;
  font-size: .7rem;
  font-weight: 700;
  padding: .2rem .6rem;
  border-radius: 2rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  display: inline-block;
  margin-bottom: .5rem;
}
.quiz-banner-title { font-size: 1.3rem; font-weight: 700; margin: 0 0 .35rem; }
.quiz-banner-desc  { font-size: .88rem; color: rgba(255,255,255,.8); margin: 0 0 .6rem; }
.quiz-banner-stats { display: flex; gap: 1rem; font-size: .82rem; color: rgba(255,255,255,.75); }
.quiz-banner-actions { display: flex; gap: .75rem; flex-wrap: wrap; flex-shrink: 0; }
.btn-quiz-primary {
  background: var(--tnch-accent);
  color: #fff;
  font-weight: 700;
  padding: .65rem 1.5rem;
  border-radius: var(--tnch-radius);
  text-decoration: none;
  white-space: nowrap;
  transition: background .15s;
}
.btn-quiz-primary:hover { background: #d97706; color: #fff; }
.btn-quiz-outline {
  background: transparent;
  color: #fff;
  font-weight: 600;
  padding: .65rem 1.5rem;
  border-radius: var(--tnch-radius);
  text-decoration: none;
  border: 2px solid rgba(255,255,255,.5);
  white-space: nowrap;
  transition: border-color .15s;
}
.btn-quiz-outline:hover { border-color: #fff; color: #fff; }

/* ── Section 4: Announcements + Countdown ──────────────────────────────── */
.updates-countdown-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}
@media (max-width: 768px) { .updates-countdown-grid { grid-template-columns: 1fr; } }

.announcements-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .75rem; }
.announcement-item { display: flex; align-items: flex-start; gap: .75rem; }
.ann-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: .25rem;
}
.ann-dot-red   { background: var(--tnch-danger); }
.ann-dot-blue  { background: var(--tnch-primary); }
.ann-dot-green { background: var(--tnch-success); }
.ann-dot-gold  { background: var(--tnch-accent); }
.ann-content { display: flex; flex-direction: column; gap: .15rem; }
.ann-title { font-size: .88rem; font-weight: 600; color: var(--tnch-text); text-decoration: none; }
a.ann-title:hover { color: var(--tnch-primary); text-decoration: underline; }
.ann-new-badge {
  display: inline-block;
  background: var(--tnch-danger);
  color: #fff;
  font-size: .6rem;
  font-weight: 700;
  padding: .05rem .35rem;
  border-radius: .2rem;
  margin-left: .35rem;
  vertical-align: middle;
  letter-spacing: .04em;
}
.ann-meta { font-size: .73rem; color: var(--tnch-muted); }

/* Countdown cards */
.countdown-panel { display: flex; flex-direction: column; gap: 1rem; }
.countdown-card {
  background: #fff;
  border: 1px solid var(--tnch-border);
  border-radius: var(--tnch-radius-lg);
  padding: 1rem 1.25rem;
  box-shadow: var(--tnch-shadow);
}
.countdown-exam-name { font-size: .88rem; font-weight: 600; color: var(--tnch-text); margin-bottom: .6rem; }
.countdown-display { display: flex; gap: .75rem; }
.countdown-unit { display: flex; flex-direction: column; align-items: center; min-width: 48px; }
.countdown-value {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--tnch-primary);
  line-height: 1;
}
.countdown-label { font-size: .65rem; color: var(--tnch-muted); text-transform: uppercase; letter-spacing: .06em; margin-top: .2rem; }
.countdown-date-label { font-size: .73rem; color: var(--tnch-muted); margin-top: .5rem; }

/* ── Section 5: Job Cards ───────────────────────────────────────────────── */
.job-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}
.job-card {
  background: #fff;
  border: 1px solid var(--tnch-border);
  border-radius: var(--tnch-radius-lg);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: .75rem;
  box-shadow: var(--tnch-shadow);
  transition: box-shadow .2s, transform .15s;
}
.job-card:hover { box-shadow: var(--tnch-shadow-md); transform: translateY(-2px); }
.job-card-header { display: flex; align-items: flex-start; gap: .75rem; }
.job-org-emoji { font-size: 1.6rem; flex-shrink: 0; }
.job-org-name { font-size: .75rem; color: var(--tnch-muted); font-weight: 500; }
.job-title { font-size: .95rem; font-weight: 700; margin: .1rem 0 0; }
.job-title a { color: var(--tnch-text); text-decoration: none; }
.job-title a:hover { color: var(--tnch-primary); }
.job-tags { display: flex; flex-wrap: wrap; gap: .35rem; }
.job-tag {
  font-size: .72rem;
  font-weight: 600;
  padding: .2rem .55rem;
  border-radius: .3rem;
}
.job-tag-posts   { background: #d1fae5; color: #065f46; }
.job-tag-qual    { background: #e0e7ff; color: #3730a3; }
.job-tag-deadline { background: #fef3c7; color: #92400e; }
.job-tag-urgent   { background: #fee2e2; color: #991b1b; }
.job-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: .5rem;
  border-top: 1px solid var(--tnch-border);
}
.job-posted-date { font-size: .72rem; color: var(--tnch-muted); }
.btn-apply-now {
  background: var(--tnch-primary);
  color: #fff;
  font-size: .78rem;
  font-weight: 700;
  padding: .35rem .85rem;
  border-radius: var(--tnch-radius);
  text-decoration: none;
  transition: background .15s;
}
.btn-apply-now:hover { background: var(--tnch-primary-dk); color: #fff; }

/* ── Section 6: Study Materials ────────────────────────────────────────── */
.materials-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}
@media (max-width: 680px) { .materials-grid { grid-template-columns: 1fr; } }
.materials-panel {
  background: #fff;
  border: 1px solid var(--tnch-border);
  border-radius: var(--tnch-radius-lg);
  padding: 1.25rem;
  box-shadow: var(--tnch-shadow);
}
.materials-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  padding-bottom: .75rem;
  border-bottom: 1px solid var(--tnch-border);
}
.materials-panel-title { font-size: .95rem; font-weight: 700; color: var(--tnch-text); margin: 0; }

/* PYQ list */
.pyq-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .85rem; }
.pyq-item { display: flex; flex-direction: column; gap: .3rem; padding-bottom: .75rem; border-bottom: 1px solid var(--tnch-border); }
.pyq-item:last-child { border-bottom: none; padding-bottom: 0; }
.pyq-meta { display: flex; align-items: center; gap: .4rem; }
.pyq-exam-tag {
  background: var(--tnch-primary);
  color: #fff;
  font-size: .65rem;
  font-weight: 700;
  padding: .1rem .4rem;
  border-radius: .2rem;
}
.pyq-year { font-size: .73rem; color: var(--tnch-muted); }
.pyq-title { font-size: .85rem; font-weight: 600; color: var(--tnch-text); }
.pyq-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.btn-download {
  background: #f3f4f6;
  color: var(--tnch-text);
  font-size: .73rem;
  font-weight: 600;
  padding: .25rem .65rem;
  border-radius: .3rem;
  text-decoration: none;
  border: 1px solid var(--tnch-border);
  transition: background .12s;
}
.btn-download:hover { background: #e5e7eb; }

/* Notes list */
.notes-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .85rem; }
.note-item { display: flex; flex-direction: column; gap: .3rem; padding-bottom: .75rem; border-bottom: 1px solid var(--tnch-border); }
.note-item:last-child { border-bottom: none; padding-bottom: 0; }
.note-meta { display: flex; align-items: center; gap: .4rem; }
.note-subject-tag {
  background: #fce7f3;
  color: #9d174d;
  font-size: .65rem;
  font-weight: 700;
  padding: .1rem .4rem;
  border-radius: .2rem;
}
.note-lang { font-size: .71rem; color: var(--tnch-muted); }
.note-title a { font-size: .85rem; font-weight: 600; color: var(--tnch-text); text-decoration: none; }
.note-title a:hover { color: var(--tnch-primary); }
.note-exam-tags { display: flex; flex-wrap: wrap; gap: .3rem; }
.btn-read-note {
  display: inline-block;
  font-size: .73rem;
  font-weight: 600;
  color: var(--tnch-primary);
  text-decoration: none;
}
.btn-read-note:hover { text-decoration: underline; }

/* ── Section 7: Hall Tickets ────────────────────────────────────────────── */
.hall-ticket-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.25rem;
}
.ht-card {
  background: #fff;
  border: 1px solid var(--tnch-border);
  border-radius: var(--tnch-radius-lg);
  padding: 1.25rem;
  box-shadow: var(--tnch-shadow);
  display: flex;
  flex-direction: column;
  gap: .6rem;
}
.ht-card-header { display: flex; align-items: flex-start; justify-content: space-between; gap: .5rem; }
.ht-exam-name { font-size: .9rem; font-weight: 700; color: var(--tnch-text); }
.ht-status-badge {
  font-size: .67rem;
  font-weight: 700;
  padding: .2rem .5rem;
  border-radius: 2rem;
  text-align: center;
  white-space: nowrap;
  flex-shrink: 0;
}
.ht-status-live            { background: #d1fae5; color: #065f46; }
.ht-status-coming_soon     { background: #e0e7ff; color: #3730a3; }
.ht-status-result_expected { background: #fef3c7; color: #92400e; }
.ht-status-apply_open      { background: #dbeafe; color: #1e40af; }
.ht-exam-date { font-size: .78rem; color: var(--tnch-muted); }
.ht-actions { display: flex; flex-direction: column; gap: .5rem; margin-top: auto; }
.btn-ht-action {
  display: block;
  text-align: center;
  background: var(--tnch-primary);
  color: #fff;
  font-size: .78rem;
  font-weight: 700;
  padding: .4rem .75rem;
  border-radius: var(--tnch-radius);
  text-decoration: none;
  transition: background .15s;
}
.btn-ht-action:hover { background: var(--tnch-primary-dk); color: #fff; }
.btn-ht-result { background: var(--tnch-success); }
.btn-ht-result:hover { background: #059669; }
.ht-not-available { font-size: .75rem; color: var(--tnch-muted); text-align: center; }

/* ── Mobile Bottom Navigation ───────────────────────────────────────────── */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: #fff;
  border-top: 1px solid var(--tnch-border);
  z-index: 1000;
  padding-bottom: env(safe-area-inset-bottom);
  box-shadow: 0 -2px 8px rgba(0,0,0,.08);
}
@media (max-width: 900px) { .mobile-bottom-nav { display: flex; } }
.mobile-bottom-nav a {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .15rem;
  padding: .55rem .25rem;
  color: var(--tnch-muted);
  text-decoration: none;
  font-size: .65rem;
  font-weight: 600;
  transition: color .15s;
}
.mobile-bottom-nav a.active,
.mobile-bottom-nav a:hover { color: var(--tnch-primary); }
.mobile-bottom-nav svg { width: 20px; height: 20px; }

/* ── Spacing utility for mobile nav ─────────────────────────────────────── */
@media (max-width: 900px) {
  body { padding-bottom: 68px; }
}

/* ── Responsive tweaks ───────────────────────────────────────────────────── */
@media (max-width: 576px) {
  .hero-section { padding: 2rem 0 1.75rem; }
  .quiz-banner-inner { flex-direction: column; }
  .quiz-banner-actions { width: 100%; }
  .btn-quiz-primary, .btn-quiz-outline { width: 100%; text-align: center; }
}
