/**
 * WebRTC Phone Styles
 * Modern, minimal design for in-app calling
 */

/* WebRTC Phone Section - Top of Page */
.phone-section {
    background: linear-gradient(135deg, #1e3a5f 0%, #0d2137 100%);
    border: 2px solid #3b82f6;
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 20px;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

.phone-status-bar {
    display: flex;
    align-items: center;
    gap: 16px;
}

.phone-icon {
    width: 50px;
    height: 50px;
    background: rgba(59, 130, 246, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #3b82f6;
}

.phone-icon.ringing {
    animation: pulse-icon 1s infinite;
    background: rgba(34, 197, 94, 0.3);
    color: #22c55e;
}

.phone-icon.in-call {
    background: rgba(34, 197, 94, 0.3);
    color: #22c55e;
}

@keyframes pulse-icon {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.phone-info h3 {
    margin: 0 0 4px 0;
    color: #ffffff;
    font-size: 16px;
}

.phone-status-text {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #94a3b8;
}

.phone-status-text .status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.phone-status-text .status-dot.offline {
    background: #ef4444;
}

.phone-status-text .status-dot.connecting {
    background: #f59e0b;
    animation: blink 1s infinite;
}

.phone-status-text .status-dot.online {
    background: #22c55e;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.phone-controls {
    margin-left: auto;
}

/* Incoming Call Banner */
.incoming-call-banner {
    margin-top: 16px;
    padding: 16px;
    background: linear-gradient(135deg, #166534 0%, #14532d 100%);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    animation: incoming-pulse 2s infinite;
}

.incoming-call-banner.hidden {
    display: none;
}

@keyframes incoming-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.4); }
    50% { box-shadow: 0 0 20px 10px rgba(34, 197, 94, 0.2); }
}

.caller-info {
    display: flex;
    align-items: center;
    gap: 12px;
    color: white;
    font-size: 18px;
    font-weight: 600;
}

.caller-info i {
    font-size: 24px;
}

.call-actions {
    display: flex;
    gap: 12px;
}

.call-actions .btn {
    padding: 10px 20px;
    font-weight: 600;
}

/* Original floating phone widget - hidden, using top section instead */
.webrtc-phone {
    display: none !important;
}

.webrtc-phone.ringing {
    animation: pulse-ring 1s infinite;
    border-color: #22c55e;
    box-shadow: 0 8px 32px rgba(34, 197, 94, 0.3);
}

.webrtc-phone.in-call {
    border-color: #3b82f6;
    box-shadow: 0 8px 32px rgba(59, 130, 246, 0.3);
}

@keyframes pulse-ring {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

.phone-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 12px;
}

.phone-header i {
    color: #8b5cf6;
    font-size: 18px;
}

#phone-status-text {
    color: #e2e8f0;
    font-size: 14px;
    font-weight: 500;
    flex: 1;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #64748b;
    transition: background 0.3s;
}

.status-dot.online {
    background: #22c55e;
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.5);
}

.status-dot.offline {
    background: #64748b;
}

.status-dot.busy, .status-dot.in-call {
    background: #f59e0b;
    box-shadow: 0 0 8px rgba(245, 158, 11, 0.5);
}

.call-info {
    text-align: center;
    padding: 16px 0;
}

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

.caller-name {
    color: #ffffff;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
}

.call-timer {
    color: #94a3b8;
    font-size: 24px;
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-weight: 300;
}

.call-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 12px;
}

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

.call-actions button {
    padding: 12px 24px;
    border: none;
    border-radius: 30px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.btn-accept {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    color: white;
}

.btn-accept:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 16px rgba(34, 197, 94, 0.4);
}

.btn-reject, .btn-end {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
}

.btn-reject:hover, .btn-end:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 16px rgba(239, 68, 68, 0.4);
}

/* Minimized state */
.webrtc-phone.minimized {
    min-width: auto;
    padding: 12px;
}

.webrtc-phone.minimized .call-info,
.webrtc-phone.minimized .call-actions {
    display: none;
}

/* Mobile responsive */
@media (max-width: 480px) {
    .webrtc-phone {
        bottom: 10px;
        right: 10px;
        left: 10px;
        min-width: auto;
    }
    
    .call-actions {
        flex-direction: column;
    }
    
    .call-actions button {
        width: 100%;
        justify-content: center;
    }
    
    .phone-section {
        padding: 12px;
        margin-bottom: 16px;
    }
    
    .phone-status-bar {
        flex-wrap: wrap;
        gap: 12px;
    }
    
    .phone-icon {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
    
    .phone-info h3 {
        font-size: 14px;
    }
    
    .incoming-call-banner {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }
    
    .incoming-call-banner .call-actions {
        width: 100%;
        justify-content: center;
    }
}
