/* Demo Controls Styles */
.demo-controls-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Preset Buttons */
.preset-btn {
    padding: 8px;
    border: 1px solid #ddd;
    background: #f9f9f9;
    cursor: pointer;
    text-align: center;
    font-size: 12px;
}

.preset-btn:hover {
    background: #e9e9e9;
}

.preset-btn.active {
    background: #007cba;
    color: white;
    border-color: #007cba;
}

.demo-controls-container h3 {
    margin: 0 0 30px 0;
    color: #1a365d;
    font-size: 24px;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 10px;
}

.demo-controls-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

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

.control-section {
    background: #f8fafc;
    padding: 20px;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
}

.control-section h4 {
    margin: 0 0 20px 0;
    color: #2d3748;
    font-size: 18px;
    font-weight: 600;
}

.control-group {
    margin-bottom: 20px;
}

.control-group:last-child {
    margin-bottom: 0;
}

.control-group label {
    display: block;
    margin-bottom: 8px;
    color: #4a5568;
    font-weight: 500;
    font-size: 14px;
}

.range-inputs {
    display: flex;
    align-items: center;
    gap: 10px;
}

.range-inputs input[type="number"] {
    width: 80px;
    padding: 8px 12px;
    border: 1px solid #cbd5e0;
    border-radius: 4px;
    font-size: 14px;
}

.range-inputs span {
    color: #718096;
    font-size: 14px;
}

.slider {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #e2e8f0;
    outline: none;
    -webkit-appearance: none;
    margin-bottom: 8px;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #3182ce;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #3182ce;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.slider-value {
    color: #3182ce;
    font-weight: 600;
    font-size: 14px;
}

.control-buttons {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.btn {
    padding: 12px 24px;
    border-radius: 6px;
    border: none;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background: #3182ce;
    color: white;
}

.btn-primary:hover {
    background: #2c5aa0;
}

.btn-secondary {
    background: #38a169;
    color: white;
}

.btn-secondary:hover {
    background: #2f855a;
}

.btn-outline {
    background: transparent;
    color: #718096;
    border: 1px solid #cbd5e0;
}

.btn-outline:hover {
    background: #f7fafc;
    border-color: #a0aec0;
}

.live-preview {
    background: #f8fafc;
    padding: 20px;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    margin-bottom: 20px;
}

.live-preview h4 {
    margin: 0 0 15px 0;
    color: #2d3748;
    font-size: 16px;
    font-weight: 600;
}

.api-response {
    background: white;
    padding: 15px;
    border-radius: 4px;
    border: 1px solid #e2e8f0;
    min-height: 100px;
}

.api-data {
    display: grid;
    gap: 20px;
}

.api-section h5 {
    margin: 0 0 10px 0;
    color: #2d3748;
    font-size: 14px;
    font-weight: 600;
}

.api-section code {
    background: #f1f5f9;
    padding: 4px 8px;
    border-radius: 3px;
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 12px;
}

.samples-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
}

.sample {
    background: #f8fafc;
    padding: 10px;
    border-radius: 4px;
    border: 1px solid #e2e8f0;
    font-size: 12px;
    line-height: 1.4;
}

.more-samples {
    color: #718096;
    font-style: italic;
    padding: 10px;
    text-align: center;
}

.metadata-grid {
    display: grid;
    gap: 15px;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.meta-item .label {
    min-width: 80px;
    color: #4a5568;
    font-size: 14px;
}

.meta-item .value {
    min-width: 40px;
    color: #2d3748;
    font-weight: 600;
    font-size: 14px;
}

.progress-bar {
    flex: 1;
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #48bb78, #38a169);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.status-messages {
    margin-top: 20px;
}

.status-message {
    padding: 12px 16px;
    border-radius: 4px;
    font-size: 14px;
    margin-bottom: 10px;
}

.status-success {
    background: #f0fff4;
    color: #22543d;
    border: 1px solid #9ae6b4;
}

.status-error {
    background: #fed7d7;
    color: #742a2a;
    border: 1px solid #fc8181;
}

.status-loading {
    background: #ebf8ff;
    color: #2a4365;
    border: 1px solid #90cdf4;
}

/* Input focus styles */
input[type="number"]:focus,
.slider:focus {
    outline: none;
    border-color: #3182ce;
    box-shadow: 0 0 0 3px rgba(49, 130, 206, 0.1);
}

/* Animation for status messages */
.status-message {
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Auto-save indicator */
.auto-save-indicator {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #48bb78;
    color: white;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    z-index: 10000;
}

.auto-save-indicator.fade-out {
    opacity: 0;
}

/* Visual feedback for changing inputs */
.demo-controls-container input:focus {
    transition: all 0.2s ease;
}

.demo-controls-container input.saving {
    border-color: #3182ce;
    box-shadow: 0 0 0 3px rgba(49, 130, 206, 0.2);
}

/* Performance info section */
.performance-info {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    padding: 20px;
    border-radius: 6px;
    margin-bottom: 30px;
}

.performance-info h4 {
    margin: 0 0 15px 0;
    font-size: 18px;
    font-weight: 600;
    color: #2d3748;
}

.performance-info p {
    margin: 0 0 10px 0;
    font-size: 14px;
    line-height: 1.5;
    color: #4a5568;
}

.performance-info p:last-child {
    margin-bottom: 0;
}

.performance-info code {
    background: #e2e8f0;
    padding: 4px 8px;
    border-radius: 4px;
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 13px;
    font-weight: 500;
    color: #2d3748;
}

/* EEG Presets Section */
.eeg-presets {
    background: #f8fafc;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    margin-bottom: 30px;
}

.eeg-presets h4 {
    margin: 0 0 20px 0;
    color: #2d3748;
    font-size: 18px;
    font-weight: 600;
}

.preset-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}

@media (max-width: 768px) {
    .preset-buttons {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .preset-buttons {
        grid-template-columns: 1fr;
    }
}

.preset-btn {
    background: #3182ce;
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease;
    text-align: center;
}

.preset-btn:hover {
    background: #2c5aa0;
}

.preset-btn:active {
    background: #2a4365;
}

/* Compact Layout Styles */
.controls-compact {
    max-width: 800px;
    margin: 0 auto;
}

.control-row {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.control-row label {
    min-width: 80px;
    font-weight: bold;
    margin: 0;
}

.control-row .slider {
    flex: 1;
    margin: 0;
}

.control-row .value-display {
    font-weight: bold;
    min-width: 60px;
}

.control-row .value-display.frequency {
    color: #059669;
}

.control-row .value-display.amplitude {
    color: #2563eb;
}

.control-row input[type="number"] {
    width: 70px;
    padding: 4px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.controls-buttons {
    text-align: center;
    margin-top: 15px;
}

.controls-buttons .btn {
    padding: 8px 20px;
}

.preview-compact {
    margin-top: 20px;
}

.preview-compact h4 {
    margin: 0 0 10px 0;
}

.preview-compact canvas {
    border: 1px solid #ddd;
    background: white;
    width: 100%;
    max-width: 800px;
}

.endpoint-info {
    margin-top: 20px;
    padding: 10px;
    background: #f9f9f9;
    border-radius: 4px;
}

.endpoint-info code {
    background: #e2e8f0;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: monospace;
}