/* Enhanced WebRTC Modal Styles - Professional Conferencing Interface */

/* Modal Base Styles - SDO Shift Luxury Theme */
#webrtc-modal .modal-content {
    background: linear-gradient(135deg, #1B263B 0%, #0F172A 50%, #1B263B 100%);
    border: 1px solid rgba(79, 172, 254, 0.2);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(79, 172, 254, 0.1);
    border-radius: 12px;
    overflow: hidden;
}

#webrtc-modal .modal-header {
    background: linear-gradient(135deg, rgba(27, 38, 59, 0.9) 0%, rgba(79, 172, 254, 0.1) 100%);
    border-bottom: 1px solid rgba(79, 172, 254, 0.3);
    backdrop-filter: blur(20px);
    padding: 1rem 1.5rem;
    position: relative;
    overflow: hidden;
}

#webrtc-modal .modal-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(79, 172, 254, 0.1), transparent);
    animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {
    0%, 100% { left: -100%; }
    50% { left: 100%; }
}

#webrtc-modal .modal-title {
    font-weight: 600;
    color: #ffffff;
    display: flex;
    align-items: center;
}

#webrtc-modal .modal-body {
    padding: 0;
    height: 70vh;
    min-height: 500px;
    position: relative;
    overflow: hidden;
}

/* Video Container - SDO Shift Theme */
.video-container {
    position: relative;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #0F172A 0%, #1B263B 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.video-container::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, rgba(79, 172, 254, 0.05) 0%, transparent 70%);
    pointer-events: none;
}

/* Remote Video (Main Display) */
.remote-video-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #1a1a1a;
    display: flex;
    align-items: center;
    justify-content: center;
}

.remote-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: #000;
    border-radius: 0;
}

.remote-video:not([src]) {
    background: linear-gradient(135deg, #0F172A 0%, #1B263B 100%);
}

/* Local Video (Picture-in-Picture) */
.local-video-container {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 200px;
    height: 150px;
    background: #2d2d2d;
    border-radius: 12px;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    z-index: 10;
    cursor: pointer;
    transition: all 0.3s ease;
}

.local-video-container:hover {
    transform: scale(1.05);
    border-color: #4FACFE;
    box-shadow: 0 8px 32px rgba(79, 172, 254, 0.4);
}

.local-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: #000;
    border-radius: 12px;
}

.local-video:not([src]) {
    background: linear-gradient(135deg, #2d2d2d 0%, #1a1a1a 100%);
}

/* Video Overlays */
.video-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    padding: 12px;
    color: white;
    font-size: 0.875rem;
}

.participant-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.audio-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
}

.audio-indicator i {
    font-size: 14px;
}

.audio-indicator i.muted {
    color: #dc3545;
}

/* Volume Meter */
.volume-meter {
    width: 40px;
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    overflow: hidden;
}

.volume-bar {
    height: 100%;
    background: #28a745;
    width: 0%;
    transition: width 0.1s ease;
    border-radius: 2px;
}

.volume-meter-horizontal {
    width: 100px;
    height: 6px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
    overflow: hidden;
    margin-top: 4px;
}

.volume-bar-horizontal {
    height: 100%;
    background: linear-gradient(90deg, #28a745 0%, #ffc107 70%, #dc3545 100%);
    width: 0%;
    transition: width 0.1s ease;
    border-radius: 3px;
}

/* Connection Quality Indicator */
.connection-quality {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(0, 0, 0, 0.5);
    padding: 6px 8px;
    border-radius: 6px;
    font-size: 12px;
}

/* Screen Share Indicator */
.screen-share-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: rgba(0, 123, 255, 0.9);
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    backdrop-filter: blur(10px);
}

/* Video Off Overlay */
.video-off-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #2d2d2d;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 14px;
}

.avatar-large {
    width: 80px;
    height: 80px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    font-size: 32px;
}

/* Call Controls */
.call-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.9));
    padding: 20px;
    display: flex;
    justify-content: center;
    z-index: 20;
}

.controls-group {
    display: flex;
    align-items: center;
    gap: 12px;
    background: linear-gradient(135deg, rgba(27, 38, 59, 0.9) 0%, rgba(15, 23, 42, 0.9) 100%);
    padding: 12px 24px;
    border-radius: 50px;
    backdrop-filter: blur(20px);
    border: 1px solid rgba(79, 172, 254, 0.3);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.control-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 1px solid rgba(79, 172, 254, 0.3);
    background: rgba(27, 38, 59, 0.8);
    color: #4FACFE;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 18px;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

.control-btn:hover {
    background: rgba(79, 172, 254, 0.2);
    border-color: #4FACFE;
    color: white;
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(79, 172, 254, 0.3);
}

.control-btn:active {
    transform: scale(0.95);
}

/* Control Button States */
.control-btn.muted {
    background: rgba(220, 53, 69, 0.8);
}

.control-btn.video-off {
    background: rgba(220, 53, 69, 0.8);
}

.control-btn.sharing {
    background: rgba(0, 123, 255, 0.8);
}

.control-btn.recording {
    background: rgba(220, 53, 69, 0.8);
    animation: recording-pulse 2s infinite;
}

.control-btn.end-call {
    background: rgba(220, 53, 69, 0.9);
    width: 60px;
    height: 60px;
}

.control-btn.end-call:hover {
    background: rgba(220, 53, 69, 1);
}

.control-btn.admin-only {
    border: 2px solid rgba(255, 193, 7, 0.6);
    background: rgba(255, 193, 7, 0.1);
    color: #FFC107;
}

.control-btn.admin-only:hover {
    background: rgba(255, 193, 7, 0.2);
    border-color: #FFC107;
    color: white;
    box-shadow: 0 4px 15px rgba(255, 193, 7, 0.4);
}

.control-divider {
    width: 1px;
    height: 30px;
    background: rgba(255, 255, 255, 0.2);
    margin: 0 8px;
}

/* Recording Animation */
@keyframes recording-pulse {
    0%, 100% { 
        box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.7);
        transform: scale(1);
    }
    50% { 
        box-shadow: 0 0 0 15px rgba(220, 53, 69, 0);
        transform: scale(1.05);
    }
}

