/**
 * AI Voice Support - Styles
 * Modern, Biblical-themed styling for the voice assistant modal
 */

/* ========================================
   MODAL OVERLAY
   ======================================== */
.ai-voice-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(8px);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.ai-voice-modal.active {
    display: flex;
    opacity: 1;
}

/* ========================================
   MODAL CONTAINER
   ======================================== */
.ai-voice-container {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 24px;
    padding: 2.5rem;
    max-width: 600px;
    width: 90%;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(59, 130, 246, 0.1);
    animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ========================================
   HEADER
   ======================================== */
.ai-voice-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
}

.ai-voice-title {
    font-size: 1.75rem;
    font-weight: 700;
    background: linear-gradient(135deg, #3b82f6 0%, #60a5fa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.ai-voice-title svg {
    width: 32px;
    height: 32px;
    fill: #3b82f6;
}

.ai-voice-close {
    background: rgba(100, 116, 139, 0.1);
    border: 1px solid rgba(100, 116, 139, 0.2);
    border-radius: 12px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #94a3b8;
}

.ai-voice-close:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.4);
    color: #ef4444;
    transform: scale(1.05);
}

/* ========================================
   VISUALIZER
   ======================================== */
.ai-voice-visualizer-container {
    width: 100%;
    height: 180px;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 16px;
    margin-bottom: 1.5rem;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.3);
}

.ai-voice-visualizer {
    width: 100%;
    height: 100%;
    display: block;
}

/* Pulsing effect when listening */
.ai-status.listening+.ai-voice-visualizer-container {
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.3),
            0 0 0 0 rgba(59, 130, 246, 0.4);
    }

    50% {
        box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.3),
            0 0 0 8px rgba(59, 130, 246, 0);
    }
}

/* ========================================
   STATUS
   ======================================== */
.ai-status {
    text-align: center;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: rgba(59, 130, 246, 0.05);
    border: 1px solid rgba(59, 130, 246, 0.1);
    border-radius: 12px;
    transition: all 0.3s ease;
}

.ai-status-text {
    font-size: 1.125rem;
    font-weight: 600;
    color: #e2e8f0;
}

/* Status states */
.ai-status.connecting {
    background: rgba(251, 191, 36, 0.1);
    border-color: rgba(251, 191, 36, 0.3);
}

.ai-status.connecting .ai-status-text {
    color: #fbbf24;
}

.ai-status.listening {
    background: rgba(59, 130, 246, 0.1);
    border-color: rgba(59, 130, 246, 0.3);
    animation: listenPulse 1.5s ease-in-out infinite;
}

.ai-status.listening .ai-status-text {
    color: #3b82f6;
}

@keyframes listenPulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.02);
    }
}

.ai-status.speaking {
    background: rgba(34, 197, 94, 0.1);
    border-color: rgba(34, 197, 94, 0.3);
}

.ai-status.speaking .ai-status-text {
    color: #22c55e;
}

.ai-status.error {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
}

.ai-status.error .ai-status-text {
    color: #ef4444;
}

/* ========================================
   CONTROLS
   ======================================== */
.ai-voice-controls {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.ai-btn {
    padding: 0.875rem 2rem;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    outline: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: inherit;
}

.ai-btn-primary {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.ai-btn-primary:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
    transform: translateY(-2px);
}

.ai-btn-secondary {
    background: rgba(100, 116, 139, 0.2);
    color: #e2e8f0;
    border: 1px solid rgba(100, 116, 139, 0.3);
}

.ai-btn-secondary:hover {
    background: rgba(100, 116, 139, 0.3);
    border-color: rgba(100, 116, 139, 0.4);
    transform: translateY(-2px);
}

.ai-btn-danger {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.ai-btn-danger:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.4);
    transform: translateY(-2px);
}

.ai-retry-btn {
    display: none;
}

.ai-retry-btn.visible {
    display: flex;
}

/* ========================================
   FLOATING ACTION BUTTON
   ======================================== */
.ai-voice-fab {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.4),
        0 4px 8px rgba(0, 0, 0, 0.2);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 9998;
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.ai-voice-fab:hover {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 12px 32px rgba(59, 130, 246, 0.5),
        0 6px 12px rgba(0, 0, 0, 0.3);
}

.ai-voice-fab:active {
    transform: scale(0.95);
}

.ai-voice-fab svg {
    width: 28px;
    height: 28px;
    fill: white;
}

/* Pulse animation for FAB */
.ai-voice-fab::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: rgba(59, 130, 246, 0.4);
    animation: fabPulse 2s ease-out infinite;
}

@keyframes fabPulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 640px) {
    .ai-voice-container {
        padding: 1.5rem;
        width: 95%;
        border-radius: 20px;
    }

    .ai-voice-title {
        font-size: 1.5rem;
    }

    .ai-voice-visualizer-container {
        height: 140px;
    }

    .ai-voice-controls {
        flex-direction: column;
    }

    .ai-btn {
        width: 100%;
        justify-content: center;
    }

    .ai-voice-fab {
        bottom: 1rem;
        right: 1rem;
        width: 56px;
        height: 56px;
    }

    .ai-voice-fab svg {
        width: 24px;
        height: 24px;
    }
}

/* ========================================
   ACCESSIBILITY
   ======================================== */
@media (prefers-reduced-motion: reduce) {

    .ai-voice-modal,
    .ai-voice-container,
    .ai-btn,
    .ai-voice-fab {
        animation: none;
        transition: none;
    }

    .ai-voice-fab::before {
        animation: none;
    }
}

/* Focus styles for keyboard navigation */
.ai-btn:focus,
.ai-voice-close:focus,
.ai-voice-fab:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}