/* Modern UI CSS - Giao diện hiện đại cho Game Pikachu */

/* Animation cho các hiệu ứng */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes flash {
    0%, 50%, 100% { opacity: 1; }
    25%, 75% { opacity: 0.5; }
}

@keyframes glow {
    0%, 100% { box-shadow: 0 0 5px #FFD700; }
    50% { box-shadow: 0 0 20px #FFD700, 0 0 30px #FFD700; }
}

@keyframes yellowGlow {
    0% {
        box-shadow: 0 0 5px rgba(255, 245, 150, 0.4),
                    0 0 10px rgba(255, 245, 150, 0.3);
        filter: brightness(1);
    }
    50% {
        box-shadow: 0 0 15px rgba(255, 245, 150, 0.9),
                    0 0 25px rgba(255, 235, 100, 0.7),
                    0 0 35px rgba(255, 225, 50, 0.5);
        filter: brightness(1.2);
    }
    100% {
        box-shadow: 0 0 20px rgba(255, 245, 150, 0.8),
                    0 0 30px rgba(255, 235, 100, 0.6),
                    0 0 40px rgba(255, 225, 50, 0.4);
        filter: brightness(1.15);
    }
}

/* Cải thiện giao diện chung */
body {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    /* Xoa display flex de khong lam vo layout */
}

/* Main table với hiệu ứng */
#maintable {
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
    border-radius: 15px;
    overflow: hidden;
    animation: fadeIn 1s ease-out;
    background: rgba(0,0,0,0.8) !important;
}

/* Status panel nâng cấp */
.status {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 15px;
    border-radius: 10px 0 0 10px;
}

.txstatus {
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
    animation: fadeIn 1.5s ease-out;
}

#level, #blood, #score {
    /* Bỏ animation pulse */
    text-shadow: 0 0 10px rgba(255,215,0,0.5);
    color: #FFD700;
    font-weight: bold;
}

/* Board improvements */
#board {
    background: rgba(0,0,0,0.3);
    border-radius: 10px;
    padding: 10px;
    /* Khong thay doi position de tranh vo layout */
}

/* Chi style co ban cho pieces */
#board div img {
    cursor: pointer;
    border-radius: 5px;
    /* Hover effect duoc xu ly trong hover-fix.css */
}

/* Giữ nguyên timer bar gốc nhưng thêm hiệu ứng */
.timebar {
    background: rgba(0,0,0,0.2);
    border-radius: 0 10px 10px 0;
    padding: 10px;
}

/* Container timer đẹp hơn */
.timebar-container {
    padding: 20px 10px;
}

/* Khung timer cố định */
.timebar-frame {
    /* Bỏ animation glow */
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
}

/* Hiệu ứng cho countdown */
.time-countdown {
    font-size: 32px !important;
    background: linear-gradient(135deg, #FFD700, #FFA500);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    /* Bỏ animation pulse */
}

/* Warning effect cho thời gian ít */
@keyframes warning-pulse {
    0%, 100% { transform: scale(1); color: #ff0000; }
    50% { transform: scale(1.1); color: #ff6600; }
}

.time-countdown.warning {
    animation: warning-pulse 0.5s infinite !important;
}

/* Buttons với style hiện đại */
.btn_option {
    padding: 20px;
    background: rgba(0,0,0,0.5);
    border-radius: 10px;
}

#gReplay, #gPause, #gFull, #gNextLV, #change_sound, #change_block {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white !important;
    padding: 10px 20px;
    border: none;
    border-radius: 25px;
    font-weight: bold;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    margin: 5px;
}

#gReplay:hover, #gPause:hover, #gFull:hover, 
#gNextLV:hover, #change_sound:hover, #change_block:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102,126,234,0.4);
    animation: glow 1s infinite;
}

/* Game info section */
.game-info {
    animation: fadeIn 1.5s ease-out;
    max-width: 1200px;
    margin: 30px auto !important;
    text-align: center;
    padding: 20px 30px !important;
}

.game-info h2 {
    /* Bỏ animation pulse */
    color: #FFD700;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.game-info > div > div {
    transition: all 0.3s ease;
}

.game-info > div > div:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    #maintable {
        width: 100%;
        max-width: 100%;
    }
    
    .btn_option input {
        display: block;
        width: 90%;
        margin: 10px auto;
    }
}

/* Loading effect */
#loading {
    position: relative;
}

#loading::before {
    content: "";
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, #FFD700, #FF6B6B, #4ECDC4, #667eea);
    border-radius: 15px;
    background-size: 400% 400%;
    z-index: -1;
    animation: gradient 10s ease infinite;
    opacity: 0.5;
}

@keyframes gradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Sound button states */
.soundOn {
    background: linear-gradient(135deg, #2ECC71 0%, #27AE60 100%) !important;
}

.soundOff {
    background: linear-gradient(135deg, #E74C3C 0%, #C0392B 100%) !important;
}

/* Selected pieces */
.selected {
    animation: flash 0.5s infinite;
    border: 3px solid #FFD700 !important;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.8),
                0 0 25px rgba(255, 215, 0, 0.6),
                inset 0 0 10px rgba(255, 215, 0, 0.3) !important;
}

/* Win/Lose effects */
.win-effect {
    animation: pulse 0.5s 3;
    background: rgba(46,204,113,0.3);
}

.lose-effect {
    animation: flash 0.5s 3;
    background: rgba(231,76,60,0.3);
}