/* Import a modern font */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600&display=swap');

body {
    /* Use the new font */
    font-family: 'Poppins', sans-serif;
    /* A slightly softer dark background */
    background-color: #1a1a1a;
    color: #f0f0f0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    margin: 0;
    padding: 20px;
    box-sizing: border-box;
}
.container {
    position: relative;
    width: 640px;
    height: 480px;
    border: none; /* Remove old border */
    border-radius: 12px; /* Rounded corners */
    overflow: hidden; /* To keep video inside rounded corners */
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3); /* Modern shadow */
    flex-shrink: 0; /* Evita que el contenedor se encoja */
}
/* Selector específico para los elementos dentro del contenedor de video */
.container video,
.container #output-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}
.container video {
    transform: scaleX(-1); /* Espejo para que sea más intuitivo */
}
#info {
    margin-top: 15px;
    font-size: 1.4em;
    font-weight: 400;
    color: #03dac6;
    min-height: 50px;
    text-align: center;
}

h1 {
    font-weight: 600;
    color: #03dac6;
    margin-bottom: 20px;
    text-shadow: 0 0 5px rgba(3, 218, 198, 0.5);
}

/* Modern stats container */
.stats-container {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
    width: 640px;
    display: none; /* Ocultar por defecto */
}

/* Individual stat card */
.stat-card {
    background-color: #2c2c2c;
    padding: 15px 20px;
    border-radius: 8px;
    text-align: center;
    flex-grow: 1;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.stat-card p {
    margin: 0;
    font-size: 0.9em;
    color: #a0a0a0;
}

.stat-card span {
    font-size: 1.8em;
    font-weight: 600;
    color: #f0f0f0;
    display: block;
}

#timer {
    font-size: 1.2em;
    color: #ffc107; /* Un color amarillo para destacar */
    margin: 5px 0;
    height: 25px;
    font-weight: 600;
}

.log-container {
    width: 640px;
    margin-top: 20px;
    background-color: #2c2c2c;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    display: none; /* Hidden by default */
}

.log-container h2 {
    margin-top: 0;
    text-align: center;
    color: #f0f0f0;
    font-weight: 600;
}

#challenge-log {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.log-entry {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    border-radius: 6px;
    font-weight: 400;
}

#voice-visualizer {
    margin-top: 15px;
    width: 640px;
    height: 50px;
    background-color: #222;
    border-radius: 8px; /* Rounded corners */
    box-shadow: inset 0 0 10px rgba(0,0,0,0.5); /* Inner shadow for depth */
}

.log-success {
    background-color: rgba(3, 218, 198, 0.15);
    color: #03dac6;
    border-left: 4px solid #03dac6;
}

.log-failure {
    background-color: rgba(207, 102, 121, 0.15);
    color: #cf6679;
    border-left: 4px solid #cf6679;
}

.status-good {
    color: #03dac6 !important; /* Usar !important para sobreescribir el color base */
}

.status-bad {
    color: #cf6679 !important; /* Usar !important para sobreescribir el color base */
}

/* --- Loader Overlay --- */
#loader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(26, 26, 26, 0.95);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    transition: opacity 0.5s ease;
}

.loader-content p {
    margin-top: 20px;
    font-size: 1.2em;
    letter-spacing: 1px;
}

.spinner {
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-left-color: #03dac6;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Modern button style */
#startButton {
    margin-top: 20px;
    padding: 12px 30px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    background: linear-gradient(45deg, #03dac6, #018786);
    color: #ffffff;
    border: none;
    border-radius: 50px; /* Pill shape */
    box-shadow: 0 4px 15px rgba(3, 218, 198, 0.4);
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

#startButton:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(3, 218, 198, 0.6);
}

#startButton:active {
    transform: translateY(0);
    box-shadow: 0 4px 15px rgba(3, 218, 198, 0.4);
}

#startButton:disabled {
    background: #555;
    color: #999;
    cursor: not-allowed;
    box-shadow: none;
    transform: translateY(0);
}
