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

body {
    font-family: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    background: #faf9f6;
    color: #1a1a1a;
    min-height: 100vh;
    line-height: 1.6;
}

/* Header */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid #e0e0e0;
    background: #faf9f6;
}

.logo {
    width: 40px;
    height: 40px;
    margin-right: 1rem;
    border-radius: 50%;
    transition: transform 0.3s ease;
}

.logo:hover {
    transform: scale(1.1);
}
.header-content {
    display: flex;
    align-items: center;
}

.header-content h1 {
    font-size: 1.5rem;
    font-weight: 400;
    color: #1a1a1a;
    margin-bottom: 0;
}

.header-content p {
    color: #666666;
    font-size: 0.8rem;
    margin-left: 1rem;
}

.language-toggle {
    display: flex;
    gap: 0.5rem;
}

.lang-btn {
    background: transparent;
    border: none;
    color: #999999;
    padding: 0.5rem 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.85rem;
    font-family: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-weight: 400;
}

.lang-btn.active,
.lang-btn:hover {
    background: transparent;
    color: #1a1a1a;
}

/* Layout principal */
.app-layout {
    display: flex;
    min-height: calc(100vh - 80px);
}

.main-content {
    flex: 0 0 60%;
    padding: 1.5rem;
    max-width: 60%;
}

.sidebar {
    flex: 0 0 40%;
    background: #f5f4f1;
    border-left: 1px solid #e0e0e0;
    overflow-y: auto;
    max-width: 40%;
}

.sidebar-content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.controls-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    align-items: start;
}

.control-section {
    break-inside: avoid;
}

.effects-section {
    grid-column: 1 / -1;
}

.effects-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* Descripción */
.description h2 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: #1a1a1a;
    font-weight: 400;
    line-height: 1.5;
}

.subtitle {
    color: #666666;
    margin-bottom: 2rem;
    font-size: 0.9rem;
}

.donation-link {
    color: #1a1a1a;
    text-decoration: underline;
    transition: all 0.3s ease;
}

.donation-link:hover {
    color: #666666;
    text-decoration: none;
}

/* Carga de archivos compacta */
.file-upload-compact {
    margin-bottom: 1.5rem;
}

.file-drop-zone-compact {
    border: 1px dashed #cccccc;
    border-radius: 4px;
    padding: 1rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #ffffff;
}

.file-drop-zone-compact:hover,
.file-drop-zone-compact.drag-over {
    background: #f5f4f1;
    border-color: #999999;
}

.drop-content-compact {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.drop-icon {
    font-size: 1.2rem;
}

.file-info-compact {
    margin-top: 0.5rem;
    font-size: 0.8rem;
    color: #666666;
    text-align: center;
}

/* Editor de raw data */
.raw-data-editor {
    margin-top: 1rem;
}

.editor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e0e0e0;
}

.editor-header h3 {
    font-size: 0.95rem;
    font-weight: 400;
    color: #1a1a1a;
}

.editor-controls {
    display: flex;
    gap: 0.5rem;
}

.editor-controls button {
    background: #ffffff;
    border: 1px solid #cccccc;
    color: #1a1a1a;
    padding: 0.4rem 0.9rem;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.8rem;
    font-family: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-weight: 400;
}

.editor-controls button:hover {
    background: #f5f4f1;
    border-color: #999999;
}

#playBtn {
    background: #1a1a1a;
    color: #ffffff;
    border-color: #1a1a1a;
}

#playBtn:hover {
    background: #333333;
    border-color: #333333;
}

#rawDataEditor {
    width: 100%;
    height: 450px;
    background: #ffffff;
    border: 1px solid #cccccc;
    border-radius: 4px;
    color: #1a1a1a;
    padding: 1rem;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    line-height: 1.5;
    resize: vertical;
}

#rawDataEditor:focus {
    outline: none;
    border-color: #999999;
}

/* Sidebar controles */
.sidebar h3 {
    font-size: 1rem;
    font-weight: 400;
    color: #1a1a1a;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid #e0e0e0;
    padding-bottom: 0.5rem;
}

.control-section {
    margin-bottom: 0;
    padding: 1rem;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    background: #ffffff;
}

.control-section h4,
.effects-section h4 {
    font-size: 0.85rem;
    font-weight: 400;
    color: #666666;
    margin-bottom: 0.8rem;
    text-transform: lowercase;
    letter-spacing: 0;
}

.control-section select {
    width: 100%;
    background: #f5f4f1;
    border: 1px solid #cccccc;
    color: #1a1a1a;
    padding: 0.5rem;
    border-radius: 4px;
    margin-bottom: 1rem;
    font-size: 0.8rem;
    font-family: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* Controles de parámetros */
.param-control {
    margin-bottom: 0.6rem;
}

.param-control label {
    display: block;
    margin-bottom: 0.3rem;
    font-size: 0.8rem;
    color: #666666;
    font-weight: 400;
}

.param-control input[type="range"] {
    width: 100%;
    height: 4px;
    background: #cccccc;
    border-radius: 2px;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
    border: none;
}

/* Bloques de efectos */
.effect-block {
    margin-bottom: 0;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 0.8rem;
    background: #ffffff;
}

.effect-block input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #1a1a1a;
    margin-right: 0.5rem;
}

.effect-toggle {
    font-weight: 400;
    margin-bottom: 1rem;
    cursor: pointer;
    font-size: 0.85rem;
}

.effect-params {
    margin-left: 0;
    opacity: 0.5;
    transition: opacity 0.3s ease;
}

.effect-block input[type="checkbox"]:checked ~ .effect-params {
    opacity: 1;
}

.effect-params select {
    width: 100%;
    background: #f5f4f1;
    border: 1px solid #cccccc;
    color: #1a1a1a;
    padding: 0.4rem;
    border-radius: 4px;
    margin-bottom: 0.5rem;
    font-size: 0.8rem;
    font-family: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* Footer */
footer {
    text-align: center;
    padding: 1rem;
    color: #999999;
    border-top: 1px solid #e0e0e0;
    background: #faf9f6;
    font-size: 0.75rem;
}

/* Responsive */
@media (max-width: 1200px) {
    .controls-grid,
    .effects-grid {
        grid-template-columns: 1fr;
    }
    
    .effects-section {
        grid-column: 1;
    }
}

@media (max-width: 1024px) {
    .app-layout {
        flex-direction: column;
    }
    
    .main-content {
        flex: none;
        max-width: 100%;
    }
    
    .sidebar {
        flex: none;
        max-width: 100%;
        border-left: none;
        border-top: 1px solid #e0e0e0;
    }
    
    .controls-grid,
    .effects-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {
    .controls-grid,
    .effects-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
        padding: 1rem;
    }

    .header-content {
        flex-direction: column;
        gap: 0.5rem;
    }

    .header-content h1 {
        margin-left: 0;
        font-size: 1.5rem;
    }

    .header-content p {
        margin-left: 0;
    }

    .main-content {
        padding: 1rem;
        flex: none;
        max-width: 100%;
    }

    .sidebar-content {
        padding: 1rem;
    }

    .editor-header {
        flex-direction: column;
        gap: 0.5rem;
        align-items: stretch;
    }

    .editor-controls {
        justify-content: center;
        flex-wrap: wrap;
    }

    #rawDataEditor {
        height: 350px;
    }
}

/* Animaciones */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.raw-data-editor,
.sidebar {
    animation: fadeIn 0.3s ease-out;
}

/* Estados de carga */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

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

::-webkit-scrollbar-track {
    background: #e0e0e0;
}

::-webkit-scrollbar-thumb {
    background: #999999;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #666666;
}