:root {
    /* Color Palette */
    --color-bg-dark: #2b1b17;
    /* Marrón Árbol Flamenco */
    --color-bg-panel: #1a0f0a;
    /* Darker panel background */
    --color-gold: #d4af37;
    /* Oro Metalizado */
    --color-gold-dim: #c5a059;
    /* Duller gold for text/borders */
    --color-gold-bright: #ffd700;
    /* Bright gold for highlights */
    --color-text-primary: #e0e0e0;
    --color-overlay: rgba(0, 0, 0, 0.7);

    /* Spacing & Borders */
    --border-radius: 4px;
    /* Sharp hardware look */
    --border-width: 2px;
}

/* Home Logo Styles */
.home-logo-link {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1000;
    /* High priority but below Modal */
    transition: transform 0.3s ease;
}

.home-logo-link:hover {
    transform: scale(1.05);
    filter: drop-shadow(0 0 10px var(--color-gold));
}

.home-logo {
    width: 150px;
    /* Adjust size as needed */
    height: auto;
    display: block;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Sidebar Logo */
.sidebar-logo-container {
    text-align: center;
    margin-bottom: 10px;
    padding: 5px;
    border-bottom: 2px solid var(--color-gold-dim);
}

.sidebar-logo {
    max-width: 100%;
    height: auto;
    border-radius: var(--border-radius);
    border: 1px solid var(--color-gold);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.5);
}

body {
    font-family: 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--color-bg-dark);
    color: var(--color-gold);
    background-image: url('background.png');
    /* Fallback / Blend */
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Scrollbars */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--color-bg-panel);
}

::-webkit-scrollbar-thumb {
    background: var(--color-gold-dim);
    border-radius: 4px;
}

/* Common UI Elements */
button {
    background: linear-gradient(135deg, var(--color-gold-dim), var(--color-bg-dark));
    border: 1px solid var(--color-gold);
    color: var(--color-gold-bright);
    padding: 10px 20px;
    font-size: 1rem;
    text-transform: uppercase;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.5);
    transition: all 0.2s ease;
    border-radius: var(--border-radius);
    text-shadow: 1px 1px 2px black;
}

button:hover {
    background: linear-gradient(135deg, var(--color-gold), var(--color-bg-panel));
    box-shadow: 0 0 10px var(--color-gold);
    transform: translateY(-1px);
}

button:active {
    transform: translateY(1px);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.8);
}

input[type="text"] {
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid var(--color-gold-dim);
    color: var(--color-gold-bright);
    padding: 12px;
    font-size: 1.1rem;
    border-radius: var(--border-radius);
    outline: none;
    transition: border-color 0.3s;
}

input[type="text"]:focus {
    border-color: var(--color-gold-bright);
    box-shadow: 0 0 8px rgba(212, 175, 55, 0.4);
}

/* Glass panel style for containers */
.glass-panel {
    background: rgba(26, 15, 10, 0.85);
    /* Dark brown semi-transparent */
    border: 1px solid var(--color-gold-dim);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
    border-radius: var(--border-radius);
}


/* Tuner Modal Styles */
.modal-overlay {
    position: fixed !important;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 99999;
    /* Max Priority */
}

.tuner-panel {
    width: 450px;
    padding: 30px;
    text-align: center;
    position: relative;
    background: #1a0f0a;
    border: 3px solid var(--color-gold);
    border-radius: 15px;
    box-shadow: 0 0 50px rgba(0, 0, 0, 1);
    z-index: 100000;
}

.tuner-panel h2 {
    color: var(--color-gold-bright);
    margin-bottom: 20px;
    font-size: 1.8rem;
    text-transform: uppercase;
    letter-spacing: 2px;
}

#close-tuner {
    position: absolute;
    top: 10px;
    right: 10px;
    background: transparent;
    border: none;
    color: var(--color-gold-dim);
    font-size: 1.5rem;
    box-shadow: none;
    padding: 0;
}

#close-tuner:hover {
    color: red;
    transform: scale(1.1);
}

