/* 
 * Kalvi Vazhikaati - Tamil Nadu Higher Education Guide
 * Main Stylesheet - Shared across all pages
 * Design: Premium, accessible, bilingual (EN/TA)
 */

/* ============================================
   DESIGN TOKENS & CSS VARIABLES
   ============================================ */
:root {
  /* Background gradients */
  --bg-1: #eef2ff;
  --bg-2: #e0f2fe;
  
  /* Brand colors */
  --accent: #2563eb;
  --accent-soft: rgba(37, 99, 235, 0.08);
  --accent-strong: #1d4ed8;
  
  /* Surface colors */
  --bg-card: rgba(255, 255, 255, 0.97);
  --border-soft: rgba(148, 163, 184, 0.6);
  
  /* Text colors */
  --text-main: #020617;
  --text-muted: #475569;
  
  /* Border radius */
  --radius-lg: 26px;
  --radius-md: 18px;
  --radius-sm: 12px;
  --radius-pill: 999px;
  
  /* Shadows */
  --shadow-soft: 0 20px 60px rgba(15, 23, 42, 0.22);
  --shadow-small: 0 12px 28px rgba(15, 23, 42, 0.12);
  --shadow-hover: 0 25px 70px rgba(15, 23, 42, 0.28);
  
  /* Transitions */
  --transition-fast: 180ms cubic-bezier(0.16, 1, 0.3, 1);
  --transition-smooth: 320ms cubic-bezier(0.16, 1, 0.3, 1);
}

/* ============================================
   RESET & BASE STYLES
   ============================================ */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Manrope", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text-main);
  min-height: 100vh;
  background:
    radial-gradient(circle at 0% 0%, #e0f2fe 0, transparent 45%),
    radial-gradient(circle at 100% 100%, #ddd6fe 0, transparent 45%),
    linear-gradient(135deg, var(--bg-1), var(--bg-2));
  line-height: 1.6;
}

/* Texture overlay */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image: 
    linear-gradient(135deg, rgba(255, 255, 255, 0.45), transparent 40%, rgba(15, 23, 42, 0.18)),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.32), rgba(255, 255, 255, 0.32) 1px, transparent 1px, transparent 2px);
  mix-blend-mode: soft-light;
  opacity: 0.7;
  pointer-events: none;
}

/* Tamil font class */
.ta-sub {
  font-family: "Noto Sans Tamil", system-ui, sans-serif;
}

/* ============================================
   LAYOUT CONTAINERS
   ============================================ */
.kh-container {
  width: min(1120px, 100% - 40px);
  margin-inline: auto;
}

.kh-main {
  padding-bottom: 60px;
}

.kh-section {
  padding: 60px 0;
}

.kh-section + .kh-section {
  border-top: 1px solid rgba(255, 255, 255, 0.9);
}

/* ============================================
   HEADER & NAVIGATION
   ============================================ */
.kh-header {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0.9));
  border-bottom: 1px solid rgba(255, 255, 255, 0.96);
}

.kh-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-block: 10px;
}

.kh-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
}

.kh-logo-circle {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-pill);
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 0 0, #bfdbfe, #4f46e5);
  color: #eff6ff;
  font-weight: 800;
  font-size: 0.95rem;
  letter-spacing: -0.05em;
}

.kh-brand-name {
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -0.06em;
}

.kh-brand-tagline {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.kh-nav {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 0.9rem;
}

.kh-nav a {
  text-decoration: none;
  color: #0f172a;
  padding: 4px 8px;
  border-radius: 999px;
  transition: background var(--transition-fast), color var(--transition-fast);
}

.kh-nav a:hover {
  background: rgba(148, 163, 184, 0.2);
  color: var(--accent-strong);
}

.kh-nav a.active {
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-weight: 600;
}

/* Language toggle */
.kh-lang-switch {
  display: inline-flex;
  padding: 2px;
  border-radius: var(--radius-pill);
  background: rgba(15, 23, 42, 0.04);
}

.kh-lang-btn {
  border: none;
  background: transparent;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  color: rgba(15, 23, 42, 0.72);
  transition: background var(--transition-fast), color var(--transition-fast),
    box-shadow var(--transition-fast), transform var(--transition-fast);
}

.kh-lang-btn.is-active {
  background: #ffffff;
  color: var(--accent-strong);
  box-shadow: 0 2px 7px rgba(15, 23, 42, 0.2);
  transform: translateY(-1px);
}

/* Mobile menu toggle */
.kh-mobile-menu-btn {
  display: none;
  border: none;
  background: rgba(15, 23, 42, 0.04);
  padding: 8px 12px;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
}

/* ============================================
   HERO SECTION
   ============================================ */
.kh-hero {
  padding: 64px 0 46px;
}

.kh-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(0, 1.1fr);
  gap: 30px;
  align-items: center;
}

