/* ============================================================
   SSC GD Constable 2026 - Result & Intelligence Portal
   Design System & Master Stylesheet
   ============================================================ */

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --bg-primary: #f8fafc;
    --bg-secondary: #f1f5f9;
    --bg-card: #ffffff;
    --bg-card-hover: #f8fafc;
    --border: rgba(99, 102, 241, 0.18);
    --border-light: #e2e8f0;
    --border-glow: rgba(99, 102, 241, 0.4);
    
    --text-primary: #0f172a;
    --text-secondary: #334155;
    --text-muted: #64748b;
    
    --accent: #4f46e5;
    --accent-light: #6366f1;
    --accent-glow: rgba(79, 70, 229, 0.12);
    --accent-hover: #4338ca;
    
    --navy-dark: #0a192f;
    --navy-light: #1e293b;
    
    --success: #059669;
    --success-bg: #ecfdf5;
    --success-border: #a7f3d0;
    
    --warning: #d97706;
    --warning-bg: #fffbeb;
    --warning-border: #fde68a;
    
    --danger: #dc2626;
    --danger-bg: #fef2f2;
    --danger-border: #fecaca;
    
    --info: #0284c7;
    --info-bg: #f0f9ff;
    --info-border: #bae6fd;
    
    --gradient-1: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 50%, #4f46e5 100%);
    --gradient-hero: linear-gradient(135deg, #0f172a 0%, #1e1b4b 50%, #1e293b 100%);
    --gradient-card: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);
    --gradient-accent: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -1px rgba(0,0,0,0.04);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -2px rgba(0,0,0,0.04);
    --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.1), 0 10px 10px -5px rgba(0,0,0,0.04);
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-full: 9999px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
}

/* Background atmospheric gradient */
body::before {
    content: '';
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background:
        radial-gradient(ellipse at 15% 20%, rgba(99, 102, 241, 0.05) 0%, transparent 45%),
        radial-gradient(ellipse at 85% 15%, rgba(14, 165, 233, 0.04) 0%, transparent 45%),
        radial-gradient(ellipse at 50% 85%, rgba(16, 185, 129, 0.03) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    position: relative;
    z-index: 1;
}

/* Government Top Bar */
.gov-topbar {
    background: #0f172a;
    color: #94a3b8;
    font-size: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    position: relative;
    z-index: 100;
}
.gov-topbar-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 6px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}
.gov-emblem {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    color: #f1f5f9;
}
.gov-topbar strong {
    color: #38bdf8;
}

/* Main Site Navigation */
.site-nav-wrap {
    background: #ffffff;
    border-bottom: 1px solid var(--border-light);
    position: sticky;
    top: 0;
    z-index: 90;
    box-shadow: var(--shadow-sm);
}
.site-nav {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
    flex-wrap: wrap;
}
.nav-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--text-primary);
}
.nav-badge-logo {
    width: 40px;
    height: 40px;
    background: var(--gradient-1);
    color: #ffffff;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 15px;
    letter-spacing: -0.5px;
    box-shadow: 0 4px 10px rgba(59, 130, 246, 0.3);
}
.nav-brand-title {
    font-size: 16px;
    font-weight: 800;
    color: var(--navy-dark);
    letter-spacing: -0.3px;
    line-height: 1.2;
}
.nav-brand-sub {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
}
.nav-links {
    display: flex;
    align-items: center;
    gap: 6px;
    list-style: none;
}
.nav-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 13.5px;
    font-weight: 600;
    transition: all 0.2s ease;
}
.nav-link:hover {
    background: var(--bg-secondary);
    color: var(--accent);
}
.nav-link.active {
    background: var(--accent-glow);
    color: var(--accent);
    border: 1px solid rgba(79, 70, 229, 0.25);
}
.nav-cta {
    background: var(--accent);
    color: #ffffff !important;
    border-radius: var(--radius-sm);
    padding: 8px 16px;
}
.nav-cta:hover {
    background: var(--accent-hover) !important;
    transform: translateY(-1px);
}

/* Hero Section */
.hero {
    background: var(--gradient-hero);
    color: #ffffff;
    border-radius: var(--radius-lg);
    margin: 24px 0 32px;
    padding: 40px 36px;
    box-shadow: var(--shadow-xl);
    position: relative;
    overflow: hidden;
}
.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.25) 0%, transparent 70%);
    pointer-events: none;
}
.hero-tagline-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.badge-live {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(220, 38, 38, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.5);
    color: #fca5a5;
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: 11.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.badge-live::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ef4444;
    animation: pulse 1.8s infinite;
}
@keyframes pulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(239, 68, 68, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}
.badge-meta {
    background: rgba(255, 255, 255, 0.1);
    color: #cbd5e1;
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: 11.5px;
    font-weight: 600;
}
.hero h1 {
    font-size: clamp(26px, 3.2vw, 42px);
    font-weight: 900;
    line-height: 1.2;
    letter-spacing: -0.5px;
    margin-bottom: 12px;
    color: #ffffff;
}
.hero p.hero-subtitle {
    font-size: clamp(14px, 1.3vw, 17px);
    color: #cbd5e1;
    max-width: 900px;
    line-height: 1.6;
    margin-bottom: 24px;
}

/* Quick Search Container */
.search-box-wrap {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-md);
    padding: 16px;
    max-width: 850px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}
