/* ═══════════════════════════════════════════════════
   Project W.E — Voice Support UI
   Premium Voice Call Experience
   ═══════════════════════════════════════════════════ */

/* ═══════════════════════════════════════════════════
   CALL MODAL
   ═══════════════════════════════════════════════════ */
.call-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: none;
    background: linear-gradient(180deg, #042f2e 0%, #0d3d38 40%, #115e59 100%);
    opacity: 0;
    transition: opacity 0.4s ease;
    overflow: hidden;
}

.call-modal::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(ellipse at center, rgba(20, 184, 166, 0.08) 0%, transparent 60%);
    animation: aurora 15s ease-in-out infinite;
    pointer-events: none;
}

@keyframes aurora {

    0%,
    100% {
        transform: translate(0, 0) rotate(0deg);
    }

    25% {
        transform: translate(5%, 5%) rotate(2deg);
    }

    50% {
        transform: translate(0, 10%) rotate(0deg);
    }

    75% {
        transform: translate(-5%, 5%) rotate(-2deg);
    }
}

.call-modal.active {
    display: flex;
    flex-direction: column;
    opacity: 1;
}

/* ═══════════════════════════════════════════════════
   HEADER
   ═══════════════════════════════════════════════════ */
.call-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    background: transparent;
    position: relative;
    z-index: 10;
}

.call-header .back-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: rgba(94, 234, 212, 0.9);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1.2rem;
}

.call-header .back-btn:hover {
    background: rgba(94, 234, 212, 0.15);
    border-color: rgba(94, 234, 212, 0.3);
}

.call-header .header-center {
    text-align: center;
}

.call-header .we-symbol {
    font-size: 0.9rem;
    color: #5eead4;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    font-weight: 600;
}

.call-header h1 {
    font-size: 1rem;
    font-weight: 400;
    letter-spacing: 0.2em;
    color: rgba(255, 255, 255, 0.95);
    margin: 0;
    font-family: 'Outfit', sans-serif;
    text-transform: uppercase;
}

/* ═══════════════════════════════════════════════════
   LANGUAGE TOGGLE
   ═══════════════════════════════════════════════════ */
.language-toggle {
    display: flex;
    gap: 0.5rem;
    padding: 0.4rem;
    margin: 1.5rem auto 1rem auto;
    background: rgba(13, 58, 52, 0.8);
    border-radius: 2rem;
    border: 1px solid rgba(94, 234, 212, 0.15);
    width: fit-content;
    z-index: 20;
    backdrop-filter: blur(8px);
}

.lang-btn {
    padding: 0.6rem 1.2rem;
    border-radius: 1.5rem;
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Outfit', sans-serif;
    font-weight: 500;
}

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

.lang-btn.active {
    background: rgba(94, 234, 212, 0.2);
    color: #5eead4;
    box-shadow: 0 0 12px rgba(94, 234, 212, 0.2);
}

/* ═══════════════════════════════════════════════════
   CALL CONTAINER
   ═══════════════════════════════════════════════════ */
.call-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    position: relative;
}

/* ═══════════════════════════════════════════════════
   AVATAR
   ═══════════════════════════════════════════════════ */
.avatar-container {
    position: relative;
    width: 180px;
    height: 180px;
    margin-bottom: 3rem;
}

.avatar-glow {
    position: absolute;
    inset: -30px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(94, 234, 212, 0.2) 0%, transparent 70%);
    opacity: 0.4;
    transition: opacity 0.5s, transform 0.5s;
}

.avatar-container.speaking .avatar-glow {
    opacity: 1;
    animation: pulse-glow-we 2s ease-in-out infinite;
}

.avatar-container.listening .avatar-glow {
    opacity: 0.8;
    background: radial-gradient(circle, rgba(96, 165, 250, 0.25) 0%, transparent 70%);
}

.avatar-ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px solid rgba(94, 234, 212, 0.3);
    transition: all 0.4s ease;
}

.avatar-container.speaking .avatar-ring {
    border-color: rgba(94, 234, 212, 0.8);
    animation: pulse-ring-we 2s ease-in-out infinite;
}

.avatar-container.listening .avatar-ring {
    border-color: rgba(96, 165, 250, 0.6);
}

.avatar-inner {
    position: absolute;
    inset: 12px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(94, 234, 212, 0.15), rgba(20, 184, 166, 0.08));
    border: 1px solid rgba(94, 234, 212, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
}

.avatar-icon {
    font-size: 4rem;
    color: #5eead4;
    text-shadow: 0 0 40px rgba(94, 234, 212, 0.6);
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
}

/* Sound Waves */
.sound-waves {
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 5px;
    align-items: flex-end;
    height: 24px;
    opacity: 0;
    transition: opacity 0.3s;
}

.avatar-container.speaking .sound-waves {
    opacity: 1;
}

