/* =========================================================
   PEGAWAI TERBAIK — FRONTEND
   ========================================================= */

.ptv-wrapper {
    max-width: 1100px;
    margin: 40px auto;
    padding: 0 20px 60px;
    font-family: inherit;
    color: #172033;
}

/* =========================================================
   HEADER
   ========================================================= */

.ptv-header {
    text-align: center;
    padding: 45px 25px 35px;
    margin-bottom: 25px;
    border-radius: 24px;
    background: linear-gradient(135deg, #1d4ed8, #4f46e5);
    color: #fff;
    box-shadow: 0 15px 40px rgba(37, 70, 180, .18);
}

.ptv-icon {
    width: 70px;
    height: 70px;
    margin: 0 auto 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,.16);
    border-radius: 50%;
    font-size: 36px;
}

.ptv-header h1 {
    margin: 0;
    color: #fff;
    font-size: clamp(28px, 5vw, 42px);
    font-weight: 800;
    line-height: 1.15;
}

.ptv-header p {
    margin: 14px auto 0;
    max-width: 650px;
    color: rgba(255,255,255,.9);
    font-size: 16px;
}

/* =========================================================
   PROGRESS
   ========================================================= */

.ptv-progress-box {
    background: #fff;
    padding: 24px;
    margin-bottom: 30px;
    border-radius: 18px;
    border: 1px solid #e7eaf0;
    box-shadow: 0 8px 25px rgba(20,30,60,.06);
}

.ptv-progress-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    margin-bottom: 12px;
}

.ptv-progress-info strong {
    font-size: 22px;
    color: #1d4ed8;
}

.ptv-progress-info span {
    color: #697386;
    font-size: 14px;
}

.ptv-progress {
    height: 12px;
    background: #edf0f5;
    border-radius: 20px;
    overflow: hidden;
}

.ptv-progress-bar {
    height: 100%;
    min-width: 0;
    border-radius: 20px;
    background: linear-gradient(90deg, #2563eb, #7c3aed);
    transition: width .6s ease;
}

.ptv-progress-percent {
    margin-top: 10px;
    text-align: right;
    font-size: 13px;
    font-weight: 700;
    color: #596579;
}

/* =========================================================
   KANDIDAT
   ========================================================= */

.ptv-candidates {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 22px;
}

.ptv-card {
    position: relative;
    background: #fff;
    padding: 25px 22px 22px;
    text-align: center;
    border: 1px solid #e6e9ef;
    border-radius: 22px;
    box-shadow: 0 8px 25px rgba(20,30,60,.06);
    transition:
        transform .25s ease,
        box-shadow .25s ease,
        border-color .25s ease;
}

.ptv-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 18px 40px rgba(20,30,60,.12);
    border-color: #c7d2fe;
}

.ptv-photo {
    width: 145px;
    height: 145px;
    margin: 0 auto 18px;
    overflow: hidden;
    border-radius: 50%;
    border: 5px solid #eef2ff;
    background: #f4f6fa;
}

.ptv-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.ptv-no-photo {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 55px;
}

.ptv-card h2 {
    margin: 5px 0 6px;
    font-size: 21px;
    line-height: 1.25;
    color: #172033;
}

.ptv-card p {
    margin: 0 0 18px;
    color: #778195;
    font-size: 14px;
}

/* =========================================================
   BUTTON PILIH
   ========================================================= */

.ptv-vote-button {
    width: 100%;
    min-height: 48px;
    padding: 12px 18px;
    border: 0;
    border-radius: 12px;
    background: #2563eb;
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition:
        transform .2s ease,
        box-shadow .2s ease,
        background .2s ease;
}

.ptv-vote-button:hover:not(:disabled) {
    background: #1d4ed8;
    transform: translateY(-2px);
    box-shadow: 0 8px 18px rgba(37,99,235,.25);
}

.ptv-vote-button:disabled {
    opacity: .65;
    cursor: not-allowed;
}

/* =========================================================
   TERIMA KASIH
   ========================================================= */

