/* Test Devices - Professional Styling */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    background: #f8f9fa;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #2c3e50;
    line-height: 1.5;
    padding: 20px;
}

.container {
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    padding: 40px;
    max-width: 800px;
    width: 100%;
    text-align: center;
    border: 1px solid #e9ecef;
}

.header {
    margin-bottom: 40px;
}

.header h1 {
    color: #2c3e50;
    font-size: 1.8em;
    font-weight: 600;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.header h1 i {
    color: #3498db;
    font-size: 0.9em;
}

.header p {
    color: #6c757d;
    font-size: 1em;
    font-weight: 400;
}

.step {
    display: none;
    animation: fadeIn 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.step.active {
    display: block;
}

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

.step-header {
    background: #3498db;
    color: white;
    padding: 20px 24px;
    border-radius: 12px;
    margin-bottom: 28px;
    font-size: 1.1em;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.15);
}

.sound-check {
    background: #fff9c4;
    border: 1px solid #ffc107;
    border-radius: 12px;
    padding: 24px;
    margin: 24px 0;
}


.sound-check h3 {
    color: #856404;
    font-size: 1.1em;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-weight: 500;
}

.sound-check p {
    color: #856404;
    font-size: 0.95em;
    line-height: 1.5;
}

.mic-selector, .camera-selector {
    margin: 28px 0;
}

.mic-selector label, .camera-selector label {
    display: block;
    color: #2c3e50;
    font-weight: 500;
    margin-bottom: 8px;
    font-size: 1em;
    text-align: left;
}

.mic-selector select, .camera-selector select {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    font-size: 0.95em;
    background: white;
    color: #2c3e50;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
}

.mic-selector select:focus, .camera-selector select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.test-area, .video-preview {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 24px;
    margin: 20px 0;
    border: 1px solid #e9ecef;
}

.recording-indicator {
    font-size: 1.3em;
    margin: 16px 0;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.volume-indicator {
    width: 100%;
    height: 20px;
    background: #e9ecef;
    border-radius: 12px;
    margin: 20px 0;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.volume-bar {
    height: 100%;
    background: linear-gradient(90deg, #27ae60, #f39c12, #e74c3c);
    width: 0%;
    transition: width 0.15s ease;
    border-radius: 12px;
}

.countdown {
    font-size: 2.5em;
    font-weight: 700;
    color: #e74c3c;
    margin: 16px 0;
    font-variant-numeric: tabular-nums;
}

.video-container {
    position: relative;
    width: 100%;
    max-width: 400px;
    margin: 0 auto 24px auto;
    background: #000;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2);
}

#previewVideo, #testVideo {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 16px;
}

.video-status {
    padding: 16px 20px;
    margin: 16px 0;
    border-radius: 8px;
    font-size: 0.95em;
    font-weight: 400;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.video-loading {
    background: linear-gradient(135deg, #fff3cd, #ffeaa7);
    border: 2px solid #ffc107;
    color: #856404;
}

.video-ready {
    background: linear-gradient(135deg, #d4edda, #a8e6cf);
    border: 2px solid #28a745;
    color: #155724;
}

.video-error {
    background: linear-gradient(135deg, #f8d7da, #ff7675);
    border: 2px solid #dc3545;
    color: #721c24;
}

.quality-info {
    background: #e3f2fd;
    border: 1px solid #2196f3;
    border-radius: 8px;
    padding: 16px;
    margin: 16px 0;
    margin-bottom: 0px;
    color: #1976d2;
    font-size: 0.9em;
    text-align: left;
}

.quality-info strong {
    display: block;
    margin-bottom: 8px;
    font-size: 0.95em;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 0.95em;
    cursor: pointer;
    transition: all 0.2s ease;
    margin: 8px 6px;
    font-weight: 500;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}


.btn-primary {
    background: #3498db;
    color: white;
    box-shadow: 0 2px 4px rgba(52, 152, 219, 0.2);
}

.btn-success {
    background: #28a745;
    color: white;
    box-shadow: 0 2px 4px rgba(40, 167, 69, 0.2);
}

.btn-danger {
    background: #dc3545;
    color: white;
    box-shadow: 0 2px 4px rgba(220, 53, 69, 0.2);
}

.btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.question {
    background: #e8f5e8;
    border: 1px solid #28a745;
    border-radius: 12px;
    padding: 24px;
    margin: 20px 0;
}


.question h3 {
    color: #155724;
    font-size: 1.1em;
    margin-bottom: 12px;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.question p {
    color: #155724;
    font-size: 0.95em;
    margin-bottom: 16px;
    line-height: 1.5;
}

.troubleshooting {
    text-align: left;
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 32px;
    margin: 24px 0;
}

.troubleshooting h3 {
    color: #dc3545;
    margin-bottom: 24px;
    font-size: 1.3em;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-weight: 600;
}

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

.trouble-step {
    background: #f8f9fa;
    border-left: 3px solid #3498db;
    padding: 20px;
    border-radius: 8px;
    height: fit-content;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.trouble-step:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.trouble-step h4 {
    color: #2c3e50;
    font-size: 1em;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
}

.trouble-step h4 i {
    color: #3498db;
    width: 20px;
    text-align: center;
}

.trouble-step p {
    color: #6c757d;
    line-height: 1.5;
    margin-bottom: 8px;
    font-size: 0.9em;
}

.trouble-step strong {
    color: #2980b9;
    font-weight: 600;
}

.success-message {
    background: #28a745;
    color: white;
    padding: 32px;
    border-radius: 12px;
    margin: 24px 0;
    font-size: 1.1em;
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.2);
}


.success-message h2 {
    font-size: 1.3em;
    margin-bottom: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.pulse {
    animation: pulse 1.5s infinite;
}

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

.playing-audio {
    background: #e3f2fd;
    border: 1px solid #2196f3;
    border-radius: 12px;
    padding: 24px;
    margin: 20px 0;
    color: #1976d2;
}


.playing-audio h3 {
    font-size: 1.1em;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-weight: 500;
}

.hidden {
    display: none !important;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 32px 24px;
        margin: 10px;
        border-radius: 20px;
    }

    .header h1 {
        font-size: 2em;
        flex-direction: column;
        gap: 8px;
    }

    .step-header {
        padding: 20px 24px;
        font-size: 1.2em;
    }

    .troubleshooting-grid {
        grid-template-columns: 1fr;
    }

    .btn {
        width: 100%;
        margin: 8px 0;
        justify-content: center;
    }

    .countdown {
        font-size: 2.5em;
    }

    .video-container {
        max-width: 100%;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 24px 16px;
    }

    .header h1 {
        font-size: 1.8em;
    }

    .header p {
        font-size: 1.1em;
    }

    .trouble-step {
        padding: 20px;
    }
}