/* Custom CSS for Vote Nasyiah */
.auth-one-bg {
    background-image: url(../../uploads/site/bg_auth.jpg);
}

.auth-one-bg .bg-overlay {
    opacity: 0.25;
}

.error-validation {
    width: 100%;
    margin-top: 0.25rem;
    font-size: 0.875em;
    color: #f06548;
}

#loading-ajax {
    display: none;
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.5);
    z-index: 9999;
}

#reader {
    width: 100%;
    border: none;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

#reader video {
    border-radius: 15px;
    transform: scaleX(-1);
}

.scanner-container {
    position: relative;
    text-align: center;
    background: #fff;
    border-radius: 20px;
}

/* ── Result Card ── */
.scan-result-card {
    height: 100%;
    min-height: 420px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    border-radius: 20px;
    transition:
        background 0.4s ease,
        border-color 0.4s ease;
}

.idle-state {
    opacity: 0.5;
}

.result-state {
    display: none;
}

.result-state.active {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    animation: popIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes popIn {
    from {
        opacity: 0;
        transform: scale(0.7);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

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

/* Result icon pulse */
.result-icon-wrap {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 18px;
    font-size: 3.5rem;
    animation: popIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.result-icon-wrap.success {
    background: rgba(10, 179, 156, 0.15);
    color: #0ab39c;
}
.result-icon-wrap.error {
    background: rgba(240, 101, 72, 0.15);
    color: #f06548;
}

.result-nama {
    font-size: 1.7rem;
    font-weight: 800;
    line-height: 1.2;
    word-break: break-word;
    text-align: center;
}

.result-tipe-badge {
    font-size: 0.85rem;
    padding: 6px 16px;
    border-radius: 20px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    margin-top: 8px;
    display: inline-block;
}

.result-msg {
    font-size: 1rem;
    text-align: center;
    word-break: break-word;
    padding: 0 12px;
}

/* Background card saat hasil muncul */
.scan-result-card.state-success {
    background: linear-gradient(135deg, #d1fae5 0%, #ecfdf5 100%) !important;
    border: 2px solid #0ab39c !important;
}
.scan-result-card.state-error {
    background: linear-gradient(135deg, #fee2e2 0%, #fff5f5 100%) !important;
    border: 2px solid #f06548 !important;
}
.scan-result-card.state-idle {
    background: #f8f9fa !important;
    border: 1px solid #dee2e6 !important;
}

/* ── Live Count ── */
.candidate-rank {
    position: absolute;
    top: -10px;
    left: -10px;
    width: 35px;
    height: 35px;
    background-color: #0ab39c;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 16px;
    box-shadow: 0 4px 10px rgba(10, 179, 156, 0.4);
    z-index: 10;
}

.card-animate {
    transition: all 0.4s;
}

.card-animate:hover {
    transform: translateY(-5px);
}

/* ── DataTable & Monitoring ── */
.dt-buttons {
    margin-bottom: 15px;
}
.status-badge {
    font-size: 13px;
    padding: 5px 10px;
}
.snapshot-img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s;
}
.snapshot-img:hover {
    transform: scale(1.1);
}

/* ── Bilik Vote ── */
.candidate-card {
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    border: 2px solid transparent;
    position: relative;
}

.candidate-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.candidate-card.selected {
    border-color: #0ab39c;
    background-color: #f3fdfa;
    box-shadow: 0 10px 20px rgba(10, 179, 156, 0.2);
}

.candidate-card .check-icon {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 2rem;
    color: #0ab39c;
    display: none;
    background: #fff;
    border-radius: 50%;
    line-height: 1;
}

.candidate-card.selected .check-icon {
    display: block;
    animation: popIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.candidate-img {
    width: 100%;
    aspect-ratio: 4/5;
    object-fit: cover;
    object-position: top;
    background: #f8f9fa;
    border-radius: 10px 10px 0 0;
}

.bottom-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: #fff;
    box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.1);
    padding: 15px 30px;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.bottom-bar-spacer {
    height: 80px;
}
