/* =======================================================
   STYLE UTAMA: NUANSA HIJAU-PUTIH, DOODLE & BATIK KREATIF
   ======================================================= */
@import url('https://fonts.googleapis.com/css2?family=Comic+Neue:wght@400;700&family=Fredoka+One&family=Plus+Jakarta+Sans:wght@400;600;800&display=swap');

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

:root {
    --primary-green: #1b5e20;
    --medium-green: #2e7d32;
    --light-green: #a1dba3;
    --bg-green-soft: #f1fbf2;
    --pure-white: #ffffff;
    --dark-text: #1c311e;
    --doodle-border: #4caf50;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Plus Jakarta Sans', sans-serif;
    background-color: var(--bg-green-soft);
    /* Pola Batik Geometris Doodle Menggunakan Gambar SVG Inline */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80' viewBox='0 0 80 80'%3E%3Cpath d='M40 0 L80 40 L40 80 L0 40 Z' fill='none' stroke='%23d0edd3' stroke-width='1.5' stroke-dasharray='5 3'/%3E%3Cpath d='M40 10 L70 40 L40 70 L10 40 Z' fill='none' stroke='%23e2f5e5' stroke-width='1'/%3E%3Ccircle cx='40' cy='40' r='6' fill='none' stroke='%232e7d32' stroke-width='1.5' stroke-dasharray='2 2' opacity='0.4'/%3E%3Ccircle cx='40' cy='40' r='2' fill='%232e7d32' opacity='0.3'/%3E%3C/svg%3E");
    color: var(--dark-text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* --- ANIMASI FULL --- */
@keyframes floatAnimation {
    0% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-10px) rotate(0.5deg); }
    100% { transform: translateY(0px) rotate(0deg); }
}

@keyframes pulseAnimation {
    0% { transform: scale(1); box-shadow: 0 4px 15px rgba(46, 125, 50, 0.2); }
    50% { transform: scale(1.03); box-shadow: 0 8px 25px rgba(46, 125, 50, 0.4); }
    100% { transform: scale(1); box-shadow: 0 4px 15px rgba(46, 125, 50, 0.2); }
}

