/* DDSP Training Health Monitor Styles */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    min-height: 100vh;
    color: #333;
    padding: 20px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

header {
    text-align: center;
    color: white;
    margin-bottom: 30px;
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.subtitle {
    font-size: 1.2em;
    opacity: 0.9;
}

/* Grid Layout */
.main-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 20px;
}

.full-width {
    grid-column: 1 / -1;
}

/* Cards */
.card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: transform 0.2s;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}

.card h2 {
    margin-bottom: 15px;
    color: #2a5298;
    font-size: 1.3em;
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 10px;
}

/* Form Controls */
.form-control {
    width: 100%;
    padding: 10px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 1em;
    transition: border-color 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: #667eea;
}

/* Buttons */
.btn-primary, .btn-secondary {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #f0f0f0;
    color: #555;
    margin: 5px;
}

.btn-secondary:hover {
    background: #e0e0e0;
}

/* Health Indicator */
.health-indicator {
    display: flex;
    align-items: center;
    padding: 20px;
    border-radius: 8px;
    background: #f8f9fa;
    transition: all 0.3s;
}

.health-indicator.healthy {
    background: #d4edda;
    border: 1px solid #c3e6cb;
}

.health-indicator.warning {
    background: #fff3cd;
    border: 1px solid #ffeeba;
}

.health-indicator.failing {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
}

.status-icon {
    font-size: 2em;
    margin-right: 15px;
}

.status-text {
    font-size: 1.2em;
    font-weight: 600;
}

/* Phase Info */
.phase-info {
    margin-top: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

.phase-info h3 {
    font-size: 1em;
    color: #666;
    margin-bottom: 10px;
}

.phase-name {
    font-size: 1.2em;
    font-weight: 600;
    color: #2a5298;
    margin-bottom: 5px;
}

.expected-loss {
    color: #666;
    font-size: 0.9em;
}

/* Loss Chart */
#lossChart {
    max-height: 300px;
}

.chart-info {
    margin-top: 10px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 6px;
    font-size: 0.9em;
    color: #666;
}

/* Test Results */
.test-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.test-card {
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    transition: all 0.3s;
}

.test-card.pass {
    background: #d4edda;
    border: 1px solid #c3e6cb;
}

.test-card.fail {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
}

.test-icon {
    font-size: 1.5em;
    margin-bottom: 10px;
}

.test-title {
    font-weight: 600;
    margin-bottom: 5px;
}

.test-details {
    font-size: 0.85em;
    color: #666;
}

.test-placeholder {
    padding: 40px;
    text-align: center;
    color: #999;
    font-style: italic;
}

/* Failure Modes */
.failure-list {
    max-height: 300px;
    overflow-y: auto;
}

.failure-item {
    display: flex;
    align-items: center;
    padding: 10px;
    margin-bottom: 8px;
    background: #fff3cd;
    border: 1px solid #ffeeba;
    border-radius: 6px;
}

.failure-icon {
    margin-right: 10px;
    font-size: 1.2em;
}

.no-issues {
    padding: 20px;
    text-align: center;
    color: #28a745;
    font-weight: 600;
}

/* Audio Tests */
.test-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.audio-status {
    margin-top: 15px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 6px;
    text-align: center;
    min-height: 40px;
}

/* Detailed Metrics */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.metric-card {
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
}

.metric-card.healthy {
    background: #d4edda;
    border-color: #c3e6cb;
}

.metric-card.warning {
    background: #fff3cd;
    border-color: #ffeeba;
}

.metric-card.failing {
    background: #f8d7da;
    border-color: #f5c6cb;
}

.metric-title {
    font-size: 0.9em;
    color: #666;
    margin-bottom: 5px;
}

.metric-value {
    font-size: 1.3em;
    font-weight: 600;
}

.metric-placeholder {
    padding: 40px;
    text-align: center;
    color: #999;
    font-style: italic;
}

/* Comparison Tool */
.comparison-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.comparison-controls select {
    flex: 1;
}

.comparison-results {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading-text {
    color: white;
    margin-top: 20px;
    font-size: 1.2em;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Status Messages */
.status-message {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 8px;
    font-weight: 600;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    animation: slideIn 0.3s ease;
    z-index: 999;
}

.status-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.status-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.status-message.info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .main-grid {
        grid-template-columns: 1fr;
    }
    
    .test-buttons {
        grid-template-columns: 1fr;
    }
    
    .comparison-controls {
        flex-direction: column;
    }
    
    header h1 {
        font-size: 2em;
    }
}