.kh-hero-kicker {
  margin: 0 0 10px;
  font-size: 0.86rem;
  text-transform: uppercase;
  letter-spacing: 0.17em;
  color: var(--text-muted);
}

.kh-hero-kicker .ta-sub {
  display: block;
  font-size: 0.86rem;
  text-transform: none;
  letter-spacing: 0;
  margin-top: 4px;
}

.kh-hero-title {
  margin: 0 0 12px;
  font-size: clamp(2.1rem, 3vw, 2.7rem);
  letter-spacing: -0.07em;
}

.kh-hero-title .ta-sub {
  display: block;
  font-size: 1.08rem;
  letter-spacing: 0;
  color: #0f172a;
  margin-top: 4px;
}

.kh-hero-sub {
  margin: 0 0 16px;
  font-size: 1rem;
  color: var(--text-muted);
  max-width: 620px;
}

.kh-hero-sub .ta-sub {
  display: block;
  margin-top: 6px;
  font-size: 0.98rem;
}

.kh-hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

/* ============================================
   SECTION HEADINGS
   ============================================ */
.section-heading {
  margin-bottom: 18px;
}

.section-heading h2 {
  margin: 0 0 6px;
  font-size: 1.8rem;
  letter-spacing: -0.04em;
}

.section-heading .ta-sub {
  display: block;
  font-size: 1.02rem;
  color: var(--text-muted);
}

.section-heading p {
  margin: 4px 0 0;
  font-size: 0.98rem;
  color: var(--text-muted);
  max-width: 720px;
}

/* ============================================
   CARDS & INFO BLOCKS
   ============================================ */
.kh-hero-card,
.info-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  border: 1px solid rgba(255, 255, 255, 0.96);
  padding: 18px 18px 20px;
  transition: transform var(--transition-smooth), box-shadow var(--transition-smooth);
}

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

.kh-hero-card-title,
.info-card h3 {
  margin: 0 0 6px;
  font-size: 1.06rem;
  letter-spacing: -0.03em;
}

.kh-hero-card-title .ta-sub,
.info-card .ta-sub {
  display: block;
  margin-top: 3px;
  font-size: 0.96rem;
  color: var(--text-muted);
}

.info-card p {
  margin: 8px 0 10px;
  font-size: 0.92rem;
  color: var(--text-muted);
}

/* Card grid layouts */
.info-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.1fr);
  gap: 20px;
}

.info-grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.info-grid-4 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

/* ============================================
   KPI CARDS
   ============================================ */
.kh-hero-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.kpi-card {
  border-radius: 16px;
  padding: 10px 12px;
  background: linear-gradient(135deg, rgba(239, 246, 255, 0.98), rgba(219, 234, 254, 0.94));
  border: 1px solid rgba(148, 163, 184, 0.7);
  box-shadow: var(--shadow-small);
  font-size: 0.86rem;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

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

.kpi-label {
  font-weight: 600;
  margin-bottom: 4px;
  display: block;
  font-size: 0.84rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #1e293b;
}

.kpi-main {
  font-size: 1rem;
  font-weight: 700;
}

.kpi-sub {
  margin-top: 2px;
  color: var(--text-muted);
}

/* ============================================
   PILLS, TAGS & BADGES
   ============================================ */
.kh-pill {
  border-radius: var(--radius-pill);
  padding: 4px 11px;
  font-size: 0.8rem;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(148, 163, 184, 0.7);
}

.kh-tag {
  display: inline-flex;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.6);
  font-size: 0.76rem;
  background: rgba(255, 255, 255, 0.95);
  margin: 1px 2px 1px 0;
}

.kh-badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.kh-badge {
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-size: 0.78rem;
  border: 1px dashed rgba(148, 163, 184, 0.9);
  background: rgba(248, 250, 252, 0.96);
}

/* ============================================
   TABLES
   ============================================ */
.table-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 14px 14px 16px;
  border: 1px solid rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow-small);
  overflow-x: auto;
  margin-bottom: 16px;
}

.table-title {
  margin: 0 0 6px;
  font-size: 1rem;
  font-weight: 700;
}

.table-title .ta-sub {
  display: block;
  margin-top: 2px;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.kh-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  min-width: 640px;
}

