/* ========== CALL OVERLAY - 3 MODES ========== */

/* EXPANDED: Fullscreen */
.call-overlay-expanded {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: #111827;
    display: flex;
    flex-direction: column;
}

/* MINI: Small draggable window */
.call-overlay-mini {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 320px;
    height: 240px;
    z-index: 9999;
    background: #111827;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
    border: 1px solid rgba(255,255,255,0.1);
    cursor: move;
}

/* ICON: Small round button */
.call-overlay-icon {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 64px;
    height: 64px;
    z-index: 9999;
    background: linear-gradient(135deg, #f97316, #f59e0b);
    border-radius: 50%;
    box-shadow: 0 4px 20px rgba(249,115,22,0.5);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: callIconPulse 2s ease-in-out infinite;
}

@keyframes callIconPulse {
    0%, 100% { box-shadow: 0 4px 20px rgba(249,115,22,0.5); }
    50% { box-shadow: 0 4px 30px rgba(249,115,22,0.8); transform: scale(1.05); }
}

/* ========== EXPANDED VIEW ELEMENTS ========== */
.co-remote-video-expanded {
    z-index: 3;
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    object-fit: cover;
    background: #000;
}

.co-local-pip {
    position: absolute;
    bottom: 100px;
    right: 16px;
    width: 128px;
    height: 176px;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid rgba(255,255,255,0.2);
    z-index: 10;
}

.co-local-pip video {
    transform: scaleX(-1);
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Header gradient */
.co-header {
    position: absolute;
    top: 0; left: 0; right: 0;
    padding: 16px;
    background: linear-gradient(to bottom, rgba(0,0,0,0.7), transparent);
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Controls bar */
.co-controls {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    padding: 24px;
    background: linear-gradient(to top, rgba(0,0,0,0.7), transparent);
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.co-btn {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    border: none;
    cursor: pointer;
}

.co-btn-default { background: rgba(107,114,128,0.8); }
.co-btn-default:hover { background: rgba(107,114,128,1); }
.co-btn-end { background: #dc2626; width: 64px; height: 64px; }
.co-btn-end:hover { background: #b91c1c; }
.co-btn-minimize { background: rgba(107,114,128,0.8); }
.co-btn-minimize:hover { background: rgba(107,114,128,1); }

.co-btn svg { width: 24px; height: 24px; color: white; }
.co-btn-end svg { width: 32px; height: 32px; }

/* Waiting state */
.co-waiting {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #111827;
    z-index: 5;
}

.co-waiting-avatar {
    width: 128px;
    height: 128px;
    border-radius: 50%;
    background: linear-gradient(135deg, #f97316, #f59e0b);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}

.co-waiting-avatar span {
    color: white;
    font-size: 48px;
    font-weight: bold;
}

/* ========== MINI VIEW ELEMENTS ========== */
.co-mini-content {
    position: relative;
    width: 100%;
    height: 100%;
}

.co-mini-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.co-mini-overlay {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    padding: 8px;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.co-mini-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.co-mini-info span {
    color: white;
    font-size: 12px;
    font-weight: 600;
}

.co-mini-btns {
    display: flex;
    gap: 4px;
}

.co-mini-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

.co-mini-btn svg { width: 16px; height: 16px; color: white; }
.co-mini-btn-end { background: #dc2626; }
.co-mini-btn-expand { background: rgba(255,255,255,0.2); }

/* ========== ICON VIEW ELEMENTS ========== */
.co-icon-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.co-icon-duration {
    color: white;
    font-size: 10px;
    font-weight: bold;
    margin-top: 2px;
}

/* Audio-only overlay */
.co-audio-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(to bottom, #1f2937, #111827);
    z-index: 6;
}

.co-audio-avatar {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    background: linear-gradient(135deg, #f97316, #f59e0b);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
    border: 4px solid rgba(34,197,94,0.5);
}

.co-audio-avatar span {
    color: white;
    font-size: 56px;
    font-weight: bold;
}


/* ========== MOBILE RESPONSIVE ========== */
@media (max-width: 767px) {
    /* Local PIP smaller on mobile */
    .co-local-pip {
        width: 90px;
        height: 120px;
        bottom: 90px;
        right: 10px;
    }

    /* Control buttons slightly smaller but still tappable */
    .co-btn {
        width: 48px;
        height: 48px;
    }
    .co-btn-end {
        width: 56px;
        height: 56px;
    }
    .co-btn svg { width: 20px; height: 20px; }
    .co-btn-end svg { width: 28px; height: 28px; }

    .co-controls {
        padding: 16px 12px;
        gap: 10px;
    }

    /* Header more compact on mobile */
    .co-header {
        padding: 10px 12px;
    }

    /* Mini view responsive */
    .call-overlay-mini {
        width: 200px;
        height: 160px;
        bottom: 12px;
        right: 12px;
    }

    /* Icon view slightly smaller */
    .call-overlay-icon {
        width: 56px;
        height: 56px;
        bottom: 12px;
        right: 12px;
    }

    /* Waiting avatar smaller on mobile */
    .co-waiting-avatar {
        width: 96px;
        height: 96px;
    }
    .co-waiting-avatar span {
        font-size: 36px;
    }

    /* Audio overlay avatar smaller */
    .co-audio-avatar {
        width: 120px;
        height: 120px;
    }
    .co-audio-avatar span {
        font-size: 42px;
    }
}