.ptv-thank-you {
    padding: 28px 22px;
    margin-bottom: 25px;
    text-align: center;
    background: #ecfdf5;
    border: 1px solid #bbf7d0;
    border-radius: 18px;
    animation: ptvFadeUp .5s ease;
}

.ptv-thank-you-icon {
    font-size: 38px;
    margin-bottom: 5px;
}

.ptv-thank-you h2 {
    margin: 5px 0;
    color: #166534;
}

.ptv-thank-you p {
    margin: 5px 0 0;
    color: #35704b;
}

/* =========================================================
   VOTING SELESAI
   ========================================================= */

.ptv-finished {
    margin-top: 20px;
    padding: 28px;
    text-align: center;
    border-radius: 18px;
    background: linear-gradient(135deg, #fff7ed, #fef3c7);
    border: 1px solid #fed7aa;
}

.ptv-finished h2 {
    margin: 0 0 8px;
    color: #9a3412;
}

.ptv-finished p {
    margin: 0 0 18px;
    color: #7c4a20;
}

.ptv-results-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 12px 24px;
    border: 0;
    border-radius: 12px;
    background: #7c3aed;
    color: #fff !important;
    text-decoration: none !important;
    font-weight: 700;
    cursor: pointer;
    transition: transform .2s ease, box-shadow .2s ease;
}

.ptv-results-button:hover {
    color: #fff !important;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(124,58,237,.25);
}


/* =====================================================
   HASIL AKHIR - PREMIUM
   ===================================================== */

#ptv-results {
    width: 100%;
    max-width: 1100px;
    margin: 50px auto 0;
    padding: 45px 25px;
    box-sizing: border-box;

    background: rgba(255, 255, 255, 0.96);
    border-radius: 28px;

    box-shadow:
        0 15px 50px rgba(0, 0, 0, 0.10);
}


/* HEADER HASIL */

#ptv-results .ptv-results-header {
    text-align: center;
    margin-bottom: 40px;
}

#ptv-results .ptv-results-trophy {
    font-size: 55px;
    margin-bottom: 10px;

    animation: ptvTrophyBounce 1s ease;
}

#ptv-results .ptv-results-header h2 {
    margin: 0 0 10px;

    font-size: 34px;
    line-height: 1.2;

    font-weight: 800;

    color: #172b4d;
}

#ptv-results .ptv-results-header p {
    margin: 0;

    font-size: 15px;

    color: #6b7280;
}


/* =====================================================
   RANKING
   ===================================================== */

#ptv-results .ptv-ranking {
    display: grid;

    grid-template-columns:
        repeat(3, 1fr);

    gap: 22px;

    align-items: stretch;
}


/* KARTU */

#ptv-results .ptv-result-card {
    position: relative;

    padding: 30px 20px;

    background: #ffffff;

    border: 1px solid #e7ebf0;

    border-radius: 20px;

    text-align: center;

    box-sizing: border-box;

    box-shadow:
        0 8px 25px rgba(0, 0, 0, 0.07);

    transition:
        transform 0.25s ease,
        box-shadow 0.25s ease;
}

#ptv-results .ptv-result-card:hover {
    transform: translateY(-5px);

    box-shadow:
        0 14px 35px rgba(0, 0, 0, 0.12);
}


/* JUARA 1 */

#ptv-results .ptv-rank-1 {
    transform: translateY(-10px);

    border: 2px solid #d6b65d;

    box-shadow:
        0 15px 40px rgba(190, 150, 40, 0.18);
}

#ptv-results .ptv-rank-1:hover {
    transform: translateY(-15px);
}


/* NOMOR RANK */

#ptv-results .ptv-rank-number {
    font-size: 38px;

    margin-bottom: 15px;
}


/* FOTO */

#ptv-results .ptv-result-photo {
    width: 115px;
    height: 115px;

    margin: 0 auto 18px;

    overflow: hidden;

    border-radius: 50%;

    border: 4px solid #edf1f5;

    box-sizing: border-box;
}

#ptv-results .ptv-result-photo img {
    width: 100%;
    height: 100%;

    object-fit: cover;
}


