/* ========================================
   UTS QR Codes — Main Stylesheet
   Theme: Deep Navy + Saffron (Indian Railway)
   ======================================== */

/* ---- Reset & Base ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --navy:       #0B1629;
    --navy-mid:   #111E35;
    --navy-light: #1A2D4F;
    --navy-card:  #162340;
    --saffron:    #F59E0B;
    --saffron-d:  #D97706;
    --saffron-l:  #FCD34D;
    --green:      #10B981;
    --red:        #EF4444;
    --text:       #E2E8F0;
    --text-muted: #94A3B8;
    --text-dim:   #64748B;
    --border:     rgba(255,255,255,0.08);
    --glass:      rgba(255,255,255,0.05);
    --glass-hover:rgba(255,255,255,0.09);
    --shadow:     0 4px 24px rgba(0,0,0,0.4);
    --radius:     12px;
    --radius-sm:  8px;
    --radius-lg:  20px;
    --transition: 0.2s ease;
    --font:       'Inter', system-ui, sans-serif;
}

html { scroll-behavior: smooth; }

body {
    font-family: var(--font);
    background: var(--navy);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main { flex: 1; }

a { color: var(--saffron); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--saffron-l); }

img { max-width: 100%; height: auto; display: block; }

ul { list-style: none; }

/* ---- Container ---- */
.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* ---- Typography ---- */
h1,h2,h3,h4,h5 { font-weight: 700; line-height: 1.2; color: #fff; }
h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); }
h2 { font-size: clamp(1.4rem, 3vw, 2rem); }
h3 { font-size: 1.2rem; }

/* ============================================
   HEADER
   ============================================ */
