/**
 * Estilos para el Reloj Personalizado - Modal de Timer
 * Estilo básico y minimalista - MODAL INESCAPABLE
 */

.timer-modal-inescapable {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9000;
    pointer-events: all;
}

.timer-container-inescapable {
    background: white;
    border: 3px solid #333;
    border-radius: 8px;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.4);
    pointer-events: all;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

/* Prevenir cualquier interacción que pueda cerrar el modal timer */
.timer-modal-inescapable * {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

/* Permitir interacción normal en los modales admin */
#adminModal, #adminModal * {
    user-select: text !important;
    -webkit-user-select: text !important;
    -moz-user-select: text !important;
    -ms-user-select: text !important;
    pointer-events: auto !important;
}

.timer-modal-inescapable {
    outline: none;
    border: none;
}

.timer-modal-inescapable:focus {
    outline: none;
}

/* Asegurar que los modales admin aparezcan SIEMPRE encima del timer */
#adminModal.modal-overlay {
    z-index: 10000 !important;
}

.modal-overlay.active {
    z-index: 10000 !important;
}

/* Asegurar que cualquier modal con estas clases esté encima del timer */
.herramientas-modal {
    z-index: 10000 !important;
}

.timer-modal {
    z-index: 10000 !important;
}

.timer-header {
    background: #333;
    color: white;
    padding: 20px;
    text-align: center;
    border-bottom: 1px solid #ddd;
}

.timer-icon {
    font-size: 2rem;
    margin-bottom: 10px;
}

.timer-title {
    font-size: 1.3rem;
    font-weight: bold;
    margin-bottom: 5px;
}

.timer-subtitle {
    font-size: 0.9rem;
    opacity: 0.8;
}

.timer-content {
    padding: 20px;
    text-align: center;
}

.timer-message {
    background: #f5f5f5;
    border: 1px solid #ddd;
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 4px;
    font-size: 1rem;
    color: #333;
    line-height: 1.4;
}

.timer-display {
    margin-bottom: 20px;
}

.time-remaining {
    font-size: 2.5rem;
    font-weight: bold;
    color: #333;
    margin-bottom: 10px;
    font-family: monospace;
}

.time-label {
    font-size: 0.9rem;
    color: #666;
}

.progress-container {
    background: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 4px;
    height: 10px;
    margin: 15px 0;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: #333;
    transition: width 1s linear;
}

.progress-percentage {
    font-size: 0.8rem;
    color: #666;
    margin-top: 5px;
}

.timer-actions {
    padding: 15px;
    background: #f5f5f5;
    border-top: 1px solid #ddd;
    display: flex;
    gap: 10px;
    justify-content: center;
}

.timer-btn {
    padding: 10px 20px;
    border: 1px solid #333;
    border-radius: 4px;
    cursor: pointer;
    font-weight: normal;
    font-size: 0.9rem;
    background: white;
    color: #333;
    min-width: 100px;
}

.timer-btn:hover {
    background: #f0f0f0;
}

.timer-btn-close {
    background: #333;
    color: white;
    border: 1px solid #333;
}

.timer-btn-close:hover {
    background: #555;
}

.timer-btn-minimize {
    background: white;
    color: #333;
    border: 1px solid #333;
}

.timer-btn-minimize:hover {
    background: #f0f0f0;
}

/* Estado cuando el timer está terminado */
.timer-finished .timer-header {
    background: #28a745;
}

.timer-finished .time-remaining {
    color: #28a745;
}

.timer-finished .progress-bar {
    background: #28a745;
}

/* Estado crítico cuando queda poco tiempo */
.timer-critical .time-remaining {
    color: #dc3545;
}

.timer-critical .progress-bar {
    background: #dc3545;
}

/* Modo minimizado */
.timer-minimized {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 250px;
    height: auto;
    border-radius: 4px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    z-index: 9999;
}

.timer-minimized .timer-header {
    padding: 10px;
}

.timer-minimized .timer-icon {
    font-size: 1.2rem;
    margin-bottom: 0;
    margin-right: 8px;
    display: inline-block;
}

.timer-minimized .timer-title {
    font-size: 1rem;
    margin-bottom: 0;
    display: inline-block;
}

.timer-minimized .timer-subtitle {
    display: none;
}

.timer-minimized .timer-content {
    padding: 10px;
}

.timer-minimized .time-remaining {
    font-size: 1.3rem;
    margin-bottom: 5px;
}

.timer-minimized .timer-message {
    display: none;
}

.timer-minimized .timer-actions {
    padding: 8px 10px;
}

/* Responsivo */
@media (max-width: 480px) {
    .timer-container {
        width: 95%;
        margin: 10px;
    }
    
    .timer-header {
        padding: 15px;
    }
    
    .timer-content {
        padding: 15px;
    }
    
    .time-remaining {
        font-size: 2rem;
    }
    
    .timer-actions {
        padding: 10px;
        flex-direction: column;
    }
    
    .timer-btn {
        width: 100%;
        margin-bottom: 8px;
    }
}