/* =====================================================
   🗳️ TSJE Official Style - Electoral Simulator
   Exact replica of the Paraguayan voting machine UI
   ===================================================== */

:root {
    --tsje-bg: #D1D1D1; /* Background gray from screenshots */
    --tsje-header-bg: #000000;
    --tsje-blue: #005AAB; /* Closer to official blue */
    --tsje-blue-light: #007bff;
    --tsje-green: #29A745;
    --tsje-orange: #FF8000; /* More vibrant orange for Reset */
    --tsje-gray: #f8f9fa;
    --tsje-border: #999999;
    --tsje-text: #000000;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    user-select: none;
}

body {
    background-color: #000; /* Black background as requested */
    font-family: "Nimbus Sans L", "Arial", sans-serif;
    color: var(--tsje-text);
    overflow: hidden;
    height: 100vh;
    width: 100vw;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* ── Container Layout ── */
.official-wrapper {
    display: flex;
    flex-direction: column;
    width: 1280px;
    height: 800px;
    background-color: var(--tsje-bg);
    box-shadow: 0 0 50px rgba(255,255,255,0.1);
    border: none;
    transform-origin: center;
    position: absolute; /* Ensures flex centering works perfectly with scale */
}

/* ── Top Header ── */
.official-header {
    background-color: #545859; /* R84 G88 B89 */
    height: 90px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 40px;
    border-bottom: none; /* Removed white border */
}

.official-sub-header {
    background-color: #545859; /* R84 G88 B89 */
    color: white;
    font-size: 11px;
    padding: 2px 40px;
    display: flex;
    gap: 15px;
    border-bottom: 1px solid #666;
}

.official-sub-header span {
    font-weight: bold;
    color: #aaa;
}

.official-sub-header b {
    color: #fff;
    text-transform: uppercase;
}

.official-header .logo-container {
    height: 80%;
}

.official-header .logo-container img {
    height: 100%;
}

.official-header .election-info {
    color: white;
    text-align: center;
}

.official-header .election-info h1 {
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 2px;
}

.official-header .election-info p {
    font-size: 14px;
    opacity: 0.8;
}

/* ── Control Bar (BLUE or BLACK) ── */
.official-control-bar {
    background-color: #545859; /* R84 G88 B89 */
    height: 55px;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    box-shadow: inset 0 -3px 0 rgba(0,0,0,0.2);
}

.official-control-bar.black {
    background-color: #545859; /* R84 G88 B89 */
}

.official-control-bar .title-box {
    background-color: #6c757d;
    padding: 2px 40px;
    border-bottom: 2px solid white;
    font-size: 24px;
    font-weight: 900;
}

.official-control-bar h2 {
    font-size: 24px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ── Main Content Area ── */
.official-content {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
    background-color: var(--tsje-bg);
}

/* ── Candidate Cards Grid ── */
.official-grid {
    display: grid;
    gap: 20px;
    width: 100%;
}

.official-grid.cols-3 {
    grid-template-columns: repeat(3, 1fr);
}

.official-grid.cols-2 {
    grid-template-columns: repeat(2, 1fr);
}

.official-grid.cols-4 {
    grid-template-columns: repeat(4, 1fr);
}

/* ── Official Candidate Card ── */
.official-card {
    background-color: white;
    border: 1px solid var(--tsje-border);
    display: flex;
    flex-direction: column;
    padding: 15px;
    cursor: pointer;
    text-align: center;
    min-height: 250px;
}

.official-card .movement-name {
    font-size: 24px;
    font-weight: 900;
    margin-bottom: 20px;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-transform: uppercase;
}

.official-card .card-body {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 30px;
    flex: 1;
}

.official-card .photo-box {
    width: 150px;
    height: 150px;
}

.official-card .photo-box img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.official-card .list-info {
    text-align: center;
}

.official-card .list-label {
    font-size: 20px;
    font-weight: bold;
}

.official-card .list-number {
    font-size: 80px;
    font-weight: 900;
    line-height: 0.8;
}

.official-card .mhc-label {
    font-size: 18px;
    font-weight: bold;
    margin-top: 5px;
}

.official-card .candidate-name {
    margin-top: 20px;
    font-size: 32px;
    font-weight: bold;
    text-transform: capitalize;
}

/* ── Blank Vote Card ── */
.official-card.blank {
    justify-content: center;
}

.official-card.blank .blank-title {
    font-size: 48px;
    font-weight: 900;
    text-transform: uppercase;
}

/* ── Blank Vote Card ── */
.official-card.blank {
    justify-content: center;
    align-items: center;
    background-color: #f8f9fa;
}

.official-card.blank .blank-title {
    font-size: 24px;
    font-weight: 900;
    text-transform: uppercase;
    color: #666;
}

/* ── Junta List Card (Massive) ── */
.junta-card {
    background-color: white;
    border: 1px solid var(--tsje-border);
    padding: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    text-align: center;
    min-height: 400px;
}

.junta-card .junta-list-title {
    font-size: 80px;
    font-weight: 900;
    margin-bottom: 60px;
}

.junta-card .junta-movement {
    font-size: 48px;
    font-weight: 900;
    text-transform: uppercase;
}

/* ── Preferential Grid ── */
/* ── Preferential Screen Header ── */
.pref-header {
    background-color: white;
    text-align: center;
    padding: 10px; /* Reduced padding */
    margin-bottom: 10px; /* Reduced margin */
    border: 1px solid #ccc;
}

.pref-header h3 {
    font-size: 20px; /* Smaller font */
    font-weight: bold;
    margin-bottom: 2px;
}

.pref-header h4 {
    font-size: 24px; /* Smaller font */
    font-weight: 900;
    text-transform: uppercase;
}

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

.pref-card {
    background: #ffffff;
    border: 1px solid #bdbdbd;
    padding: 3% 4%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    aspect-ratio: 2.2 / 1; 
    cursor: pointer;
    position: relative;
    border-radius: 4px;
    width: 100%;
    overflow: hidden;
}

.pref-card-photo {
    width: 33%;
    height: 100%; 
    display: flex;
    align-items: center;
    justify-content: center;
}

.pref-card-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 4px;
}

.pref-card-content {
    text-align: center;
    width: 63%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.pref-card-content .opcion-label {
    font-size: 20px;
    font-weight: bold;
    color: #000;
}

.pref-card-content .numero-val {
    font-size: 32px;
    font-weight: bold;
    color: #000;
}

.pref-card-content .pref-card-name {
    font-size: 18px;
    font-weight: normal;
    color: #000;
    margin-top: 5%;
    line-height: 1.1;
}

/* ── Confirmation Screen (New Layout) ── */
.confirm-wrapper {
    display: flex;
    gap: 10px;
    height: 100%;
}

.confirm-main {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.confirm-column {
    background-color: white;
    border: 1px solid var(--tsje-border);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    position: relative;
}

.confirm-category-title {
    font-size: 24px;
    font-weight: 800;
    margin-bottom: 5px;
    text-transform: uppercase;
}

.confirm-separator {
    width: 90%;
    height: 1px;
    background-color: #ccc;
    margin-bottom: 15px;
}

.confirm-movement {
    font-size: 28px;
    font-weight: 900;
    margin-bottom: 20px;
    text-transform: uppercase;
}

.confirm-lista {
    font-size: 32px;
    font-weight: 900;
    margin-bottom: 15px;
}

.confirm-photo {
    width: 180px;
    height: 200px;
    margin-bottom: 15px;
}

.confirm-photo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.confirm-name {
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 5px;
}

.confirm-option {
    font-size: 24px;
    font-weight: 600;
}

.btn-modify-footer {
    margin-top: auto;
    background-color: #555;
    color: white;
    padding: 10px 40px;
    border: none;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    border-radius: 4px;
}

/* ── Confirmation Sidebar ── */
.confirm-sidebar {
    width: 200px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sidebar-btn {
    flex: 1;
    border: none;
    color: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    text-align: center;
    padding: 20px;
}

.sidebar-btn.reset {
    background-color: #FF6600;
}

.sidebar-btn.print {
    background-color: #009933;
}

.sidebar-btn .icon {
    font-size: 48px;
    margin-bottom: 10px;
}

.sidebar-btn .text {
    font-size: 22px;
    font-weight: 900;
    line-height: 1.1;
}

/* ── Bottom Buttons ── */
.official-footer {
    height: 70px;
    background-color: #E2E2E2;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 40px;
    border-top: 2px solid #ccc;
}

.btn-official {
    height: 50px;
    padding: 0 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    font-weight: bold;
    text-transform: uppercase;
    cursor: pointer;
}

.btn-reset {
    background-color: var(--tsje-orange);
    color: white;
}

.btn-help {
    background-color: var(--tsje-blue);
    color: white;
    margin-left: 10px;
}

/* ── Animations ── */
.fade-in { animation: fadeIn 0.3s ease-in; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ── Guided Mode Highlight Animation ── */
@keyframes pulseHighlight {
    0% {
        box-shadow: 0 0 10px #FF0000, 0 0 20px #FF0000;
        border-color: #FF0000;
        transform: scale(1);
    }
    15% {
        box-shadow: 0 0 25px #FF0000, 0 0 50px #FF0000;
        border-color: #CC0000;
        transform: scale(1.03);
    }
    30% {
        box-shadow: 0 0 10px #FF0000, 0 0 20px #FF0000;
        border-color: #FF0000;
        transform: scale(1);
    }
    45% {
        box-shadow: 0 0 25px #FF0000, 0 0 50px #FF0000;
        border-color: #CC0000;
        transform: scale(1.03);
    }
    60% {
        box-shadow: 0 0 10px #FF0000, 0 0 20px #FF0000;
        border-color: #FF0000;
        transform: scale(1);
    }
    100% {
        box-shadow: 0 0 10px #FF0000, 0 0 20px #FF0000;
        border-color: #FF0000;
        transform: scale(1);
    }
}

.guide-pulse {
    animation: pulseHighlight 1.5s infinite ease-in-out;
    border: 3px solid #FF0000 !important;
    z-index: 10;
}