.site-header {
    position: sticky; top: 0; z-index: 100;
    background: rgba(11,22,41,0.92);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    padding: 0;
}
.header-inner {
    display: flex; align-items: center; gap: 20px;
    height: 64px;
}
.logo {
    display: flex; align-items: center; gap: 10px;
    text-decoration: none; flex-shrink: 0;
}
.logo-icon { font-size: 1.5rem; }
.logo-text {
    font-size: 1.1rem; font-weight: 800; color: #fff;
    background: linear-gradient(135deg, #fff 0%, var(--saffron) 100%);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text;
}
.main-nav { display: flex; gap: 4px; margin-left: auto; }
.main-nav a {
    padding: 6px 14px; border-radius: 6px; font-size: 0.9rem;
    font-weight: 500; color: var(--text-muted);
    transition: all var(--transition);
}
.main-nav a:hover { color: #fff; background: var(--glass); }

/* Search mini in header */
.header-search { position: relative; }
.search-form-mini {
    display: flex; align-items: center;
    background: var(--glass); border: 1px solid var(--border);
    border-radius: 8px; overflow: visible; position: relative;
}
.search-form-mini input {
    background: transparent; border: none; outline: none;
    color: var(--text); padding: 8px 12px; font-size: 0.85rem;
    font-family: var(--font); width: 220px;
}
.search-form-mini input::placeholder { color: var(--text-dim); }
.search-form-mini button {
    background: transparent; border: none; cursor: pointer;
    color: var(--text-muted); padding: 8px 12px;
    display: flex; align-items: center;
    transition: color var(--transition);
}
.search-form-mini button:hover { color: var(--saffron); }

.search-dropdown {
    position: absolute; top: calc(100% + 8px); left: 0; right: 0;
    background: var(--navy-mid); border: 1px solid var(--border);
    border-radius: var(--radius-sm); box-shadow: var(--shadow);
    display: none; z-index: 200; max-height: 320px; overflow-y: auto;
}
.search-dropdown.active { display: block; }
.search-result-item {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 14px; cursor: pointer;
    transition: background var(--transition); text-decoration: none; color: var(--text);
}
.search-result-item:hover { background: var(--glass-hover); }
.search-result-item .code-badge {
    background: var(--saffron); color: #000; font-size: 0.7rem;
    font-weight: 700; padding: 2px 6px; border-radius: 4px; flex-shrink: 0;
}
.search-result-item .station-info .name { font-size: 0.9rem; font-weight: 500; }
.search-result-item .station-info .state { font-size: 0.75rem; color: var(--text-muted); }
.search-no-result { padding: 16px; text-align: center; color: var(--text-muted); font-size: 0.9rem; }
.search-loading { padding: 16px; text-align: center; color: var(--text-muted); }

.nav-toggle {
    display: none; flex-direction: column; gap: 5px;
    background: none; border: none; cursor: pointer; padding: 4px;
    margin-left: auto;
}
.nav-toggle span {
    display: block; width: 22px; height: 2px;
    background: var(--text); border-radius: 2px;
    transition: all 0.3s;
}

/* ============================================
   HERO SECTION
   ============================================ */
.hero {
    padding: 80px 0 60px;
    background: radial-gradient(ellipse at 50% 0%, rgba(245,158,11,0.12) 0%, transparent 60%);
    text-align: center; position: relative; overflow: hidden;
}
.hero::before {
    content: ''; position: absolute; inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.02'%3E%3Ccircle cx='30' cy='30' r='1'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    pointer-events: none;
}
.hero-badge {
    display: inline-flex; align-items: center; gap: 6px;
    background: rgba(245,158,11,0.15); border: 1px solid rgba(245,158,11,0.3);
    border-radius: 20px; padding: 6px 14px; font-size: 0.8rem;
    color: var(--saffron); font-weight: 600; margin-bottom: 20px;
    animation: fadeDown 0.6s ease;
}
.hero h1 { 
    animation: fadeDown 0.6s ease 0.1s both;
    margin-bottom: 16px;
}
.hero h1 span { color: var(--saffron); }
.hero p {
    font-size: 1.1rem; color: var(--text-muted); max-width: 560px;
    margin: 0 auto 36px; animation: fadeDown 0.6s ease 0.2s both;
}

/* Hero Search */
.hero-search {
    max-width: 580px; margin: 0 auto;
    animation: fadeDown 0.6s ease 0.3s both;
}
.hero-search-form {
    display: flex; background: var(--navy-card);
    border: 1px solid var(--border); border-radius: 50px;
    overflow: hidden; box-shadow: 0 8px 40px rgba(0,0,0,0.3);
    transition: border-color var(--transition), box-shadow var(--transition);
}
.hero-search-form:focus-within {
    border-color: var(--saffron);
    box-shadow: 0 8px 40px rgba(245,158,11,0.15);
}
.hero-search-form input {
    flex: 1; background: transparent; border: none; outline: none;
    color: var(--text); padding: 16px 24px; font-size: 1rem;
    font-family: var(--font);
}
.hero-search-form input::placeholder { color: var(--text-dim); }
.hero-search-form button {
    background: var(--saffron); border: none; cursor: pointer;
    color: #000; padding: 0 28px; font-weight: 700; font-size: 0.95rem;
    font-family: var(--font); display: flex; align-items: center; gap: 8px;
    border-radius: 0 50px 50px 0; transition: background var(--transition);
}
.hero-search-form button:hover { background: var(--saffron-l); }

.hero-stats {
    display: flex; justify-content: center; gap: 40px;
    margin-top: 48px; animation: fadeDown 0.6s ease 0.4s both;
}
.hero-stat { text-align: center; }
.hero-stat .num { font-size: 2rem; font-weight: 800; color: var(--saffron); }
.hero-stat .label { font-size: 0.8rem; color: var(--text-muted); margin-top: 2px; }

/* ============================================
   STATES SECTION
   ============================================ */
.section { padding: 60px 0; }
.section-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 32px;
}
.section-title { font-size: 1.5rem; font-weight: 700; }
.section-title span { color: var(--saffron); }
.section-link { color: var(--saffron); font-size: 0.9rem; font-weight: 500; }
.states-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 24px; margin-top: 32px;
}
.state-card {
    background: var(--navy-light); border-radius: 16px; padding: 24px 16px;
    display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 12px;
    border: 1px solid var(--border); transition: 0.3s ease; text-decoration: none;
}
.state-card:hover {
    background: var(--navy-mid); border-color: rgba(245,158,11,0.4); transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0,0,0,0.2);
}
.state-icon {
    width: 90px; height: 90px;
    display: flex; align-items: center; justify-content: center;
    transition: 0.3s ease;
}
.state-icon svg {
    width: 100%; height: 100%;
    fill: var(--saffron); stroke: none;
    filter: drop-shadow(0 6px 12px rgba(245,158,11,0.25));
    transition: 0.3s ease;
}
.state-card:hover .state-icon svg {
    filter: drop-shadow(0 8px 16px rgba(245,158,11,0.4)); transform: scale(1.05);
}
.state-info { display: flex; flex-direction: column; align-items: center; }
.state-info .state-name { font-weight: 600; font-size: 1rem; color: #fff; margin-bottom: 4px; }
.state-info .station-count {
    font-size: 0.85rem; color: var(--text-muted);
    background: rgba(255,255,255,0.05); padding: 4px 10px; border-radius: 20px;
}

/* ============================================
   STATION CARDS
   ============================================ */
.stations-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 14px;
}

