﻿/* ===== VARIABLES Y RESET ===== */
:root {
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --dark-bg: #1a1a2e;
    --card-bg: rgba(255, 255, 255, 0.05);
    --white-key: #ffffff;
    --black-key: #1a1a1a;
    --key-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    --key-active: #667eea;
    --text-primary: #ffffff;
    --text-secondary: #b8b8d4;
    --success: #4ade80;
    --danger: #f87171;
    --warning: #fbbf24;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--dark-bg);
    background-image:
        radial-gradient(circle at 20% 50%, rgba(102, 126, 234, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(118, 75, 162, 0.1) 0%, transparent 50%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    overflow-x: hidden;
}

.container {
    width: 95%;
    max-width: 1400px;
    padding: 2rem;
}

/* ===== HEADER ===== */
header {
    margin-bottom: 2rem;
    animation: fadeInDown 0.6s ease-out;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.app-logo {
    height: 150px;
    width: auto;
    max-width: 440px;
    object-fit: contain;
    animation: fadeIn 0.5s ease-out;
}

.title-section {
    text-align: left;
    flex: 1;
}

header h1 {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 800;
    background: var(--primary-gradient);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
background-clip: text;
margin-bottom: 0.5rem;
letter-spacing: -1px;
}

.subtitle {
    color: var(--text-secondary);
    font-size: clamp(0.9rem, 2vw, 1.1rem);
    font-weight: 300;
}

/* ===== AUTENTICACIÓN ===== */
.auth-section {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.auth-btn {
    padding: 0.75rem 1.5rem;
    background: var(--primary-gradient);
    color: white;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.auth-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.auth-btn:active {
    transform: translateY(0);
}

.auth-btn.logout {
    background: var(--secondary-gradient);
    box-shadow: 0 4px 15px rgba(240, 147, 251, 0.3);
}

.auth-btn.logout:hover {
    box-shadow: 0 6px 20px rgba(240, 147, 251, 0.4);
}

.welcome-msg {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1.25rem;
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

#user-email {
    color: var(--text-primary);
    font-weight: 500;
    font-size: 0.9rem;
}

/* ===== PANEL DE INFORMACIÓN ===== */
.info-panel {
    display: flex;
    justify-content: space-around;
    align-items: center;
    gap: 1.5rem;
    padding: 1.5rem;
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 2rem;
    animation: fadeIn 0.8s ease-out 0.2s both;
    flex-wrap: wrap;
}

.midi-status,
.note-display {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.status-label,
.note-label {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.status-indicator {
    padding: 0.5rem 1rem;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.85rem;
    transition: all 0.3s ease;
}

.status-indicator.connected {
    background: var(--success);
    color: var(--dark-bg);
    box-shadow: 0 0 20px rgba(74, 222, 128, 0.4);
}

.status-indicator.disconnected {
    background: var(--danger);
    color: white;
}

#current-note {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    min-width: 60px;
    text-align: left;
    padding: 0.5rem 1rem;
    background: var(--primary-gradient);
    border-radius: 12px;
    transition: transform 0.2s ease;
}

#current-note.playing {
    transform: scale(1.1);
}

/* ===== PANEL DE ESTADÍSTICAS ===== */
.stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
    animation: fadeIn 0.8s ease-out 0.3s both;
}

.points-panel,
.leaderboard-panel {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 2rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.points-panel h3,
.leaderboard-panel h3 {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
    text-align: left;
}

.points-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

#current-points {
    font-size: 3.5rem;
    font-weight: 800;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    transition: transform 0.2s ease;
}

.points-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.practice-btn {
    width: 100%;
    padding: 1rem;
    background: var(--success);
    color: white;
    border: none;
    border-radius: 12px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(74, 222, 128, 0.3);
}

.practice-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(74, 222, 128, 0.4);
}

.practice-btn:active {
    transform: translateY(0);
}

/* ===== LEADERBOARD ===== */
.leaderboard-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.leaderboard-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    margin-bottom: 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.leaderboard-item:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateX(5px);
}

.leaderboard-rank {
    font-size: 1.2rem;
    font-weight: 700;
    min-width: 40px;
}

.leaderboard-rank.gold {
    color: #ffd700;
}

.leaderboard-rank.silver {
    color: #c0c0c0;
}

.leaderboard-rank.bronze {
    color: #cd7f32;
}

.leaderboard-email {
    flex: 1;
    margin: 0 1rem;
    font-weight: 500;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.leaderboard-points {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--success);
}

.leaderboard-empty {
    text-align: left;
    color: var(--text-secondary);
    padding: 2rem;
    font-style: italic;
}

/* ===== PANEL DE GRABACIÓN Y METRÓNOMO ===== */
.recorder-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
    animation: fadeIn 0.8s ease-out 0.32s both;
}

.recorder-panel,
.metronome-panel {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 2rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.recorder-panel h3,
.metronome-panel h3 {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
    text-align: left;
}

.recorder-controls {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.recorder-btn {
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.recorder-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

.recorder-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.recorder-btn.record {
    background: var(--danger);
    border-color: var(--danger);
}

.recorder-btn.record:hover:not(:disabled) {
    background: #dc2626;
    box-shadow: 0 4px 15px rgba(248, 113, 113, 0.4);
}

.recorder-btn.record.recording {
    animation: pulse 1.5s ease-in-out infinite;
}

.recorder-btn.stop {
    background: var(--warning);
    border-color: var(--warning);
    color: var(--dark-bg);
}

.recorder-btn.play {
    background: var(--success);
    border-color: var(--success);
}

.recorder-btn.export {
    background: var(--primary-gradient);
    border: none;
}

.btn-icon {
    font-size: 1rem;
}

.recording-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    font-size: 0.9rem;
}

#recording-status {
    color: var(--text-secondary);
    font-weight: 600;
}

#recording-notes {
    color: var(--success);
    font-weight: 700;
}

/* ===== METRÓNOMO ===== */
.metronome-controls {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.metronome-btn {
    padding: 1rem;
    background: var(--primary-gradient);
    color: white;
    border: none;
    border-radius: 12px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.metronome-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.metronome-btn.active {
    background: var(--danger);
}

.bpm-control {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.bpm-control label {
    font-weight: 600;
    color: var(--text-primary);
    text-align: left;
}

#bpm-value {
    color: var(--success);
    font-size: 1.2rem;
}

#bpm-slider {
    width: 100%;
    height: 8px;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.1);
    outline: none;
    -webkit-appearance: none;
}

#bpm-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary-gradient);
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4);
}

