/* =====================================================================
   SokoHai — [CALLS 2026-11]  css/49-call-ui.css
   Simu za mtandao (sauti + video) ndani ya app — WebRTC.
   Skrini kamili nyeusi kama WhatsApp: video ya mwenzako, dirisha dogo la
   kamera yako, vitufe vya mkrofoni/kamera/spikaa/kata simu, na muda.
   ===================================================================== */

#skhCallOverlay {
    position: fixed;
    inset: 0;
    z-index: 100200;
    background: #0B1410;
    color: #EAF4EF;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    font-family: inherit;
}
#skhCallOverlay[hidden] { display: none !important; }

/* ---------- Video ya mwenzako (video call) ---------- */
#skhCallRemote {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: #0B1410;
    display: none;
}
#skhCallOverlay.is-video #skhCallRemote { display: block; }
#skhCallOverlay.is-video.has-remote-video #skhCallRemote { opacity: 1; }
#skhCallOverlay:not(.has-remote-video) #skhCallRemote { opacity: 0; }

/* ---------- Picha/jina wakati hakuna video ---------- */
.skh-call-art {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 24px;
    text-align: center;
    background: radial-gradient(circle at 50% 30%, #16332A 0%, #0B1410 70%);
    transition: opacity .25s ease;
}
#skhCallOverlay.has-remote-video.is-video .skh-call-art { opacity: 0; pointer-events: none; }
.skh-call-art-av {
    width: 116px;
    height: 116px;
    border-radius: 50%;
    overflow: hidden;
    background: #1E4A3C;
    border: 2px solid rgba(255, 255, 255, .14);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 42px;
    font-weight: 900;
    color: #CFF3E5;
    animation: skhCallPulse 2.4s ease-in-out infinite;
}
.skh-call-art-av img { width: 100%; height: 100%; object-fit: cover; }
@keyframes skhCallPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(24, 169, 130, .34); }
    50% { box-shadow: 0 0 0 18px rgba(24, 169, 130, 0); }
}
.skh-call-art-name { font-size: 22px; font-weight: 900; color: #FFFFFF; }
.skh-call-art-state { font-size: 14px; font-weight: 700; color: #9DC7B6; }

/* ---------- Kichwa cha juu ---------- */
.skh-call-top {
    position: relative;
    z-index: 3;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: calc(12px + env(safe-area-inset-top, 0px)) 14px 10px;
    background: linear-gradient(180deg, rgba(6, 16, 12, .85), rgba(6, 16, 12, 0));
}
.skh-call-top-t { min-width: 0; flex: 1 1 auto; display: flex; flex-direction: column; gap: 2px; }
.skh-call-top-t b {
    font-size: 15px; font-weight: 900; color: #fff;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    text-shadow: 0 1px 4px rgba(0, 0, 0, .55);
}
.skh-call-top-t span {
    font-size: 12.5px; font-weight: 700; color: #E7F4EF;
    font-variant-numeric: tabular-nums;
    text-shadow: 0 1px 4px rgba(0, 0, 0, .55);
}
.skh-call-lbl { text-shadow: 0 1px 4px rgba(0, 0, 0, .6); }
.skh-call-badge {
    flex: 0 0 auto;
    font-size: 10.5px;
    font-weight: 900;
    letter-spacing: .06em;
    text-transform: uppercase;
    padding: 4px 9px;
    border-radius: 99px;
    background: rgba(24, 169, 130, .18);
    border: 1px solid rgba(24, 169, 130, .45);
    color: #6FE3B8;
}
.skh-call-iconbtn {
    flex: 0 0 auto;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, .16);
    background: rgba(255, 255, 255, .08);
    color: #EAF4EF;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
}
.skh-call-iconbtn svg { width: 18px; height: 18px; }
.skh-call-iconbtn:hover { background: rgba(255, 255, 255, .16); }

/* ---------- Dirisha dogo la kamera yako ---------- */
#skhCallLocal {
    position: absolute;
    right: 14px;
    top: calc(72px + env(safe-area-inset-top, 0px));
    width: 108px;
    height: 156px;
    border-radius: 14px;
    object-fit: cover;
    background: #12251E;
    border: 1px solid rgba(255, 255, 255, .18);
    box-shadow: 0 10px 26px rgba(0, 0, 0, .45);
    z-index: 4;
    display: none;
    transform: scaleX(-1);
}
#skhCallOverlay.is-video #skhCallLocal { display: block; }
#skhCallOverlay.is-cam-off #skhCallLocal { display: none; }