.note-display {
    font-size: 5rem;
    font-weight: bold;
    color: white;
    margin: 10px 0;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

#note-octave {
    font-size: 2rem;
    color: var(--color-gold-dim);
    vertical-align: super;
}

/* Gauge Visuals */
.tuner-gauge {
    position: relative;
    width: 100%;
    height: 150px;
    background: radial-gradient(circle at bottom, #333 0%, #111 70%);
    border-radius: 10px 10px 0 0;
    margin: 20px 0;
    border-bottom: 2px solid var(--color-gold-dim);
    overflow: hidden;
}

.gauge-center {
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 2px;
    height: 100%;
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(-50%);
}

.gauge-needle {
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 6px;
    height: 130px;
    background: var(--color-gold);
    transform-origin: bottom center;
    transform: translateX(-50%) rotate(0deg);
    transition: transform 0.1s linear, background-color 0.2s;
    border-radius: 3px;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
}

#freq-display {
    color: var(--color-gold-dim);
    font-family: monospace;
    font-size: 1.2rem;
}

#status-msg {
    margin-top: 10px;
    font-weight: bold;
    min-height: 1.5rem;
}

#status-message {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--color-bg-panel);
    border: 1px solid var(--color-gold);
    color: var(--color-gold);
    padding: 10px 20px;
    z-index: 1000;
    display: none;
    border-radius: var(--border-radius);
}

/* --- Volume Controls (Appended) --- */
/* Slider (Range Input) Styling */
input[type=range] {
    -webkit-appearance: none;
    width: 60px;
    /* Small slider to fit on video */
    background: transparent;
    margin: 0;
}

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

/* Slider Track */
input[type=range]::-webkit-slider-runnable-track {
    width: 100%;
    height: 6px;
    cursor: pointer;
    background: #333;
    border: 1px solid var(--color-gold-dim);
    border-radius: 3px;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.5);
}

/* Slider Thumb */
input[type=range]::-webkit-slider-thumb {
    height: 12px;
    width: 12px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--color-gold-bright), var(--color-gold));
    border: 1px solid #fff;
    cursor: pointer;
    -webkit-appearance: none;
    margin-top: -4px;
    /* Center thumb */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

/* Volume Control Container in Video Card */
.volume-control {
    position: absolute;
    bottom: 40px;
    /* Above name label */
    left: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    opacity: 0.8;
    /* Always partly visible or show on hover */
    background: rgba(0, 0, 0, 0.6);
    padding: 4px 8px;
    border-radius: 100px;
    border: 1px solid var(--color-gold-dim);
    transition: opacity 0.2s;
    z-index: 20;
}

.video-card:hover .volume-control {
    opacity: 1;
}

.volume-icon {
    /* Simple CSS speaker icon maybe, or emoji */
    color: var(--color-gold);
    font-size: 0.8rem;
    cursor: pointer;
    cursor: pointer;
    /* Click to mute? */
}

/* --- Metronome Panel Styles --- */
#metronome-panel {
    position: fixed;
    top: 80px;
    right: 20px;
    width: 320px;
    background: #1a0f0a;
    /* Fallback */
    background: var(--color-bg-panel);
    border: 2px solid var(--color-gold);
    z-index: 500;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--color-gold-dim);
    padding-bottom: 10px;
    margin-bottom: 15px;
}

.panel-header h3 {
    margin: 0;
    color: var(--color-gold-bright);
}

.metronome-tabs {
    display: flex;
    justify-content: space-around;
    margin-bottom: 15px;
    background: rgba(0, 0, 0, 0.3);
    padding: 5px;
    border-radius: 4px;
}

.tab-btn {
    background: transparent;
    border: none;
    color: var(--color-gold-dim);
    font-size: 0.9rem;
    padding: 8px 15px;
    cursor: pointer;
    box-shadow: none;
}

