/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

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

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

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

header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* Main Content Layout */
.main-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

@media (max-width: 768px) {
    .main-content {
        grid-template-columns: 1fr;
    }
}

/* Speech Section */
.speech-section {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

/* Engine Selector */
.engine-selector {
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
    border: 2px solid #e9ecef;
}

.engine-label {
    display: block;
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
    font-size: 0.95rem;
}

.engine-options {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.engine-option {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 8px 15px;
    border-radius: 8px;
    background: white;
    border: 2px solid #ddd;
    transition: all 0.3s ease;
}

.engine-option:hover {
    border-color: #667eea;
    background: #f0f4ff;
}

.engine-option input[type="radio"] {
    cursor: pointer;
    width: 18px;
    height: 18px;
    accent-color: #667eea;
}

.engine-option input[type="radio"]:checked + span {
    font-weight: 600;
    color: #667eea;
}

.engine-option span {
    font-size: 0.95rem;
    color: #666;
    transition: all 0.3s ease;
}

.speech-controls {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-primary {
    background: linear-gradient(45deg, #4CAF50, #45a049);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(76, 175, 80, 0.4);
}

.btn-secondary {
    background: linear-gradient(45deg, #f44336, #d32f2f);
    color: white;
}

.btn-secondary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(244, 67, 54, 0.4);
}

.btn-outline {
    background: transparent;
    color: #666;
    border: 2px solid #ddd;
}

.btn-outline:hover:not(:disabled) {
    background: #f5f5f5;
    border-color: #999;
}

.icon {
    font-size: 1.2rem;
}

/* Status Indicator */
.status-indicator {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 25px;
}

.status {
    font-weight: 600;
    color: #666;
}

.recording-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #f44336;
    font-weight: 600;
}

.recording-indicator::before {
    content: '';
    width: 12px;
    height: 12px;
    background: #f44336;
    border-radius: 50%;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.3; }
    100% { opacity: 1; }
}

/* Transcript Boxes */
.transcript-box {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    padding: 20px;
    min-height: 120px;
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 20px;
    position: relative;
}

.transcript-box .placeholder {
    color: #999;
    font-style: italic;
}

.transcript-box.has-content {
    border-color: #4CAF50;
    background: #f1f8e9;
}

/* Results Section */
.results-section {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.test-results {
    min-height: 200px;
}

.no-results {
    text-align: center;
    color: #999;
    padding: 40px 20px;
}

.no-results .icon {
    font-size: 3rem;
    margin-bottom: 15px;
    display: block;
}

/* Test Items */
.test-item {
    background: linear-gradient(45deg, #e3f2fd, #bbdefb);
    border: 2px solid #2196f3;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 10px;
    transition: all 0.3s ease;
}

.test-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(33, 150, 243, 0.3);
}

.test-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}

.test-name {
    font-weight: 600;
    color: #1976d2;
    font-size: 1.1rem;
}

.test-metadata {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.test-category {
    font-size: 0.85rem;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.method-badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.method-badge.embedding {
    background: #4CAF50;
    color: white;
}

.method-badge.llm {
    background: #FF9800;
    color: white;
}

.confidence-score {
    background: #2196f3;
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.test-confidence {
    background: #4CAF50;
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
}

/* Processing Status */
.processing-status {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px;
    background: #fff3cd;
    border: 2px solid #ffeaa7;
    border-radius: 10px;
    color: #856404;
    font-weight: 600;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #856404;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Tests Reference */
.tests-reference {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

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

.test-card {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
}

.test-card:hover {
    border-color: #4CAF50;
    background: #f1f8e9;
    transform: translateY(-2px);
}

.test-card.selected {
    border-color: #4CAF50;
    background: #e8f5e8;
}

.test-card-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
}

.test-card-category {
    font-size: 0.9rem;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s ease-in;
}

.modal.show {
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: white;
    border-radius: 15px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease-out;
}

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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 2px solid #e9ecef;
}

.modal-header h3 {
    color: #1976d2;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 2rem;
    color: #999;
    cursor: pointer;
    transition: color 0.3s ease;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    color: #333;
}

.modal-body {
    padding: 25px;
}

.modal-body h4 {
    color: #666;
    margin-bottom: 15px;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.modal-body ul {
    list-style: none;
    padding: 0;
}

.modal-body ul li {
    background: #f8f9fa;
    padding: 10px 15px;
    margin-bottom: 8px;
    border-radius: 8px;
    border-left: 3px solid #4CAF50;
    color: #333;
}

/* Utility Classes */
.hidden {
    display: none !important;
}

.fade-in {
    animation: fadeIn 0.5s ease-in;
}

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

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .speech-controls {
        justify-content: center;
    }
    
    .btn {
        flex: 1;
        min-width: 120px;
    }
    
    .tests-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
}