/* Connection Status */
.connection-status {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 20px 30px;
    border-radius: 12px;
    backdrop-filter: blur(20px);
    z-index: 30;
    text-align: center;
    min-width: 300px;
}

/* Incoming Call Status */
.incoming-call-status {
    background: linear-gradient(135deg, rgba(27, 38, 59, 0.95) 0%, rgba(15, 23, 42, 0.95) 100%);
    border: 2px solid #4FACFE;
    border-radius: 16px;
    padding: 30px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(79, 172, 254, 0.3);
}

.caller-avatar {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #4FACFE 0%, #00F2FE 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
    margin: 0 auto;
    box-shadow: 0 8px 25px rgba(79, 172, 254, 0.4);
    animation: callerPulse 2s ease-in-out infinite;
}

@keyframes callerPulse {
    0%, 100% { 
        transform: scale(1);
        box-shadow: 0 8px 25px rgba(79, 172, 254, 0.4);
    }
    50% { 
        transform: scale(1.05);
        box-shadow: 0 12px 35px rgba(79, 172, 254, 0.6);
    }
}

.incoming-call-actions .btn {
    min-width: 120px;
    border-radius: 25px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
}

.incoming-call-actions .btn:hover {
    transform: translateY(-2px);
}

.status-content {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 16px;
}

/* Settings Panel */
.settings-panel {
    position: absolute;
    top: 0;
    right: 0;
    width: 300px;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(20px);
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 25;
    overflow-y: auto;
}

.settings-content {
    padding: 20px;
    color: white;
}

.settings-content h6 {
    color: #ffffff;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.setting-group {
    margin-bottom: 20px;
}

.setting-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #ffffff;
}

.setting-group .form-select {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    border-radius: 6px;
}

.setting-group .form-select:focus {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(79, 172, 254, 0.5);
    box-shadow: 0 0 0 0.2rem rgba(79, 172, 254, 0.25);
}

.setting-group .form-check {
    margin-top: 8px;
}

.setting-group .form-check-input:checked {
    background-color: #007bff;
    border-color: #007bff;
}

.setting-group .form-check-label {
    color: rgba(255, 255, 255, 0.8);
    font-weight: normal;
}

.volume-test {
    margin-top: 10px;
}

.volume-test small {
    color: rgba(255, 255, 255, 0.7);
}

/* Badge Styles */
.badge.bg-success {
    background-color: rgba(40, 167, 69, 0.8) !important;
}

.badge.bg-danger {
    background-color: rgba(220, 53, 69, 0.8) !important;
    animation: recording-pulse 2s infinite;
}

/* Responsive Design */
@media (max-width: 768px) {
    #webrtc-modal .modal-body {
        height: 60vh;
        min-height: 400px;
    }
    
    .local-video-container {
        width: 120px;
        height: 90px;
        top: 10px;
        right: 10px;
    }
    
    .controls-group {
        gap: 8px;
        padding: 8px 16px;
    }
    
    .control-btn {
        width: 45px;
        height: 45px;
        font-size: 16px;
    }
    
    .control-btn.end-call {
        width: 50px;
        height: 50px;
    }
    
    .settings-panel {
        width: 100%;
        top: 0;
        right: 0;
    }
    
    .video-overlay {
        padding: 8px;
        font-size: 0.75rem;
    }
    
    .participant-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
}

@media (max-width: 480px) {
    .local-video-container {
        width: 100px;
        height: 75px;
    }
    
    .controls-group {
        gap: 6px;
        padding: 6px 12px;
    }
    
    .control-btn {
        width: 40px;
        height: 40px;
        font-size: 14px;
    }
    
    .control-btn.end-call {
        width: 45px;
        height: 45px;
    }
}

/* Accessibility */
.control-btn:focus {
    outline: 2px solid rgba(79, 172, 254, 0.5);
    outline-offset: 2px;
}

.control-btn[aria-pressed="true"] {
    background: rgba(79, 172, 254, 0.8);
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .control-btn {
        border: 2px solid white;
    }
    
    .video-overlay {
        background: rgba(0, 0, 0, 0.9);
    }
    
    .settings-panel {
        background: rgba(0, 0, 0, 0.95);
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .control-btn,
    .local-video-container,
    .volume-bar,
    .volume-bar-horizontal {
        transition: none;
    }
    
    @keyframes recording-pulse {
        0%, 100% { 
            box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.7);
        }
    }
}
