/* =========================================
   1. FONTS & GLOBAL SETTINGS
   ========================================= */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+Devanagari:wght@400;600;800&display=swap');

body {
    font-family: 'Poppins', sans-serif;
    background-color: #f0f2f5;
    margin: 0;
    padding: 0;
}

.hidden {
    display: none !important;
}

.fade-in-up {
    animation: fadeInUp 0.5s ease-out forwards;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* =========================================
   2. LOGIN PAGES
   ========================================= */
.login-body {
    background: linear-gradient(135deg, #E0EAFC 0%, #CFDEF3 100%);
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-body-dark {
    background: linear-gradient(135deg, #0f2027 0%, #203a43 50%, #2c5364 100%);
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-card {
    border: none;
    border-radius: 15px;
    background: #ffffff;
    box-shadow: 0 20px 60px rgba(0, 43, 91, 0.2);
    overflow: hidden;
    max-width: 450px;
    width: 95%;
}

.login-header {
    background: #002B5B;
    color: white;
    padding: 15px;
    border-bottom: 4px solid #FFC107;
    position: relative;
    text-align: center;
}

.sec-logo-absolute {
    position: absolute;
    top: 10px;
    left: 15px;
    width: 50px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.4));
}

.govt-logo-center {
    width: 45px;
    margin-bottom: 5px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.4));
}

.govt-logo {
    width: 50px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
    margin-bottom: 10px;
}

.marathi-title {
    font-family: 'Noto Sans Devanagari', sans-serif;
    font-weight: 800;
    font-size: 1.4rem;
    line-height: 1.2;
    margin-bottom: 2px;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.marathi-subtitle {
    font-family: 'Noto Sans Devanagari', sans-serif;
    font-weight: 700;
    color: #FFC107;
    letter-spacing: 1.5px;
    font-size: 1.1rem;
    margin-top: 2px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.captcha-box {
    background-color: #f1f3f4;
    border: 1px solid #ced4da;
    border-radius: 8px;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

canvas {
    pointer-events: none;
}

.refresh-btn {
    background: none;
    border: none;
    color: #002B5B;
    cursor: pointer;
    font-size: 1.2rem;
    transition: transform 0.2s;
}

.refresh-btn:hover {
    transform: rotate(180deg);
    color: #FFC107;
}

/* =========================================
   3. SIDEBAR & NAVIGATION
   ========================================= */
.navbar {
    background: linear-gradient(90deg, #002B5B 0%, #005b9f 100%);
}

.sidebar {
    min-height: 100vh;
    background: #002B5B;
    color: white;
    transition: all 0.3s;
}

.sidebar .nav-link,
.nav-link-sidebar {
    color: rgba(255, 255, 255, 0.8);
    padding: 12px 15px;
    border-radius: 8px;
    margin-bottom: 5px;
    cursor: pointer;
    transition: 0.3s;
    display: block;
    text-decoration: none;
    font-size: 0.95rem;
}

.sidebar .nav-link:hover,
.sidebar .nav-link.active,
.nav-link-sidebar:hover,
.nav-link-sidebar.active {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    font-weight: 600;
}

.nav-link i,
.nav-link-sidebar i {
    width: 25px;
    text-align: center;
}

/* =========================================
   4. DASHBOARD COMPONENTS
   ========================================= */
.card {
    border: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    border-radius: 12px;
    background-color: white;
}

.card-header-custom {
    background-color: #002B5B;
    color: white;
    font-weight: bold;
}

.nav-tabs .nav-link {
    color: #002B5B !important;
    background-color: #e9ecef;
    font-weight: 600;
    margin-right: 5px;
    border: 1px solid #dee2e6;
}

.nav-tabs .nav-link.active {
    background-color: #002B5B !important;
    color: #ffffff !important;
    border-color: #002B5B;
}

.upload-area {
    background-color: #f8f9fa;
    border: 2px dashed #dee2e6;
    border-radius: 10px;
    padding: 15px;
    margin-top: 20px;
    text-align: center;
}

.table thead {
    background-color: #002B5B;
    color: white;
}

.table td {
    vertical-align: middle;
}

.data-table-container {
    max-height: 500px;
    overflow-y: auto;
    margin-top: 20px;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.data-table-container .table th,
.sticky-top {
    position: sticky;
    top: 0;
    background: #002B5B;
    color: white;
    z-index: 2;
    text-align: center;
}

.gan-badge {
    background-color: #e3f2fd;
    color: #0d47a1;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.85rem;
    margin: 2px;
    display: inline-block;
    border: 1px solid #90caf9;
}

.form-control,
.form-select {
    border-radius: 8px;
    padding: 10px 12px;
    border: 1px solid #ced4da;
}

.form-control:focus,
.form-select:focus {
    box-shadow: 0 0 0 0.2rem rgba(0, 43, 91, 0.25);
    border-color: #002B5B;
}

/* =========================================
   6. AUTO-FIT (Desktop) & SCROLL (Mobile)
   ========================================= */
#ganStatusContainer {
    display: flex !important;
    flex-wrap: nowrap !important;
    justify-content: center !important;
    align-items: stretch;
    gap: 15px;
    width: 100%;
    padding: 20px 10px;
    overflow-x: hidden;
}

#ganStatusContainer::-webkit-scrollbar {
    height: 6px;
}

#ganStatusContainer::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 10px;
}

.gan-card {
    flex: 1 1 0;
    min-width: 0;
    max-width: 160px;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    border: none;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    text-align: center;
    padding: 15px 5px;
    height: 150px;
    position: relative;
    overflow: hidden;
}

.gan-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
    z-index: 10;
}

.gan-card.completed {
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
    border-top: 5px solid #2e7d32;
}

.gan-card.completed .count {
    color: #2e7d32;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.gan-card.completed .label {
    background: #2e7d32;
    color: white;
}

.gan-card.completed .gan-name {
    color: #1b5e20;
}

.gan-card.pending {
    background: linear-gradient(135deg, #fff3e0 0%, #ffe0b2 100%);
    border-top: 5px solid #ef6c00;
}

.gan-card.pending .count {
    color: #ef6c00;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    font-weight: 800;
}

.gan-card.pending .label {
    background: #ef6c00;
    color: white;
}

.gan-card.pending .gan-name {
    color: #e65100;
}

.gan-name {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.2;
    height: 34px;
    margin-bottom: 5px;
}

.label {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 3px 10px;
    border-radius: 20px;
    width: 100%;
    max-width: 80px;
}

@media only screen and (max-width: 768px) {
    #ganStatusContainer {
        justify-content: flex-start !important;
        overflow-x: auto !important;
        padding-bottom: 15px;
        -webkit-overflow-scrolling: touch;
    }

    .gan-card {
        flex: 0 0 auto !important;
        min-width: 135px !important;
        width: 135px !important;
    }
}

@media print {
    @page {
        size: legal portrait;
        margin: 0.5in;
    }

    body {
        background: white;
        -webkit-print-color-adjust: exact;
    }

    #ganStatusContainer,
    .navbar,
    .btn-group,
    #pollHeaderInfo,
    .card-header,
    #sidebar,
    .no-print,
    button {
        display: none !important;
    }

    .report-page {
        width: 100%;
        border: none !important;
        box-shadow: none !important;
        page-break-after: always;
    }

    table {
        width: 100%;
        border-collapse: collapse;
    }

    th,
    td {
        border: 1px solid black !important;
        padding: 5px !important;
        font-size: 10pt !important;
        color: black !important;
    }
}

/* =========================================================
   🔥 7. COUNTING DASHBOARD - PREMIUM 3D TABLE DESIGN 🔥
   ========================================================= */

.cnt-booth-card-table {
    background: #fdfdfd;
    /* Table Top Surface */
    border-radius: 12px;
    border: 1px solid #d1d9e6;
    /* टेबलची जाडी (Thickness) दर्शवण्यासाठी खालील बॉर्डर */
    border-bottom: 6px solid #b0b8c5;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    padding: 0;
    margin-bottom: 20px;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    /* Smooth Animation */
    overflow: hidden;
    position: relative;
    cursor: pointer;
}

/* 🔥 3D HOVER EFFECT - टेबल वर उचलल्यासारखे दिसेल 🔥 */
.cnt-booth-card-table:hover {
    transform: translateY(-10px) scale(1.02);
    /* वर उचलणे */
    border-bottom: 10px solid #9aa5b6;
    /* जाडी वाढल्यासारखा फील */
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    /* खाली मोठी सावली */
    z-index: 10;
}

/* क्लिक केल्यावर दबल्याचा फील */
.cnt-booth-card-table:active {
    transform: translateY(2px);
    border-bottom: 2px solid #b0b8c5;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* --- COLORS & GRADIENTS --- */

/* 1. Header Strip (Default / Pending) */
.table-header-strip {
    background: linear-gradient(135deg, #4b6cb7 0%, #182848 100%);
    /* Royal Blue Gradient */
    color: #fff;
    padding: 8px;
    text-align: center;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 1px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    position: relative;
    z-index: 2;
}

/* 2. Completed (Green Gradient) */
.cnt-booth-card-table.status-done {
    border-color: #198754;
    border-bottom-color: #146c43;
    /* Darker Green Bottom */
    background: #f0fff4;
    /* Light Green Tint */
}

.cnt-booth-card-table.status-done:hover {
    border-bottom-color: #0f5132;
}

.cnt-booth-card-table.status-done .table-header-strip {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
}

/* 3. Issue (Red Gradient) */
.cnt-booth-card-table.status-issue {
    border-color: #dc3545;
    border-bottom-color: #b02a37;
    background: #fff5f5;
}

.cnt-booth-card-table.status-issue .table-header-strip {
    background: linear-gradient(135deg, #cb2d3e 0%, #ef473a 100%);
}

/* 4. Postal (Purple - Special Case styling inside JS inline styles mostly, but base here) */
.cnt-booth-card-table[style*="6f42c1"] {
    border-bottom-color: #520dc2 !important;
}

/* --- INSIDE CONTENT --- */

.table-surface {
    padding: 12px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 120px;
    /* Subtle Table Texture */
    background-image: radial-gradient(#e9ecef 10%, transparent 10%);
    background-size: 12px 12px;
}

/* Paper Document Look (Data Card) */
.table-paper-doc {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-left: 4px solid #ffc107;
    /* Yellow Accent for Paper */
    padding: 10px;
    border-radius: 6px;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.08);
    margin-bottom: 12px;
    position: relative;
    transition: transform 0.3s;
}

/* Paper Hover Lift */
.cnt-booth-card-table:hover .table-paper-doc {
    transform: translateY(-2px);
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.1);
}

/* Paper Clip Effect */
.table-paper-doc::before {
    content: '';
    position: absolute;
    top: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 35px;
    height: 8px;
    background: linear-gradient(to right, #6c757d, #adb5bd, #6c757d);
    /* Metallic Clip */
    border-radius: 4px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.table-booth-no {
    font-size: 1.2rem;
    font-weight: 800;
    color: #2c3e50;
    margin-bottom: 2px;
}

.table-booth-name {
    font-size: 0.8rem;
    color: #666;
    line-height: 1.3;
    font-weight: 500;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Action Button */
.cnt-booth-card-table button {
    border-radius: 20px;
    /* Rounded Pill Button */
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    transition: background 0.3s, transform 0.2s;
}

.cnt-booth-card-table:hover button {
    transform: scale(1.05);
    /* Button slightly grows on table hover */
}

/* Report & Modal Styles (Unchanged) */
.vm4-table th {
    background-color: #212529;
    color: white;
    text-align: center;
    vertical-align: middle;
}

.vm4-input {
    border: 2px solid #ced4da;
    text-align: center;
    font-weight: bold;
    font-size: 1.2rem;
    width: 100%;
    border-radius: 5px;
    color: #0d6efd;
}

.vm4-input:focus {
    background-color: #e8f0fe;
    outline: none;
    border-color: #0d6efd;
}

.total-row {
    background-color: #e9ecef;
    font-weight: bold;
}

.report-section {
    background-color: #fff;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.report-page {
    width: 100%;
    background: white;
    padding: 20px;
    margin: 20px auto;
    border: 1px solid #ddd;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

.report-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 10pt;
}

.report-table th,
.report-table td {
    border: 1px solid black;
    padding: 5px;
    text-align: center;
}

@media print {
    body * {
        visibility: hidden;
    }

    #printVM3Area,
    #printVM3Area * {
        visibility: visible;
    }

    #printVM3Area {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
    }

    .no-print {
        display: none !important;
    }

    .report-page {
        box-shadow: none;
        border: none;
        margin: 0;
        width: 100%;
    }
}

.collector-sidebar {
    width: 260px;
}