/* NAMA */

#ptv-results .ptv-result-card h3 {
    margin: 0 0 6px;

    font-size: 21px;

    font-weight: 750;

    color: #172b4d;
}


/* JABATAN */

#ptv-results .ptv-result-position {
    margin: 0 0 15px;

    font-size: 14px;

    color: #7b8491;
}


/* JUMLAH SUARA */

#ptv-results .ptv-result-votes {
    font-size: 16px;

    font-weight: 700;

    color: #374151;
}


/* PERSENTASE */

#ptv-results .ptv-result-percent {
    margin-top: 8px;

    font-size: 14px;

    color: #2271b1;

    font-weight: 600;
}


/* =====================================================
   PEMENANG
   ===================================================== */

#ptv-results .ptv-winner {
    position: relative;

    margin: 45px auto 0;

    max-width: 650px;

    padding: 35px 25px;

    text-align: center;

    border-radius: 24px;

    background:
        linear-gradient(
            135deg,
            #f8fbff,
            #eef6ff
        );

    border: 1px solid #dcecff;

    box-shadow:
        0 12px 35px rgba(34, 113, 177, 0.10);

    overflow: hidden;
}


/* CONFETTI ICON */

#ptv-results .ptv-winner-confetti {
    font-size: 45px;

    margin-bottom: 8px;

    animation:
        ptvWinnerPop
        0.7s
        ease-out;
}


/* LABEL */

#ptv-results .ptv-winner-label {
    margin-bottom: 8px;

    font-size: 12px;

    letter-spacing: 3px;

    font-weight: 800;

    color: #2271b1;
}


/* NAMA PEMENANG */

#ptv-results .ptv-winner h2 {
    margin: 0;

    font-size: 32px;

    line-height: 1.2;

    font-weight: 800;

    color: #172b4d;
}


/* SELAMAT */

#ptv-results .ptv-winner p {
    margin: 12px 0 0;

    font-size: 16px;

    color: #667085;
}


/* =====================================================
   ANIMASI
   ===================================================== */

@keyframes ptvTrophyBounce {

    0% {
        opacity: 0;
        transform: scale(0.5);
    }

    60% {
        transform: scale(1.15);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }

}


@keyframes ptvWinnerPop {

    0% {
        opacity: 0;
        transform: scale(0.5);
    }

    70% {
        transform: scale(1.12);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }

}


/* =====================================================
   MOBILE
   ===================================================== */

@media (max-width: 768px) {

    #ptv-results {
        margin-top: 35px;

        padding: 35px 15px;

        border-radius: 20px;
    }

    #ptv-results .ptv-results-header h2 {
        font-size: 28px;
    }

    #ptv-results .ptv-ranking {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    #ptv-results .ptv-rank-1 {
        transform: none;
    }

    #ptv-results .ptv-rank-1:hover {
        transform: translateY(-4px);
    }

    #ptv-results .ptv-winner {
        margin-top: 30px;

        padding: 30px 18px;
    }

    #ptv-results .ptv-winner h2 {
        font-size: 26px;
    }

}

/* TEST POPUP */
#ptv-test-modal {
    position: fixed !important;
    inset: 0 !important;

    width: 100vw !important;
    height: 100vh !important;

    background: rgba(0, 0, 0, 0.65) !important;

    z-index: 999999 !important;

    display: flex !important;
    align-items: center !important;
    justify-content: center !important;

    padding: 20px !important;
    box-sizing: border-box !important;
}

#ptv-test-modal > div {
    width: 100% !important;
    max-width: 400px !important;

    background: #fff !important;

    padding: 30px !important;

    border-radius: 20px !important;

    text-align: center !important;

    box-sizing: border-box !important;

    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3) !important;
}

#ptv-test-modal h2 {
    margin-top: 0 !important;
}

#ptv-test-modal strong {
    font-size: 22px !important;
}

#ptv-test-modal {
    position: fixed !important;
    inset: 0 !important;

    width: 100vw !important;
    height: 100vh !important;

    background: rgba(0, 0, 0, 0.65) !important;

    z-index: 999999 !important;

    display: flex !important;
    align-items: center !important;
    justify-content: center !important;

    padding: 20px !important;
    box-sizing: border-box !important;
}

