/* ============================================
   NeuroFocus Web - Versión Limpia
   Mobile-First | Solo funcionalidades esenciales
   ============================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #6366f1;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --bg: #0f172a;
    --card: #1e293b;
    --text: #f1f5f9;
    --text-secondary: #94a3b8;
    --border: #334155;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, var(--bg) 0%, var(--card) 100%);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    padding: 1rem;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
}

section {
    background: var(--card);
    border-radius: 1rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border);
}

h2 {
    font-size: 1.3rem;
    margin-bottom: 1rem;
    color: var(--text);
}

/* Intro Section */
.intro-section {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(168, 85, 247, 0.1));
    border: 2px solid var(--primary);
    text-align: center;
}

.intro-text {
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    text-align: justify;
}

.developer-credit {
    font-size: 0.95rem;
    color: var(--text);
    margin-top: 1rem;
}

.developer-credit strong {
    color: var(--primary);
}

/* Status */
.status-section {
    text-align: center;
}

.status-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin: 1rem 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.status-light {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    box-shadow: 0 0 10px currentColor;
    animation: pulse 2s infinite;
}

.status-light.disconnected {
    background: #64748b;
    color: #64748b;
}

.status-light.connecting {
    background: var(--warning);
    color: var(--warning);
}

.status-light.connected {
    background: var(--success);
    color: var(--success);
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

/* Buttons */
.btn {
    padding: 1rem 1.5rem;
    border: none;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    width: 100%;
    margin-top: 0.5rem;
}

.btn:hover {
    transform: translateY(-2px);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), #4f46e5);
    color: white;
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-demo {
    background: linear-gradient(135deg, #a855f7, #ec4899);
    color: white;
    margin-top: 1rem;
}

/* EEG Table */
.eeg-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.eeg-table th,
.eeg-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.eeg-table th {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary);
    font-weight: 600;
}

.eeg-table td:nth-child(2) {
    font-family: 'Courier New', monospace;
    color: #a855f7;
    font-weight: 600;
    font-size: 1.1rem;
}

/* Audio Controls */
.audio-controls {
    display: grid;
    gap: 0.5rem;
    margin: 1rem 0;
}

.btn-audio {
    background: rgba(99, 102, 241, 0.1);
    color: var(--text);
    border: 2px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0;
}

.btn-audio:hover {
    border-color: var(--primary);
}

.btn-audio.playing {
    background: rgba(99, 102, 241, 0.3);
    border-color: var(--primary);
}

.volume-control {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 1rem;
}

#volumeSlider {
    flex: 1;
    height: 6px;
    border-radius: 3px;
    background: var(--border);
}

#volumeSlider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
}

#volumeValue {
    min-width: 45px;
    font-weight: 600;
}

/* Recording */
.recording-info {
    background: rgba(99, 102, 241, 0.05);
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    display: grid;
    gap: 0.5rem;
}

/* Graphs Section */
.graphs-section {
    background: var(--card);
    border-radius: 1rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border);
}

.graphs-grid {
    display: grid;
    gap: 1rem;
    margin-top: 1rem;
}

.graph-item {
    background: rgba(0, 0, 0, 0.3);
    padding: 1rem;
    border-radius: 0.5rem;
    border: 1px solid var(--border);
}

.graph-item h4 {
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.graph-item canvas {
    width: 100%;
    height: auto;
    border-radius: 0.25rem;
    background: #000;
}

.recording-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.recording-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #64748b;
}

.recording-indicator.recording {
    background: var(--danger);
    animation: blink 1s infinite;
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.3;
    }
}

.recording-controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

/* Frequency Bands Section */
.frequency-bands-section {
    background: var(--card);
    border-radius: 1rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border);
}

.channel-selector {
    margin-bottom: 1.5rem;
}

.channel-selector label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
}

.channel-selector select {
    width: 100%;
    padding: 0.75rem;
    background: rgba(0, 0, 0, 0.3);
    color: var(--text);
    border: 2px solid var(--border);
    border-radius: 0.5rem;
    font-size: 1rem;
    cursor: pointer;
    transition: border-color 0.3s;
}

.channel-selector select:focus {
    outline: none;
    border-color: var(--primary);
}

.frequency-bars {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.freq-bar label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
}

.bar-container {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: rgba(0, 0, 0, 0.3);
    padding: 0.5rem;
    border-radius: 0.5rem;
}

.bar {
    height: 30px;
    border-radius: 0.25rem;
    transition: width 0.5s ease;
    min-width: 2px;
    box-shadow: 0 0 10px currentColor;
}

.bar-container span {
    min-width: 50px;
    text-align: right;
    color: var(--text);
    font-weight: bold;
    font-family: 'Courier New', monospace;
}

/* Theta/Beta Ratio */
.theta-beta-ratio {
    margin-top: 2rem;
    padding: 1.5rem;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 0.75rem;
    text-align: center;
    border: 2px solid var(--border);
}

.theta-beta-ratio h3 {
    margin-bottom: 1rem;
    color: var(--text);
    font-size: 1.1rem;
}

.ratio-display {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    margin: 1.5rem 0;
    flex-wrap: wrap;
}

.ratio-number {
    font-size: 3rem;
    font-weight: bold;
    color: var(--success);
    font-family: 'Courier New', monospace;
    text-shadow: 0 0 20px currentColor;
    transition: color 0.5s;
}

.ratio-status {
    font-size: 1.2rem;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    background: var(--success);
    color: white;
    font-weight: 600;
    transition: all 0.5s;
}

.ratio-status.warning {
    background: var(--warning);
    color: #0f172a;
}

.ratio-status.alert {
    background: var(--danger);
    color: white;
    animation: pulse-alert 2s infinite;
}

@keyframes pulse-alert {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

.ratio-info {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
}

.ratio-info p {
    margin: 0.5rem 0;
}

/* Footer */
footer {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

/* Responsive */
@media (min-width: 768px) {
    .audio-controls {
        grid-template-columns: repeat(3, 1fr);
    }

    .recording-info {
        grid-template-columns: repeat(3, 1fr);
    }

    .graphs-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    h2 {
        font-size: 1.5rem;
    }

    .btn {
        width: auto;
        min-width: 200px;
    }

    .status-section .btn {
        padding: 1rem 2rem;
    }

    .recording-controls .btn {
        width: 100%;
    }

    .graphs-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .ratio-number {
        font-size: 4rem;
    }
}