/* ============================================
   🥊 TEMA MUHAMMAD ALI - "The Greatest"
   ============================================ */

body.ali-theme {
    --primary: linear-gradient(135deg, #1a0000 0%, #8B0000 50%, #1a0000 100%);
    --preparing: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    --fighting: linear-gradient(135deg, #8B0000 0%, #DC143C 50%, #FFD700 100%);
    --warning: linear-gradient(135deg, #FFD700 0%, #FF4500 100%);
    --resting: linear-gradient(135deg, #1a1a2e 0%, #8B0000 100%);
    --finished: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
}

body.ali-theme::before {
    background: linear-gradient(135deg, #1a0000 0%, #8B0000 50%, #1a0000 100%);
}

body.ali-theme.preparing::before { background: var(--preparing); }
body.ali-theme.fighting::before { background: var(--fighting); }
body.ali-theme.resting::before { background: var(--resting); }
body.ali-theme.finished::before { background: var(--finished); }

body.ali-theme .timer-card {
    background: linear-gradient(145deg, #1a0000 0%, #2d0000 100%);
    border: 2px solid #FFD700;
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.3);
}

body.ali-theme .time-display {
    color: #FFD700;
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
}

body.ali-theme .status-display {
    color: #FFD700;
}

body.ali-theme .round-info {
    color: #FFA500;
}

body.ali-theme .logo {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    box-shadow: 0 10px 30px rgba(255, 215, 0, 0.4);
}

body.ali-theme .logo-text {
    color: #1a0000;
}

body.ali-theme .btn-start {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    color: #1a0000;
    box-shadow: 0 8px 25px rgba(255, 215, 0, 0.4);
}

body.ali-theme .btn-settings {
    background: linear-gradient(135deg, #2d0000 0%, #1a0000 100%);
    color: #FFD700;
    border: 2px solid #FFD700;
}

body.ali-theme .settings-panel {
    background: linear-gradient(145deg, #1a0000 0%, #2d0000 50%, #1a0000 100%);
    border: 2px solid #FFD700;
    box-shadow: 0 0 25px rgba(255, 215, 0, 0.3);
}

body.ali-theme .training-summary {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
}

body.ali-theme .training-summary .total {
    color: #1a0000;
}

body.ali-theme .training-summary h4 {
    color: #1a0000;
}

body.ali-theme .training-summary .breakdown {
    color: #2d0000;
}

body.ali-theme .quote-box {
    background: rgba(255, 215, 0, 0.1);
    border: 1px solid rgba(255, 215, 0, 0.3);
}

body.ali-theme .quote-author {
    color: #FFD700;
}

body.ali-theme .progress-fill {
    background: linear-gradient(90deg, #FFD700, #FFA500);
}

body.ali-theme .fs-time {
    color: #FFD700;
    text-shadow: 
        0 0 20px rgba(255, 215, 0, 0.8),
        0 0 40px rgba(255, 215, 0, 0.6),
        0 0 60px rgba(255, 215, 0, 0.4);
}

body.ali-theme .fs-round {
    color: #FFA500;
}

body.ali-theme .fs-status {
    color: #FFD700;
}

body.ali-theme .float-btn.pause {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    color: #1a0000;
}

body.ali-theme .float-btn.reset {
    background: linear-gradient(135deg, #8B0000 0%, #DC143C 100%);
    color: #FFD700;
}

body.ali-theme .icon-btn,
body.ali-theme .music-btn,
body.ali-theme .darkmode-btn,
body.ali-theme .trophy-btn {
    background: rgba(255, 215, 0, 0.2);
    border: 1px solid rgba(255, 215, 0, 0.3);
}

body.ali-theme .icon-btn:hover,
body.ali-theme .music-btn:hover,
body.ali-theme .darkmode-btn:hover {
    background: rgba(255, 215, 0, 0.4);
}

body.ali-theme .counter-btn {
    background: #FFD700;
    color: #1a0000;
}

body.ali-theme .mode-btn {
    background: rgba(255, 215, 0, 0.15);
    border: 1px solid rgba(255, 215, 0, 0.3);
}

body.ali-theme .mode-btn:hover {
    background: rgba(255, 215, 0, 0.3);
}

body.ali-theme .mode-btn.active {
    background: #FFD700;
}

body.ali-theme .mode-btn.active .mode-name,
body.ali-theme .mode-btn.active .mode-desc {
    color: #1a0000;
}

body.ali-theme .kcal-goal-section {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 50%, #FF8C00 100%);
}

body.ali-theme .kcal-goal-input {
    color: #8B0000;
}

body.ali-theme .kcal-goal-btn {
    background: #1a0000;
    color: #FFD700;
}

body.ali-theme .modal-content {
    background: linear-gradient(145deg, #1a0000 0%, #2d0000 100%);
    border: 2px solid #FFD700;
    color: #FFD700;
}

body.ali-theme .modal-title {
    color: #FFD700;
}

body.ali-theme .stat-card {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    color: #1a0000;
}

/* ============================================
   🎨 SELECTOR DE TEMAS
   ============================================ */

.theme-selector-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    z-index: 3000;
    display: none;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.theme-selector-modal.show {
    display: flex;
}

/* Animación de cierre: zoom-out + fade */
.theme-selector-modal.modal-closing .theme-selector-content {
    transform: scale(0.94);
    opacity: 0;
}

/* Botón en estado "Seleccionar" — acento oscuro más prominente */
.theme-close-btn.theme-btn-select {
    background: #1c1c1e;
    letter-spacing: 0.03em;
}
body.dark-mode .theme-close-btn.theme-btn-select,
body.ali-theme .theme-close-btn.theme-btn-select {
    background: #f2f2f7;
}

.theme-selector-content {
    background: #ffffff;
    border-radius: 28px;
    padding: 28px 24px 24px;
    max-width: 350px;
    width: 100%;
    text-align: center;
    box-shadow: 0 20px 48px rgba(0, 0, 0, 0.14), 0 4px 12px rgba(0, 0, 0, 0.06);
    /* Base para la animación de cierre */
    transform: scale(1);
    opacity: 1;
    transition: transform 0.3s ease-in-out, opacity 0.3s ease-in-out;
}

body.dark-mode .theme-selector-content,
body.ali-theme .theme-selector-content {
    background: #1c1c1e;
    box-shadow: 0 20px 48px rgba(0, 0, 0, 0.6);
}

.theme-selector-title {
    font-size: 1.35em;
    font-weight: 800;
    margin-bottom: 22px;
    color: #1c1c1e;
    letter-spacing: -0.01em;
}

body.dark-mode .theme-selector-title,
body.ali-theme .theme-selector-title {
    color: #f2f2f7;
}

.theme-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.theme-option {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border-radius: 16px;
    border: 1.5px solid #edf2f7;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #f8f9fa;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
    -webkit-tap-highlight-color: transparent;
}

body.dark-mode .theme-option,
body.ali-theme .theme-option {
    background: #2c2c2e;
    border-color: #3a3a3c;
}

.theme-option:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.07);
    border-color: #d1d9e0;
}

body.dark-mode .theme-option:hover,
body.ali-theme .theme-option:hover {
    background: #3a3a3c;
    border-color: #48484a;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}

.theme-option.active {
    border: 2px solid #1c1c1e;
    background: #ffffff;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

body.dark-mode .theme-option.active,
body.ali-theme .theme-option.active {
    border-color: #f2f2f7;
    background: #3a3a3c;
}

.theme-option.locked {
    opacity: 0.55;
    cursor: pointer;
}

.theme-icon {
    font-size: 1.7em;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    flex-shrink: 0;
}

.theme-icon.light {
    background: linear-gradient(135deg, #ffffff 0%, #f0f0f0 100%);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.theme-icon.dark {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.theme-icon.ali {
    background: linear-gradient(135deg, #8B0000 0%, #FFD700 100%);
    box-shadow: 0 2px 8px rgba(255, 215, 0, 0.3);
}

.theme-info {
    flex: 1;
    text-align: left;
}

.theme-name {
    font-size: 1.05em;
    font-weight: 700;
    color: #1c1c1e;
    margin-bottom: 3px;
    letter-spacing: -0.01em;
}

body.dark-mode .theme-name,
body.ali-theme .theme-name {
    color: #f2f2f7;
}

.theme-desc {
    font-size: 0.82em;
    color: #8e8e93;
    line-height: 1.3;
}

body.dark-mode .theme-desc,
body.ali-theme .theme-desc {
    color: #98989d;
}

.theme-lock {
    font-size: 1.1em;
    opacity: 0.7;
}

.theme-close-btn {
    width: 100%;
    padding: 14px 24px;
    background: #1c1c1e;
    color: #ffffff;
    border: none;
    border-radius: 30px;
    font-size: 1em;
    font-weight: 700;
    cursor: pointer;
    transition: opacity 0.2s ease, transform 0.15s ease;
    -webkit-tap-highlight-color: transparent;
    letter-spacing: 0.01em;
}

.theme-close-btn:hover {
    opacity: 0.85;
    transform: scale(1.01);
}

.theme-close-btn:active {
    transform: scale(0.98);
}

body.dark-mode .theme-close-btn,
body.ali-theme .theme-close-btn {
    background: #f2f2f7;
    color: #1c1c1e;
}

/* ============================================
   ⭐ POPUP DE REVIEW
   ============================================ */

.review-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    z-index: 4000;
    display: none;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.review-modal.show {
    display: flex;
}

.review-content {
    background: linear-gradient(145deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 24px;
    padding: 35px 30px;
    max-width: 340px;
    width: 100%;
    text-align: center;
    animation: reviewPop 0.4s ease-out;
}

@keyframes reviewPop {
    0% {
        opacity: 0;
        transform: scale(0.8);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.review-stars {
    font-size: 2.5em;
    margin-bottom: 20px;
    animation: starPulse 2s ease-in-out infinite;
}

@keyframes starPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.review-title {
    font-size: 1.4em;
    font-weight: 800;
    color: #2d3436;
    margin-bottom: 12px;
}

.review-text {
    font-size: 1em;
    color: #636e72;
    margin-bottom: 8px;
    line-height: 1.5;
}

.review-reward {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    padding: 10px 18px;
    border-radius: 20px;
    font-size: 0.9em;
    font-weight: 700;
    color: #1a0000;
    margin: 15px 0 25px;
}

.review-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.review-btn {
    padding: 14px 20px;
    border-radius: 12px;
    font-size: 1em;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    border: none;
}

.review-btn.primary {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    color: #1a0000;
    box-shadow: 0 8px 25px rgba(255, 215, 0, 0.4);
}

.review-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(255, 215, 0, 0.5);
}

.review-btn.secondary {
    background: transparent;
    color: #636e72;
}

.review-btn.secondary:hover {
    background: rgba(0, 0, 0, 0.05);
}

/* ============================================
   🎉 POPUP DE RECOMPENSA
   ============================================ */

.reward-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    z-index: 5000;
    display: none;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.reward-modal.show {
    display: flex;
}

.reward-content {
    background: linear-gradient(145deg, #1a0000 0%, #2d0000 100%);
    border: 3px solid #FFD700;
    border-radius: 24px;
    padding: 40px 30px;
    max-width: 340px;
    width: 100%;
    text-align: center;
    animation: rewardPop 0.5s ease-out;
    box-shadow: 0 0 50px rgba(255, 215, 0, 0.4);
}

@keyframes rewardPop {
    0% {
        opacity: 0;
        transform: scale(0.5) rotate(-10deg);
    }
    70% {
        transform: scale(1.1) rotate(3deg);
    }
    100% {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }
}

.reward-icon {
    font-size: 4em;
    margin-bottom: 20px;
    animation: rewardBounce 1s ease-in-out infinite;
}

@keyframes rewardBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.reward-title {
    font-size: 1.6em;
    font-weight: 900;
    color: #FFD700;
    margin-bottom: 15px;
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
}

.reward-text {
    font-size: 1em;
    color: #ffffff;
    margin-bottom: 25px;
    line-height: 1.5;
}

.reward-theme-preview {
    background: linear-gradient(135deg, #8B0000 0%, #FFD700 100%);
    padding: 20px;
    border-radius: 16px;
    margin-bottom: 25px;
}

.reward-theme-name {
    font-size: 1.3em;
    font-weight: 800;
    color: #ffffff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.reward-btn {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    color: #1a0000;
    border: none;
    border-radius: 12px;
    font-size: 1.1em;
    font-weight: 800;
    cursor: pointer;
    transition: transform 0.2s;
}

.reward-btn:hover {
    transform: scale(1.02);
}

@media (max-width: 480px) {
    .theme-selector-content,
    .review-content,
    .reward-content {
        padding: 25px 20px;
        margin: 10px;
    }
    
    .theme-option {
        padding: 12px 15px;
    }
    
    .theme-icon {
        width: 45px;
        height: 45px;
        font-size: 1.6em;
    }
    
    .review-stars {
        font-size: 2em;
    }
    
    .reward-icon {
        font-size: 3em;
    }
}