#ptv-test-modal > div {
    width: 100% !important;
    max-width: 430px !important;

    background: #fff !important;

    padding: 35px 30px !important;

    border-radius: 20px !important;

    text-align: center !important;

    box-sizing: border-box !important;

    box-shadow: 0 20px 60px rgba(0,0,0,.3) !important;
}


/* =====================================================
   POPUP KONFIRMASI - MODERN
   ===================================================== */

#ptv-confirm-modal.ptv-modal-overlay {
    position: fixed !important;
    inset: 0 !important;

    width: 100vw !important;
    height: 100vh !important;

    padding: 20px !important;
    box-sizing: border-box !important;

    background: rgba(10, 25, 45, 0.60) !important;

    backdrop-filter: blur(6px) !important;
    -webkit-backdrop-filter: blur(6px) !important;

    display: flex !important;
    align-items: center !important;
    justify-content: center !important;

    z-index: 999999 !important;
}


/* KARTU POPUP */

#ptv-confirm-modal .ptv-confirm-modal {
    position: relative !important;

    width: 100% !important;
    max-width: 440px !important;

    padding: 38px 32px 30px !important;

    box-sizing: border-box !important;

    background: #ffffff !important;

    border-radius: 24px !important;

    text-align: center !important;

    box-shadow:
        0 25px 70px rgba(0, 0, 0, 0.28) !important;

    animation: ptvModalIn 0.35s ease-out !important;
}


/* ANIMASI */

@keyframes ptvModalIn {

    from {
        opacity: 0;
        transform: translateY(25px) scale(0.94);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }

}


/* ICON */

#ptv-confirm-modal .ptv-confirm-icon {
    width: 76px !important;
    height: 76px !important;

    margin: 0 auto 18px !important;

    display: flex !important;
    align-items: center !important;
    justify-content: center !important;

    border-radius: 50% !important;

    background: #eef6ff !important;

    font-size: 40px !important;

    box-shadow:
        0 8px 20px rgba(34, 113, 177, 0.12) !important;
}


/* JUDUL */

#ptv-confirm-modal h2 {
    margin: 0 0 10px !important;

    font-size: 27px !important;
    line-height: 1.25 !important;

    font-weight: 700 !important;

    color: #172b4d !important;
}


/* TEXT */

#ptv-confirm-modal .ptv-confirm-text {
    margin: 0 !important;

    font-size: 15px !important;

    color: #6b7280 !important;
}


/* NAMA KANDIDAT */

#ptv-confirm-modal .ptv-confirm-candidate {
    margin: 12px 0 18px !important;

    padding: 12px 18px !important;

    border-radius: 12px !important;

    background: #f5f9fd !important;

    font-size: 22px !important;

    font-weight: 700 !important;

    line-height: 1.35 !important;

    color: #2271b1 !important;

    word-break: break-word !important;
}


/* PERINGATAN */

#ptv-confirm-modal .ptv-confirm-warning {
    margin: 0 auto 26px !important;

    max-width: 340px !important;

    font-size: 13px !important;

    line-height: 1.55 !important;

    color: #8a8f98 !important;
}


/* BUTTON AREA */

#ptv-confirm-modal .ptv-confirm-actions {
    display: flex !important;

    gap: 12px !important;

    width: 100% !important;
}


/* SEMUA BUTTON */

#ptv-confirm-modal .ptv-confirm-actions button {
    flex: 1 !important;

    min-height: 50px !important;

    padding: 10px 16px !important;

    border-radius: 11px !important;

    font-family: inherit !important;

    font-size: 15px !important;

    font-weight: 600 !important;

    cursor: pointer !important;

    transition:
        transform 0.15s ease,
        box-shadow 0.15s ease,
        opacity 0.15s ease !important;
}


/* BATAL */

#ptv-confirm-modal .ptv-confirm-cancel {
    background: #f4f5f7 !important;

    border: 1px solid #e1e4e8 !important;

    color: #4b5563 !important;
}

