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

:root {
    --primary-color: #f38020;
    --secondary-color: #ff6b35;
    --background: #0a0e27;
    --surface: #1a1f3a;
    --surface-light: #2a2f4a;
    --text-primary: #ffffff;
    --text-secondary: #b0b0b0;
    --success: #4caf50;
    --warning: #ff9800;
    --error: #f44336;
    --border-radius: 12px;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, var(--background) 0%, #1a1f3a 100%);
    color: var(--text-primary);
    min-height: 100vh;
    padding: 20px;
    line-height: 1.6;
}

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

header {
    text-align: center;
    margin-bottom: 40px;
    padding: 30px 0;
}

header h1 {
    font-size: 3rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1.2rem;
}

.test-container {
    background: var(--surface);
    border-radius: var(--border-radius);
    padding: 40px;
    box-shadow: var(--shadow);
}

.test-button-container {
    text-align: center;
    margin-bottom: 30px;
}

.btn-primary, .btn-secondary {
    padding: 15px 40px;
    font-size: 1.1rem;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(243, 128, 32, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: var(--surface-light);
    color: var(--text-primary);
    border: 2px solid var(--primary-color);
}

.btn-secondary:hover {
    background: var(--primary-color);
}

.test-status {
    text-align: center;
    padding: 20px;
    margin-bottom: 30px;
    font-size: 1.1rem;
    color: var(--text-secondary);
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.test-status.active {
    color: var(--primary-color);
    font-weight: 600;
}

.aim-score-container {
    text-align: center;
    padding: 30px;
    margin-bottom: 30px;
    background: linear-gradient(135deg, rgba(243, 128, 32, 0.1), rgba(255, 107, 53, 0.1));
    border-radius: var(--border-radius);
    border: 2px solid var(--primary-color);
}

.aim-score-label {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.aim-score-value {
    font-size: 4rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
}

.aim-score-description {
    font-size: 1rem;
    color: var(--text-secondary);
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.metric-card {
    background: var(--surface-light);
    padding: 25px;
    border-radius: var(--border-radius);
    text-align: center;
    transition: transform 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.metric-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary-color);
}

.metric-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.metric-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 5px;
}

.metric-unit {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.charts-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.chart-card {
    background: var(--surface-light);
    padding: 25px;
    border-radius: var(--border-radius);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.chart-card h3 {
    margin-bottom: 20px;
    color: var(--text-primary);
    font-size: 1.2rem;
}

.chart-card canvas {
    max-height: 300px;
}

.analytics-container {
    margin-top: 40px;
}

.analytics-container h3 {
    margin-bottom: 20px;
    color: var(--text-primary);
    font-size: 1.5rem;
}

.table-container {
    overflow-x: auto;
    background: var(--surface-light);
    border-radius: var(--border-radius);
    padding: 20px;
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead {
    background: var(--surface);
}

th {
    padding: 15px;
    text-align: left;
    color: var(--text-primary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.9rem;
    border-bottom: 2px solid var(--primary-color);
}

td {
    padding: 12px 15px;
    color: var(--text-secondary);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

tbody tr:hover {
    background: rgba(243, 128, 32, 0.1);
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--surface-light);
    border-radius: 4px;
    overflow: hidden;
    margin-top: 20px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    transition: width 0.3s ease;
    width: 0%;
}

/* Verbose Logging Panel */
.log-container {
    background: var(--surface-light);
    border-radius: var(--border-radius);
    padding: 20px;
    margin-top: 30px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.log-output {
    background: #000;
    color: #0f0;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    padding: 15px;
    border-radius: 5px;
    height: 400px;
    overflow-y: auto;
    border: 1px solid #333;
}

.log-entry {
    margin-bottom: 4px;
    word-wrap: break-word;
}

.log-entry.info {
    color: #0ff;
}

.log-entry.success {
    color: #0f0;
}

.log-entry.warning {
    color: #ff0;
}

.log-entry.error {
    color: #f00;
}

.log-entry .timestamp {
    color: #888;
    margin-right: 8px;
}

#clearLogs {
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 5px;
    font-weight: 600;
    transition: background 0.3s ease;
}

#clearLogs:hover {
    background: #1e88e5;
}

@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }
    
    .test-container {
        padding: 20px;
    }
    
    .metrics-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .charts-container {
        grid-template-columns: 1fr;
    }
    
    .metric-value {
        font-size: 2rem;
    }
    
    .aim-score-value {
        font-size: 3rem;
    }
    
    .log-output {
        height: 300px;
        font-size: 0.75rem;
    }
}

