/* =========================================================
   SIR SEARCH PORTAL
   Version: 1.0
   Responsive Design: Desktop, Tablet and Mobile
   ========================================================= */


/* =========================
   1. ROOT VARIABLES
   ========================= */

:root {
    --primary-blue: #F97D09;
    --primary-blue-dark: #F97D09;
    --primary-blue-light: #e8f1ff;

    --success-green: #F97D09;
    --success-green-dark: #F97D09;
    --success-green-light: #e7f8f0;

    --page-background: #f4f7fb;
    --card-background: #ffffff;

    --text-primary: #0f1f3d;
    --text-secondary: #5d6d85;
    --text-muted: #8492a6;

    --border-color: #dfe7f1;

    --purple-light: #f0e8ff;
    --purple-text: #673ab7;

    --orange-light: #fff0df;
    --orange-text: #F97D09;

    --green-light: #dcf8e8;
    --green-text: #F97D09;

    --cyan-light: #def3ff;
    --cyan-text: #08739c;

    --border-radius: 16px;
    --border-radius-small: 10px;

    --shadow-soft: 0 5px 20px rgba(15, 31, 61, 0.07);
    --shadow-medium: 0 10px 30px rgba(15, 31, 61, 0.12);
}


/* =========================================================
   BJP-INSPIRED COLOR PALETTE
   ========================================================= */

:root {
    --saffron: #ff9933;
    --saffron-dark: #e87500;
    --saffron-light: #fff1df;

    --india-green: #F97D09;
    --india-green-dark: #F97D09;
    --india-green-light: #e6f6e4;

    --deep-blue: #F97D09;
    --deep-blue-light: #e7f1ff;

    --navy: #10254a;
    --page-background: #f7f8f4;
}


/* =========================
   STATISTICS SECTION
   ========================= */

.stats-section {
    padding: 24px 0 5px;
}

.stat-card {
    position: relative;
    display: flex;
    align-items: center;
    gap: 15px;
    height: 100%;
    min-height: 125px;
    padding: 20px;
    overflow: hidden;
    background: #ffffff;
    border: 1px solid #e1e8f0;
    border-radius: 16px;
    box-shadow: 0 5px 20px rgba(15, 31, 61, 0.07);
    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 28px rgba(15, 31, 61, 0.12);
}

.stat-icon {
    display: flex;
    flex: 0 0 58px;
    align-items: center;
    justify-content: center;
    width: 58px;
    height: 58px;
    border-radius: 50%;
    font-size: 1.45rem;
}

