/* AKILBEMSG CALL WINDOW V1 */

.akilbemsg-call-window[hidden] {
    display: none !important;
}

.akilbemsg-call-window {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(10, 16, 28, 0.88);
}

.akilbemsg-call-panel {
    display: flex;
    flex-direction: column;
    width: min(100%, 900px);
    max-height: 100%;
    overflow: hidden;
    border-radius: 18px;
    background: #141b29;
    color: #fff;
}

.akilbemsg-call-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 18px;
    text-align: center;
}

.akilbemsg-call-title {
    font-size: 20px;
    font-weight: 700;
}

.akilbemsg-call-status {
    font-size: 13px;
    color: #b7c4d8;
}

.akilbemsg-call-video-area {
    position: relative;
    width: 100%;
    min-height: 240px;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #080d16;
}

#akilbemsg-remote-video {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #080d16;
}

#akilbemsg-local-video {
    position: absolute;
    right: 16px;
    bottom: 16px;
    width: 25%;
    max-width: 200px;
    aspect-ratio: 3 / 4;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.7);
    border-radius: 12px;
    background: #263143;
    transform: scaleX(-1);
}

.akilbemsg-call-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
    padding: 20px;
}

.akilbemsg-call-controls button {
    min-height: 44px;
    padding: 10px 18px;
    border: 0;
    border-radius: 24px;
    background: #344258;
    color: #fff;
    font-size: 14px;
    cursor: pointer;
}

.akilbemsg-call-controls button:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.akilbemsg-call-controls button:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 3px;
}

#akilbemsg-call-end {
    background: #d93025;
}

@media (max-width: 767px) {
    .akilbemsg-call-window {
        padding: 0;
    }

    .akilbemsg-call-panel {
        width: 100%;
        height: 100%;
        max-height: 100dvh;
        border-radius: 0;
    }

    .akilbemsg-call-video-area {
        flex: 1;
        min-height: 0;
        aspect-ratio: auto;
    }

    #akilbemsg-local-video {
        right: 12px;
        bottom: 12px;
        width: 30%;
        max-width: 140px;
    }

    .akilbemsg-call-controls {
        flex-shrink: 0;
        padding: 16px 12px max(16px, env(safe-area-inset-bottom));
    }
}


/* ===== AKILBEMSG CALL SCREEN PRO V1 ===== */

.akilbemsg-call-window {
    box-sizing: border-box;
    background: rgba(3, 9, 22, 0.82);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

.akilbemsg-call-panel {
    position: relative;
    box-sizing: border-box;
    width: min(100%, 440px);
    max-height: min(760px, calc(100dvh - 40px));
    min-height: min(600px, calc(100dvh - 40px));
    border: 1px solid rgba(148, 187, 255, 0.18);
    border-radius: 28px;
    background:
        radial-gradient(
            circle at 50% 18%,
            rgba(35, 111, 220, 0.38),
            transparent 45%
        ),
        linear-gradient(
            160deg,
            #102748 0%,
            #0a162b 55%,
            #060d19 100%
        );
    box-shadow: 0 25px 90px rgba(0, 0, 0, 0.55);
    color: #fff;
}

.akilbemsg-call-header {
    position: relative;
    z-index: 2;
    padding: 30px 20px 18px;
    text-align: center;
}

.akilbemsg-call-title {
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.akilbemsg-call-status {
    color: #b9cbea;
    font-size: 14px;
}

.akilbemsg-call-video-area {
    flex: 1;
    min-height: 200px;
    aspect-ratio: auto;
    background: transparent;
}

#akilbemsg-remote-video {
    background: transparent;
}

.akilbemsg-call-controls {
    position: relative;
    z-index: 3;
    gap: 12px;
    padding: 22px 18px 30px;
}

.akilbemsg-call-controls button {
    min-height: 52px;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(125, 160, 210, 0.17);
    color: #fff;
    font-weight: 600;
    transition:
        background 0.2s ease,
        transform 0.2s ease;
}

.akilbemsg-call-controls button:not(:disabled):active {
    transform: scale(0.96);
}

.akilbemsg-call-controls button[hidden] {
    display: none !important;
}

#akilbemsg-call-answer {
    background: #15804b;
}

#akilbemsg-call-reject,
#akilbemsg-call-end {
    background: #cf3444;
}

