/* CSS khusus untuk halaman Livedraw */

/* ========== BASE STYLING LIVEDRAW ========== */
/* Reset untuk embed */
html, body {
    margin: 0;
    padding: 0;
    background: transparent;
    min-height: 100%;
    height: auto;
    overflow-x: hidden;
    font-family: Arial, sans-serif;
}

body.embed-mode {
    background: linear-gradient(rgba(0,0,0,0.35), rgba(0,0,0,0.35)), url('/togel/img/bg.jpg') center/cover no-repeat;
}

.livedraw-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    background-color: transparent;
    border-radius: 8px;
    text-align: center;
    color: #fff;
}

.livedraw-header {
    text-align: center;
    color: #ffd700;
    margin: 20px 0;
}

.livedraw-title {
    font-size: 24px;
    font-weight: 800;
    color: #fff;
    margin: 0 0 8px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.livedraw-meta {
    color: #ffdca0;
    margin-bottom: 15px;
    font-size: 14px;
}

/* ========== STYLING BOLA EMAS SAMA DENGAN INDEX ========== */

/* Base styling untuk semua bola digit di livedraw */
.livedraw-container .digit-gold,
.embed-mode .digit-gold,
#livedrawModal .digit-gold {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 40px !important;
    height: 40px !important;
    border-radius: 50% !important;
    /* Background emas yang kuat */
    background: 
        radial-gradient(circle at 30% 30%, rgba(255,255,255,.5), transparent 70%),
        linear-gradient(135deg, #ffea00, #ffd700 40%, #ffb700 70%, #ff8c00) !important;
    color: #201505 !important;
    font-weight: 800 !important;
    font-size: 18px !important;
    letter-spacing: 1px !important;
    /* Shadow emas yang dramatis */
    box-shadow: 
        inset 0 2px 4px rgba(255,255,255,.7),
        inset 0 -2px 4px rgba(255,180,0,.3),
        0 4px 8px rgba(0,0,0,.3),
        0 0 12px rgba(255,215,0,.4) !important;
    margin: 6px !important;
    box-sizing: border-box !important;
    position: relative !important;
    overflow: hidden !important;
}

/* Efek cahaya bergerak untuk semua bola di livedraw */
.livedraw-container .digit-gold::before,
.embed-mode .digit-gold::before,
#livedrawModal .digit-gold::before {
    content: "";
    position: absolute;
    top: -100%;
    left: -100%;
    width: 60%;
    height: 60%;
    background: linear-gradient(45deg, 
        transparent, 
        rgba(255,255,255,.6), 
        transparent);
    transform: rotate(45deg);
    animation: shineEffect 2.5s infinite;
    pointer-events: none;
}

/* Animasi cahaya bergerak */
@keyframes shineEffect {
    0% {
        top: -100%;
        left: -100%;
        opacity: 0;
    }
    50% {
        opacity: 1;
    }
    100% {
        top: 100%;
        left: 100%;
        opacity: 0;
    }
}

/* Prize 1 lebih besar untuk livedraw */
.livedraw-container .prize1 .digit-gold,
.livedraw-container .nomor-img.prize1 .digit-gold,
.embed-mode .prize1 .digit-gold,
.embed-mode .nomor-img.prize1 .digit-gold,
#livedrawModal .prize1 .digit-gold,
#livedrawModal .nomor-img.prize1 .digit-gold {
    width: 56px !important;
    height: 56px !important;
    font-size: 22px !important;
    /* Background emas premium */
    background: 
        radial-gradient(circle at 30% 30%, rgba(255,255,255,.6), transparent 70%),
        linear-gradient(135deg, #fff700, #ffea00 30%, #ffd700 60%, #ffb700 85%, #ff9500) !important;
    /* Shadow lebih dramatis */
    box-shadow: 
        inset 0 3px 6px rgba(255,255,255,.8),
        inset 0 -2px 4px rgba(255,180,0,.4),
        0 6px 12px rgba(0,0,0,.4),
        0 0 20px rgba(255,215,0,.6),
        0 0 30px rgba(255,215,0,.3) !important;
    animation: gold-pulse 2.6s ease-in-out infinite !important;
}