.station-card {
    background: var(--navy-card); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 16px;
    display: flex; flex-direction: column; align-items: center;
    text-decoration: none; color: var(--text); text-align: center;
    transition: all var(--transition);
    animation: fadeUp 0.4s ease both;
}
.station-card:hover {
    border-color: var(--saffron);
    transform: translateY(-3px);
    box-shadow: 0 12px 32px rgba(0,0,0,0.3);
    color: #fff;
}
.station-qr-thumb {
    width: 80px; height: 80px; border-radius: 8px;
    background: #fff; padding: 6px; margin-bottom: 12px;
    display: flex; align-items: center; justify-content: center;
    overflow: hidden;
}
.station-qr-thumb img { width: 100%; height: 100%; object-fit: contain; }
.station-qr-placeholder {
    width: 80px; height: 80px; border-radius: 8px;
    background: var(--navy-light); border: 1px dashed var(--border);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem; margin-bottom: 12px;
}
.station-card .name { font-weight: 600; font-size: 0.88rem; line-height: 1.3; }
.station-card .code {
    display: inline-block; margin-top: 6px;
    background: rgba(245,158,11,0.15); color: var(--saffron);
    font-size: 0.72rem; font-weight: 700; padding: 2px 8px;
    border-radius: 4px; letter-spacing: 0.5px;
}

/* ============================================
   STATION DETAIL PAGE
   ============================================ */