.sound-waves span {
    width: 4px;
    background: linear-gradient(to top, #14b8a6, #5eead4);
    border-radius: 4px;
    animation: sound-wave-we 0.6s ease-in-out infinite;
}

.sound-waves span:nth-child(1) {
    height: 10px;
    animation-delay: 0s;
}

.sound-waves span:nth-child(2) {
    height: 18px;
    animation-delay: 0.1s;
}

.sound-waves span:nth-child(3) {
    height: 14px;
    animation-delay: 0.2s;
}

@keyframes sound-wave-we {

    0%,
    100% {
        transform: scaleY(1);
        opacity: 0.7;
    }

    50% {
        transform: scaleY(1.6);
        opacity: 1;
    }
}

@keyframes pulse-glow-we {

    0%,
    100% {
        opacity: 0.5;
        transform: scale(1);
    }

    50% {
        opacity: 1;
        transform: scale(1.08);
    }
}

@keyframes pulse-ring-we {

    0%,
    100% {
        transform: scale(1);
        opacity: 0.6;
    }

    50% {
        transform: scale(1.04);
        opacity: 1;
    }
}

/* ═══════════════════════════════════════════════════
   STATUS
   ═══════════════════════════════════════════════════ */
.call-status {
    margin-bottom: 1rem;
    text-align: center;
}

.call-status p {
    font-size: 1.1rem;
    color: #e2e8f0;
    margin: 0;
    font-family: 'Outfit', sans-serif;
    font-weight: 500;
    letter-spacing: 0.02em;
}

.status-error {
    color: #f87171 !important;
    animation: shake-we 0.5s ease-in-out;
}

.status-connecting {
    color: #5eead4 !important;
    animation: pulse-text-we 1.5s infinite;
}

.status-connected {
    color: #4ade80 !important;
    font-weight: 600;
}

.status-listening {
    color: #60a5fa !important;
    text-shadow: 0 0 15px rgba(96, 165, 250, 0.5);
    animation: breathe-we 3s infinite;
}

.status-speaking {
    color: #5eead4 !important;
    text-shadow: 0 0 15px rgba(94, 234, 212, 0.5);
}

.status-idle {
    color: #94a3b8 !important;
}

@keyframes shake-we {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-5px);
    }

    75% {
        transform: translateX(5px);
    }
}

@keyframes pulse-text-we {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

@keyframes breathe-we {

    0%,
    100% {
        opacity: 0.8;
    }

    50% {
        opacity: 1;
        text-shadow: 0 0 25px rgba(96, 165, 250, 0.8);
    }
}

/* Subtitle */
.call-subtitle {
    font-family: 'Outfit', sans-serif;
    font-size: 1rem;
    font-style: italic;
    color: #5eead4;
    opacity: 0.9;
    text-align: center;
    max-width: 300px;
    margin-top: 0.5rem;
    font-weight: 300;
}

/* ═══════════════════════════════════════════════════
   CALL CONTROLS
   ═══════════════════════════════════════════════════ */
.call-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    padding: 3rem;
}

.control-btn {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: white;
    font-size: 1.2rem;
}

.control-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: scale(1.05);
}

.mute-btn.muted {
    background: rgba(248, 113, 113, 0.2);
    border-color: rgba(248, 113, 113, 0.4);
    color: #f87171;
}

.placeholder {
    visibility: hidden;
    width: 56px;
    height: 56px;
}

.call-btn {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1.5rem;
}

.start-call {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: #fff;
    box-shadow: 0 4px 24px rgba(34, 197, 94, 0.4);
}

.start-call:hover {
    transform: scale(1.08);
    box-shadow: 0 8px 32px rgba(34, 197, 94, 0.5);
}

.end-call {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: #fff;
    box-shadow: 0 4px 24px rgba(239, 68, 68, 0.4);
}

.end-call:hover {
    transform: scale(1.08);
    box-shadow: 0 8px 32px rgba(239, 68, 68, 0.5);
}

/* Instructions */
.call-instructions {
    text-align: center;
    padding: 1rem;
    color: #94a3b8;
    font-size: 0.85rem;
    margin-bottom: 1rem;
    font-family: 'Outfit', sans-serif;
}

.call-instructions p {
    margin: 0.5rem 0;
}

/* ═══════════════════════════════════════════════════
   FLOATING ACTION BUTTON
   ═══════════════════════════════════════════════════ */
.call-fab {
    position: fixed;
    bottom: 30px;
    left: 30px;
    background: linear-gradient(135deg, #0F766E 0%, #14B8A6 100%);
    border: none;
    border-radius: 30px;
    padding: 16px 28px;
    cursor: pointer;
    box-shadow: 0 8px 32px rgba(15, 118, 110, 0.35);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 500;
    overflow: hidden;
}

.call-fab::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.call-fab:hover::before {
    left: 100%;
}

.call-fab:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 12px 40px rgba(15, 118, 110, 0.45);
}

.fab-content {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    position: relative;
    z-index: 1;
}

.fab-icon {
    font-size: 24px;
}

.fab-label {
    font-weight: 600;
    font-size: 16px;
    letter-spacing: 0.5px;
    font-family: 'Outfit', sans-serif;
}

/* ═══════════════════════════════════════════════════
   MOBILE RESPONSIVE
   ═══════════════════════════════════════════════════ */
@media (max-width: 768px) {
    .avatar-container {
        width: 150px;
        height: 150px;
        margin-bottom: 2rem;
    }

    .avatar-icon {
        font-size: 3rem;
    }

    .call-controls {
        gap: 1.5rem;
        padding: 2rem;
    }

    .call-btn {
        width: 64px;
        height: 64px;
    }

    .control-btn {
        width: 50px;
        height: 50px;
    }

    .call-fab {
        bottom: 140px;
        left: 16px;
        padding: 12px 18px;
    }

    .fab-label {
        font-size: 13px;
    }

    .fab-icon {
        font-size: 18px;
    }
}

@media (max-width: 480px) {
    .call-fab {
        bottom: 160px;
        left: 12px;
        right: auto;
        padding: 10px 16px;
        border-radius: 50px;
    }

    .fab-label {
        font-size: 12px;
    }

    .fab-icon {
        font-size: 16px;
    }

    .fab-content {
        gap: 6px;
    }

    .language-toggle {
        padding: 0.3rem;
        flex-wrap: wrap;
        max-width: 320px;
    }

    .lang-btn {
        padding: 0.45rem 0.8rem;
        font-size: 0.8rem;
    }
}

/* Safe area insets for notched phones */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .call-fab {
        bottom: max(30px, env(safe-area-inset-bottom));
    }

    .call-controls {
        padding-bottom: max(3rem, env(safe-area-inset-bottom));
    }
}