/* Additions to ios-translate.css for JS compatibility */

.translate-result-text {
    width: 100%;
    height: 100%;
    overflow-y: auto;
    word-wrap: break-word;
}

.translate-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    height: 100%;
    color: rgba(255, 255, 255, 0.5);
}

.loading-dot {
    width: 8px;
    height: 8px;
    background: #8f73ff;
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out both;
}

.loading-dot:nth-child(1) {
    animation-delay: -0.32s;
}

.loading-dot:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes bounce {

    0%,
    80%,
    100% {
        transform: scale(0);
    }

    40% {
        transform: scale(1);
    }
}

/* ===== SPEECH MODE STYLES ===== */

/* Mode Toggle Container */
.mode-toggle-container {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    background: rgba(255, 255, 255, 0.05);
    padding: 6px;
    border-radius: 12px;
    justify-content: center;
}

.mode-toggle-btn {
    flex: 1;
    max-width: 120px;
    padding: 10px 16px;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.mode-toggle-btn:hover {
    color: rgba(255, 255, 255, 0.8);
}

.mode-toggle-btn.active {
    background: var(--primary, #8b5cf6);
    color: white;
    box-shadow: 0 4px 12px rgba(143, 115, 255, 0.3);
}

.mode-icon {
    font-size: 1rem;
}

/* Voice Input Panel */
.voice-input-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 24px 16px;
    gap: 16px;
    background: linear-gradient(135deg, rgba(143, 115, 255, 0.1), rgba(217, 70, 239, 0.05));
    border-radius: 16px;
    margin-bottom: 16px;
}

/* Microphone Button */
.mic-btn {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, #8b5cf6, #d946ef);
    border: none;
    cursor: pointer;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 8px 24px rgba(143, 115, 255, 0.4);
}

.mic-btn:hover {
    transform: scale(1.05);
}

.mic-btn:active,
.mic-btn.active-press {
    transform: scale(0.9);
    box-shadow: 0 0 0 10px rgba(239, 68, 68, 0.2);
    background: #ef4444;
    /* Red color when holding */
}

.mic-btn .mic-icon {
    font-size: 2rem;
    z-index: 2;
}

/* Pulse Animation */
.mic-pulse {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: rgba(143, 115, 255, 0.4);
    opacity: 0;
    z-index: 1;
}

.mic-btn.listening .mic-pulse {
    animation: pulse-ring 1.5s infinite;
}

.mic-btn.listening {
    background: linear-gradient(135deg, #ef4444, #f97316);
    box-shadow: 0 8px 24px rgba(239, 68, 68, 0.5);
}

@keyframes pulse-ring {
    0% {
        transform: scale(1);
        opacity: 0.6;
    }

    100% {
        transform: scale(1.8);
        opacity: 0;
    }
}

/* Mic Status Text */
.mic-status {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
    margin: 0;
    transition: color 0.2s;
}

.mic-status.listening {
    color: #10b981;
    font-weight: 600;
}

.mic-status.error {
    color: #ef4444;
}

/* Voice Transcript */
.voice-transcript {
    width: 100%;
    min-height: 60px;
    padding: 12px 16px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    font-size: 1rem;
    line-height: 1.6;
    color: white;
    text-align: center;
}

.voice-transcript .placeholder {
    color: rgba(255, 255, 255, 0.4);
    font-style: italic;
}

/* Responsive */
@media (max-width: 480px) {
    .mic-btn {
        width: 70px;
        height: 70px;
    }

    .mic-btn .mic-icon {
        font-size: 1.6rem;
    }

    .mode-toggle-btn {
        padding: 8px 12px;
        font-size: 0.85rem;
    }
}