/**
 * Guitar Synthesia - Estilos CSS
 * UI minimalista y moderna con estética de amplificador de guitarra
 */

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

/* Reset y base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: #0a0a0c;
    color: #e8e8e8;
}

/* ============================================
   Sidebar
   ============================================ */

.sidebar-toggle {
    position: fixed;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
    z-index: 1500;
    width: 24px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(20, 20, 25, 0.85);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-left: none;
    border-radius: 0 10px 10px 0;
    color: #c0c0c8;
    cursor: pointer;
    transition: all 0.25s ease;
    padding: 0;
}

.sidebar-toggle:hover {
    background: rgba(255, 154, 92, 0.2);
    border-color: rgba(255, 154, 92, 0.4);
    color: #ff9a5c;
    width: 30px;
}

.sidebar-toggle.hidden {
    display: none;
}

.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1900;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 380px;
    height: 100%;
    background: linear-gradient(180deg, #141418 0%, #111115 100%);
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 8px 0 30px rgba(0, 0, 0, 0.5);
}

.sidebar.open {
    transform: translateX(0);
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 20px 12px;
    flex-shrink: 0;
}

.sidebar-header h2 {
    font-size: 20px;
    font-weight: 700;
    background: linear-gradient(135deg, #ff9a5c 0%, #ffc85c 50%, #ff9a5c 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.sidebar-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    color: #8888a0;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.sidebar-close:hover {
    background: rgba(255, 80, 80, 0.15);
    border-color: rgba(255, 80, 80, 0.3);
    color: #ff6060;
}

.sidebar-search {
    padding: 0 20px 16px;
    position: relative;
    flex-shrink: 0;
}

.sidebar-search .search-icon {
    position: absolute;
    left: 32px;
    top: calc(50% - 8px);
    transform: translateY(-50%);
    color: #55555f;
    pointer-events: none;
}

.sidebar-search input {
    width: 100%;
    padding: 10px 12px 10px 40px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    color: #e0e0e8;
    font-size: 13px;
    font-family: inherit;
    transition: all 0.2s ease;
    outline: none;
}

.sidebar-search input::placeholder {
    color: #55555f;
}

.sidebar-search input:focus {
    border-color: rgba(255, 154, 92, 0.4);
    box-shadow: 0 0 0 3px rgba(255, 154, 92, 0.08);
}

.sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 0 20px;
    min-height: 0;
}

/* Sidebar config panel */
.sidebar-config {
    flex-shrink: 0;
    padding: 16px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(0, 0, 0, 0.15);
}

.sidebar-config .config-row {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.sidebar-config .config-row:last-child {
    margin-bottom: 0;
}

.sidebar-config .config-field {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.sidebar-config .config-field.full {
    flex: 1 1 100%;
}

.sidebar-config label {
    font-size: 11px;
    color: #8888a0;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 5px;
}

.sidebar-config input,
.sidebar-config select {
    width: 100%;
    padding: 8px 10px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    color: #e0e0e8;
    font-size: 13px;
    font-family: inherit;
    transition: all 0.2s ease;
    outline: none;
}

.sidebar-config select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b6b78' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 30px;
}

.sidebar-config input:focus,
.sidebar-config select:focus {
    border-color: rgba(255, 154, 92, 0.4);
}

.notation-toggle {
    display: flex;
    gap: 0;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.notation-btn {
    flex: 1;
    padding: 7px 12px;
    background: rgba(255, 255, 255, 0.04);
    border: none;
    color: #6b6b78;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.notation-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #a0a0aa;
}

.notation-btn.active {
    background: rgba(255, 154, 92, 0.15);
    color: #ff9a5c;
}

@media (max-width: 440px) {
    .sidebar {
        width: 100%;
    }
}


.hint {
    font-size: 11px;
    color: #55555f;
    margin-top: 4px;
    line-height: 1.4;
}

/* Canvas principal */
#main-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: block;
}

/* Mensajes de notificación */
.message {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    padding: 14px 24px;
    background: rgba(15, 15, 18, 0.95);
    color: #e0e0e8;
    border-radius: 10px;
    font-size: 14px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 50;
    border: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(20px);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.message.visible {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.message.info {
    border-left: 3px solid #5c9aff;
}

.message.success {
    border-left: 3px solid #5cff8a;
}

.message.error {
    border-left: 3px solid #ff5c5c;
}

/* Barra de progreso */
.progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    background: rgba(255, 154, 92, 0.15);
    z-index: 100;
    cursor: pointer;
    transition: height 0.2s ease, background 0.2s ease;
}

.progress-bar:hover {
    height: 10px;
    background: rgba(255, 154, 92, 0.3);
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg,
        #cc6b3a 0%,
        #ff9a5c 50%,
        #ffb87a 100%
    );
    width: 0%;
    transition: width 0.1s linear;
    position: relative;
}

.progress-bar-fill::after {
    content: '';
    position: absolute;
    right: -6px;
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
    height: 12px;
    background: #ffb87a;
    border-radius: 50%;
    box-shadow: 0 0 6px rgba(255, 154, 92, 0.6);
    transition: width 0.2s ease, height 0.2s ease, box-shadow 0.2s ease;
}

.progress-bar:hover .progress-bar-fill::after {
    width: 16px;
    height: 16px;
    box-shadow: 0 0 12px rgba(255, 154, 92, 0.9);
}

/* Estilos para la zona de letras horizontales (se renderiza en canvas) */
/* Estas variables CSS se pueden usar para temas personalizados */
:root {
    --lyrics-bg-color: #1a1a1f;
    --lyrics-active-color: #ff9a5c;
    --lyrics-upcoming-color: rgba(255, 255, 255, 0.5);
    --lyrics-past-color: rgba(255, 255, 255, 0.25);
    --lyrics-glow-color: rgba(255, 154, 92, 0.6);
    --progress-bg-color: #1a1a1f;
    --progress-fill-color: #ff9a5c;
}

/* Animaciones */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

@keyframes glow {
    0%, 100% { 
        box-shadow: 0 0 5px currentColor, 0 0 10px currentColor;
    }
    50% { 
        box-shadow: 0 0 15px currentColor, 0 0 30px currentColor;
    }
}

/* Scrollbar personalizada */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}


