/* Mikrofon testi özel stilleri */

.microphone-container {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 15px;
    padding: 2rem;
    min-height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.permission-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 3rem 2rem;
    backdrop-filter: blur(10px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    max-width: 500px;
    width: 100%;
}

#microphone-interface {
    width: 100%;
    color: white;
}

/* Audio Level Meter */
.audio-level-container {
    display: flex;
    justify-content: center;
    align-items: center;
}

.audio-level-meter {
    width: 300px;
    height: 60px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 30px;
    position: relative;
    overflow: hidden;
    border: 3px solid rgba(255, 255, 255, 0.2);
}

.audio-level-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #4CAF50, #FFC107, #FF5722);
    border-radius: 30px;
    transition: width 0.1s ease;
    position: relative;
}

.audio-level-bar::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3));
    animation: audio-shimmer 2s infinite;
}

@keyframes audio-shimmer {
    0%, 100% { opacity: 0; }
    50% { opacity: 1; }
}

.audio-level-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-weight: bold;
    color: white;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.7);
    z-index: 10;
}

/* Waveform Visualization */
.waveform-container {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 1rem;
    backdrop-filter: blur(10px);
}

#waveform-canvas {
    width: 100%;
    height: 200px;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.3);
}

/* Microphone Controls */
.microphone-controls {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    padding: 1.5rem;
    backdrop-filter: blur(10px);
}

.microphone-controls .btn {
    border: 2px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.microphone-controls .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
}

.microphone-controls .form-select {
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid rgba(255, 255, 255, 0.3);
    min-width: 200px;
}

.microphone-controls .form-check-input {
    background-color: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
}

.microphone-controls .form-check-input:checked {
    background-color: #0d6efd;
    border-color: #0d6efd;
}

/* Audio Stats */
.audio-stats {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 1.5rem;
    backdrop-filter: blur(10px);
}

.stat-card {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 1.5rem;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.stat-card:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.stat-card i {
    color: rgba(255, 255, 255, 0.8);
}

.stat-value {
    font-size: 1.5rem;
    font-weight: bold;
    color: white;
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 500;
}

/* Error Display */
#error-display {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

#error-display .alert {
    background: rgba(255, 255, 255, 0.95);
    border: none;
    border-radius: 15px;
    backdrop-filter: blur(10px);
    max-width: 500px;
    width: 100%;
}

/* Microphone Info */
.microphone-info {
    border: 1px solid rgba(13, 110, 253, 0.1);
    transition: all 0.3s ease;
}

.microphone-info:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

/* Loading Animation */
.microphone-loading {
    position: relative;
    overflow: hidden;
}

.microphone-loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    animation: microphone-shimmer 2s infinite;
}

@keyframes microphone-shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* Active Recording Animation */
.recording-active .audio-level-meter {
    animation: recording-pulse 2s infinite;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
}

@keyframes recording-pulse {
    0%, 100% {
        border-color: rgba(255, 255, 255, 0.2);
        box-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
    }
    50% {
        border-color: rgba(255, 255, 255, 0.6);
        box-shadow: 0 0 30px rgba(255, 255, 255, 0.6);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .microphone-container {
        padding: 1rem;
        min-height: 400px;
    }
    
    .permission-card {
        padding: 2rem 1rem;
    }
    
    .audio-level-meter {
        width: 250px;
        height: 50px;
    }
    
    .microphone-controls {
        padding: 1rem;
    }
    
    .microphone-controls .row {
        --bs-gutter-x: 0.5rem;
    }
    
    .microphone-controls .form-select {
        min-width: 150px;
        font-size: 0.9rem;
    }
    
    .audio-stats {
        padding: 1rem;
    }
    
    .stat-card {
        padding: 1rem;
        margin-bottom: 1rem;
    }
    
    .stat-value {
        font-size: 1.2rem;
    }
    
    #waveform-canvas {
        height: 150px;
    }
}

@media (max-width: 480px) {
    .microphone-container {
        padding: 0.75rem;
        min-height: 350px;
    }
    
    .permission-card {
        padding: 1.5rem 1rem;
    }
    
    .audio-level-meter {
        width: 200px;
        height: 40px;
    }
    
    .microphone-controls .form-select {
        min-width: 120px;
        font-size: 0.8rem;
    }
    
    .stat-card {
        padding: 0.75rem;
    }
    
    .stat-value {
        font-size: 1rem;
    }
    
    .stat-label {
        font-size: 0.8rem;
    }
    
    #waveform-canvas {
        height: 120px;
    }
}

/* Accessibility */
.microphone-controls .btn:focus,
.microphone-controls .form-select:focus,
.microphone-controls .form-check-input:focus {
    outline: 2px solid rgba(255, 255, 255, 0.8);
    outline-offset: 2px;
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .microphone-container {
        background: #000;
        border: 2px solid #fff;
    }
    
    .permission-card {
        background: #fff;
        border: 2px solid #000;
    }
    
    .microphone-controls,
    .audio-stats,
    .waveform-container {
        background: #000;
        border: 1px solid #fff;
    }
    
    .stat-card {
        border: 1px solid #fff;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .microphone-controls .btn,
    .stat-card,
    .microphone-info,
    .audio-level-bar {
        transition: none;
        animation: none;
    }
    
    .recording-active .audio-level-meter {
        animation: none;
    }
    
    .microphone-loading::after,
    .audio-level-bar::after {
        animation: none;
    }
}

/* Print Styles */
@media print {
    .microphone-container,
    .microphone-controls {
        display: none;
    }
}
