/**
 * @file call-overlay.css
 * @brief WebRTC call overlay styles — incoming ring card + active call panel.
 */

/* ── base overlay ──────────────────────────────────────────────────────── */
.webrtc-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    animation: webrtc-fade-in 0.2s ease;
}

@keyframes webrtc-fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* ── incoming call card ────────────────────────────────────────────────── */
.webrtc-incoming-card {
    background: var(--bg-secondary, #1e1e2e);
    border: 1px solid var(--border-light, rgba(255,255,255,0.1));
    border-radius: 1.25rem;
    padding: 2rem 2.5rem;
    text-align: center;
    min-width: 280px;
    box-shadow: 0 24px 64px rgba(0,0,0,0.5);
    animation: webrtc-slide-up 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes webrtc-slide-up {
    from { transform: translateY(40px) scale(0.95); opacity: 0; }
    to   { transform: translateY(0)    scale(1);    opacity: 1; }
}

.webrtc-incoming-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: color-mix(in srgb, var(--color-primary, #7c6fcd) 15%, transparent);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    font-size: 1.5rem;
    color: var(--color-primary, #7c6fcd);
    animation: webrtc-ring-pulse 1s ease-in-out infinite;
}

@keyframes webrtc-ring-pulse {
    0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--color-primary, #7c6fcd) 40%, transparent); }
    50%       { box-shadow: 0 0 0 16px color-mix(in srgb, var(--color-primary, #7c6fcd) 0%, transparent); }
}

.webrtc-incoming-name {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary, #fff);
    margin-bottom: 0.25rem;
}

.webrtc-incoming-label {
    font-size: 0.875rem;
    color: var(--text-secondary, rgba(255,255,255,0.6));
    margin-bottom: 1.5rem;
}

.webrtc-incoming-actions {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
}

/* ── active call panel ─────────────────────────────────────────────────── */
.webrtc-call-panel {
    width: min(900px, 96vw);
    height: min(600px, 90vh);
    background: #0a0a0f;
    border-radius: 1rem;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 32px 80px rgba(0,0,0,0.7);
    animation: webrtc-slide-up 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.webrtc-call-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.25rem;
    background: rgba(255,255,255,0.04);
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.webrtc-call-title {
    font-weight: 600;
    color: #fff;
    font-size: 0.95rem;
}

.webrtc-call-status {
    font-size: 0.8rem;
    color: rgba(255,255,255,0.5);
}

/* ── video area ────────────────────────────────────────────────────────── */
.webrtc-videos {
    flex: 1;
    position: relative;
    background: #000;
    overflow: hidden;
}

.webrtc-video {
    object-fit: cover;
}

.webrtc-video--remote {
    width: 100%;
    height: 100%;
}

.webrtc-video--local {
    position: absolute;
    bottom: 0.75rem;
    right: 0.75rem;
    width: 140px;
    height: 100px;
    border-radius: 0.5rem;
    border: 2px solid rgba(255,255,255,0.2);
    box-shadow: 0 4px 16px rgba(0,0,0,0.5);
    z-index: 2;
}

/* ── controls bar ──────────────────────────────────────────────────────── */
.webrtc-controls {
    display: flex;
    gap: 1rem;
    justify-content: center;
    align-items: center;
    padding: 0.875rem 1rem;
    background: rgba(0,0,0,0.6);
}

/* ── buttons ───────────────────────────────────────────────────────────── */
.webrtc-btn {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s, opacity 0.15s;
    outline: none;
}

.webrtc-btn:hover  { transform: scale(1.08); }
.webrtc-btn:active { transform: scale(0.95); }

.webrtc-btn--accept {
    background: #22c55e;
    color: #fff;
    width: 60px;
    height: 60px;
    font-size: 1.3rem;
}

.webrtc-btn--reject,
.webrtc-btn--hangup {
    background: #ef4444;
    color: #fff;
    width: 60px;
    height: 60px;
    font-size: 1.3rem;
}

.webrtc-btn--mute,
.webrtc-btn--camera {
    background: rgba(255,255,255,0.12);
    color: #fff;
}

.webrtc-btn--active {
    background: rgba(239, 68, 68, 0.25);
    color: #ef4444;
}

/* ── responsive ────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
    .webrtc-call-panel {
        width: 100vw;
        height: 100dvh;
        border-radius: 0;
    }

    .webrtc-video--local {
        width: 90px;
        height: 64px;
    }
}