.stat-content {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.stat-label {
    margin-bottom: 1px;
    color: var(--navy);
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

.stat-number {
    color: var(--navy);
    font-size: 1.65rem;
    font-weight: 850;
    line-height: 1.25;
}

.stat-description {
    margin-top: 2px;
    color: #64748b;
    font-size: 0.78rem;
}


/* Saffron */

.stat-card-saffron {
    border-top: 4px solid var(--saffron);
}

.stat-card-saffron .stat-icon {
    background-color: var(--saffron-light);
    color: var(--saffron-dark);
}


/* Green */

.stat-card-green {
    border-top: 4px solid var(--india-green);
}

.stat-card-green .stat-icon {
    background-color: var(--india-green-light);
    color: var(--india-green);
}


/* Blue */

.stat-card-blue {
    border-top: 4px solid var(--deep-blue);
}

.stat-card-blue .stat-icon {
    background-color: var(--deep-blue-light);
    color: var(--deep-blue);
}


/* Constituency */

.stat-card-constituency {
    border-top: 4px solid var(--saffron);
}

.stat-card-constituency .stat-icon {
    background-color: var(--india-green-light);
    color: var(--india-green);
}


/* =========================
   MOBILE STATISTICS
   ========================= */

@media (max-width: 767.98px) {

    .stats-section {
        padding-top: 16px;
    }

    .stat-card {
        min-height: 105px;
        padding: 14px;
        gap: 10px;
    }

    .stat-icon {
        flex-basis: 45px;
        width: 45px;
        height: 45px;
        font-size: 1.1rem;
    }

    .stat-label {
        font-size: 0.7rem;
    }

    .stat-number {
        font-size: 1.3rem;
    }

    .stat-description {
        font-size: 0.7rem;
    }
}


@media (max-width: 420px) {

    .stat-card {
        align-items: flex-start;
        flex-direction: column;
        min-height: 145px;
    }
}


/* =========================
   2. GLOBAL
   ========================= */

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    background-color: var(--page-background);
    color: var(--text-primary);
    font-family:
        Inter,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Roboto,
        Helvetica,
        Arial,
        sans-serif;
    font-size: 16px;
    line-height: 1.5;
}

button,
input,
select {
    font-family: inherit;
}


/* =========================
   3. MAIN CONTAINER
   ========================= */

.container {
    max-width: 1500px;
}


/* =========================
   4. HERO / HEADER
   ========================= */

.hero-section {
    background: linear-gradient(
        135deg,
        #F97D09 0%,
        #F97D09 55%,
        #F97D09 100%
    );
    color: #ffffff;
    padding: 28px 0;
    box-shadow: 0 3px 15px rgba(0, 0, 0, 0.12);
}

.logo {
    width: 90px;
    height: 90px;
    object-fit: contain;
    border-radius: 50%;
    background-color: #ffffff;
    padding: 4px;
}

.hero-title {
    margin: 0 0 5px;
    font-size: 2.2rem;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.hero-subtitle {
    margin: 0;
    color: rgba(255, 255, 255, 0.88);
    font-size: 1.05rem;
}


/* =========================
   5. SEARCH CARDS
   ========================= */

.search-card {
    height: 100%;
    overflow: hidden;
    background-color: var(--card-background);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-soft) !important;
}

.search-card .card-header {
    padding: 17px 22px;
    border: 0;
}

.search-card .card-header.bg-primary {
    background-color: var(--primary-blue) !important;
}

.search-card .card-header.bg-success {
    background-color: var(--success-green) !important;
}

.search-card .card-header h4 {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 1.3rem;
    font-weight: 750;
    text-transform: uppercase;
}

.search-card .card-body {
    padding: 22px;
}


/* =========================
   6. FORM ELEMENTS
   ========================= */

.form-label {
    margin-bottom: 7px;
    color: var(--text-primary);
    font-size: 0.92rem;
    font-weight: 600;
}

.form-control,
.form-select {
    min-height: 54px;
    padding: 11px 15px;
    background-color: #ffffff;
    color: var(--text-primary);
    border: 1px solid #ced9e8;
    border-radius: var(--border-radius-small);
    font-size: 1rem;
    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

.form-control::placeholder {
    color: #8995a7;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 4px rgba(20, 99, 214, 0.12);
}

.search-card .btn {
    min-height: 54px;
    border: 0;
    border-radius: var(--border-radius-small);
    font-size: 1.05rem;
    font-weight: 700;
    text-transform: uppercase;
    transition:
        transform 0.15s ease,
        box-shadow 0.15s ease,
        opacity 0.15s ease;
}

.search-card .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 15px rgba(15, 31, 61, 0.15);
}

.search-card .btn:active {
    transform: translateY(0);
}

.btn-primary {
    background-color: var(--primary-blue);
}

.btn-primary:hover,
.btn-primary:focus {
    background-color: var(--primary-blue-dark);
}

.btn-success {
    background-color: var(--success-green);
}

.btn-success:hover,
.btn-success:focus {
    background-color: var(--success-green-dark);
}


/* =========================
   7. SEARCH RESULTS SECTION
   ========================= */

.results-section {
    margin-bottom: 50px;
    padding: 20px;
    background-color: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-soft);
}

.results-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    margin-bottom: 18px;
}

