/* Custom styles for RoadNote PWA */

/* Toggle Switch Component */
.toggle {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 24px;
    background-color: #ccc;
    border-radius: 24px;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s ease;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}

.toggle:checked {
    background-color: #3B82F6;
}

.toggle::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background-color: white;
    border-radius: 50%;
    transition: transform 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle:checked::before {
    transform: translateX(24px);
}

/* Recording Button States */
.record-btn-idle {
    background-color: #3B82F6;
    transform: scale(1);
}

.record-btn-recording {
    background-color: #EF4444;
    transform: scale(1.1);
    animation: pulse 2s infinite;
}

.record-btn-processing {
    background-color: #F59E0B;
    transform: scale(1);
}

/* Pulse Animation for Recording */
@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(239, 68, 68, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
    }
}

/* Transcript Display */
#transcriptDisplay {
    max-height: 200px;
    overflow-y: auto;
    line-height: 1.6;
}

/* Toast Notifications */
.toast {
    min-width: 300px;
    padding: 16px;
    border-radius: 8px;
    color: white;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transform: translateX(100%);
    transition: transform 0.3s ease;
}

.toast.show {
    transform: translateX(0);
}

.toast-success {
    background-color: #10B981;
}

.toast-error {
    background-color: #EF4444;
}

.toast-warning {
    background-color: #F59E0B;
}

.toast-info {
    background-color: #3B82F6;
}

/* History Item Styles */
.history-item {
    border-left: 4px solid #ccc;
    transition: border-color 0.3s ease;
}

.history-item.pending {
    border-color: #F59E0B;
}

.history-item.failed {
    border-color: #EF4444;
}

.history-item.success {
    border-color: #10B981;
}

/* Responsive Design */
@media (max-width: 640px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    #recordBtn {
        width: 120px;
        height: 120px;
    }
    
    #recordBtn svg {
        width: 40px;
        height: 40px;
    }
}

/* Focus States for Accessibility */
button:focus,
input:focus {
    outline: 2px solid #3B82F6;
    outline-offset: 2px;
}

/* Loading Spinner */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #ffffff;
    animation: spin 1s ease-in-out infinite;
}

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

/* Modal Backdrop */
.modal-backdrop {
    backdrop-filter: blur(4px);
}

/* Voice Command Indicator */
.voice-command-active {
    border: 2px solid #10B981;
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.2);
}

/* Accessibility Improvements */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .bg-gray-50 {
        background-color: #ffffff;
    }
    
    .text-gray-500 {
        color: #000000;
    }
    
    .border-gray-300 {
        border-color: #000000;
    }
}

/* Print Styles */
@media print {
    nav,
    #toastContainer,
    #confirmModal {
        display: none !important;
    }
}

/* 음성 레벨 애니메이션 */
.voice-reactive {
    transition: all 0.15s ease-out;
}

.voice-level-1 { transform: scale(1.02); box-shadow: 0 0 10px rgba(239, 68, 68, 0.3); }
.voice-level-2 { transform: scale(1.04); box-shadow: 0 0 15px rgba(239, 68, 68, 0.4); }
.voice-level-3 { transform: scale(1.06); box-shadow: 0 0 20px rgba(239, 68, 68, 0.5); }
.voice-level-4 { transform: scale(1.08); box-shadow: 0 0 25px rgba(239, 68, 68, 0.6); }
.voice-level-5 { transform: scale(1.10); box-shadow: 0 0 30px rgba(239, 68, 68, 0.7); }

/* 실시간 인식 박스 음성 시각화 */
.voice-visualizer {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 60px;
    gap: 3px;
    margin: 10px 0;
}

.voice-bar {
    width: 4px;
    background: linear-gradient(to top, #3b82f6, #60a5fa);
    border-radius: 2px;
    transition: height 0.1s ease-out;
    min-height: 8px;
}

.voice-bar-1 { height: 15px; animation-delay: 0s; }
.voice-bar-2 { height: 25px; animation-delay: 0.1s; }
.voice-bar-3 { height: 35px; animation-delay: 0.2s; }
.voice-bar-4 { height: 40px; animation-delay: 0.15s; }
.voice-bar-5 { height: 30px; animation-delay: 0.25s; }
.voice-bar-6 { height: 20px; animation-delay: 0.3s; }
.voice-bar-7 { height: 35px; animation-delay: 0.05s; }
.voice-bar-8 { height: 25px; animation-delay: 0.2s; }
.voice-bar-9 { height: 40px; animation-delay: 0.1s; }
.voice-bar-10 { height: 15px; animation-delay: 0.3s; }

@keyframes voice-wave {
    0%, 100% { transform: scaleY(0.3); opacity: 0.7; }
    50% { transform: scaleY(1); opacity: 1; }
}

.voice-active .voice-bar {
    animation: voice-wave 1.5s ease-in-out infinite;
}

/* 음성 없을 때 기본 상태 */
.voice-idle .voice-bar {
    height: 8px;
    opacity: 0.3;
}