.tab-btn.active {
    background: var(--color-gold);
    color: #1a0f0a;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

.metronome-content {
    display: none;
    text-align: center;
}

.metronome-content.active {
    display: block;
}

.bpm-display {
    font-size: 2.5rem;
    font-weight: bold;
    color: white;
    margin: 10px 0;
}

/* Compás Clock Visuals */
.compas-clock {
    width: 200px;
    height: 200px;
    margin: 20px auto;
    position: relative;
    border-radius: 50%;
    border: 2px solid var(--color-gold-dim);
    background: radial-gradient(circle, #2b1b17, #000);
}

.clock-dot {
    position: absolute;
    width: 20px;
    height: 20px;
    background: #444;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    box-shadow: inset 0 0 5px black;
    transition: background 0.1s;
}

.clock-dot.active {
    background: var(--color-gold-bright);
    box-shadow: 0 0 15px var(--color-gold);
    transform: translate(-50%, -50%) scale(1.3);
}

.clock-dot.accent {
    border: 2px solid red;
    /* Mark accent positions visually */
}

#metro-play-btn {
    width: 100%;
    margin-top: 15px;
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    color: white;
    border-color: #27ae60;
}

#metro-play-btn.playing {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    border-color: #c0392b;
}

/* --- Metronome Panel Styles --- */
#metronome-panel {
    position: fixed;
    top: 80px;
    right: 20px;
    width: 320px;
    background: #1a0f0a;
    /* Fallback */
    background: var(--color-bg-panel);
    border: 2px solid var(--color-gold);
    z-index: 500;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--color-gold-dim);
    padding-bottom: 10px;
    margin-bottom: 15px;
}

.panel-header h3 {
    margin: 0;
    color: var(--color-gold-bright);
}

.metronome-tabs {
    display: flex;
    justify-content: space-around;
    margin-bottom: 15px;
    background: rgba(0, 0, 0, 0.3);
    padding: 5px;
    border-radius: 4px;
}

.tab-btn {
    background: transparent;
    border: none;
    color: var(--color-gold-dim);
    font-size: 0.9rem;
    padding: 8px 15px;
    cursor: pointer;
    box-shadow: none;
}

.tab-btn.active {
    background: var(--color-gold);
    color: #1a0f0a;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

.metronome-content {
    display: none;
    text-align: center;
}

.metronome-content.active {
    display: block;
}

.bpm-display {
    font-size: 2.5rem;
    font-weight: bold;
    color: white;
    margin: 10px 0;
}

/* Compás Clock Visuals */
.compas-clock {
    width: 200px;
    height: 200px;
    margin: 20px auto;
    position: relative;
    border-radius: 50%;
    border: 2px solid var(--color-gold-dim);
    background: radial-gradient(circle, #2b1b17, #000);
}

.clock-dot {
    position: absolute;
    width: 20px;
    height: 20px;
    background: #444;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    box-shadow: inset 0 0 5px black;
    transition: background 0.1s;
}

.clock-dot.active {
    background: var(--color-gold-bright);
    box-shadow: 0 0 15px var(--color-gold);
    transform: translate(-50%, -50%) scale(1.3);
}

.clock-dot.accent {
    border: 2px solid red;
    /* Mark accent positions visually */
}

#metro-play-btn {
    width: 100%;
    margin-top: 15px;
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    color: white;
    border-color: #27ae60;
}

#metro-play-btn.playing {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    border-color: #c0392b;
}

/* --- Fullscreen Spotlight Overlay --- */
#fullscreen-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #000;
    z-index: 2000;
    /* On top of everything */
    display: none;
    /* Hidden by default */
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

#fullscreen-video {
    width: 95%;
    height: 90%;
    object-fit: contain;
    border: 2px solid var(--color-gold);
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.5);
}

#fullscreen-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid white;
    color: white;
    padding: 10px 20px;
    cursor: pointer;
    font-size: 1rem;
    border-radius: 4px;
}

#fullscreen-label {
    position: absolute;
    bottom: 20px;
    color: var(--color-gold-bright);
    font-size: 1.5rem;
    text-shadow: 2px 2px 4px black;
    background: rgba(0, 0, 0, 0.6);
    padding: 5px 15px;
    border-radius: 4px;
}