.results-title-group {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.results-title {
    margin: 0;
    color: var(--text-primary);
    font-size: 1.45rem;
    font-weight: 800;
}

#resultCount {
    padding: 8px 13px;
    background-color: var(--primary-blue-light) !important;
    color: var(--primary-blue);
    border-radius: 50px;
    font-size: 0.9rem !important;
    font-weight: 700;
}

.search-time {
    color: var(--text-secondary);
    font-size: 0.9rem;
}


/* =========================
   8. RESULT CARDS
   ========================= */

.result-card {
    position: relative;
    display: flex;
    align-items: center;
    gap: 18px;
    margin-bottom: 14px;
    padding: 18px 20px;
    background-color: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease,
        border-color 0.2s ease;
}

.result-card:last-child {
    margin-bottom: 0;
}

.result-card:hover {
    transform: translateY(-2px);
    border-color: #bfd1ea;
    box-shadow: var(--shadow-soft);
}

.result-avatar {
    display: flex;
    flex: 0 0 58px;
    align-items: center;
    justify-content: center;
    width: 58px;
    height: 58px;
    background-color: var(--primary-blue);
    color: #ffffff;
    border-radius: 50%;
    font-size: 1.5rem;
    font-weight: 500;
    text-transform: uppercase;
}

.result-main {
    flex: 1;
    min-width: 0;
}

.result-name-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.result-name {
    margin: 0;
    color: var(--text-primary);
    font-size: 1.25rem;
    font-weight: 800;
    word-break: break-word;
}

.match-percent {
    color: #F97D09;
    font-size: 0.82rem;
    font-weight: 700;
}

.result-relation {
    margin: 3px 0 9px;
    color: var(--text-secondary);
    font-size: 0.96rem;
}

.result-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.info-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 10px;
    border-radius: 50px;
    font-size: 0.84rem;
    font-weight: 500;
    white-space: nowrap;
}

.badge-booth {
    background-color: var(--primary-blue-light);
    color: var(--primary-blue);
}

.badge-house {
    background-color: var(--purple-light);
    color: var(--purple-text);
}

.badge-age {
    background-color: var(--orange-light);
    color: var(--orange-text);
}

.badge-gender {
    background-color: var(--green-light);
    color: var(--green-text);
}

.badge-constituency {
    background-color: var(--cyan-light);
    color: var(--cyan-text);
}

.result-action {
    flex: 0 0 auto;
    text-align: right;
}

.result-serial {
    display: block;
    margin-bottom: 8px;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 700;
}

.btn-slip {
    min-height: 42px;
    padding: 8px 16px;
    background-color: #ffffff;
    color: var(--primary-blue);
    border: 1px solid var(--primary-blue);
    border-radius: 12px;
    font-weight: 700;
    white-space: nowrap;
    transition:
        color 0.2s ease,
        background-color 0.2s ease;
}

.btn-slip:hover {
    background-color: var(--primary-blue);
    color: #ffffff;
}


/* =========================
   9. EMPTY, LOADING & ERROR
   ========================= */

.state-message {
    padding: 35px 20px;
    text-align: center;
    background-color: #ffffff;
    border: 1px dashed #cad6e5;
    border-radius: 14px;
}

.state-message i {
    display: block;
    margin-bottom: 10px;
    color: var(--primary-blue);
    font-size: 2rem;
}

.state-message h3 {
    margin-bottom: 5px;
    font-size: 1.1rem;
    font-weight: 700;
}

.state-message p {
    margin: 0;
    color: var(--text-secondary);
}

.loading-spinner {
    width: 38px;
    height: 38px;
    margin-bottom: 12px;
}


/* =========================
   10. SIR SLIP MODAL
   ========================= */

#slipModal .modal-dialog {
    max-width: 720px;
}

#slipModal .modal-content {
    overflow: hidden;
    border: 0;
    border-radius: 22px;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.28);
}