/* Efek cahaya premium untuk prize 1 */
.livedraw-container .nomor-img.prize1 .digit-gold::before,
.embed-mode .nomor-img.prize1 .digit-gold::before,
#livedrawModal .nomor-img.prize1 .digit-gold::before {
    width: 70%;
    height: 70%;
    background: linear-gradient(45deg, 
        transparent, 
        rgba(255,255,255,.8), 
        rgba(255,255,255,.6),
        transparent);
    animation: shineEffectPremium 2s infinite;
}

@keyframes shineEffectPremium {
    0% {
        top: -120%;
        left: -120%;
        opacity: 0;
    }
    40% {
        opacity: 1;
    }
    100% {
        top: 120%;
        left: 120%;
        opacity: 0;
    }
}

/* Animasi pulse untuk prize 1 */
@keyframes gold-pulse{
    0%{
        transform:translateY(0) scale(1);
        box-shadow: 
            inset 0 3px 6px rgba(255,255,255,.8),
            inset 0 -2px 4px rgba(255,180,0,.4),
            0 6px 12px rgba(0,0,0,.4),
            0 0 20px rgba(255,215,0,.6),
            0 0 30px rgba(255,215,0,.3);
    }
    50%{
        transform:translateY(-4px) scale(1.05);
        box-shadow: 
            inset 0 4px 8px rgba(255,255,255,.9),
            inset 0 -3px 6px rgba(255,180,0,.5),
            0 10px 20px rgba(0,0,0,.5),
            0 0 25px rgba(255,215,0,.8),
            0 0 40px rgba(255,215,0,.5);
    }
    100%{
        transform:translateY(0) scale(1);
        box-shadow: 
            inset 0 3px 6px rgba(255,255,255,.8),
            inset 0 -2px 4px rgba(255,180,0,.4),
            0 6px 12px rgba(0,0,0,.4),
            0 0 20px rgba(255,215,0,.6),
            0 0 30px rgba(255,215,0,.3);
    }
}

/* Delay animasi bergelombang */
.livedraw-container .nomor-img.prize1 .digit-gold:nth-child(1),
.embed-mode .nomor-img.prize1 .digit-gold:nth-child(1),
#livedrawModal .nomor-img.prize1 .digit-gold:nth-child(1) {animation-delay:0s}

.livedraw-container .nomor-img.prize1 .digit-gold:nth-child(2),
.embed-mode .nomor-img.prize1 .digit-gold:nth-child(2),
#livedrawModal .nomor-img.prize1 .digit-gold:nth-child(2) {animation-delay:0.15s}

.livedraw-container .nomor-img.prize1 .digit-gold:nth-child(3),
.embed-mode .nomor-img.prize1 .digit-gold:nth-child(3),
#livedrawModal .nomor-img.prize1 .digit-gold:nth-child(3) {animation-delay:0.3s}

.livedraw-container .nomor-img.prize1 .digit-gold:nth-child(4),
.embed-mode .nomor-img.prize1 .digit-gold:nth-child(4),
#livedrawModal .nomor-img.prize1 .digit-gold:nth-child(4) {animation-delay:0.45s}

/* Delay efek cahaya untuk variasi */
.livedraw-container .digit-gold:nth-child(1)::before,
.embed-mode .digit-gold:nth-child(1)::before,
#livedrawModal .digit-gold:nth-child(1)::before { animation-delay: 0s; }

.livedraw-container .digit-gold:nth-child(2)::before,
.embed-mode .digit-gold:nth-child(2)::before,
#livedrawModal .digit-gold:nth-child(2)::before { animation-delay: 0.3s; }

