/* =========================================
   LUMEN - GLOBAL STYLES & GLASSMORPHISM
   ========================================= */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

:root {
    /* Paleta de Colores Ciberpunk / Futuro */
    --bg-gradient-1: #1a1a2e;
    --bg-gradient-2: #16213e;
    --bg-gradient-3: #0f3460;
    
    --primary-color: #00d2ff;   /* Cian Neón */
    --secondary-color: #3a7bd5; /* Azul Eléctrico */
    --accent-red: #ff4b4b;      /* Para errores o grabación */
    --text-color: #ffffff;
    
    /* Variables del Efecto Vidrio (Glass) */
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.2);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --blur-strength: 12px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

body {
    background: linear-gradient(45deg, var(--bg-gradient-1), var(--bg-gradient-2), var(--bg-gradient-3));
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
    min-height: 100vh;
    color: var(--text-color);
    overflow-x: hidden; /* Evitar scroll horizontal en móvil */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* Animación suave del fondo */
@keyframes gradientBG {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* =========================================
   ELEMENTOS DE FONDO (BLOBS)
   ========================================= */
.blob {
    position: absolute;
    width: 300px;
    height: 300px;
    background: linear-gradient(180deg, #ff00cc, #333399);
    border-radius: 50%;
    filter: blur(80px);
    z-index: -1; /* Detrás del vidrio */
    animation: float 8s ease-in-out infinite;
    opacity: 0.7;
}

.blob:nth-child(1) { 
    top: -50px; 
    left: -50px; 
}
.blob:nth-child(2) { 
    bottom: -50px; 
    right: -50px; 
    background: linear-gradient(180deg, var(--primary-color), var(--secondary-color)); 
    animation-delay: 1s; 
}

@keyframes float {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(20px) scale(1.05); }
}

/* =========================================
   LOGIN & CONTENEDORES GLASS
   ========================================= */
.login-container, .glass-panel {
    width: 90%;
    max-width: 400px;
    padding: 40px;
    background: var(--glass-bg);
    backdrop-filter: blur(var(--blur-strength));
    -webkit-backdrop-filter: blur(var(--blur-strength));
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    box-shadow: var(--glass-shadow);
    text-align: center;
    position: relative;
    z-index: 10;
}

.brand-logo {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 5px;
    background: linear-gradient(to right, #fff, var(--primary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 20px rgba(0, 210, 255, 0.3);
}

.subtitle {
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 30px;
    font-size: 0.9rem;
}

/* Inputs del Login */
.input-group {
    position: relative;
    margin-bottom: 20px;
    text-align: left;
}

.input-group i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--primary-color);
    font-size: 1.1rem;
    pointer-events: none;
    transition: 0.3s;
}

.input-field {
    width: 100%;
    padding: 12px 15px 12px 45px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid transparent;
    border-radius: 10px;
    color: #fff;
    outline: none;
    transition: 0.3s;
}

.input-field::placeholder { color: rgba(255, 255, 255, 0.5); }

.input-field:focus {
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--primary-color);
    box-shadow: 0 0 10px rgba(0, 210, 255, 0.2);
}

.btn-login {
    width: 100%;
    padding: 12px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    border: none;
    border-radius: 10px;
    color: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: 0.3s;
    margin-top: 10px;
    box-shadow: 0 4px 15px rgba(0, 210, 255, 0.3);
}

.btn-login:hover {
    transform: scale(1.02);
    box-shadow: 0 6px 20px rgba(0, 210, 255, 0.5);
}