/* Loading spinner */
.loading-spinner {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 48px;
    height: 48px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: #ff9a5c;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    z-index: 200;
}

@keyframes spin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

@keyframes spin-inline {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Estilos para el mástil (referencia, se dibuja en canvas) */
.fretboard-reference {
    /* Cuerdas por color - estilo vibrante */
    --string-1: #ff5c5c; /* E agudo */
    --string-2: #ff9a5c; /* B */
    --string-3: #ffd55c; /* G */
    --string-4: #5cff8a; /* D */
    --string-5: #5c9aff; /* A */
    --string-6: #a55cff; /* E grave */
}

/* ============================================
   Project Selector Styles
   ============================================ */

/* Loading state */
.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 24px;
    color: #8888a0;
}

.loading-state .spinner {
    width: 28px;
    height: 28px;
    border: 3px solid rgba(255, 154, 92, 0.2);
    border-top-color: #ff9a5c;
    border-radius: 50%;
    animation: spin-inline 0.8s linear infinite;
}

/* Error state */
.error-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 20px;
    text-align: center;
    color: #ff7070;
}

.error-state .error-icon {
    font-size: 24px;
}

.error-state .error-message {
    font-size: 13px;
}

/* Empty state */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 24px;
    text-align: center;
    color: #6b6b78;
}

.empty-state .empty-icon {
    font-size: 32px;
    opacity: 0.6;
}

.empty-state a {
    color: #ff9a5c;
    text-decoration: none;
}

.empty-state a:hover {
    text-decoration: underline;
}

/* Projects list */
.projects-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-bottom: 8px;
}

.project-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.project-card:hover {
    background: rgba(255, 154, 92, 0.08);
    border-color: rgba(255, 154, 92, 0.25);
}

.project-card.selected {
    background: rgba(255, 154, 92, 0.12);
    border-color: rgba(255, 154, 92, 0.4);
    box-shadow: 0 0 0 2px rgba(255, 154, 92, 0.15);
}

.project-card .project-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(255, 154, 92, 0.15) 0%, rgba(255, 184, 122, 0.1) 100%);
    border-radius: 8px;
    font-size: 18px;
    flex-shrink: 0;
}

.project-card .project-info {
    flex: 1;
    min-width: 0;
}

.project-card .project-title {
    display: block;
    font-weight: 600;
    font-size: 14px;
    color: #e8e8ee;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.project-card .project-artist {
    display: block;
    font-size: 12px;
    color: #7b7b88;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.project-card .check-icon {
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: transparent;
    border: 2px solid rgba(255, 255, 255, 0.15);
    color: transparent;
    font-size: 12px;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.project-card.selected .check-icon {
    background: #ff9a5c;
    border-color: #ff9a5c;
    color: #0a0a0c;
}

.project-card.loading {
    pointer-events: none;
    opacity: 0.6;
}

.project-card.loading .check-icon {
    border-color: rgba(255, 154, 92, 0.4);
    background: transparent;
    color: transparent;
    animation: spin-inline 0.8s linear infinite;
    border-top-color: #ff9a5c;
}


/* Secondary button */
.secondary-btn {
    padding: 8px 16px;
    font-size: 12px;
    font-weight: 600;
    font-family: inherit;
    color: #b0b0b8;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.secondary-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.2);
    color: #e0e0e8;
}

/* Playback info overlay */
.playback-info {
    position: fixed;
    top: 50px;
    right: 14px;
    z-index: 100;
    display: none;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
    pointer-events: none;
    font-family: 'Outfit', Arial, sans-serif;
}

.playback-info.visible {
    display: flex;
}

.playback-info .pi-time {
    font-size: 15px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.85);
    text-shadow: 0 1px 4px rgba(0,0,0,0.7);
}

.playback-info .pi-speed {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.45);
    text-shadow: 0 1px 3px rgba(0,0,0,0.6);
}

.playback-info .pi-pause {
    display: inline-flex;
    gap: 4px;
    align-items: center;
    vertical-align: middle;
    margin-right: 6px;
}

.playback-info .pi-pause-bar {
    width: 4px;
    height: 16px;
    background: #ff9a5c;
    border-radius: 1px;
}

/* Hidden utility */
.hidden {
    display: none !important;
}