@keyframes titleFade {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes lineDraw {
    from { width: 0; }
    to { width: 150px; }
}

.animate-float {
    animation: floatAnimation 5s ease-in-out infinite;
}

.animate-pulse {
    animation: pulseAnimation 2.5s ease-in-out infinite;
}

/* --- HEADER STYLE --- */
.main-header {
    text-align: center;
    padding: 40px 20px 30px;
    background: rgba(255, 255, 255, 0.95);
    border-bottom: 5px dashed var(--primary-green);
    border-radius: 0 0 40px 40px;
    box-shadow: 0 10px 30px rgba(27, 94, 32, 0.05);
    animation: titleFade 1s ease-out;
    position: relative;
    max-width: 900px;
    margin: 0 auto 30px;
    width: 100%;
}

.logo-doodle {
    font-family: 'Comic Neue', cursive;
    font-weight: bold;
    font-size: 1.5rem;
    color: var(--medium-green);
    margin-bottom: 5px;
}

.main-header h1 {
    font-family: 'Fredoka One', cursive;
    font-size: 2.3rem;
    color: var(--primary-green);
    margin: 10px 0;
    letter-spacing: 1px;
}

.subtitle {
    font-size: 1.1rem;
    color: #555;
    margin-bottom: 15px;
}

.decor-line {
    height: 4px;
    background: var(--medium-green);
    margin: 0 auto;
    border-radius: 2px;
    animation: lineDraw 1.5s ease-out forwards;
}

/* --- GRID CONTAINER --- */
.container {
    max-width: 1100px;
    width: 100%;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    gap: 40px;
    padding: 20px;
    flex-wrap: wrap;
    flex: 1;
}

/* --- KANDIDAT CARD (Tampilan Identik) --- */
.card-paslon {
    background: var(--pure-white);
    border: 3px dashed var(--doodle-border);
    border-radius: 30px;
    width: 460px;
    padding: 35px;
    position: relative;
    box-shadow: 0 15px 35px rgba(27, 94, 32, 0.06);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.card-paslon:hover {
    transform: translateY(-12px) scale(1.01) !important;
    border-style: solid;
    border-color: var(--primary-green);
    box-shadow: 0 25px 50px rgba(27, 94, 32, 0.15);
}

.card-paslon.updating {
    opacity: 0.6;
    transform: scale(0.98);
}

.nomor-urut {
    position: absolute;
    top: -25px;
    left: 35px;
    background: var(--primary-green);
    color: var(--pure-white);
    font-family: 'Fredoka One', cursive;
    font-size: 2rem;
    width: 65px;
    height: 65px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 4px solid var(--pure-white);
    box-shadow: 0 8px 20px rgba(27, 94, 32, 0.3);
}

.frame-foto {
    width: 100%;
    height: 180px;
    background: #eef9f0;
    border: 2px dashed var(--light-green);
    border-radius: 20px;
    margin-top: 15px;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.frame-foto::before {
    content: "";
    position: absolute;
    width: 200%;
    height: 200%;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40' viewBox='0 0 40 40'%3E%3Ccircle cx='20' cy='20' r='10' fill='none' stroke='%23dbf3de' stroke-width='1'/%3E%3C/svg%3E");
    opacity: 0.6;
}

.avatar-doodle {
    font-size: 4.5rem;
    z-index: 1;
}

.nama-paslon {
    font-family: 'Fredoka One', cursive;
    color: var(--primary-green);
    font-size: 1.5rem;
    margin: 0 0 20px 0;
    text-align: center;
}

.visi-misi-box {
    background: #fcfdfc;
    border: 2px solid #eef3ef;
    border-radius: 20px;
    padding: 20px;
    margin-bottom: 25px;
    height: 220px;
    overflow-y: auto;
}

.visi-misi-box::-webkit-scrollbar {
    width: 6px;
}
.visi-misi-box::-webkit-scrollbar-thumb {
    background: var(--light-green);
    border-radius: 10px;
}

.visi-misi-box h3 {
    margin: 0 0 5px 0;
    font-size: 1rem;
    color: var(--medium-green);
    font-family: 'Fredoka One', cursive;
}

.visi-misi-box p {
    margin: 0 0 15px 0;
    font-size: 0.95rem;
    line-height: 1.5;
    color: #444;
}

/* --- TOMBOL PILIH (Halaman Voting) --- */
.btn-pilih {
    width: 100%;
    background: var(--primary-green);
    color: var(--pure-white);
    border: none;
    padding: 16px;
    font-family: 'Fredoka One', cursive;
    font-size: 1.2rem;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s;
    letter-spacing: 0.5px;
}

.btn-pilih:hover {
    background: #0f3d13;
    transform: translateY(-2px);
}

/* --- PANEL REAL-TIME (Halaman Perhitungan Suara) --- */
/* Dimensi dan letak dibuat presisi menyamai tombol pilih */
.result-box-wrapper {
    background: #eef9f0;
    border: 2px solid var(--medium-green);
    border-radius: 20px;
    padding: 12px 20px;
    min-height: 58px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.result-stats {
    display: flex;
    justify-content: space-between;
    font-family: 'Fredoka One', cursive;
    font-size: 1.1rem;
    color: var(--primary-green);
    margin-bottom: 5px;
}

.progress-bar-container {
    width: 100%;
    height: 12px;
    background: #d4edd7;
    border-radius: 6px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: var(--primary-green);
    width: 0%;
    border-radius: 6px;
    transition: width 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- BANNER INFORMASI --- */
.countdown-badge {
    position: absolute;
    right: 30px;
    top: 30px;
    background: #fff3cd;
    border: 2px dashed #ffc107;
    color: #856404;
    font-family: 'Fredoka One', cursive;
    padding: 8px 15px;
    border-radius: 15px;
    font-size: 1.1rem;
}

.total-suara-banner {
    background: var(--primary-green);
    color: var(--pure-white);
    max-width: 350px;
    width: 100%;
    margin: 0 auto 10px;
    text-align: center;
    padding: 12px 20px;
    border-radius: 20px;
    font-family: 'Fredoka One', cursive;
    font-size: 1.2rem;
    box-shadow: 0 5px 15px rgba(27, 94, 32, 0.2);
}

.alert-msg {
    max-width: 500px;
    width: 90%;
    margin: 10px auto;
    padding: 12px;
    border-radius: 15px;
    text-align: center;
    font-weight: bold;
}
.alert-success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.alert-already { background: #fff3cd; color: #856404; border: 1px solid #ffeeba; }

.highlight-timer {
    color: #d9534f;
    font-weight: bold;
}

/* --- FOOTER --- */
.footer {
    text-align: center;
    padding: 30px 20px;
    margin-top: 40px;
    background: rgba(255, 255, 255, 0.95);
    border-top: 3px dashed var(--light-green);
    font-size: 0.95rem;
    color: #555;
}

.link-switch {
    color: var(--primary-green);
    text-decoration: none;
    font-weight: bold;
    font-family: 'Fredoka One', cursive;
    font-size: 1.05rem;
    transition: color 0.2s;
}

.link-switch:hover {
    color: #0f3d13;
    text-decoration: underline;
}
/* --- TAMPILAN FOTO PASLON ASLI --- */
.foto-kandidat {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Menjaga proporsi foto agar tidak gepeng */
    object-position: top; /* Fokus ke wajah/bagian atas foto */
    border-radius: 18px; /* Menyesuaikan lengkungan frame */
    position: relative;
    z-index: 2; /* Agar foto berada di atas background pattern */
}
