/* 
 * RK 2.0 Core Theme
 * Hoja de estilos compartida para las herramientas RK-SaaS
 * Basado en la estética Glassmorphism del metrónomo.
 */

body {
    margin: 0;
    padding: 0;
    background-color: #030712;
    color: #f3f4f6;
}

/* --- ESTILOS DE LA INTRO --- */
#intro-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #030712;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: opacity 0.8s ease-out, visibility 0.8s;
}

.loader-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(139, 92, 246, 0.1);
    border-radius: 50%;
    border-top-color: #8b5cf6;
    animation: spin 1s ease-in-out infinite;
    margin-bottom: 24px;
}

.intro-text {
    font-family: 'Outfit', sans-serif;
    color: #fff;
    font-size: 1.25rem;
    letter-spacing: 4px;
    font-weight: 800;
    text-transform: uppercase;
    animation: pulse-text 2s infinite;
    background: linear-gradient(to right, #a78bfa, #3b82f6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes pulse-text {

    0%,
    100% {
        opacity: 0.6;
    }

    50% {
        opacity: 1;
    }
}

/* --- ESTILOS DEL METRÓNOMO --- */
@keyframes pulse-animation {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(139, 92, 246, 0.7);
    }

    50% {
        transform: scale(1.1);
        box-shadow: 0 0 0 15px rgba(139, 92, 246, 0);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(139, 92, 246, 0);
    }
}

.animate-beat {
    animation: pulse-animation 0.1s ease-out;
    background-color: #8b5cf6 !important;
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.8);
}

/* Personalización de inputs range */
input[type=range] {
    -webkit-appearance: none;
    background: transparent;
}

input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    height: 24px;
    width: 24px;
    border-radius: 50%;
    background: #8b5cf6;
    cursor: pointer;
    margin-top: -10px;
    box-shadow: 0 0 10px rgba(139, 92, 246, 0.5), inset 0 0 4px rgba(255, 255, 255, 0.3);
    border: 2px solid #fff;
    transition: transform 0.1s;
}

input[type=range]::-webkit-slider-thumb:hover {
    transform: scale(1.1);
}

input[type=range]::-webkit-slider-runnable-track {
    width: 100%;
    height: 6px;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

input[type=range]:focus {
    outline: none;
}

/* Glassmorphism Classes */
.glass-panel {
    background: rgba(17, 24, 39, 0.7);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.glass-button {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.2s ease;
}

.glass-button:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

/* Animación suave para el modal */
.modal-enter {
    animation: fade-in 0.3s ease-out forwards;
}

@keyframes fade-in {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Estilos Select Oscuro */
select {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%239ca3af' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

select option {
    background-color: #111827;
    color: #fff;
}

/* Barra de navegación RK 2.0 */
.rk-header-nav {
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(51, 65, 85, 0.5);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 50;
    margin-bottom: 1rem;
    width: 100%;
    box-sizing: border-box;
}

.rk-header-nav a.btn-back {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    padding: 0.6rem 1.2rem;
    border-radius: 9999px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.875rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.rk-header-nav a.btn-back:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    color: white;
}

.rk-header-nav .brand {
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -0.025em;
    background: linear-gradient(to right, #38bdf8, #3b82f6);
    -webkit-background-clip: text;
    color: transparent;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Ajustes para Móvil */
@media (max-width: 640px) {
    .rk-header-nav {
        padding: 0.8rem 1rem;
    }

    .rk-header-nav .brand {
        font-size: 1rem;
    }

    .rk-header-nav .brand span.full-text {
        display: none;
    }

    .rk-header-nav a.btn-back {
        padding: 0.5rem 0.8rem;
        font-size: 0.85rem;
    }

    .rk-header-nav a.btn-back span {
        display: none;
    }

    /* Ocultar texto "Volver" en móvil muy estrecho si es necesario, pero pondremos "Volver" corto */
    .rk-header-nav {
        margin-bottom: 1rem;
    }
}

/* ── Diagramas de Acordes (light card) ─────────────────────────── */
.chord-box-svg {
    min-width: 110px;
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 10px 8px 6px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.chord-box-svg:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
}

.chord-title {
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 4px;
    font-size: 0.85rem;
    font-family: 'Outfit', sans-serif;
}

.chord-quality-label {
    font-size: 0.7rem;
    color: #64748b;
    margin-top: 2px;
}

/* ── Scroll horizontal de acordes ───────────────────────────────── */
.chords-scroll-container {
    display: flex;
    overflow-x: auto;
    gap: 1rem;
    padding: 0.75rem 0 1rem;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: rgba(139, 92, 246, 0.4) transparent;
}

.chords-scroll-container::-webkit-scrollbar {
    height: 4px;
}

.chords-scroll-container::-webkit-scrollbar-thumb {
    background: rgba(139, 92, 246, 0.4);
    border-radius: 2px;
}

/* ── Fretboard compartido (diapasón) ────────────────────────────── */
.fretboard-wrapper {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    background: #1e2a3a;
    padding: 1rem;
    border-radius: 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.note-marker {
    position: absolute;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background-color: #4299e1;
    color: white;
    font-size: 0.75rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3;
    transform: translate(-50%, -50%);
    transition: transform 0.1s;
}

.note-marker.root {
    background-color: #e53e3e;
}

.note-marker:hover {
    transform: translate(-50%, -50%) scale(1.15);
}

.fret-number-label {
    width: 50px;
    text-align: center;
    font-size: 0.75rem;
    color: #94a3b8;
}

/* --- RK 2.0 WRAPPER (Fondo y tipografía base compartida) --- */
.rk-2-wrapper {
    font-family: 'Outfit', sans-serif;
    background-color: #0b1120;
    background-image:
        radial-gradient(circle at top right, rgba(0, 255, 136, 0.06), transparent 400px),
        radial-gradient(circle at bottom left, rgba(0, 153, 255, 0.06), transparent 400px);
    min-height: 100vh;
    color: #e2e8f0;
}