.search-form {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.search-input-wrap {
    flex: 1;
    min-width: 260px;
    position: relative;
}
.search-input {
    width: 100%;
    height: 52px;
    padding: 0 18px 0 44px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: #ffffff;
    color: var(--text-primary);
    font-size: 15px;
    font-weight: 500;
    outline: none;
    transition: all 0.2s ease;
}
.search-input:focus {
    border-color: var(--accent-light);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.35);
}
.search-icon-inside {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #64748b;
    font-size: 18px;
    pointer-events: none;
}
.btn-search {
    height: 52px;
    padding: 0 28px;
    background: var(--gradient-accent);
    color: #ffffff;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}
.btn-search:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(124, 58, 237, 0.35);
}
.btn-search:active {
    transform: translateY(0);
}
.search-hint {
    font-size: 12px;
    color: #94a3b8;
    margin-top: 8px;
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}
.search-hint strong {
    color: #e2e8f0;
}

/* Search Result Modal / Dropdown Card */
.search-result-card {
    display: none;
    margin-top: 16px;
    background: #ffffff;
    border-radius: var(--radius-md);
    padding: 24px;
    color: var(--text-primary);
    box-shadow: var(--shadow-xl);
    border-left: 6px solid var(--accent);
    animation: fadeIn 0.3s ease;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Stat Grid */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}
.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    transition: all 0.25s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: var(--border);
}
.stat-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}
.stat-label {
    font-size: 12.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
}
.stat-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}
.stat-val {
    font-size: 28px;
    font-weight: 900;
    color: var(--navy-dark);
    letter-spacing: -0.5px;
    line-height: 1.1;
    margin-bottom: 6px;
}
.stat-sub {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
}

/* Section Containers */
.section-card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 28px;
    margin-bottom: 32px;
    box-shadow: var(--shadow-sm);
}
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-light);
    flex-wrap: wrap;
    gap: 12px;
}
.section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 19px;
    font-weight: 800;
    color: var(--navy-dark);
    letter-spacing: -0.3px;
}
.section-title .icon {
    font-size: 22px;
}
.section-subtitle {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 400;
    margin-top: 2px;
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 0.2px;
}
.badge-success { background: var(--success-bg); color: var(--success); border: 1px solid var(--success-border); }
.badge-warning { background: var(--warning-bg); color: var(--warning); border: 1px solid var(--warning-border); }
.badge-danger { background: var(--danger-bg); color: var(--danger); border: 1px solid var(--danger-border); }
.badge-info { background: var(--info-bg); color: var(--info); border: 1px solid var(--info-border); }
.badge-neutral { background: var(--bg-secondary); color: var(--text-secondary); border: 1px solid var(--border-light); }

/* Table Styling */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
table.custom-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 13.5px;
}
table.custom-table th {
    background: var(--bg-secondary);
    color: var(--text-secondary);
    padding: 12px 16px;
    font-weight: 700;
    font-size: 11.5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border-light);
    border-top: 1px solid var(--border-light);
    white-space: nowrap;
    text-align: left;
}
table.custom-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-light);
    color: var(--text-primary);
    vertical-align: middle;
}
table.custom-table tbody tr {
    transition: background-color 0.15s ease;
}
table.custom-table tbody tr:hover {
    background-color: #f8fafc;
}

/* Category Matrix Cards */
.cat-matrix-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}
.cat-matrix-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 16px;
    text-align: center;
}
.cat-matrix-card .cat-title {
    font-size: 14px;
    font-weight: 800;
    color: var(--navy-dark);
    margin-bottom: 6px;
}
.cat-matrix-card .cat-count {
    font-size: 20px;
    font-weight: 900;
    color: var(--accent);
}
.cat-matrix-card .cat-extra {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Button UI */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: var(--radius-sm);
    font-size: 13.5px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.2s ease;
}
.btn-primary {
    background: var(--accent);
    color: #ffffff;
}
.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
}
.btn-outline {
    background: #ffffff;
    border-color: var(--border-light);
    color: var(--text-secondary);
}
.btn-outline:hover {
    background: var(--bg-secondary);
    border-color: var(--accent);
    color: var(--accent);
}
.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

/* PDF Links Banner */
.pdf-banner {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
    margin-top: 20px;
}
.pdf-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.2s ease;
}
.pdf-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--accent);
}
.pdf-icon {
    width: 44px;
    height: 44px;
    background: #fef2f2;
    color: #dc2626;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}
.pdf-info h4 {
    font-size: 13.5px;
    font-weight: 700;
    margin-bottom: 2px;
}
.pdf-info p {
    font-size: 11.5px;
    color: var(--text-muted);
}

/* Footer */
.site-footer {
    background: var(--navy-dark);
    color: #94a3b8;
    padding: 40px 0 24px;
    margin-top: 60px;
    font-size: 13px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 32px;
    margin-bottom: 30px;
}
.footer-col h4 {
    color: #f1f5f9;
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.footer-col p {
    line-height: 1.6;
    margin-bottom: 12px;
}
.footer-links {
    list-style: none;
}
.footer-links li {
    margin-bottom: 8px;
}
.footer-links a {
    color: #94a3b8;
    text-decoration: none;
    transition: color 0.2s;
}
.footer-links a:hover {
    color: #38bdf8;
}
.footer-bottom {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px 20px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    text-align: center;
    font-size: 12px;
    color: #64748b;
}

/* Responsive tweaks */
@media (max-width: 768px) {
    .hero {
        padding: 28px 20px;
    }
    .site-nav {
        height: auto;
        padding: 12px 20px;
        gap: 12px;
    }
    .nav-links {
        width: 100%;
        overflow-x: auto;
        padding-bottom: 6px;
    }
    .stat-grid {
        grid-template-columns: 1fr 1fr;
    }
    .section-card {
        padding: 20px 16px;
    }
}
