/* NeXt-TDNN Speaker Verification Demo Styles */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    background-color: #f5f7fa;
    color: #2c3e50;
    line-height: 1.6;
}

.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 40px 0;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
}

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

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

.tabs {
    display: flex;
    gap: 10px;
    margin: 30px 0;
    border-bottom: 2px solid #e0e6ed;
    overflow-x: auto;
}

.tab {
    padding: 15px 30px;
    background: none;
    border: none;
    font-size: 16px;
    font-weight: 500;
    color: #64748b;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.3s;
    white-space: nowrap;
}

.tab:hover {
    color: #667eea;
}

.tab.active {
    color: #667eea;
    border-bottom-color: #667eea;
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s;
}

.tab-content.active {
    display: block;
}

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

.card {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    margin-bottom: 20px;
}

.card h2 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 1.8em;
}

.card h3 {
    color: #34495e;
    margin: 20px 0 15px;
    font-size: 1.3em;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.feature-card {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 8px;
    text-align: center;
    transition: transform 0.3s;
}

.feature-card:hover {
    transform: translateY(-5px);
}

.feature-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 15px;
    color: #667eea;
}

.feature-title {
    font-weight: 600;
    margin-bottom: 10px;
    color: #2c3e50;
}

.feature-desc {
    color: #64748b;
    font-size: 14px;
}

.demo-section {
    background: #f8f9fa;
    padding: 30px;
    border-radius: 8px;
    margin: 20px 0;
}

.button-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin: 20px 0;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: #667eea;
    color: white;
}

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

.btn-secondary {
    background: #e0e6ed;
    color: #34495e;
}

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

.benchmark-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

.benchmark-table th,
.benchmark-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e0e6ed;
}

.benchmark-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #2c3e50;
}

.benchmark-table tr:hover {
    background: #f8f9fa;
}

.model-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.model-card-small {
    background: white;
    border: 2px solid #e0e6ed;
    border-radius: 8px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s;
}

.model-card-small:hover {
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.model-card-small.active {
    border-color: #667eea;
    background: #f3f4ff;
}

.code-block {
    background: #1e293b;
    color: #e2e8f0;
    padding: 20px;
    border-radius: 8px;
    overflow-x: auto;
    font-family: 'Courier New', monospace;
    margin: 20px 0;
}

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

.stat-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 25px;
    border-radius: 8px;
    text-align: center;
}

.stat-value {
    font-size: 2.5em;
    font-weight: 700;
    margin-bottom: 5px;
}

.stat-label {
    opacity: 0.9;
    font-size: 14px;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e0e6ed;
    border-radius: 4px;
    overflow: hidden;
    margin: 10px 0;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    width: 0%;
    transition: width 0.3s;
}

.alert {
    padding: 15px 20px;
    border-radius: 6px;
    margin: 20px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-info {
    background: #e0f2fe;
    color: #0369a1;
    border: 1px solid #7dd3fc;
}

.alert-success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #6ee7b7;
}

.alert-warning {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fcd34d;
}

.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #e0e6ed;
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Demo-specific styles */
.file-upload-area {
    border: 2px dashed #cbd5e1;
    border-radius: 8px;
    padding: 40px;
    text-align: center;
    margin: 20px 0;
    transition: all 0.3s;
}

.file-upload-area.dragover {
    border-color: #667eea;
    background: #f3f4ff;
}

.upload-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 15px;
    color: #94a3b8;
}

.file-info {
    background: #f1f5f9;
    padding: 15px;
    border-radius: 6px;
    margin: 10px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.result-box {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 8px;
    margin: 20px 0;
    text-align: center;
}

.score-display {
    font-size: 3em;
    font-weight: 700;
    margin: 20px 0;
}

.score-display.match {
    color: #10b981;
}

.score-display.no-match {
    color: #ef4444;
}

.s-norm-info {
    background: #fef3c7;
    padding: 15px;
    border-radius: 6px;
    margin: 15px 0;
    font-size: 14px;
    color: #92400e;
}

/* Additional styles */
.error-page {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
    font-size: 18px;
    color: #ef4444;
    text-align: center;
    padding: 20px;
}

.model-metric {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.metric-cosine {
    background: #e0f2fe;
    color: #0369a1;
}

.metric-euclidean {
    background: #fef3c7;
    color: #92400e;
}

.file-input-group {
    margin: 20px 0;
}

.file-input-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #34495e;
}

.file-input-group input[type="file"] {
    width: 100%;
    padding: 10px;
    border: 1px solid #e0e6ed;
    border-radius: 6px;
    background: white;
}

.loading-state {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 20px;
    justify-content: center;
}

.model-category {
    margin-bottom: 40px;
}

.model-category h3 {
    margin-bottom: 20px;
    color: #2c3e50;
}

.alert-error {
    background: #fee;
    color: #c33;
    border: 1px solid #fcc;
}

/* Responsive design */
@media (max-width: 768px) {
    .header h1 {
        font-size: 2em;
    }
    
    .tabs {
        overflow-x: scroll;
        -webkit-overflow-scrolling: touch;
    }
    
    .tab {
        padding: 12px 20px;
        font-size: 14px;
    }
    
    .feature-grid,
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .container {
        padding: 15px;
    }
    
    .card {
        padding: 20px;
    }
}