/**
 * 3CX Call Modal CSS - Single Source of Truth
 * Extracted from call-modal.blade.php for reusability
 */

/* Use standard Bootstrap modal styling - removed custom header/body styles */
.modal-body {
    padding: 15px;
    /* Reduced from 24px to 15px */
}

/* HIGH SPECIFICITY - Force override Bootstrap modal styles */
.modal-content .modal-body .modern-state {
    text-align: center !important;
    padding: 20px 16px !important;
    /* Reduced from 48px 32px to 20px 16px */
    background: white !important;
    min-height: 300px !important;
    /* Reduced from 420px to 300px */
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
    border-radius: 8px;
    margin-bottom: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

/* Allow states to be hidden/shown - default hidden */
.modal-content .modal-body .modern-state {
    display: none;
    background: transparent !important;
    /* Remove white card background */
    box-shadow: none !important;
    /* Remove card shadow */
    border-radius: 0 !important;
    /* Remove card border radius */
    margin-bottom: 0 !important;
    /* Remove card margin */
}

/* Show states when they should be visible */
.modal-content .modal-body .modern-state.active {
    display: flex !important;
}

.modern-icon-container {
    margin-bottom: 16px !important;
    /* Reduced from 24px to 16px */
    padding: 0 !important;
    /* Remove padding around icon */
    background: transparent !important;
    /* Remove any background */
}

.modern-icon {
    color: #6c757d;
    transition: all 0.3s ease;
    background: transparent !important;
    /* Ensure no background on icon */
    padding: 0 !important;
    /* Remove any padding */
    border: none !important;
    /* Remove any border */
}

.modern-icon.connecting {
    color: #6c757d;
}

.modern-icon.dialing {
    color: #ffc107;
}

.modern-icon.ringing {
    color: #17a2b8;
}

.modern-icon.connected {
    color: #28a745;
}

.modern-icon.ended {
    color: #28a745;
}

.modern-icon.error {
    color: #dc3545;
}

.modal-content .modal-body .modern-status {
    font-size: 28px !important;
    font-weight: 600 !important;
    color: #2c3e50 !important;
    margin: 0 0 16px 0 !important;
    text-transform: capitalize !important;
}

.modal-content .modal-body .modern-number {
    font-size: 28px !important;
    font-weight: 500 !important;
    color: #2c3e50 !important;
    margin: 12px 0 20px 0 !important;
    font-family: 'Segoe UI', sans-serif !important;
    letter-spacing: 1px !important;
}

.modern-extension,
.modern-subtitle {
    font-size: 14px;
    color: #6c757d;
    display: block;
    margin-top: 12px;
}

.modern-progress {
    width: 100%;
    height: 4px;
    background: #e9ecef;
    border-radius: 2px;
    overflow: hidden;
    margin: 16px 0;
}

.modern-progress-bar {
    height: 100%;
    transition: width 0.3s ease;
    border-radius: 2px;
}

.modern-progress-bar.dialing {
    width: 60%;
    background: linear-gradient(90deg, #ffc107, #ffca2c);
    animation: progress-pulse 2s infinite;
}

.modern-progress-bar.ringing {
    width: 85%;
    background: linear-gradient(90deg, #17a2b8, #20c0db);
    animation: progress-pulse 1.5s infinite;
}

.modal-content .modal-body .modern-timer {
    font-size: 40px !important;
    font-weight: 400 !important;
    color: #28a745 !important;
    margin: 16px 0 20px 0 !important;
    font-family: 'Segoe UI', 'Roboto', monospace !important;
    background: rgba(40, 167, 69, 0.1) !important;
    padding: 12px 24px !important;
    border-radius: 12px !important;
    display: inline-block !important;
    letter-spacing: 2px !important;
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.1) !important;
}

.modern-duration {
    font-size: 18px;
    color: #6c757d;
    margin: 16px 0;
}

.modern-error {
    color: #dc3545;
    font-size: 16px;
    margin: 12px 0;
}

.phone-footer {
    border-top: 1px solid #eee;
    padding: 15px 30px;
    text-align: center;
}

/* Enhanced modern End Call button */
.modern-end-button {
    width: 100% !important;
    height: 64px !important;
    background: linear-gradient(135deg, #dc3545, #c82333) !important;
    color: white !important;
    border: none !important;
    border-radius: 16px !important;
    font-size: 20px !important;
    font-weight: 700 !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    margin-top: 24px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 12px !important;
    box-shadow: 0 4px 16px rgba(220, 53, 69, 0.4) !important;
    text-transform: uppercase !important;
    letter-spacing: 0.8px !important;
}

.modern-end-button:hover {
    background: linear-gradient(135deg, #c82333, #a71d2a) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 20px rgba(220, 53, 69, 0.5) !important;
}

@keyframes progress-pulse {
    0% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }

    100% {
        opacity: 1;
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }

    100% {
        transform: scale(1);
    }
}

@keyframes ring-animation {
    0% {
        transform: rotate(-15deg) scale(1);
        box-shadow: 0 0 0 0 rgba(23, 162, 184, 0.5);
    }

    25% {
        transform: rotate(15deg) scale(1.02);
        box-shadow: 0 0 0 5px rgba(23, 162, 184, 0.3);
    }

    50% {
        transform: rotate(-10deg) scale(1);
        box-shadow: 0 0 0 10px rgba(23, 162, 184, 0.1);
    }

    75% {
        transform: rotate(10deg) scale(1.02);
        box-shadow: 0 0 0 5px rgba(23, 162, 184, 0.3);
    }

    100% {
        transform: rotate(-15deg) scale(1);
        box-shadow: 0 0 0 0 rgba(23, 162, 184, 0.5);
    }
}

@keyframes connected-glow {
    0% {
        box-shadow: 0 0 0 0 rgba(40, 167, 69, 0.7);
    }

    50% {
        box-shadow: 0 0 20px 5px rgba(40, 167, 69, 0.5);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(40, 167, 69, 0.7);
    }
}

/* Apply animations to icons only */
.modern-icon.pulse {
    animation: pulse 2s infinite;
}

.modern-icon.ring-animation {
    animation: ring-animation 0.8s infinite;
}

.modern-icon.connected-glow {
    animation: connected-glow 2s infinite;
}

.debug-console {
    border-top: 1px solid #eee;
    padding-top: 15px;
}

/* Additional utility classes for call states */
.call-state {
    display: none;
}

.call-state.active {
    display: flex !important;
}

/* Processing state for buttons */
.test-call-btn.processing {
    opacity: 0.6;
    cursor: not-allowed;
}

.test-call-btn.processing i {
    animation: fa-spin 2s infinite linear;
}

/* Icon Animations - Clean and Smooth */
@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.15);
        opacity: 0.8;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes ring-animation {
    0% {
        transform: rotate(-10deg) scale(1);
    }

    25% {
        transform: rotate(10deg) scale(1.02);
    }

    50% {
        transform: rotate(-8deg) scale(1);
    }

    75% {
        transform: rotate(8deg) scale(1.02);
    }

    100% {
        transform: rotate(-10deg) scale(1);
    }
}

@keyframes connected-glow {
    0% {
        opacity: 1;
        color: #28a745;
    }

    50% {
        opacity: 0.7;
        color: #34ce57;
    }

    100% {
        opacity: 1;
        color: #28a745;
    }
}

/* Apply animations to icons */
.modern-icon.pulse {
    animation: pulse 2s infinite ease-in-out;
}

.modern-icon.ring-animation {
    animation: ring-animation 0.8s infinite ease-in-out;
}

.modern-icon.connected-glow {
    animation: connected-glow 2s infinite ease-in-out;
}