/* =============================
   VARIABLES DE TEMA
   ============================= */
:root {
    --primary-color: #10a37f;
    --background-color: #f7f7f8;
    --text-color: #202123;
    --border-color: #d9d9e3;
    --input-bg: #ffffff;
    --surface-color: #ffffff;
    --muted-color: #8e8ea0;
}

.theme-oscuro {
    --primary-color: #19c37d;
    --background-color: #212121;
    --text-color: #ececf1;
    --border-color: #4d4d4f;
    --input-bg: #2f2f2f;
    --surface-color: #2f2f2f;
    --muted-color: #b4b4c0;
}

.theme-verde {
    --primary-color: #ffffff;
    --background-color: #1B6B16;
    --text-color: #ffffff;
    --border-color: rgba(255, 255, 255, 0.3);
    --input-bg: rgba(255, 255, 255, 0.18);
    --surface-color: #155010;
    --muted-color: rgba(255, 255, 255, 0.7);
}

.theme-azul {
    --primary-color: #ffffff;
    --background-color: #081D4D;
    --text-color: #ffffff;
    --border-color: rgba(255, 255, 255, 0.3);
    --input-bg: rgba(255, 255, 255, 0.18);
    --surface-color: #051438;
    --muted-color: rgba(255, 255, 255, 0.7);
}

.theme-rosa {
    --primary-color: #ffffff;
    --background-color: #CF0A24;
    --text-color: #ffffff;
    --border-color: rgba(255, 255, 255, 0.3);
    --input-bg: rgba(255, 255, 255, 0.18);
    --surface-color: #a3081c;
    --muted-color: rgba(255, 255, 255, 0.7);
}

/* =============================
   RESET Y BASE
   ============================= */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    min-height: 100dvh;
    background: linear-gradient(180deg, #ffffff 0%, var(--background-color) 38%, var(--background-color) 100%);
    color: var(--text-color);
    font-family: Arial, Helvetica, sans-serif;
    transition: background-color 0.3s, color 0.3s;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.theme-oscuro body,
.theme-verde body,
.theme-azul body,
.theme-rosa body {
    background: var(--background-color);
}

button, input {
    font: inherit;
    color: inherit;
}

/* =============================
   CONTENEDOR PRINCIPAL
   ============================= */
.container {
    width: 100%;
    max-width: 760px;
    min-height: 100dvh;
    padding: 22px 18px 32px;
    display: flex;
    flex-direction: column;
}

/* =============================
   CABECERA
   ============================= */
header {
    position: relative;
    min-height: 44px;
    margin-bottom: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

header h1 {
    color: var(--text-color);
    font-size: 28px;
    font-weight: 600;
    line-height: 1.2;
    transition: color 0.3s;
}

/* =============================
   BOTÓN DE MENÚ (HAMBURGUESA)
   ============================= */
.menu-wrapper {
    position: absolute;
    left: 0;
    top: 0;
    z-index: 10;
}

.menu-toggle {
    width: 38px;
    height: 38px;
    padding: 7px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 4px;
    outline: none;
    transition: background-color 0.2s, border-color 0.2s;
}

.menu-toggle span {
    width: 2px;
    height: 18px;
    border-radius: 2px;
    background: var(--text-color);
    transition: background-color 0.3s;
}

.menu-toggle:hover {
    background: rgba(0, 0, 0, 0.05);
    border-color: var(--border-color);
}

.theme-oscuro .menu-toggle:hover,
.theme-verde .menu-toggle:hover,
.theme-azul .menu-toggle:hover,
.theme-rosa .menu-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* =============================
   OVERLAY (FONDO OSCURO)
   ============================= */
.menu-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 200;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.menu-overlay.open {
    opacity: 1;
    visibility: visible;
}

/* =============================
   PANEL MENÚ LATERAL DESLIZABLE
   ============================= */
.main-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 280px;
    height: 100vh;
    background: var(--surface-color);
    border-right: 1px solid var(--border-color);
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.15);
    z-index: 300;
    padding: 28px 18px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    overflow-y: auto;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                background-color 0.3s,
                border-color 0.3s;
    will-change: transform;
}

.main-menu.open {
    transform: translateX(0);
}

/* Secciones del menú */
.menu-section {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.menu-section h3 {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--muted-color);
    padding-bottom: 6px;
    margin-bottom: 2px;
    border-bottom: 1px solid var(--border-color);
    transition: color 0.3s, border-color 0.3s;
}

.menu-section a,
.menu-section button {
    display: block;
    width: 100%;
    text-align: left;
    padding: 10px 12px;
    border-radius: 8px;
    color: var(--text-color);
    background: transparent;
    border: none;
    font-size: 15px;
    cursor: pointer;
    text-decoration: none;
    outline: none;
    transition: background-color 0.2s, color 0.3s;
}

.menu-section a:hover,
.menu-section button:hover {
    background: rgba(16, 163, 127, 0.1);
}

