/* DmApp Voice-to-Text Styles */

/* ===== VOICE BUTTON ===== */

.voice-button {
    background: linear-gradient(135deg, #00FF00, #00CC00);
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 255, 0, 0.3);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 10px;
    position: relative;
}

.voice-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(0, 255, 0, 0.4);
}

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

.voice-button.active {
    background: linear-gradient(135deg, #FF0000, #CC0000);
    animation: voicePulse 1.5s ease-in-out infinite;
}

@keyframes voicePulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(255, 0, 0, 0.7);
    }
    50% {
        box-shadow: 0 0 0 15px rgba(255, 0, 0, 0);
    }
}

/* ===== MESSAGE VOICE BUTTON ===== */

.message-voice-button {
    position: absolute;
    right: 60px;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    font-size: 18px;
}

/* ===== LISTENING INDICATOR ===== */

.voice-listening-indicator {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, rgba(0, 255, 0, 0.95), rgba(0, 204, 0, 0.95));
    color: white;
    padding: 15px 25px;
    border-radius: 30px;
    box-shadow: 0 8px 24px rgba(0, 255, 0, 0.4);
    z-index: 10001;
    display: flex;
    align-items: center;
    gap: 15px;
    backdrop-filter: blur(10px);
    animation: slideUpFade 0.3s ease-out;
}

@keyframes slideUpFade {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.listening-pulse {
    width: 12px;
    height: 12px;
    background: white;
    border-radius: 50%;
    animation: pulse 1s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.5);
        opacity: 0.5;
    }
}

.voice-listening-indicator span {
    font-weight: 600;
    font-size: 14px;
}

.stop-listening-btn {
    background: rgba(255, 255, 255, 0.3);
    color: white;
    border: 1px solid white;
    padding: 6px 15px;
    border-radius: 15px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.stop-listening-btn:hover {
    background: rgba(255, 255, 255, 0.4);
    transform: scale(1.05);
}

/* ===== INTERIM TEXT ===== */

.voice-interim-text {
    position: absolute;
    bottom: 100%;
    left: 0;
    right: 0;
    background: rgba(0, 255, 0, 0.1);
    color: #00AA00;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 14px;
    font-style: italic;
    margin-bottom: 5px;
    border: 1px dashed rgba(0, 255, 0, 0.3);
}

/* ===== NOTIFICATIONS ===== */

.voice-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    padding: 15px 20px;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    z-index: 10002;
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideInRight 0.4s ease-out;
}

@keyframes slideInRight {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.voice-notification.error {
    background: linear-gradient(135deg, #FFF0F0, #FFE0E0);
    border-left: 4px solid #FF0000;
}

.voice-notification span:first-child {
    font-size: 20px;
}

/* ===== LANGUAGE SELECTOR MODAL ===== */

.voice-language-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10003;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
    animation: modalFadeIn 0.3s ease-out;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.language-modal-content {
    background: white;
    border-radius: 20px;
    width: 90%;
    max-width: 400px;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes modalSlideIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

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

.modal-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: bold;
}

.close-modal {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #999;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

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

.language-list {
    max-height: 400px;
    overflow-y: auto;
    padding: 10px;
}

.language-option {
    width: 100%;
    background: white;
    border: 1px solid #e0e0e0;
    padding: 15px 20px;
    margin-bottom: 8px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 15px;
}

.language-option:hover {
    background: #f5f5f5;
    border-color: #00FF00;
}

.language-option.active {
    background: linear-gradient(135deg, rgba(0, 255, 0, 0.1), rgba(0, 204, 0, 0.05));
    border-color: #00FF00;
    font-weight: 600;
}

.language-name {
    color: #333;
}

.checkmark {
    color: #00FF00;
    font-weight: bold;
    font-size: 18px;
}

/* ===== RESPONSIVE DESIGN ===== */

@media (max-width: 768px) {
    .voice-button {
        width: 36px;
        height: 36px;
        font-size: 18px;
    }
    
    .voice-listening-indicator {
        padding: 12px 20px;
        font-size: 13px;
    }
    
    .language-modal-content {
        width: 95%;
    }
}

/* ===== DARK MODE ===== */

@media (prefers-color-scheme: dark) {
    .voice-notification {
        background: #2a2a2a;
        color: white;
    }
    
    .language-modal-content {
        background: #2a2a2a;
    }
    
    .modal-header h3 {
        color: white;
    }
    
    .language-option {
        background: #333;
        border-color: #444;
        color: white;
    }
    
    .language-option:hover {
        background: #3a3a3a;
    }
    
    .language-option.active {
        background: linear-gradient(135deg, rgba(0, 255, 0, 0.2), rgba(0, 204, 0, 0.1));
    }
    
    .language-name {
        color: white;
    }
}

/* ===== ACCESSIBILITY ===== */

.voice-button:focus {
    outline: 3px solid #00FF00;
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    .voice-button,
    .voice-listening-indicator,
    .language-option,
    .listening-pulse {
        animation: none !important;
        transition: none !important;
    }
}

/* ===== HIGH CONTRAST MODE ===== */

@media (prefers-contrast: high) {
    .voice-button {
        border: 2px solid white;
    }
    
    .language-option {
        border-width: 2px;
    }
}