#bpm-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary-gradient);
    cursor: pointer;
    border: none;
}

.beat-indicator {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

.beat-light {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: 3px solid rgba(255, 255, 255, 0.2);
    transition: all 0.1s ease;
}

.beat-light.active {
    background: var(--success);
    border-color: var(--success);
    box-shadow: 0 0 30px rgba(74, 222, 128, 0.8);
    transform: scale(1.1);
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.6;
    }
}

/* ===== RESTO DEL CSS (Lecciones, Custom Songs, Piano, Footer, etc.) ===== */
/* Continúa con todos los estilos existentes... */

.lesson-container {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: fadeIn 0.8s ease-out 0.35s both;
}

.lesson-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.lesson-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.lesson-btn {
    padding: 0.75rem 1.5rem;
    background: var(--primary-gradient);
    color: white;
    border: none;
    border-radius: 12px;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.lesson-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.lesson-btn:active {
    transform: translateY(0);
}

.lesson-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.lesson-instruction {
    color: var(--text-secondary);
    font-size: 1rem;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.lesson-progress {
    margin-bottom: 1.5rem;
}

.progress-bar {
    width: 100%;
    height: 12px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress-fill {
    height: 100%;
    background: var(--primary-gradient);
    transition: width 0.3s ease;
    border-radius: 10px;
}

.progress-text {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.feedback {
    padding: 1rem;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1rem;
    text-align: left;
    margin-bottom: 1rem;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.feedback.success {
    background: rgba(74, 222, 128, 0.2);
    border: 2px solid var(--success);
    color: var(--success);
}

.feedback.error {
    background: rgba(248, 113, 113, 0.2);
    border: 2px solid var(--danger);
    color: var(--danger);
}

.feedback.info {
    background: rgba(102, 126, 234, 0.2);
    border: 2px solid #667eea;
    color: #667eea;
}

.expected-note {
    text-align: left;
    padding: 1.5rem;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 12px;
    border: 2px dashed rgba(102, 126, 234, 0.3);
}

.expected-note-display {
    font-size: 3rem;
    font-weight: 800;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
}

.expected-note-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.expected-note-finger {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--success);
    margin: 0.5rem 0;
}

.expected-note-duration {
    font-size: 0.85rem;
    font-weight: 600;
    color: #ffd700;
    margin-top: 0.5rem;
    padding: 0.25rem 0.75rem;
    background: rgba(255, 215, 0, 0.1);
    border-radius: 8px;
    display: inline-block;
}

/* ===== PANEL DE TEMAS PERSONALIZADOS ===== */
.custom-song-container {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: fadeIn 0.8s ease-out 0.36s both;
}

.custom-song-header {
    text-align: left;
    margin-bottom: 1.5rem;
}

.custom-song-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.custom-song-subtitle {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.custom-song-format-info {
    margin-bottom: 1.5rem;
}

.custom-song-format-info details {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 1rem;
    cursor: pointer;
}

.custom-song-format-info summary {
    font-weight: 600;
    color: var(--text-primary);
    user-select: none;
}

.format-example {
    background: rgba(0, 0, 0, 0.3);
    padding: 1rem;
    border-radius: 8px;
    border-left: 3px solid var(--success);
    margin: 1rem 0;
    overflow-x: auto;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    color: #a8e6cf;
}

.format-description {
    color: var(--text-secondary);
    font-size: 0.85rem;
    line-height: 1.6;
    margin-top: 0.5rem;
}

.custom-song-textarea {
    width: 100%;
    min-height: 200px;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: var(--text-primary);
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    resize: vertical;
    margin-bottom: 1rem;
    transition: border-color 0.3s ease;
}

.custom-song-textarea:focus {
    outline: none;
    border-color: rgba(102, 126, 234, 0.5);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.custom-song-textarea::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.custom-song-actions {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.custom-song-btn {
    flex: 1;
    padding: 1rem;
    background: var(--primary-gradient);
    color: white;
    border: none;
    border-radius: 12px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.custom-song-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.custom-song-btn:active {
    transform: translateY(0);
}

.custom-song-btn-secondary {
    padding: 1rem;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.custom-song-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    color: var(--text-primary);
}

.custom-song-feedback {
    padding: 1rem;
    border-radius: 12px;
    font-weight: 600;
    text-align: left;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.custom-song-feedback.success {
    background: rgba(74, 222, 128, 0.2);
    border: 2px solid var(--success);
    color: var(--success);
}

.custom-song-feedback.error {
    background: rgba(248, 113, 113, 0.2);
    border: 2px solid var(--danger);
    color: var(--danger);
}

/* ===== CONTENEDOR DEL PIANO ===== */
.piano-container {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 2rem;
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    margin-bottom: 2rem;
    animation: fadeInUp 0.8s ease-out 0.4s both;
    overflow-x: auto;
    overflow-y: hidden;
}

.piano-keys {
    display: flex;
    position: relative;
    gap: 2px;
}

/* ===== TECLAS BLANCAS ===== */
.white-key {
    width: 60px;
    height: 280px;
    background: linear-gradient(180deg, #ffffff 0%, #f5f5f5 100%);
    border: 2px solid #ddd;
    border-radius: 0 0 8px 8px;
    cursor: pointer;
    position: relative;
    transition: all 0.1s ease;
    box-shadow: var(--key-shadow);
    user-select: none;
}

.white-key:hover {
    background: linear-gradient(180deg, #f0f0f0 0%, #e8e8e8 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4);
}

.white-key.active {
    background: var(--key-active) !important;
    transform: translateY(4px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3) inset;
}

.white-key.expected {
    border: 3px solid var(--success);
    box-shadow: 0 0 20px rgba(74, 222, 128, 0.6);
}

/* ===== TECLAS NEGRAS ===== */
.black-key {
    width: 40px;
    height: 180px;
    background: linear-gradient(180deg, #2a2a2a 0%, #000000 100%);
    border: 2px solid #000;
    border-radius: 0 0 6px 6px;
    cursor: pointer;
    position: absolute;
    z-index: 10;
    transition: all 0.1s ease;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.8);
    user-select: none;
}

.black-key:hover {
    background: linear-gradient(180deg, #3a3a3a 0%, #1a1a1a 100%);
    transform: translateY(-2px);
}

.black-key.active {
    background: var(--key-active) !important;
    transform: translateY(4px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5) inset;
}

.black-key.expected {
    border: 3px solid var(--success);
    box-shadow: 0 0 20px rgba(74, 222, 128, 0.6);
}

/* ===== LABELS DE TECLAS ===== */
.key-label {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.75rem;
    font-weight: 600;
    color: #666;
    pointer-events: none;
}

.black-key .key-label {
    color: #999;
    bottom: 8px;
}

.pc-key-label {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.7rem;
    font-weight: 700;
    color: #667eea;
    background: rgba(102, 126, 234, 0.15);
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    border: 1px solid rgba(102, 126, 234, 0.3);
    pointer-events: none;
    text-transform: uppercase;
}

.black-key .pc-key-label {
    top: 8px;
    font-size: 0.65rem;
    padding: 0.2rem 0.4rem;
    background: rgba(102, 126, 234, 0.25);
    color: #a8b5f5;
}

/* ===== FOOTER ===== */
.app-footer {
    margin-top: 4rem;
    padding: 3rem 2rem 1.5rem;
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border-radius: 20px 20px 0 0;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-bottom: none;
    animation: fadeIn 1s ease-out 0.6s both;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-info {
    text-align: left;
}

.footer-title {
    font-size: 1.3rem;
    font-weight: 700;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
}

.footer-description {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
}

.footer-credits {
    text-align: left;
}

.developer-name {
    font-size: 1rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.developer-name strong {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
}

.copyright {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.footer-links {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 1rem;
}

.footer-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
    color: var(--text-secondary);
    transition: all 0.3s ease;
    text-decoration: none;
}

.footer-link:hover {
    background: var(--primary-gradient);
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.footer-tech {
    text-align: left;
    padding-top: 1rem;
}

.footer-tech p {
    color: var(--text-secondary);
    font-size: 0.75rem;
    opacity: 0.7;
}

/* ===== ANIMACIONES ===== */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
    .white-key {
        width: 50px;
        height: 240px;
    }

    .black-key {
        width: 35px;
        height: 160px;
    }

    .pc-key-label {
        font-size: 0.65rem;
        padding: 0.2rem 0.4rem;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }

    .piano-container {
        padding: 1rem;
    }

    .white-key {
        width: 40px;
        height: 200px;
    }

    .black-key {
        width: 28px;
        height: 130px;
    }

    .info-panel {
        flex-direction: column;
        gap: 1rem;
    }

    .stats-container {
        grid-template-columns: 1fr;
    }

    .recorder-container {
        grid-template-columns: 1fr;
    }

    .pc-key-label {
        font-size: 0.6rem;
        padding: 0.15rem 0.3rem;
    }
}

@media (max-width: 480px) {
    .white-key {
        width: 32px;
        height: 160px;
    }

    .black-key {
        width: 22px;
        height: 100px;
    }

    .key-label {
        font-size: 0.6rem;
    }

    .pc-key-label {
        display: none;
    }
}

/* ===== MODAL DE AUTENTICACI�N ===== */
.auth-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    animation: fadeIn 0.3s ease-out;
}

.auth-modal-content {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    padding: 3rem;
    max-width: 450px;
    width: 90%;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: slideUp 0.4s ease-out;
}

.auth-modal-close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.auth-modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: rotate(90deg);
}

.auth-view h2 {
    font-size: 2rem;
    font-weight: 700;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 2rem;
    text-align: center;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.form-group input {
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: rgba(102, 126, 234, 0.5);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.auth-submit-btn {
    padding: 1rem 2rem;
    background: var(--primary-gradient);
    color: white;
    border: none;
    border-radius: 12px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    margin-top: 0.5rem;
}

.auth-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.auth-submit-btn:active {
    transform: translateY(0);
}

.auth-toggle {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

.auth-toggle a {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.auth-toggle a:hover {
    color: #667eea;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== NOTIFICACIONES ===== */
.notification {
    position: fixed;
    top: 2rem;
    right: 2rem;
    padding: 1rem 1.5rem;
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: var(--text-primary);
    font-weight: 600;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    z-index: 10001;
    opacity: 0;
    transform: translateX(400px);
    transition: all 0.3s ease;
    max-width: 400px;
}

.notification.show {
    opacity: 1;
    transform: translateX(0);
}

.notification-success {
    border-left: 4px solid var(--success);
}

.notification-error {
    border-left: 4px solid var(--danger);
}

.notification-info {
    border-left: 4px solid #667eea;
}

/* ===== RESALTADO DE TECLAS EN LECCIONES ===== */
.piano-key.expected-key {
    box-shadow: 0 0 30px rgba(102, 126, 234, 0.8), 0 0 60px rgba(102, 126, 234, 0.5) !important;
    border-color: #667eea !important;
    animation: pulse-glow 1.5s ease-in-out infinite;
}

.piano-key.correct-animation {
    animation: correct-flash 0.5s ease-out;
}

.finger-hint {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary-gradient);
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
    z-index: 10;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.5);
}

@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 0 30px rgba(102, 126, 234, 0.8), 0 0 60px rgba(102, 126, 234, 0.5);
    }
    50% {
        box-shadow: 0 0 40px rgba(102, 126, 234, 1), 0 0 80px rgba(102, 126, 234, 0.7);
    }
}

@keyframes correct-flash {
    0% {
        background: var(--success);
        transform: scale(1);
    }
    50% {
        background: var(--success);
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}