.livedraw-container .digit-gold:nth-child(3)::before,
.embed-mode .digit-gold:nth-child(3)::before,
#livedrawModal .digit-gold:nth-child(3)::before { animation-delay: 0.6s; }

.livedraw-container .digit-gold:nth-child(4)::before,
.embed-mode .digit-gold:nth-child(4)::before,
#livedrawModal .digit-gold:nth-child(4)::before { animation-delay: 0.9s; }

/* Hover effect untuk interaktivitas */
.livedraw-container .digit-gold:hover,
.embed-mode .digit-gold:hover,
#livedrawModal .digit-gold:hover {
    transform: scale(1.1) rotate(5deg) !important;
    box-shadow: 
        inset 0 3px 6px rgba(255,255,255,.9),
        inset 0 -2px 4px rgba(255,180,0,.5),
        0 8px 16px rgba(0,0,0,.4),
        0 0 25px rgba(255,215,0,.8) !important;
    transition: all 0.3s ease !important;
}

.livedraw-container .nomor-img.prize1 .digit-gold:hover,
.embed-mode .nomor-img.prize1 .digit-gold:hover,
#livedrawModal .nomor-img.prize1 .digit-gold:hover {
    transform: scale(1.15) rotate(8deg) !important;
    box-shadow: 
        inset 0 4px 8px rgba(255,255,255,1),
        inset 0 -3px 6px rgba(255,180,0,.6),
        0 12px 24px rgba(0,0,0,.5),
        0 0 35px rgba(255,215,0,1),
        0 0 50px rgba(255,215,0,.6) !important;
}

/* ========== CONTAINER PRIZE TANPA MAHKOTA ========== */

/* Container prize 1 - hanya container biasa */
.livedraw-container .prize1,
.embed-mode .prize1,
#livedrawModal .prize1 {
    position: relative;
    padding: 15px;
    margin: 15px auto 20px;
    max-width: 400px;
    border-radius: 8px;
    background: rgba(255, 215, 0, 0.05);
    border: 1px dashed rgba(255, 215, 0, 0.3);
}

/* Prize titles styling */
.livedraw-container .prize-title,
.embed-mode .prize-title,
#livedrawModal .prize-title {
    text-align: center;
    margin: 0 0 8px;
    font-size: 14px;
    font-weight: bold;
}

.livedraw-container .prize-title.prize-1,
.embed-mode .prize-title.prize-1,
#livedrawModal .prize-title.prize-1 {
    color: #ffd700;
    font-size: 16px;
    margin: 0 0 12px;
    position: relative;
}

.livedraw-container .prize-title.prize-1::after,
.embed-mode .prize-title.prize-1::after,
#livedrawModal .prize-title.prize-1::after {
    content: "";
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 2px;
    background: linear-gradient(90deg, transparent, #ffd700, transparent);
    box-shadow: 0 0 8px #ffd700;
}

.livedraw-container .prize-title.prize-2,
.embed-mode .prize-title.prize-2,
#livedrawModal .prize-title.prize-2 {
    color: #c0c0c0;
    margin-top: 25px;
}

.livedraw-container .prize-title.prize-3,
.embed-mode .prize-title.prize-3,
#livedrawModal .prize-title.prize-3 {
    color: #cd7f32;
    margin-top: 20px;
}

/* Container untuk nomor */
.livedraw-container .nomor-img,
.embed-mode .nomor-img,
#livedrawModal .nomor-img {
    text-align: center;
    margin: 8px 0 15px;
}

.livedraw-container .nomor-img.prize1,
.embed-mode .nomor-img.prize1,
#livedrawModal .nomor-img.prize1 {
    margin: 8px 0 10px;
}

.undi-status {
    color: #ffff00;
    font-weight: bold;
    font-size: 1.2em;
    margin: 20px 0;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.7);
    animation: blink 1.5s infinite;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0.5; }
}