.menu-section a.active,
.menu-section button.active {
    background: rgba(16, 163, 127, 0.16);
    font-weight: 600;
}

/* Hover/activo para temas de color */
.theme-verde .menu-section a:hover,
.theme-verde .menu-section button:hover,
.theme-azul .menu-section a:hover,
.theme-azul .menu-section button:hover,
.theme-rosa .menu-section a:hover,
.theme-rosa .menu-section button:hover {
    background: rgba(255, 255, 255, 0.15);
}

.theme-verde .menu-section a.active,
.theme-verde .menu-section button.active,
.theme-azul .menu-section a.active,
.theme-azul .menu-section button.active,
.theme-rosa .menu-section a.active,
.theme-rosa .menu-section button.active {
    background: rgba(255, 255, 255, 0.25);
}

.theme-oscuro .menu-section a:hover,
.theme-oscuro .menu-section button:hover {
    background: rgba(255, 255, 255, 0.08);
}

.theme-oscuro .menu-section a.active,
.theme-oscuro .menu-section button.active {
    background: rgba(255, 255, 255, 0.14);
}

/* =============================
   BUSCADOR
   ============================= */
.search-box {
    position: relative;
    width: 100%;
    max-width: 680px;
    margin: 0 auto 14px;
}

.search-box input {
    width: 100%;
    min-height: 56px;
    padding: 15px 48px 15px 18px;
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    color: var(--text-color);
    font-size: 16px;
    outline: none;
    transition: background-color 0.3s, border-color 0.3s, box-shadow 0.2s, color 0.3s;
}

.theme-oscuro .search-box input,
.theme-verde .search-box input,
.theme-azul .search-box input,
.theme-rosa .search-box input {
    box-shadow: none;
}

.search-box input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(16, 163, 127, 0.15);
}

.theme-verde .search-box input:focus,
.theme-azul .search-box input:focus,
.theme-rosa .search-box input:focus {
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.25);
}

.search-box input::placeholder {
    color: var(--muted-color);
}

.clear-btn {
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    display: none;
    background: none;
    border: none;
    color: var(--muted-color);
    font-size: 24px;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    outline: none;
}

/* =============================
   LISTA DE RESULTADOS
   ============================= */
.results-list {
    width: 100%;
    max-width: 680px;
    max-height: 260px;
    margin: 0 auto 14px;
    display: none;
    overflow-y: auto;
    list-style: none;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    transition: background-color 0.3s, border-color 0.3s;
}

.results-list li {
    padding: 13px 16px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-color);
    cursor: pointer;
    font-size: 15px;
    transition: background-color 0.2s, border-color 0.3s, color 0.3s;
}

.results-list li:last-child {
    border-bottom: none;
}

.results-list li:hover {
    background: rgba(16, 163, 127, 0.08);
}

.results-list li.active {
    background: rgba(16, 163, 127, 0.14);
}

.theme-verde .results-list li:hover,
.theme-azul .results-list li:hover,
.theme-rosa .results-list li:hover {
    background: rgba(255, 255, 255, 0.15);
}

.theme-verde .results-list li.active,
.theme-azul .results-list li.active,
.theme-rosa .results-list li.active {
    background: rgba(255, 255, 255, 0.25);
}

.results-list::-webkit-scrollbar { width: 6px; }
.results-list::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 10px;
}
.results-list::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}

/* =============================
   VISOR DE LETRAS
   ============================= */
.lyrics-container {
    width: 100%;
    max-width: 680px;
    min-height: 220px;
    margin: 0 auto;
    padding: 24px 22px;
}

.lyrics-title {
    margin-bottom: 18px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-color);
    font-size: 20px;
    font-weight: 600;
    transition: color 0.3s, border-color 0.3s;
}

.lyrics-body {
    color: var(--text-color);
    font-size: 17px;
    line-height: 1.8;
    white-space: pre-line;
    transition: color 0.3s;
}

.placeholder-text {
    padding: 48px 12px;
    color: var(--muted-color);
    text-align: center;
    font-size: 17px;
    transition: color 0.3s;
}

.placeholder-text.error-text {
    color: #e05555;
}

#lyricsContent {
    display: none;
    animation: fadeIn 0.3s ease;
}

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

/* =============================
   FUENTE SERIF (OPCIONAL)
   ============================= */
.font-serif #searchInput,
.font-serif #songTitle,
.font-serif #songBody {
    font-family: Georgia, "Times New Roman", serif;
}

/* =============================
   RESPONSIVE MÓVIL
   ============================= */
@media (max-width: 480px) {
    .container { padding: 16px 12px 24px; }
    header { margin-bottom: 54px; }
    header h1 { font-size: 22px; }
    .lyrics-container { padding: 22px 10px; }
    .lyrics-title { font-size: 19px; }
    .lyrics-body { font-size: 16px; }
}