#ptv-confirm-modal .ptv-confirm-cancel:hover {
    background: #e9ebee !important;

    transform: translateY(-1px) !important;
}


/* YA PILIH */

#ptv-confirm-modal .ptv-confirm-submit {
    background: #2271b1 !important;

    border: 1px solid #2271b1 !important;

    color: #ffffff !important;

    box-shadow:
        0 5px 14px rgba(34, 113, 177, 0.25) !important;
}

#ptv-confirm-modal .ptv-confirm-submit:hover {
    opacity: 0.92 !important;

    transform: translateY(-1px) !important;

    box-shadow:
        0 7px 18px rgba(34, 113, 177, 0.30) !important;
}


/* TOMBOL X */

#ptv-confirm-modal .ptv-modal-close {
    position: absolute !important;

    top: 12px !important;
    right: 14px !important;

    width: 36px !important;
    height: 36px !important;

    margin: 0 !important;
    padding: 0 !important;

    border: none !important;

    background: transparent !important;

    color: #9ca3af !important;

    font-size: 27px !important;

    line-height: 36px !important;

    cursor: pointer !important;

    border-radius: 50% !important;

    transition:
        background 0.15s ease,
        color 0.15s ease !important;
}

#ptv-confirm-modal .ptv-modal-close:hover {
    background: #f3f4f6 !important;

    color: #374151 !important;
}


/* MOBILE */

@media (max-width: 600px) {

    #ptv-confirm-modal.ptv-modal-overlay {
        padding: 15px !important;
    }

    #ptv-confirm-modal .ptv-confirm-modal {
        padding: 35px 20px 22px !important;

        border-radius: 20px !important;
    }

    #ptv-confirm-modal .ptv-confirm-icon {
        width: 68px !important;
        height: 68px !important;

        font-size: 36px !important;
    }

    #ptv-confirm-modal h2 {
        font-size: 23px !important;
    }

    #ptv-confirm-modal .ptv-confirm-candidate {
        font-size: 20px !important;
    }

    #ptv-confirm-modal .ptv-confirm-actions {
        flex-direction: column !important;
    }

    #ptv-confirm-modal .ptv-confirm-actions button {
        width: 100% !important;
    }

}

/* =========================================================
   CONFETTI
   ========================================================= */

#ptv-confetti {
    position: fixed !important;

    top: 0 !important;
    left: 0 !important;

    width: 100vw !important;
    height: 100vh !important;

    margin: 0 !important;
    padding: 0 !important;

    pointer-events: none !important;

    z-index: 999998 !important;

    display: block !important;
}

/* =========================================================
   FIX MOBILE - KARTU KANDIDAT
   ========================================================= */

@media (max-width: 600px) {

    .ptv-wrapper {
        width: 100%;
        max-width: 100%;
        margin: 0 auto;
        padding-left: 12px;
        padding-right: 12px;
        box-sizing: border-box;
    }

    .ptv-candidates {
        display: grid !important;

        grid-template-columns: 1fr !important;

        width: 100% !important;

        gap: 18px !important;
    }

    .ptv-card {
        width: 100% !important;
        max-width: 100% !important;

        min-width: 0 !important;

        box-sizing: border-box !important;

        margin: 0 !important;
    }

    .ptv-photo {
        margin-left: auto;
        margin-right: auto;
    }

    .ptv-card h2 {
        font-size: 22px;
        line-height: 1.3;

        word-break: normal;
        overflow-wrap: anywhere;
    }

    .ptv-card p {
        font-size: 15px;
    }

    .ptv-vote-button {
        width: auto;
        min-width: 120px;
    }
}

@media (max-width: 600px) {

    .ptv-ranking {
        display: grid !important;

        grid-template-columns: 1fr !important;

        width: 100% !important;

        gap: 18px !important;
    }

    .ptv-result-card {
        width: 100% !important;
        max-width: 100% !important;

        box-sizing: border-box !important;
    }

    .ptv-rank-1 {
        transform: none !important;
    }

}