/* ========== ANIMASI UPDATE REAL-TIME ========== */

@keyframes popDigit {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.pop-animation {
    animation: popDigit 0.5s ease;
}

/* Extra bounce untuk prize 1 */
.livedraw-container .prize1 .pop-animation,
.embed-mode .prize1 .pop-animation,
#livedrawModal .prize1 .pop-animation {
    animation: popDigit 0.8s ease, bounceGlow 0.8s ease;
}

@keyframes bounceGlow {
    0%, 100% { 
        box-shadow: 
            inset 0 3px 6px rgba(255,255,255,.8),
            inset 0 -2px 4px rgba(255,180,0,.4),
            0 6px 12px rgba(0,0,0,.4),
            0 0 20px rgba(255,215,0,.6),
            0 0 30px rgba(255,215,0,.3);
    }
    50% { 
        box-shadow: 
            inset 0 4px 8px rgba(255,255,255,.9),
            inset 0 -3px 6px rgba(255,180,0,.5),
            0 10px 20px rgba(0,0,0,.5),
            0 0 25px rgba(255,215,0,.8),
            0 0 40px rgba(255,215,0,.5);
    }
}

/* Disable animasi untuk reduced motion */
@media (prefers-reduced-motion:reduce){ 
    .livedraw-container .nomor-img.prize1 .digit-gold,
    .embed-mode .nomor-img.prize1 .digit-gold,
    #livedrawModal .nomor-img.prize1 .digit-gold {animation:none!important}
    
    .livedraw-container .digit-gold::before,
    .embed-mode .digit-gold::before,
    #livedrawModal .digit-gold::before {animation:none!important}
}

/* ========== RESPONSIVITAS MOBILE ========== */

@media (min-width:1024px){
    .livedraw-container .digit-gold,
    .embed-mode .digit-gold,
    #livedrawModal .digit-gold {
        width: 46px !important;
        height: 46px !important;
        font-size: 20px !important;
    }
    
    .livedraw-container .nomor-img.prize1 .digit-gold,
    .embed-mode .nomor-img.prize1 .digit-gold,
    #livedrawModal .nomor-img.prize1 .digit-gold {
        width: 60px !important;
        height: 60px !important;
        font-size: 24px !important;
    }
}

@media (max-width:600px){
    .livedraw-container .digit-gold,
    .embed-mode .digit-gold,
    #livedrawModal .digit-gold {
        width: 38px !important;
        height: 38px !important;
        font-size: 16px !important;
        letter-spacing: .5px !important;
        margin: 4px !important;
    }
    
    .livedraw-container .nomor-img.prize1 .digit-gold,
    .embed-mode .nomor-img.prize1 .digit-gold,
    #livedrawModal .nomor-img.prize1 .digit-gold {
        width: 46px !important;
        height: 46px !important;
        font-size: 20px !important;
    }
}

/* ========== OVERRIDE MODAL BACKGROUND ========== */

/* Perbaikan CSS untuk modal LiveDraw */
#livedrawModal.modal,
#livedrawModal .modal-content,
#livedrawModal .modal-header,
#livedrawModal #livedraw-content,
#livedrawModal iframe {
    background-color: #b08d4d !important;
}

/* Hapus semua border internal */
#livedrawModal * {
    border-color: transparent !important;
}

/* Tetapkan border khusus yang diinginkan */
#livedrawModal .modal-content {
    border: 2px solid #ffd700 !important;
    border-radius: 8px !important;
    overflow: hidden !important;
}

#livedrawModal .modal-header {
    border-bottom: 2px solid #ffd700 !important;
}

/* Override untuk iframe */
#livedrawModal iframe {
    border: none !important;
    background-color: transparent !important;
}

/* Pastikan logo pasaran muncul */
.livedraw-header img,
.pasaran-logo {
    max-width: 80px;
    margin: 0 auto 15px;
    display: block !important;
    visibility: visible !important;
}