/**
 * ==========================================================
 * CALL APP - Styles
 * ==========================================================
 */

/* Call Widget Container */
.sb-call-widget {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1000000;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    width: 320px;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.sb-call-container {
    display: flex;
    flex-direction: column;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

/* Header */
.sb-call-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: rgba(0, 0, 0, 0.1);
}

.sb-call-title {
    font-size: 14px;
    font-weight: 600;
    opacity: 0.9;
}

.sb-call-close {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.sb-call-close:hover {
    opacity: 1;
}

/* Status */
.sb-call-status {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 30px 20px;
    text-align: center;
}

.sb-call-avatar {
    position: relative;
    width: 100px;
    height: 100px;
    margin-bottom: 20px;
}

.sb-call-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid rgba(255, 255, 255, 0.3);
}

.sb-call-pulse {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 4px solid white;
    animation: sb-call-pulse 2s infinite;
    opacity: 0;
}

@keyframes sb-call-pulse {
    0% {
        transform: scale(1);
        opacity: 0.5;
    }
    100% {
        transform: scale(1.3);
        opacity: 0;
    }
}

.sb-call-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sb-call-name {
    font-size: 20px;
    font-weight: 600;
}

.sb-call-state {
    font-size: 14px;
    opacity: 0.8;
}

.sb-call-timer {
    font-size: 24px;
    font-weight: 300;
    font-family: 'Courier New', monospace;
    margin-top: 8px;
}

/* Controls */
.sb-call-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    padding: 20px;
    background: rgba(0, 0, 0, 0.1);
}

.sb-call-btn {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    transition: all 0.2s;
    color: white;
}

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

.sb-call-mute {
    background: rgba(255, 255, 255, 0.2);
}

.sb-call-mute:hover {
    background: rgba(255, 255, 255, 0.3);
}

.sb-call-end {
    background: #ff4757;
    width: 64px;
    height: 64px;
}

.sb-call-end:hover {
    background: #ff3344;
}

.sb-call-speaker {
    background: rgba(255, 255, 255, 0.2);
}

.sb-call-speaker:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Incoming Call Modal */
.sb-call-incoming {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000001;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sb-call-incoming-content {
    background: white;
    border-radius: 20px;
    padding: 40px;
    text-align: center;
    max-width: 320px;
    width: 90%;
}

.sb-call-incoming-avatar {
    width: 100px;
    height: 100px;
    margin: 0 auto 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    color: white;
}

.sb-call-incoming-name {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
}

.sb-call-incoming-number {
    font-size: 14px;
    color: #666;
    margin-bottom: 30px;
}

.sb-call-incoming-actions {
    display: flex;
    gap: 20px;
    justify-content: center;
}

.sb-call-accept {
    background: #2ed573;
    color: white;
    border: none;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    font-size: 28px;
    cursor: pointer;
    transition: all 0.2s;
}

.sb-call-accept:hover {
    background: #26c563;
    transform: scale(1.05);
}

.sb-call-decline {
    background: #ff4757;
    color: white;
    border: none;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    font-size: 28px;
    cursor: pointer;
    transition: all 0.2s;
}

.sb-call-decline:hover {
    background: #ff3344;
    transform: scale(1.05);
}

/* Chat Header Call Button */
.sb-chat-call-btn {
    background: #28a745;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}

.sb-chat-call-btn:hover {
    background: #218838;
    transform: translateY(-1px);
}

.sb-chat-call-btn i {
    font-size: 14px;
}

.sb-header-call-action {
    position: absolute;
    top: 15px;
    right: 50px;
    z-index: 10;
}

/* Admin Status Indicator */
.sb-call-status-indicator {
    position: fixed !important;
    top: 70px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    display: flex !important;
    align-items: center;
    gap: 8px;
    padding: 12px 22px !important;
    border-radius: 30px !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    cursor: pointer;
    transition: all 0.2s;
    z-index: 2147483647 !important;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    border: 2px solid white !important;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    animation: sb-call-pulse 2s infinite;
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
}

/* Ensure button is never hidden */
#sb-call-status {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: fixed !important;
}

/* Force visibility even if parent is hidden */
body > #sb-call-status {
    display: flex !important;
    visibility: visible !important;
}

@keyframes sb-call-pulse {
    0%, 100% { box-shadow: 0 4px 15px rgba(0,0,0,0.3); }
    50% { box-shadow: 0 6px 25px rgba(0,0,0,0.5); }
}

.sb-call-status-indicator i {
    font-size: 14px;
}

.sb-call-online {
    background: #2ed573 !important;
    color: white !important;
}

.sb-call-online:hover {
    background: #26c563 !important;
}

.sb-call-offline {
    background: #ff4757 !important;
    color: white !important;
}

.sb-call-offline:hover {
    background: #ff3344 !important;
}

/* Animations */
@keyframes sb-call-slide-in {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes sb-call-pulse-online {
    0% {
        box-shadow: 0 0 0 0 rgba(46, 213, 115, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(46, 213, 115, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(46, 213, 115, 0);
    }
}

.sb-call-online {
    animation: sb-call-pulse-online 2s infinite;
}

/* Responsive */
@media (max-width: 480px) {
    .sb-call-widget {
        width: 90%;
        max-width: 320px;
    }
    
    .sb-call-avatar {
        width: 80px;
        height: 80px;
    }
    
    .sb-call-btn {
        width: 48px;
        height: 48px;
        font-size: 20px;
    }
    
    .sb-call-status-indicator {
        top: 10px !important;
        right: 10px !important;
        padding: 6px 10px;
        font-size: 11px;
    }
}