.akilbemsg-call-window.is-minimized {
    inset: auto 20px 20px auto;
    width: min(320px, calc(100vw - 40px));
    height: auto;
    padding: 0;
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    pointer-events: none;
}

.akilbemsg-call-window.is-minimized .akilbemsg-call-panel {
    width: 100%;
    min-height: 0;
    max-height: 200px;
    border-radius: 20px;
    pointer-events: auto;
}

.akilbemsg-call-window.is-minimized .akilbemsg-call-video-area {
    display: none;
}

.akilbemsg-call-window.is-minimized .akilbemsg-call-header {
    padding: 14px;
}

.akilbemsg-call-window.is-minimized .akilbemsg-call-controls {
    padding: 10px;
}

@media (max-width: 767px) {
    .akilbemsg-call-window {
        inset: 0;
        width: 100%;
        height: 100%;
        padding: 0;
    }

    .akilbemsg-call-panel {
        width: 100%;
        height: 100%;
        min-height: 100dvh;
        max-height: 100dvh;
        border: 0;
        border-radius: 0;
    }

    .akilbemsg-call-header {
        padding-top: max(
            36px,
            env(safe-area-inset-top)
        );
    }

    .akilbemsg-call-video-area {
        flex: 1;
        min-height: 0;
    }

    .akilbemsg-call-controls {
        padding-bottom: max(
            24px,
            env(safe-area-inset-bottom)
        );
    }

    .akilbemsg-call-window.is-minimized {
        inset: 0;
        width: 100%;
        height: 100%;
        padding: 0;
        background: rgba(3, 9, 22, 0.82);
        pointer-events: auto;
    }

    .akilbemsg-call-window.is-minimized .akilbemsg-call-panel {
        width: 100%;
        height: 100%;
        min-height: 100dvh;
        max-height: 100dvh;
        border-radius: 0;
    }

    .akilbemsg-call-window.is-minimized .akilbemsg-call-video-area {
        display: block;
    }
}

@media (prefers-reduced-motion: reduce) {
    .akilbemsg-call-controls button {
        transition: none;
    }
}


/* AKILBEMSG CALL MINIMIZE CSS V1 */

.akilbemsg-call-minimize[hidden] {
    display: none !important;
}

.akilbemsg-call-minimize {
    align-self: flex-end;
    min-height: 36px;
    padding: 7px 14px;
    border: 1px solid rgba(255,255,255,0.18);
    border-radius: 12px;
    background: rgba(255,255,255,0.12);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.akilbemsg-call-minimize:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 3px;
}

@media (max-width: 767px) {
    .akilbemsg-call-minimize {
        display: none !important;
    }
}

@media (min-width: 768px) {
    .akilbemsg-call-window.is-minimized
    .akilbemsg-call-controls {
        display: none;
    }

    .akilbemsg-call-window.is-minimized
    .akilbemsg-call-panel {
        min-height: 0;
        max-height: 180px;
    }
}


/* AKILBEMSG AUDIO CALL PROFILE V1 */

.akilbemsg-call-audio-profile[hidden] {
    display: none !important;
}

.akilbemsg-call-window.is-audio-call
.akilbemsg-call-video-area {
    position: absolute;
    width: 1px;
    height: 1px;
    min-height: 0;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
}

.akilbemsg-call-window.is-audio-call
.akilbemsg-call-audio-profile {
    display: flex;
    flex: 1 1 auto;
    align-items: center;
    justify-content: center;
    min-height: 220px;
    padding: 24px;
}

.akilbemsg-call-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: clamp(132px, 38vw, 190px);
    height: clamp(132px, 38vw, 190px);
    flex: 0 0 auto;
    border: 4px solid rgba(255,255,255,0.25);
    border-radius: 50%;
    background: linear-gradient(145deg, #3279cf, #173a70);
    box-shadow: 0 12px 45px rgba(0,0,0,0.3);
    color: #fff;
    font-size: 76px;
    font-weight: 700;
}

.akilbemsg-call-controls button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 56px;
    min-height: 56px;
    border-radius: 999px;
}

.akilbemsg-call-controls button[hidden] {
    display: none !important;
}

.akilbemsg-call-title {
    text-transform: none;
    letter-spacing: normal;
}

@media (max-width: 767px) {
    .akilbemsg-call-window.is-audio-call
    .akilbemsg-call-audio-profile {
        min-height: 0;
    }
}