.error-msg {
    background: rgba(255, 75, 75, 0.2);
    border: 1px solid rgba(255, 75, 75, 0.5);
    color: #ffcccc;
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* =========================================
   DASHBOARD / APP INTERFACE
   ========================================= */

/* Header Flotante con Stats */
.glass-header {
    position: absolute;
    top: 20px;
    left: 20px;
    right: 20px;
    height: 60px;
    background: rgba(255, 255, 255, 0.03); /* Más sutil */
    backdrop-filter: blur(10px);
    border-radius: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    border: 1px solid var(--glass-border);
    z-index: 100;
}

.stat-box {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: bold;
    font-size: 0.9rem;
}

.flame { color: #ff6b6b; filter: drop-shadow(0 0 5px #ff6b6b); }
.gold { color: #ffd93d; filter: drop-shadow(0 0 5px #ffd93d); }

.profile-pic {
    width: 35px;
    height: 35px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: 0.3s;
}
.profile-pic:hover { background: rgba(255,255,255,0.2); }

/* Escenario Principal */
.main-stage {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100vh;
    padding-top: 70px; /* Espacio para el header */
    padding-bottom: 20px;
}

/* Tarjeta de Frase Objetivo */
.target-card {
    background: transparent;
    border: none;
    box-shadow: none;
    margin-bottom: 10px;
    padding: 10px;
}
.target-card .label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    opacity: 0.6;
}
.target-card h2 {
    font-size: 2.2rem;
    margin: 5px 0;
    text-shadow: 0 0 15px rgba(0, 210, 255, 0.4);
}
.target-card .subtext {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.6);
}

/* =========================================
   AVATAR Y FEEDBACK
   ========================================= */
.avatar-container {
    position: relative;
    width: 260px;
    height: 260px;
    margin: 20px 0;
    display: flex;
    justify-content: center;
    align-items: center;
}

.avatar-container img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 0 20px rgba(0, 210, 255, 0.2));
    transition: transform 0.3s ease;
}

/* Burbuja de Diálogo (Pop-up) */
.bubble {
    position: absolute;
    top: 0;
    right: -10px;
    background: #ffffff;
    color: #1a1a2e;
    padding: 8px 16px;
    border-radius: 20px;
    border-bottom-left-radius: 2px;
    font-weight: 700;
    font-size: 0.9rem;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    animation: popIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: none; /* Se activa con JS */
}

@keyframes popIn {
    from { transform: scale(0) translateY(10px); opacity: 0; }
    to { transform: scale(1) translateY(0); opacity: 1; }
}

/* =========================================
   CONTROLES DE AUDIO (CANVAS & MIC)
   ========================================= */

/* Canvas del Visualizador */
#audioVisualizer {
    width: 100%;
    max-width: 320px;
    height: 60px;
    margin-bottom: 25px;
    background: rgba(0, 0, 0, 0.1); /* Fondo muy sutil */
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(5px);
}

/* Botón Flotante del Micrófono */
.mic-fab {
    width: 75px;
    height: 75px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border: none;
    color: white;
    font-size: 2rem;
    box-shadow: 0 10px 30px rgba(0, 210, 255, 0.3);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    z-index: 20;
}

.mic-fab:active {
    transform: scale(0.9);
}

/* Efecto Pulsante al Grabar */
.pulse {
    background: linear-gradient(135deg, #ff5f6d, #ffc371); /* Naranja/Rojo al grabar */
    animation: pulse-ring 1.5s cubic-bezier(0.215, 0.61, 0.355, 1) infinite;
    box-shadow: 0 0 0 0 rgba(255, 95, 109, 0.7);
}

@keyframes pulse-ring {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(255, 95, 109, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 20px rgba(255, 95, 109, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(255, 95, 109, 0); }
}

/* Texto de Estado */
#statusText {
    margin-top: 15px;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.5);
    font-weight: 300;
    letter-spacing: 0.5px;
}

/* =========================================
   RESPONSIVE
   ========================================= */
@media (max-width: 480px) {
    .login-container { width: 95%; padding: 30px 20px; }
    .brand-logo { font-size: 2rem; }
    
    .avatar-container { width: 220px; height: 220px; }
    .target-card h2 { font-size: 1.8rem; }
    
    .mic-fab { width: 65px; height: 65px; font-size: 1.6rem; }
}