.kh-table th,
.kh-table td {
  padding: 8px 8px;
  text-align: left;
  border-bottom: 1px solid rgba(226, 232, 240, 0.9);
}

.kh-table thead th {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #64748b;
  background: rgba(248, 250, 252, 0.9);
}

.kh-table tbody tr {
  transition: background var(--transition-fast);
}

.kh-table tbody tr:nth-child(even) {
  background: rgba(248, 250, 252, 0.9);
}

.kh-table tbody tr:hover {
  background: rgba(239, 246, 255, 0.8);
}

/* ============================================
   LISTS
   ============================================ */
.kh-hero-list,
.kh-list {
  margin: 10px 0 0;
  padding-left: 18px;
  font-size: 0.92rem;
  color: var(--text-muted);
  display: grid;
  gap: 4px;
}

.checklist {
  list-style: none;
  padding-left: 0;
  margin: 8px 0 0;
  display: grid;
  gap: 4px;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.checklist li::before {
  content: "☑";
  margin-right: 6px;
  font-size: 0.78rem;
  color: var(--accent-strong);
}

/* ============================================
   CALLOUTS & NOTES
   ============================================ */
.kh-callout {
  margin-top: 10px;
  padding: 8px 10px;
  border-radius: 14px;
  background: var(--accent-soft);
  font-size: 0.82rem;
  color: #1e293b;
  border: 1px solid rgba(129, 140, 248, 0.7);
}

.kh-callout .ta-sub {
  display: block;
  margin-top: 3px;
}

.kh-note {
  margin: 6px 0 0;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ============================================
   BUTTONS & INTERACTIVE ELEMENTS
   ============================================ */
.kh-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  transition: all var(--transition-fast);
  border: none;
  cursor: pointer;
}

.kh-btn-primary {
  background: var(--accent);
  color: white;
  box-shadow: var(--shadow-small);
}

.kh-btn-primary:hover {
  background: var(--accent-strong);
  box-shadow: var(--shadow-soft);
  transform: translateY(-1px);
}

.kh-btn-secondary {
  background: rgba(255, 255, 255, 0.98);
  color: var(--accent-strong);
  border: 1px solid var(--border-soft);
}

.kh-btn-secondary:hover {
  background: rgba(239, 246, 255, 0.98);
  border-color: var(--accent);
}

/* ============================================
   NAVIGATION CARDS (for homepage)
   ============================================ */
.nav-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 20px;
  border: 1px solid rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow-small);
  text-decoration: none;
  color: inherit;
  display: block;
  transition: transform var(--transition-smooth), box-shadow var(--transition-smooth);
}

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

.nav-card-icon {
  font-size: 2rem;
  margin-bottom: 10px;
  display: block;
}

.nav-card h3 {
  margin: 0 0 6px;
  font-size: 1.1rem;
  letter-spacing: -0.02em;
}

.nav-card p {
  margin: 0;
  font-size: 0.88rem;
  color: var(--text-muted);
}

/* ============================================
   FOOTER
   ============================================ */
.kh-footer {
  padding: 18px 0 22px;
  background: rgba(255, 255, 255, 0.96);
  border-top: 1px solid rgba(255, 255, 255, 0.96);
  font-size: 0.84rem;
}

.kh-footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px 16px;
  color: #0f172a;
}

/* ============================================
   UTILITY CLASSES
   ============================================ */
.kh-flex-2 {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.1fr);
  gap: 18px;
}

.text-center {
  text-align: center;
}

.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }

.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }

/* ============================================
   RESPONSIVE BREAKPOINTS
   ============================================ */
@media (max-width: 960px) {
  .kh-hero-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .info-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .kh-flex-2 {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 768px) {
  .kh-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.98);
    flex-direction: column;
    padding: 16px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.3);
  }

  .kh-nav.is-open {
    display: flex;
  }

  .kh-mobile-menu-btn {
    display: block;
  }

  .kh-header-inner {
    flex-wrap: wrap;
  }
}

@media (max-width: 640px) {
  .kh-header-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .kh-main {
    padding-bottom: 40px;
  }

  .kh-section {
    padding: 48px 0;
  }

  .kh-hero {
    padding: 48px 0 36px;
  }

  .section-heading h2 {
    font-size: 1.5rem;
  }

  .kh-table {
    font-size: 0.85rem;
  }
}

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
  body::after {
    display: none;
  }

  .kh-header,
  .kh-footer,
  .kh-lang-switch {
    display: none;
  }

  .kh-section {
    page-break-inside: avoid;
  }
}