#slipModal .modal-header {
    justify-content: center;
    min-height: 66px;
    padding: 15px 22px;
    background-color: #F97D09 !important;
    border: 0;
}

#slipModal .modal-title {
    margin: 0 auto;
    padding-left: 32px;
    font-size: 1.25rem;
    font-weight: 800;
    text-transform: uppercase;
}

#slipModal .btn-close {
    margin: 0;
}

#slipModal .modal-body {
    padding: 25px;
}

.slip-person-header {
    margin-bottom: 20px;
    text-align: center;
}

.slip-person-name {
    margin: 0 0 4px;
    color: var(--text-primary);
    font-size: 1.9rem;
    font-weight: 800;
}

.slip-constituency {
    margin: 0;
    color: var(--primary-blue);
    font-size: 1rem;
}

.slip-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.slip-field {
    min-height: 88px;
    padding: 13px 15px;
    background-color: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 15px;
}

.slip-label {
    display: block;
    margin-bottom: 4px;
    color: var(--text-secondary);
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
}

.slip-value {
    display: block;
    color: var(--text-primary);
    font-size: 1.08rem;
    font-weight: 750;
    word-break: break-word;
}

#slipModal .modal-footer {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    padding: 0 25px 25px;
    border: 0;
}

#slipModal .modal-footer .btn {
    width: 100%;
    min-height: 52px;
    margin: 0;
    border-radius: 12px;
    font-weight: 750;
    text-transform: uppercase;
}


/* =========================
   11. TABLET
   ========================= */

@media (max-width: 991.98px) {

    .hero-section {
        padding: 22px 0;
        text-align: center;
    }

    .logo {
        width: 75px;
        height: 75px;
        margin-bottom: 10px;
    }

    .hero-title {
        font-size: 1.9rem;
    }

    .search-card {
        height: auto;
    }

    .result-card {
        align-items: flex-start;
    }
}


/* =========================
   12. MOBILE
   ========================= */

@media (max-width: 767.98px) {

    body {
        font-size: 15px;
    }

    .container {
        padding-right: 12px;
        padding-left: 12px;
    }

    .hero-section {
        padding: 18px 0;
    }

    .logo {
        width: 65px;
        height: 65px;
    }

    .hero-title {
        font-size: 1.6rem;
    }

    .hero-subtitle {
        font-size: 0.9rem;
    }

    .search-card .card-header {
        padding: 14px 16px;
    }

    .search-card .card-header h4 {
        font-size: 1.05rem;
    }

    .search-card .card-body {
        padding: 16px;
    }

    .form-control,
    .form-select {
        min-height: 52px;
        font-size: 16px;
    }

    .results-section {
        padding: 14px;
    }

    .results-header {
        align-items: flex-start;
        flex-direction: column;
        gap: 7px;
    }

    .results-title {
        font-size: 1.25rem;
    }

    .search-time {
        font-size: 0.8rem;
    }

    .result-card {
        display: grid;
        grid-template-columns: 48px 1fr;
        gap: 12px;
        padding: 15px;
    }

    .result-avatar {
        width: 48px;
        height: 48px;
        flex-basis: 48px;
        font-size: 1.2rem;
    }

    .result-main {
        width: 100%;
    }

    .result-name {
        font-size: 1.08rem;
    }

    .result-relation {
        font-size: 0.9rem;
    }

    .result-badges {
        gap: 6px;
    }

    .info-badge {
        padding: 5px 8px;
        font-size: 0.76rem;
    }

    .result-action {
        grid-column: 1 / -1;
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        padding-top: 4px;
    }

    .result-serial {
        margin: 0;
    }

    .btn-slip {
        min-height: 42px;
    }

    #slipModal .modal-dialog {
        margin: 8px;
    }

    #slipModal .modal-content {
        max-height: calc(100vh - 16px);
        border-radius: 16px;
    }

    #slipModal .modal-body {
        overflow-y: auto;
        padding: 17px;
    }

    .slip-person-name {
        font-size: 1.5rem;
    }

    .slip-grid {
        grid-template-columns: 1fr;
        gap: 9px;
    }

    .slip-field {
        min-height: auto;
        padding: 11px 13px;
    }

    #slipModal .modal-footer {
        grid-template-columns: 1fr;
        padding: 0 17px 17px;
    }
}