/* ---------- Vitufe vya chini ---------- */
.skh-call-ctrl {
    position: relative;
    z-index: 5;
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 16px 16px calc(24px + env(safe-area-inset-bottom, 0px));
    background: linear-gradient(0deg, rgba(6, 16, 12, .92), rgba(6, 16, 12, 0));
}
.skh-call-btn {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, .14);
    background: rgba(255, 255, 255, .1);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    position: relative;
    transition: background .15s ease, transform .06s ease;
}
.skh-call-btn:active { transform: scale(.94); }
.skh-call-btn svg { width: 24px; height: 24px; }
.skh-call-btn.is-off { background: #FFFFFF; color: #0B1410; }
.skh-call-btn.is-off::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border-top: 2px solid #D92D20;
    transform: rotate(45deg);
    pointer-events: none;
}
.skh-call-btn.hangup {
    width: 66px;
    height: 66px;
    background: #D92D20;
    border-color: #D92D20;
    box-shadow: 0 8px 22px rgba(217, 45, 32, .42);
}
.skh-call-btn.hangup:hover { background: #B42318; }
.skh-call-lbl {
    position: absolute;
    bottom: -18px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 10.5px;
    font-weight: 700;
    color: #9DC7B6;
    white-space: nowrap;
}
.skh-call-btn-wrap { position: relative; }

/* ---------- Simu inayoingia ---------- */
#skhCallIncoming {
    position: fixed;
    inset: 0;
    z-index: 100210;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 26px;
    text-align: center;
    background: radial-gradient(circle at 50% 28%, #16332A 0%, #070F0C 72%);
    color: #fff;
    font-family: inherit;
}
#skhCallIncoming[hidden] { display: none !important; }
#skhCallIncoming .skh-ci-av {
    width: 104px;
    height: 104px;
    border-radius: 50%;
    overflow: hidden;
    background: #1E4A3C;
    border: 2px solid rgba(255, 255, 255, .16);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 38px;
    font-weight: 900;
    color: #CFF3E5;
    animation: skhCallPulse 2s ease-in-out infinite;
}
#skhCallIncoming .skh-ci-av img { width: 100%; height: 100%; object-fit: cover; }
#skhCallIncoming .skh-ci-name { font-size: 22px; font-weight: 900; margin-top: 8px; }
#skhCallIncoming .skh-ci-kind { font-size: 14px; font-weight: 700; color: #9DC7B6; }
#skhCallIncoming .skh-ci-actions {
    display: flex;
    align-items: center;
    gap: 46px;
    margin-top: 34px;
}
#skhCallIncoming .skh-ci-btn {
    width: 68px;
    height: 68px;
    border-radius: 50%;
    border: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #fff;
    position: relative;
}
#skhCallIncoming .skh-ci-btn svg { width: 28px; height: 28px; }
#skhCallIncoming .skh-ci-btn.accept { background: #18A982; box-shadow: 0 10px 26px rgba(24, 169, 130, .45); animation: skhCallBob 1.4s ease-in-out infinite; }
#skhCallIncoming .skh-ci-btn.decline { background: #D92D20; box-shadow: 0 10px 26px rgba(217, 45, 32, .40); }
@keyframes skhCallBob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
#skhCallIncoming .skh-ci-lbl {
    position: absolute;
    bottom: -22px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 11px;
    font-weight: 700;
    color: #9DC7B6;
    white-space: nowrap;
}

/* ---------- Simu ---------- */
@media (max-width: 640px) {
    #skhCallLocal { width: 92px; height: 132px; right: 10px; }
    .skh-call-ctrl { gap: 10px; }
    .skh-call-btn { width: 52px; height: 52px; }
    .skh-call-btn svg { width: 22px; height: 22px; }
    .skh-call-btn.hangup { width: 60px; height: 60px; }
    .skh-call-art-av { width: 96px; height: 96px; font-size: 36px; }
    .skh-call-art-name { font-size: 19px; }
    #skhCallIncoming .skh-ci-actions { gap: 38px; }
}
