.call-overlay {
    position: fixed;
    inset: 0;
    z-index: 999999;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.call-container {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.call-background {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, #1a1a2e, #16213e, #0f3460);
    z-index: 0;
    pointer-events: none;
}

.call-background.video-call {
    background: #000;
}

.call-content {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1;
}

.call-type-icon {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255,255,255,0.1);
    padding: 8px 16px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: white;
    font-size: 14px;
    z-index: 30;
}

.call-type-icon svg {
    width: 18px;
    height: 18px;
}

.remote-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 2;
    background: #000;
}

.remote-video.hidden {
    display: none;
}

.call-info {
    position: relative;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 20px;
}

.call-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    overflow: hidden;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 36px;
    font-weight: 600;
    animation: callPulse 2s ease-in-out infinite;
    box-shadow: 0 0 40px rgba(255, 107, 53, 0.3);
    flex-shrink: 0;
}

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

.call-avatar.hidden {
    display: none;
}

@keyframes callPulse {
    0%, 100% { box-shadow: 0 0 40px rgba(255, 107, 53, 0.3); }
    50% { box-shadow: 0 0 60px rgba(255, 107, 53, 0.5); }
}

.call-name {
    font-size: 24px;
    font-weight: 600;
    color: white;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.call-status {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.6);
}

.call-timer {
    font-size: 20px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.8);
    font-variant-numeric: tabular-nums;
    background: rgba(255,255,255,0.1);
    padding: 4px 12px;
    border-radius: 20px;
}

.local-video {
    position: absolute;
    bottom: 160px;
    right: 20px;
    width: 120px;
    height: 160px;
    border-radius: 12px;
    object-fit: cover;
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
    z-index: 15;
    border: 2px solid rgba(255,255,255,0.2);
    cursor: pointer;
    transition: all 0.3s ease;
    background: #1a1a2e;
}

.local-video.hidden {
    display: none;
}

.call-error {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 71, 87, 0.9);
    color: white;
    padding: 16px 24px;
    border-radius: 12px;
    font-size: 14px;
    z-index: 100;
    text-align: center;
    max-width: 280px;
}

.video-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 30px 20px;
    padding-bottom: max(30px, env(safe-area-inset-bottom, 30px));
    background: linear-gradient(transparent, rgba(0,0,0,0.9));
    z-index: 50;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.call-actions {
    display: flex;
    gap: 20px;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}

.call-incoming-actions {
    display: flex;
    gap: 60px;
    justify-content: center;
    align-items: center;
}

.call-btn {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none;
}

.call-btn:active {
    transform: scale(0.95);
}

.call-btn svg {
    width: 24px;
    height: 24px;
    pointer-events: none;
}

.call-btn-mute {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.call-btn-mute.active {
    background: rgba(255, 107, 107, 0.8);
    color: white;
}

.call-btn-hangup {
    background: #ff4757;
    color: white;
    width: 64px;
    height: 64px;
}

.call-btn-hangup:active {
    background: #ff3344;
}

.call-btn-speaker {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.call-btn-speaker.active {
    background: rgba(29, 209, 161, 0.8);
    color: white;
}

.call-btn-video {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.call-btn-video.off {
    background: rgba(255, 107, 107, 0.8);
    color: white;
}

.call-btn-camera-switch {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.call-btn-accept {
    background: #00d2d3;
    color: white;
    width: 72px;
    height: 72px;
    animation: acceptPulse 1.5s ease-in-out infinite;
}

.call-btn-accept:active {
    background: #00b8b8;
    transform: scale(0.95);
}

@keyframes acceptPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(0, 210, 211, 0.4); }
    50% { box-shadow: 0 0 0 15px rgba(0, 210, 211, 0); }
}

.call-btn-reject {
    background: #ff4757;
    color: white;
    width: 72px;
    height: 72px;
}

.call-btn-reject:active {
    background: #ff3344;
    transform: scale(0.95);
}

.hidden {
    display: none !important;
}

@media (max-width: 480px) {
    .call-avatar {
        width: 80px;
        height: 80px;
        font-size: 28px;
    }
    
    .call-name {
        font-size: 20px;
    }
    
    .call-info {
        padding: 12px;
    }
    
    .call-status {
        font-size: 12px;
    }
    
    .local-video {
        width: 90px;
        height: 120px;
        bottom: 150px;
        right: 15px;
    }
    
    .video-controls {
        padding: 20px 15px;
        padding-bottom: max(20px, env(safe-area-inset-bottom, 20px));
    }
    
    .call-btn {
        width: 50px;
        height: 50px;
    }
    
    .call-btn svg {
        width: 22px;
        height: 22px;
    }
    
    .call-btn-hangup {
        width: 58px;
        height: 58px;
    }
    
    .call-btn-accept,
    .call-btn-reject {
        width: 64px;
        height: 64px;
    }
    
    .call-actions {
        gap: 14px;
    }
    
    .call-incoming-actions {
        gap: 50px;
    }
    
    .call-type-icon {
        top: 12px;
        font-size: 12px;
        padding: 6px 12px;
    }
}

@media (max-height: 600px) {
    .call-avatar {
        width: 60px;
        height: 60px;
        font-size: 24px;
    }
    
    .call-name {
        font-size: 18px;
    }
    
    .local-video {
        width: 70px;
        height: 90px;
        bottom: 130px;
    }
    
    .video-controls {
        padding: 15px;
    }
}