/* =========================
   13. VERY SMALL MOBILE
   ========================= */

@media (max-width: 374.98px) {

    .hero-title {
        font-size: 1.4rem;
    }

    .results-title-group {
        align-items: flex-start;
        flex-direction: column;
        gap: 7px;
    }

    .result-card {
        grid-template-columns: 42px 1fr;
        padding: 12px;
    }

    .result-avatar {
        width: 42px;
        height: 42px;
        font-size: 1rem;
    }

    .result-badges {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* =========================================================
   FINAL HERO HEADER OVERRIDE
   Desktop: Lotus | Title | Leaders
   Mobile: Lotus + Title | Leaders below
   ========================================================= */

.hero-section {
    width: 100%;
    padding: 10px 0;
    overflow: hidden;

    background: linear-gradient(
        135deg,
        #ff7a00 0%,
        #ff8c00 55%,
        #f36f00 100%
    );

    color: #ffffff;

    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.hero-header-row {
    min-height: 120px;
}


/* LEFT: LOTUS */

.header-lotus-image {
    display: block;

    width: 110px;
    height: 110px;

    margin: 0 auto;

    object-fit: cover;
    object-position: center;

    border-radius: 14px;
}


/* CENTER: TITLE */

.hero-text-section {
    color: #ffffff;
}

.hero-title {
    margin: 0;

    color: #ffffff;

    font-size: clamp(2rem, 3vw, 3.2rem);

    font-weight: 800;

    line-height: 1.15;

    letter-spacing: -0.5px;
}

.hero-subtitle {
    margin: 7px 0 0;

    color: rgba(255, 255, 255, 0.95);

    font-size: clamp(1rem, 1.3vw, 1.25rem);

    font-weight: 500;
}


/* RIGHT: LEADERS */

.header-leaders-section {
    display: flex;

    align-items: center;

    justify-content: flex-end;

    min-width: 0;
}

.header-leaders-image {
    display: block;

    width: 100%;
    max-width: 700px;

    height: auto;

    object-fit: contain;

    border-radius: 12px;
}


/* TABLET */

@media (max-width: 991.98px) {

    .hero-section {
        padding: 10px 0;
    }

    .hero-header-row {
        min-height: 95px;
    }

    .header-lotus-image {
        width: 85px;
        height: 85px;
    }

    .hero-title {
        font-size: 1.9rem;
    }

    .hero-subtitle {
        font-size: 0.95rem;
    }

    .header-leaders-image {
        max-width: 100%;
    }
}


/* MOBILE */

@media (max-width: 767.98px) {

    .hero-section {
        padding: 8px 0;
    }

    .hero-header-row {
        min-height: auto;
    }

    .header-lotus-image {
        width: 68px;
        height: 68px;

        border-radius: 10px;
    }

    .hero-text-section {
        text-align: left;
    }

    .hero-title {
        font-size: 1.55rem;
    }

    .hero-subtitle {
        margin-top: 3px;

        font-size: 0.85rem;
    }

    .header-leaders-section {
        justify-content: center;

        margin-top: 8px;
    }

    .header-leaders-image {
        width: 100%;
        max-width: 600px;

        height: auto;

        object-fit: contain;

        border-radius: 8px;
    }
}


/* VERY SMALL MOBILE */

@media (max-width: 374.98px) {

    .header-lotus-image {
        width: 58px;
        height: 58px;
    }

    .hero-title {
        font-size: 1.3rem;
    }

    .hero-subtitle {
        font-size: 0.78rem;
    }
}