.station-detail {
    padding: 48px 0;
}
.station-detail-inner {
    max-width: 680px; margin: 0 auto; text-align: center;
}
.qr-display {
    background: #fff; border-radius: 20px; padding: 0;
    display: inline-block; box-shadow: 0 20px 60px rgba(0,0,0,0.4);
    margin: 32px 0; overflow: hidden;
}
.qr-display img { width: 280px; height: 280px; object-fit: contain; border-radius: 20px; border: 4px dotted #000; box-sizing: border-box; }

.station-detail h1 { margin-bottom: 8px; }
.station-code-display {
    display: inline-block; background: rgba(245,158,11,0.15);
    border: 1px solid rgba(245,158,11,0.3); color: var(--saffron);
    font-size: 1rem; font-weight: 700; padding: 4px 16px;
    border-radius: 6px; letter-spacing: 1px; margin-bottom: 8px;
}
.station-meta { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 24px; }
.station-meta a { color: var(--saffron); }

.btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 12px 24px; border-radius: 8px; font-weight: 600;
    font-size: 0.95rem; font-family: var(--font); border: none;
    cursor: pointer; text-decoration: none; transition: all var(--transition);
}
.btn-primary { background: var(--saffron); color: #000; }
.btn-primary:hover { background: var(--saffron-l); color: #000; transform: translateY(-1px); }
.btn-outline {
    background: transparent; color: var(--text);
    border: 1px solid var(--border);
}
.btn-outline:hover { border-color: var(--saffron); color: var(--saffron); }
.btn-sm { padding: 8px 16px; font-size: 0.85rem; }

.btn-group { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* Info card on station page */
.info-card {
    background: var(--navy-card); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 20px 24px; margin-top: 24px;
    text-align: left;
}
.info-card h3 { margin-bottom: 12px; font-size: 1rem; }
.info-row {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 0; border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
}
.info-row:last-child { border-bottom: none; }
.info-row .label { color: var(--text-muted); }
.info-row .value { font-weight: 500; }

/* Nearby stations */
.nearby-stations { margin-top: 40px; text-align: left; }
.nearby-stations h2 { margin-bottom: 20px; font-size: 1.2rem; }

/* ============================================
   STATE PAGE
   ============================================ */
.state-page { padding: 40px 0; }
.state-hero {
    background: var(--navy-card); border: 1px solid var(--border);
    border-radius: var(--radius-lg); padding: 32px 40px; margin-bottom: 40px;
    display: flex; align-items: center; gap: 24px;
    position: relative; overflow: hidden;
}
.state-hero::before {
    content: attr(data-emoji);
    position: absolute; right: 24px; top: 50%; transform: translateY(-50%);
    font-size: 5rem; opacity: 0.08; pointer-events: none;
}
.state-hero-icon {
    font-size: 2.5rem; width: 72px; height: 72px;
    background: linear-gradient(135deg, rgba(245,158,11,0.2), rgba(245,158,11,0.05));
    border: 1px solid rgba(245,158,11,0.2); border-radius: 14px;
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.state-hero-icon svg {
    width: 44px; height: 44px;
    fill: var(--saffron); stroke: none;
    filter: drop-shadow(0 4px 8px rgba(245,158,11,0.3));
    transition: 0.3s ease;
}
.state-hero-info h1 { margin-bottom: 4px; }
.state-hero-info p { color: var(--text-muted); font-size: 0.95rem; }

/* Filter bar */
.filter-bar {
    display: flex; gap: 12px; align-items: center;
    margin-bottom: 28px; flex-wrap: wrap;
}
.filter-search {
    flex: 1; min-width: 240px; position: relative;
}
.filter-search input {
    width: 100%; background: var(--navy-card); border: 1px solid var(--border);
    border-radius: 8px; padding: 10px 16px 10px 40px;
    color: var(--text); font-size: 0.9rem; font-family: var(--font); outline: none;
    transition: border-color var(--transition);
}
.filter-search input:focus { border-color: var(--saffron); }
.filter-search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-dim); }
.filter-count { color: var(--text-muted); font-size: 0.85rem; white-space: nowrap; }

/* ============================================
   SEARCH PAGE
   ============================================ */
.search-page { padding: 48px 0; }
.search-hero { text-align: center; margin-bottom: 40px; }
.search-hero h1 { margin-bottom: 8px; }
.search-hero p { color: var(--text-muted); }
.search-form-large {
    display: flex; max-width: 640px; margin: 0 auto 40px;
    background: var(--navy-card); border: 1px solid var(--border);
    border-radius: 50px; overflow: hidden;
    box-shadow: var(--shadow);
}
.search-form-large input {
    flex: 1; background: transparent; border: none; outline: none;
    color: var(--text); padding: 16px 24px; font-size: 1rem; font-family: var(--font);
}
.search-form-large input::placeholder { color: var(--text-dim); }
.search-form-large button {
    background: var(--saffron); border: none; cursor: pointer;
    color: #000; padding: 0 28px; font-weight: 700; font-family: var(--font);
    border-radius: 0 50px 50px 0; display: flex; align-items: center; gap: 8px;
}
.search-results-count { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 20px; }

.search-result-card {
    display: flex; align-items: center; gap: 16px;
    background: var(--navy-card); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 16px 20px; margin-bottom: 12px;
    text-decoration: none; color: var(--text);
    transition: all var(--transition);
}
.search-result-card:hover { border-color: var(--saffron); color: #fff; }
.search-result-card .qr-mini {
    width: 52px; height: 52px; border-radius: 6px; background: #fff;
    padding: 4px; flex-shrink: 0;
}
.search-result-card .qr-mini img { width: 100%; height: 100%; object-fit: contain; }
.search-result-card .info .name { font-weight: 600; margin-bottom: 4px; }
.search-result-card .info .meta { font-size: 0.82rem; color: var(--text-muted); }
.search-result-card .code-pill {
    margin-left: auto; flex-shrink: 0;
    background: rgba(245,158,11,0.15); color: var(--saffron);
    font-size: 0.78rem; font-weight: 700; padding: 4px 10px; border-radius: 5px;
}

/* ============================================
   BREADCRUMB
   ============================================ */
.breadcrumb { margin-bottom: 24px; }
.breadcrumb ol {
    display: flex; flex-wrap: wrap; gap: 4px;
    align-items: center; list-style: none;
}
.breadcrumb-item { font-size: 0.85rem; color: var(--text-muted); }
.breadcrumb-item a { color: var(--text-muted); }
.breadcrumb-item a:hover { color: var(--saffron); }
.breadcrumb-item + .breadcrumb-item::before {
    content: '/'; margin-right: 4px; color: var(--text-dim);
}
.breadcrumb-item.active { color: var(--text); }

/* ============================================
   404 PAGE
   ============================================ */
.error-page {
    padding: 80px 0; text-align: center;
}
.error-code {
    font-size: 8rem; font-weight: 900; line-height: 1;
    background: linear-gradient(135deg, var(--saffron), var(--saffron-l));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text; margin-bottom: 16px;
}
.error-page h1 { font-size: 1.8rem; margin-bottom: 12px; }
.error-page p { color: var(--text-muted); max-width: 440px; margin: 0 auto 32px; }

/* ============================================
   FOOTER
   ============================================ */
.site-footer {
    background: var(--navy-mid); border-top: 1px solid var(--border);
    padding: 48px 0 24px; margin-top: auto;
}
.footer-grid {
    display: grid; grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 40px; margin-bottom: 40px;
}
.footer-brand p { color: var(--text-muted); font-size: 0.88rem; margin-top: 12px; line-height: 1.7; }
.footer-links h4 { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.8px; margin-bottom: 14px; color: var(--text-muted); }
.footer-links ul li { margin-bottom: 8px; }
.footer-links ul li a { color: var(--text-muted); font-size: 0.88rem; }
.footer-links ul li a:hover { color: var(--saffron); }
.footer-bottom {
    border-top: 1px solid var(--border); padding-top: 20px;
    text-align: center; color: var(--text-dim); font-size: 0.82rem;
}

/* ============================================
   ADMIN PANEL
   ============================================ */
.admin-body {
    font-family: var(--font); background: #0D1520;
    color: var(--text); min-height: 100vh; display: flex;
}
.admin-sidebar {
    width: 240px; background: var(--navy-mid);
    border-right: 1px solid var(--border);
    display: flex; flex-direction: column;
    position: fixed; top: 0; bottom: 0; left: 0; z-index: 50;
}
.admin-logo {
    padding: 20px 20px 16px; border-bottom: 1px solid var(--border);
    font-weight: 800; font-size: 1rem; color: #fff;
    display: flex; align-items: center; gap: 8px;
}
.admin-nav { flex: 1; padding: 12px 0; overflow-y: auto; }
.admin-nav a {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 20px; color: var(--text-muted); font-size: 0.9rem;
    transition: all var(--transition); border-left: 3px solid transparent;
}
.admin-nav a:hover, .admin-nav a.active {
    color: #fff; background: var(--glass); border-left-color: var(--saffron);
}
.admin-nav a svg { flex-shrink: 0; }
.admin-user {
    padding: 16px 20px; border-top: 1px solid var(--border);
    font-size: 0.85rem; color: var(--text-muted);
}
.admin-main {
    margin-left: 240px; flex: 1; display: flex; flex-direction: column;
}
.admin-topbar {
    background: var(--navy-mid); border-bottom: 1px solid var(--border);
    padding: 0 28px; height: 56px; display: flex; align-items: center;
    justify-content: space-between; position: sticky; top: 0; z-index: 40;
}
.admin-topbar h1 { font-size: 1rem; font-weight: 600; }
.admin-content { padding: 28px; flex: 1; }

.stat-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 32px; }
.stat-card {
    background: var(--navy-card); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 20px;
}
.stat-card .num { font-size: 2rem; font-weight: 800; color: var(--saffron); }
.stat-card .label { font-size: 0.82rem; color: var(--text-muted); margin-top: 4px; }

.table-wrap { background: var(--navy-card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.table-head {
    padding: 16px 20px; display: flex; align-items: center;
    justify-content: space-between; border-bottom: 1px solid var(--border);
}
.table-head h3 { font-size: 0.95rem; }
table { width: 100%; border-collapse: collapse; }
table th {
    text-align: left; padding: 12px 20px;
    font-size: 0.78rem; font-weight: 600; text-transform: uppercase;
    letter-spacing: 0.5px; color: var(--text-muted);
    background: rgba(255,255,255,0.02); border-bottom: 1px solid var(--border);
}
table td {
    padding: 12px 20px; font-size: 0.88rem;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}
table tr:last-child td { border-bottom: none; }
table tr:hover td { background: var(--glass); }

.badge {
    display: inline-block; padding: 3px 8px; border-radius: 4px;
    font-size: 0.72rem; font-weight: 600;
}
.badge-green { background: rgba(16,185,129,0.15); color: var(--green); }
.badge-red   { background: rgba(239,68,68,0.15); color: var(--red); }
.badge-gold  { background: rgba(245,158,11,0.15); color: var(--saffron); }

/* Admin forms */
.admin-form-card {
    background: var(--navy-card); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 24px 28px;
}
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-size: 0.85rem; font-weight: 500; margin-bottom: 6px; color: var(--text-muted); }
.form-group input, .form-group select, .form-group textarea {
    width: 100%; background: var(--navy-mid); border: 1px solid var(--border);
    border-radius: 6px; padding: 10px 14px; color: var(--text);
    font-size: 0.9rem; font-family: var(--font); outline: none;
    transition: border-color var(--transition);
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    border-color: var(--saffron);
}
.form-group textarea { min-height: 80px; resize: vertical; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-help { font-size: 0.78rem; color: var(--text-dim); margin-top: 4px; }

.alert {
    padding: 12px 16px; border-radius: 8px; font-size: 0.9rem; margin-bottom: 16px;
}
.alert-success { background: rgba(16,185,129,0.1); border: 1px solid rgba(16,185,129,0.3); color: var(--green); }
.alert-error   { background: rgba(239,68,68,0.1); border: 1px solid rgba(239,68,68,0.3); color: var(--red); }
.alert-info    { background: rgba(245,158,11,0.1); border: 1px solid rgba(245,158,11,0.3); color: var(--saffron); }

/* Admin Login */
.admin-login-page {
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
    background: var(--navy);
}
.login-card {
    background: var(--navy-card); border: 1px solid var(--border);
    border-radius: var(--radius-lg); padding: 40px; width: 100%; max-width: 380px;
    box-shadow: var(--shadow);
}
.login-card .logo { justify-content: center; margin-bottom: 8px; }
.login-card p { text-align: center; color: var(--text-muted); font-size: 0.88rem; margin-bottom: 28px; }

/* Install Wizard */
.install-page {
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
    background: var(--navy); padding: 40px 20px;
}
.install-card {
    background: var(--navy-card); border: 1px solid var(--border);
    border-radius: var(--radius-lg); padding: 48px; width: 100%; max-width: 560px;
    box-shadow: var(--shadow);
}
.install-header { text-align: center; margin-bottom: 36px; }
.install-header .logo { justify-content: center; margin-bottom: 12px; }
.install-header h1 { font-size: 1.5rem; margin-bottom: 6px; }
.install-header p { color: var(--text-muted); font-size: 0.9rem; }
.step-indicator {
    display: flex; gap: 6px; margin-bottom: 36px;
}
.step-dot {
    flex: 1; height: 4px; border-radius: 2px;
    background: var(--border); transition: background 0.3s;
}
.step-dot.done { background: var(--saffron); }
.step-dot.active { background: var(--saffron-l); }

.check-item {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 0.9rem;
}
.check-item:last-child { border-bottom: none; }
.check-pass { color: var(--green); font-weight: 600; }
.check-fail { color: var(--red); font-weight: 600; }

/* ============================================
   UTILS
   ============================================ */
.text-muted { color: var(--text-muted); }
.text-center { text-align: center; }
.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mt-40 { margin-top: 40px; }
.mb-24 { margin-bottom: 24px; }

.divider { border: none; border-top: 1px solid var(--border); margin: 32px 0; }

.spinner {
    width: 24px; height: 24px; border: 3px solid var(--border);
    border-top-color: var(--saffron); border-radius: 50%;
    animation: spin 0.8s linear infinite; display: inline-block;
}

/* Pagination */
.pagination {
    display: flex; gap: 6px; justify-content: center;
    flex-wrap: wrap; margin-top: 32px;
}
.page-btn {
    padding: 8px 14px; border-radius: 6px;
    background: var(--navy-card); border: 1px solid var(--border);
    color: var(--text-muted); font-size: 0.85rem; text-decoration: none;
    transition: all var(--transition);
}
.page-btn:hover { border-color: var(--saffron); color: var(--saffron); }
.page-btn.active { background: var(--saffron); border-color: var(--saffron); color: #000; font-weight: 700; }
.page-btn.disabled { opacity: 0.4; pointer-events: none; }

/* Empty state */
.empty-state { text-align: center; padding: 60px 20px; }
.empty-state .icon { font-size: 3rem; margin-bottom: 12px; }
.empty-state h3 { margin-bottom: 8px; }
.empty-state p { color: var(--text-muted); }

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeDown {
    from { opacity: 0; transform: translateY(-12px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Staggered cards */
.states-grid .state-card:nth-child(1)  { animation-delay: 0.05s; }
.states-grid .state-card:nth-child(2)  { animation-delay: 0.08s; }
.states-grid .state-card:nth-child(3)  { animation-delay: 0.11s; }
.states-grid .state-card:nth-child(4)  { animation-delay: 0.14s; }
.states-grid .state-card:nth-child(5)  { animation-delay: 0.17s; }
.states-grid .state-card:nth-child(6)  { animation-delay: 0.20s; }
.states-grid .state-card:nth-child(7)  { animation-delay: 0.23s; }
.states-grid .state-card:nth-child(8)  { animation-delay: 0.26s; }

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
    .footer-grid { grid-template-columns: 1fr 1fr; }
    .stat-cards  { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .main-nav { display: none; flex-direction: column; position: absolute; top: 64px; left: 0; right: 0; background: var(--navy-mid); border-bottom: 1px solid var(--border); padding: 12px; }
    .main-nav.open { display: flex; }
    .nav-toggle { display: flex; }
    .header-search { display: none; }
    .hero { padding: 48px 0 40px; }
    .hero-stats { gap: 24px; }
    .states-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
    .stations-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
    .footer-grid { grid-template-columns: 1fr; gap: 24px; }
    .state-hero { flex-direction: column; text-align: center; padding: 24px; }
    .qr-display img { width: 200px; height: 200px; }
    .admin-sidebar { display: none; }
    .admin-main { margin-left: 0; }
    .stat-cards { grid-template-columns: 1fr 1fr; }
    .form-row { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
    .hero-search-form { border-radius: 12px; flex-direction: column; }
    .hero-search-form button { border-radius: 0 0 12px 12px; padding: 12px; justify-content: center; }
    .states-grid { grid-template-columns: 1fr 1fr; }
    .stations-grid { grid-template-columns: 1fr 1fr; }
    .stat-cards { grid-template-columns: 1fr; }
}

/* AI Article Content Styling */
.ai-article-content h2 { font-size: 1.4rem; color: #fff; margin: 24px 0 12px 0; font-weight: 700; border-bottom: 1px solid var(--border); padding-bottom: 8px; }
.ai-article-content h3 { font-size: 1.15rem; color: var(--saffron); margin: 20px 0 10px 0; font-weight: 600; }
.ai-article-content p { margin-bottom: 16px; color: var(--text-muted); }
.ai-article-content ul, .ai-article-content ol { margin: 0 0 16px 24px; color: var(--text-muted); }
.ai-article-content li { margin-bottom: 8px; }
.ai-article-content strong { color: var(--text); font-weight: 600; }
.ai-article-content a { color: var(--saffron); text-decoration: none; }
.ai-article-content a:hover { text-decoration: underline; }
