/* =============================================
   Voice Input Styles
   เพิ่มต่อท้าย modal-fix.css หรือ style.css
   ============================================= */

/* Voice Input Wrapper */
.voice-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
}

.voice-input-wrapper .form-control {
    flex: 1;
    padding-right: 50px;
}

/* Voice Input Button */
.voice-input-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: linear-gradient(135deg, #f3f4f6, #e5e7eb);
    cursor: pointer;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 10;
}

.voice-input-btn:hover {
    background: linear-gradient(135deg, #e5e7eb, #d1d5db);
    transform: translateY(-50%) scale(1.05);
}

.voice-input-btn:active {
    transform: translateY(-50%) scale(0.95);
}

/* Recording State */
.voice-input-btn.recording {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    animation: pulse-recording 1s infinite;
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
}

@keyframes pulse-recording {
    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);
    }
}

/* Form Control with Voice */
.voice-input-wrapper .form-control:focus {
    border-color: #0d9488;
    box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.1);
}

/* Listening State - Input */
.voice-input-wrapper .form-control[placeholder="กำลังฟัง..."] {
    border-color: #ef4444;
    background: #fef2f2;
}

/* =============================================
   Toast Improvements
   ============================================= */
.toast-container {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.toast {
    padding: 12px 20px;
    border-radius: 12px;
    background: #1f2937;
    color: white;
    font-size: 0.9rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    opacity: 0;
    transform: translateY(-20px);
    transition: all 0.3s ease;
    pointer-events: auto;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast-success {
    background: linear-gradient(135deg, #059669, #047857);
}

.toast-error {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
}

.toast-warning {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

.toast-info {
    background: linear-gradient(135deg, #0891b2, #0e7490);
}

/* =============================================
   Form Row Fix for Voice Buttons
   ============================================= */
.form-row .voice-input-wrapper {
    width: 100%;
}

.form-row .voice-input-wrapper .form-control {
    width: 100%;
}

/* =============================================
   Mobile Responsive
   ============================================= */
@media (max-width: 480px) {
    .voice-input-btn {
        width: 32px;
        height: 32px;
        font-size: 1rem;
    }

    .voice-input-wrapper .form-control {
        padding-right: 45px;
    }
}

/* =====================================================
   Voice Examples - เพิ่มต่อท้ายไฟล์ voice-input.css
   ===================================================== */

.voice-examples {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    padding: 8px 15px;
    overflow: hidden;
}

.voice-example-label {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.7);
    white-space: nowrap;
    flex-shrink: 0;
}

.voice-example-scroll {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    scroll-behavior: smooth;
}

.voice-example-scroll::-webkit-scrollbar {
    display: none;
}

.voice-example-item {
    background: rgba(255, 255, 255, 0.2);
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 0.75rem;
    color: white;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.voice-example-item:hover {
    background: rgba(255, 255, 255, 0.35);
    transform: scale(1.05);
}

/* Auto scroll animation */
@keyframes scrollExamples {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }
}

.voice-example-scroll.auto-scroll {
    animation: scrollExamples 25s linear infinite;
}

.voice-example-scroll.auto-scroll:hover {
    animation-play-state: paused;
}

/* =====================================================
   Voice Examples - เพิ่มต่อท้ายไฟล์ voice-input.css
   ===================================================== */

.voice-examples {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    padding: 0 5px;
    position: relative;
}

.voice-example-label {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.7);
    white-space: nowrap;
    flex-shrink: 0;
}

.voice-example-scroll {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    scroll-behavior: smooth;
    flex: 1;
    padding: 5px 0;
}

.voice-example-scroll::-webkit-scrollbar {
    display: none;
}

.voice-example-item {
    background: rgba(255, 255, 255, 0.2);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.8rem;
    color: white;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.voice-example-item:hover {
    background: rgba(255, 255, 255, 0.35);
    transform: scale(1.05);
}

/* Auto scroll animation */
@keyframes scrollExamples {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }
}

.voice-example-scroll.auto-scroll {
    animation: scrollExamples 25s linear infinite;
}

.voice-example-scroll.auto-scroll:hover {
    animation-play-state: paused;
}

/* Navigation Arrows */
.voice-nav-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.25);
    border: none;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s;
    line-height: 1;
    padding: 0;
}

.voice-nav-btn:hover {
    background: rgba(255, 255, 255, 0.4);
    transform: scale(1.1);
}

.voice-nav-btn:active {
    transform: scale(0.95);
}

/* Guest Actions Styling */
.guest-actions {
    display: flex;
    gap: 10px;
    margin-top: 12px;
}

.guest-actions a {
    flex: 1;
    padding: 12px 20px;
    border-radius: 25px;
    text-align: center;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s;
}

.btn-login {
    background: white;
    color: #10b981;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.btn-login:hover {
    background: #f0fdf4;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.btn-register {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.5);
}

.btn-register:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}