/* ============================================ */
/* FILE: assets/css/style.css */
/* ============================================ */
:root {
    --primary-color: #1e57d0; /* deep blue like the design */
    --primary-gradient: linear-gradient(90deg,#1e57d0 0%, #2563eb 100%);
    --secondary-color: #6c757d;
    --muted-bg: #f3f6fb;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--muted-bg);
    color: #1f2937;
}

/* Page H1 size requested by user (scoped to page container to avoid header/logo collisions) */
.container h1 { font-size: 22px !important; }

.top-header { display: none; }

.main-header {
    background: var(--primary-gradient);
    color: #fff;
    padding-top: 6px;
    padding-bottom: 0px;
    box-shadow: 0 6px 18px rgba(16,24,40,0.08);
}

.main-header .logo h2 { color: #fff; display:flex; align-items:center; gap:10px; }
.main-header .logo i { color: rgba(255,255,255,0.95); }

.main-header .logo .site-title { font-size: 20px; font-weight: 700; color: #fff; }
.main-header .logo .site-subtitle { color: rgba(255,255,255,0.95); font-size: 14px; margin-top:6px; }

/* larger title for a bolder header like the mock */
.main-header .logo h2 .site-title { font-size: 22px; font-weight: 800; letter-spacing: 0.2px; }

/* Ensure logo icon and text are white even if markup contains color utility classes */
.main-header .logo h2,
.main-header .logo h2 span,
.main-header .logo h2 i {
    color: #ffffff !important;
}

/* Header navigation: make menu text white and keep toggler visible on the gradient */
.main-header .navbar-nav .nav-link {
    color: #ffffff !important;
    font-weight: 600;
    padding: 0.45rem 0.75rem;
}
.main-header .navbar-nav .nav-link:hover,
.main-header .navbar-nav .nav-link:focus {
    color: rgba(255,255,255,0.95) !important;
    text-decoration: none;
}
.main-header .navbar-toggler {
    border-color: rgba(255,255,255,0.16);
}
.main-header .navbar-toggler-icon {
    background-image: url("data:image/svg+xml;charset=utf8,%3Csvg viewBox='0 0 30 30' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath stroke='rgba(255,255,255,0.95)' stroke-width='2' stroke-linecap='round' stroke-miterlimit='10' d='M4 7h22M4 15h22M4 23h22'/%3E%3C/svg%3E");
}

/* On small screens hide the subtitle to avoid crowding the nav */
@media (max-width: 767.98px) {
    .main-header .logo .site-subtitle { display: none; }
}

/* India flag icon sizing in header */
.india-icon { display: inline-block; width: 36px; height: 24px; vertical-align: middle; }

.main-header .search-form .form-control {
    border-radius: 999px;
    padding: 18px 22px;
    box-shadow: 0 8px 24px rgba(16,24,40,0.08);
    border: none;
}
.main-header .search-form .btn {
    border-radius: 999px;
    padding: 12px 20px;
}

.logo h2 {
    font-size: 22px;
    font-weight: 700;
}

.search-form { display:flex; align-items:center; justify-content:center; }

.search-container { max-width: 820px; margin: 0 auto; }

.state-card {
    transition: all 0.25s ease;
    border: none;
    border-radius: 10px;
    background: #fff;
    padding: 18px;
    box-shadow: 0 6px 18px rgba(16,24,40,0.06);
}

.state-card .card-body { padding: 18px 20px; }

.state-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 30px rgba(16,24,40,0.10) !important;
}

.states-grid { gap: 1px; }

/* Ensure Bootstrap spacing (mb-3) doesn't add extra vertical gap inside .states-grid */
.states-grid > .col-12 { margin-bottom: 6px !important; }

/* Make state cards equal height and push action button to bottom */
.states-grid > .col-md-6 { display: flex; }
.state-card { display: flex; flex-direction: column; width: 100%; min-width: 0; }
.state-card .card-body { display: flex; flex-direction: column; flex: 1 1 auto; }
.state-card .card-body .card-title { display: flex; align-items: center; gap: 12px; }
.state-card .card-body .btn { margin-top: auto; width: 100%; }

.left-sidebar, .right-sidebar {
    position: sticky;
    top: 90px;
}

/* Small gap applied only between Statistics card and the left ad card */
.left-sidebar .card.bg-primary + .card.left-ad-card { margin-top: 10px; }

.footer {
    margin-top: auto;
    background: #1f2937;
    color: #d1d5db;
}

.footer a { color: rgba(255,255,255,0.75); }
.footer hr { border-color: rgba(255,255,255,0.06); }
.footer h5 { color: #fff; }

.footer a:hover {
    color: #fff !important;
    text-decoration: underline;
}

.ad-placeholder {
    min-height: 250px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Back to Top Button */
.back-to-top-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 52px;
    height: 52px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
    box-shadow: 0 8px 20px rgba(16,24,40,0.12);
}

.back-to-top-btn.show {
    opacity: 1;
    visibility: visible;
}

.back-to-top-btn:hover {
    background: #0b5ed7;
    transform: translateY(-3px);
}

/* Notifications */
.notification {
    position: fixed;
    top: -100px;
    right: 20px;
    background: white;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 9999;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
}

.notification.show {
    top: 20px;
}

.notification-success {
    border-left: 4px solid #198754;
}

.notification-error {
    border-left: 4px solid #dc3545;
}

.notification-info {
    border-left: 4px solid #0d6efd;
}

/* Page Loader */
.page-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255,255,255,0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

/* Dark Mode */
body.dark-mode {
    background: #1a1a1a;
    color: #e0e0e0;
}

body.dark-mode .card,
body.dark-mode .bg-white {
    background: #2d2d2d !important;
    color: #e0e0e0;
}

body.dark-mode .text-dark {
    color: #e0e0e0 !important;
}

/* Number badge shown before state name */
.state-number-badge {
    display: inline-block;
    background: var(--primary-color);
    color: #fff;
    border-radius: 999px;
    padding: 0.25rem 0.5rem;
    font-weight: 700;
    font-size: 0.9rem;
    line-height: 1;
}

.state-card a.text-reset { text-decoration: none; }

/* grid to align badge column and content column so counts start under icon */
.state-meta-grid {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.5rem 1rem;
    align-items: start;
}
.state-meta-grid .meta-content { min-width: 0; }

/* Tighter vertical spacing between title and subtitle/counts */
.state-card .card-body {
    padding-top: 0px; /* reduce top padding */
    padding-bottom: 0px; /* reduce bottom padding */
}
.state-meta-grid .meta-content .d-flex {
    gap: 0.5rem; /* reduce horizontal gap between icon and title */
    margin-bottom: 0.125rem; /* very small space between title row and counts */
}
.state-meta-grid .meta-content p.card-text { margin-top: 0.125rem; margin-bottom: 0; }

/* Make the subtitle / counts slightly smaller than body text */
.state-meta-grid .meta-content p.card-text.small {
    font-size: 11px; /* ~13.6px */
    color: #b2b8c1; /* slightly muted (Bootstrap gray-600) */
}

/* Mobile column ordering: ensure left sidebar appears above right sidebar and both appear before main content */
@media (max-width: 767.98px) {
    .row { display: flex; flex-wrap: wrap; }
    /* Put main content first, then left sidebar, then right sidebar */
    .row > .col-md-6 { order: 1; width: 100% !important; }
    .row > .col-md-3:first-child { order: 2; width: 100% !important; }
    .row > .col-md-3:last-child { order: 3; width: 100% !important; }
    /* remove sticky behaviour on small screens to avoid overlay issues */
    .left-sidebar, .right-sidebar { position: static; top: auto; }
}