/* ==========================================
   SalmasFlix — Audio / WebRTC Call UI
   Extracted from components.css in Phase 7.2.

   Owns:
     - `.call-overlay` full-screen ringing UI (avatar, pulse ring,
       shake animation, Accept / Decline / Mute / End buttons)
     - `.call-bubble` floating minimized indicator during an active call
       (bottom-left of the screen, canvas-backed waveform)
     - `.call-bubble-popup` hover popover with Mute / End

   Accepts (green #2ecc71) and decline (red #e74c3c) stay literal because
   they're universally recognized semantic colors — a dialer that flips
   green-means-reject with every theme preset would be a usability bug.
   Literal colors here are the same documented exceptions as CLAUDE.md
   lists ("semantic green for success", "red for danger").
   ========================================== */

/* ==========================================
   @layer components — call bubble + dialer overlay + popover.
   ========================================== */
@layer components {

.call-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: var(--z-critical);
    backdrop-filter: blur(10px);
    animation: fadeIn 0.3s ease;
}

.call-card {
    text-align: center;
    padding: 2.5rem 2rem;
    position: relative;
}

.call-pulse-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -65%);
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 3px solid var(--accent-primary);
    animation: callPulse 1.5s ease-out infinite;
}

@keyframes callPulse {
    0% { transform: translate(-50%, -65%) scale(1); opacity: 0.6; }
    100% { transform: translate(-50%, -65%) scale(2); opacity: 0; }
}

.call-avatar-wrap {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    overflow: hidden;
    margin: 0 auto 1.5rem;
    border: 3px solid var(--accent-primary);
    position: relative;
    z-index: 1;
}

.call-avatar {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.call-avatar-ringing {
    animation: callShake 0.5s ease-in-out infinite;
}

@keyframes callShake {
    0%, 100% { transform: rotate(0); }
    25% { transform: rotate(-10deg); }
    75% { transform: rotate(10deg); }
}

.call-name {
    font-family: 'Outfit', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.call-status {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    font-variant-numeric: tabular-nums;
}

.call-actions {
    display: flex;
    justify-content: center;
    gap: 2rem;
}

.call-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, box-shadow 0.2s;
}

.call-btn:hover {
    transform: scale(1.1);
}

.call-btn-accept {
    background: #2ecc71;
    box-shadow: 0 4px 15px rgba(46, 204, 113, 0.4);
}

.call-btn-decline {
    background: #e74c3c;
    color: white;
    font-weight: bold;
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.4);
}

.call-btn-end {
    background: #e74c3c;
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.4);
    transform: rotate(135deg);
}

.call-btn-end:hover {
    transform: rotate(135deg) scale(1.1);
}

.call-btn-mute {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    box-shadow: 0 4px 15px rgba(255, 255, 255, 0.1);
}

/* Call Bubble (floating during active call) */
.call-bubble {
    position: fixed;
    bottom: 100px;
    left: 16px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2ecc71, #27ae60);
    box-shadow: 0 4px 20px rgba(46, 204, 113, 0.5);
    cursor: pointer;
    z-index: var(--z-critical);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: callBubbleIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    transition: transform 0.2s, box-shadow 0.2s;
    overflow: hidden;
}
.call-bubble:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 24px rgba(46, 204, 113, 0.6);
}
.call-bubble canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}
.call-bubble-icon {
    position: relative;
    z-index: 1;
    font-size: 1.2rem;
    filter: brightness(1.2);
}
.call-bubble-duration {
    position: absolute;
    bottom: -18px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.65rem;
    color: var(--text-secondary);
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}
@keyframes callBubbleIn {
    from { transform: scale(0); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* Call Bubble Popup */
.call-bubble-popup {
    position: fixed;
    z-index: var(--z-critical);
    background: rgba(30, 30, 40, 0.95);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 1rem 1.25rem;
    text-align: center;
    transform: translateX(-50%) scale(0.8);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s, transform 0.2s;
    min-width: 160px;
}
.call-bubble-popup.open {
    opacity: 1;
    transform: translateX(-50%) scale(1);
    pointer-events: auto;
}
.call-popup-name {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}
.call-popup-time {
    font-size: 0.8rem;
    color: #2ecc71;
    font-variant-numeric: tabular-nums;
    margin-bottom: 0.75rem;
}
.call-popup-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
}
.call-popup-actions .call-btn {
    width: 44px;
    height: 44px;
    font-size: 1.1rem;
}

} /* end @layer components */
