/* Universal Alert System Styles */

/* Modal Overlay */
.alert-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    padding: 20px;
    box-sizing: border-box;
}

.alert-modal-overlay.alert-modal-show {
    opacity: 1;
    visibility: visible;
}

/* Prevent body scroll when modal is open */
.alert-modal-open {
    overflow: hidden;
}

/* Modal Container */
.alert-modal-container {
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    max-width: 420px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    transform: scale(0.7);
    transition: transform 0.3s ease;
    border: 2px solid #dc3545;
}

.alert-modal-show .alert-modal-container {
    transform: scale(1);
}

/* Modal Content */
.alert-modal-content {
    padding: 0;
}

/* Modal Header */
.alert-modal-header {
    background: linear-gradient(90deg, #dc3545, #b91c1c);
    color: white;
    padding: 10px 14px;
    border-radius: 8px 8px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #facc15;
}

.alert-modal-title {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

.alert-modal-icon {
    font-size: 16px;
}

.alert-modal-title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-modal-icon {
    font-size: 24px;
}

.alert-modal-close {
    background: transparent !important;
    border: none !important;
    color: #ffffff !important;
    font-size: 28px !important;
    font-weight: bold !important;
    cursor: pointer !important;
    padding: 0 !important;
    width: 36px !important;
    height: 36px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 0 !important;
    transition: all 0.2s ease !important;
    line-height: 1 !important;
    text-shadow: 0 0 3px rgba(0, 0, 0, 0.8) !important;
}

.alert-modal-close:hover {
    background-color: rgba(255, 255, 255, 0.2) !important;
    color: #ffffff !important;
    transform: scale(1.1) !important;
}

/* Modal Body */
.alert-modal-body {
    padding: 24px;
}

/* Alert Danger Box */
.alert-danger-box {
    background: linear-gradient(135deg, #fff5f5 0%, #fef2f2 100%);
    border: 2px solid #dc3545;
    border-radius: 6px;
    padding: 8px 10px;
    margin-bottom: 10px;
    box-shadow: 0 2px 4px rgba(220, 53, 69, 0.1);
}

.alert-danger-heading {
    color: #dc3545;
    font-size: 11px;
    font-weight: 700;
    margin: 0 0 4px 0;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.alert-danger-text {
    color: #374151;
    margin: 0;
    line-height: 1.3;
    font-weight: 500;
    font-size: 10px;
}

/* Alert Info Grid */
.alert-info-grid {
    margin-bottom: 20px;
}

.alert-info-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 8px 0;
    border-bottom: 1px solid #e2e8f0;
}

.alert-info-row:last-child {
    border-bottom: none;
}

.alert-info-label {
    font-weight: 600;
    color: #4a5568;
    min-width: 80px;
}

.alert-info-value {
    text-align: right;
    color: #2d3748;
    flex: 1;
    margin-left: 16px;
}

/* Severity Badge */
.alert-severity-badge {
    background: linear-gradient(45deg, #dc3545, #b91c1c);
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: 1px solid #dc3545;
    box-shadow: 0 2px 4px rgba(220, 53, 69, 0.2);
}

/* Alert Action Box */
.alert-action-box {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border: 1px solid #60a5fa;
    border-radius: 6px;
    padding: 8px 10px;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.alert-action-icon {
    font-size: 14px;
    color: #3b82f6;
    flex-shrink: 0;
}

.alert-action-content {
    color: #1e40af;
    line-height: 1.3;
    font-size: 10px;
}

/* Modal Footer */
.alert-modal-footer {
    padding: 12px 16px;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

/* Modal Buttons */
.alert-close-btn,
.alert-acknowledge-btn {
    padding: 8px 14px;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 5px;
    min-height: 36px;
    min-width: 100px;
    justify-content: center;
}

.alert-close-btn {
    background: #6c757d !important;
    color: #ffffff !important;
    border: 1px solid #6c757d !important;
    font-size: 12px !important;
}

.alert-close-btn:hover {
    background: #5a6268 !important;
    color: #ffffff !important;
    border-color: #5a6268 !important;
}

.alert-acknowledge-btn {
    background: #dc3545;
    color: white;
    border: 1px solid #dc3545;
}

.alert-acknowledge-btn:hover {
    background: #c82333;
    color: white;
    border-color: #c82333;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(220, 53, 69, 0.3);
}

.alert-acknowledge-btn:disabled {
    background: #a0aec0;
    cursor: not-allowed;
}

.alert-btn-icon {
    font-size: 16px;
}

/* Toast Container */
.alert-toast-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10000;
    pointer-events: none;
}

/* Toast Styles */
.alert-toast {
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    max-width: 400px;
    width: 100vw;
    margin-bottom: 16px;
    transform: translateY(-20px);
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: auto;
    border: 2px solid;
}

.alert-toast.alert-toast-show {
    transform: translateY(0);
    opacity: 1;
}

.alert-toast.alert-toast-hide {
    transform: translateY(-20px);
    opacity: 0;
}

.alert-toast-warning {
    border-color: #ffc107;
    background: #fff3cd;
    color: #856404;
}

.alert-toast-success {
    border-color: #28a745;
    background: #28a745;
    color: white;
}

/* Toast Content */
.alert-toast-content {
    padding: 14px 16px;
}

.alert-toast-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}

.alert-toast-icon {
    font-size: 16px;
    margin-right: 8px;
}

.alert-toast-title {
    font-size: 13px;
    font-weight: 700;
    color: #1f2937;
    flex: 1;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.alert-toast-close {
    background: rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(0, 0, 0, 0.2);
    font-size: 16px;
    color: #374151;
    cursor: pointer;
    padding: 2px;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.alert-toast-close:hover {
    background-color: rgba(0, 0, 0, 0.2);
    border-color: rgba(0, 0, 0, 0.3);
}

.alert-toast-body {
    color: #374151;
    line-height: 1.4;
    font-size: 12px;
    font-weight: 500;
}

.alert-toast-body small {
    font-size: 11px;
    color: #6b7280;
    font-weight: 400;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .alert-modal-overlay {
        padding: 14px;
    }
    
    .alert-modal-container {
        max-height: 92vh;
        border-radius: 6px;
    }
    
    .alert-modal-header {
        padding: 10px 14px;
        border-radius: 6px 6px 0 0;
    }
    
    .alert-modal-title {
        font-size: 13px;
    }
    
    .alert-modal-body {
        padding: 12px;
    }
    
    .alert-modal-body * {
        font-size: 9px !important;
    }
    
    .alert-modal-footer {
        padding: 10px 12px;
        flex-direction: column;
        gap: 6px;
    }
    
    .alert-close-btn,
    .alert-acknowledge-btn {
        width: 100%;
        justify-content: center;
        font-size: 11px;
        padding: 8px 12px;
    }
}

/* Large Mobile Landscape */
@media (max-width: 480px) {
    .alert-modal-title {
        font-size: 14px;
    }
    
    .alert-modal-icon {
        font-size: 20px;
    }
    
    .alert-danger-heading {
        font-size: 14px;
    }
    
    .alert-close-btn,
    .alert-acknowledge-btn {
        padding: 14px 16px;
        font-size: 13px;
    }
}

/* High DPI Displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .alert-modal-container {
        box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    }
    
    .alert-toast {
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    }
}

/* Focus States for Accessibility */
.alert-modal-close:focus,
.alert-close-btn:focus,
.alert-acknowledge-btn:focus,
.alert-toast-close:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* Animation for better performance */
.alert-modal-overlay,
.alert-modal-container,
.alert-toast {
    will-change: transform, opacity;
}

/* Print Styles */
@media print {
    .alert-modal-overlay,
    .alert-toast-container {
        display: none !important;
    }
}



.floating-icon--center {
    left: 50% !important;
    transform: translateX(-50%) !important;
}
#audioIcon {
    left: 50% !important;
    transform: translateX(-50%) !important;
}

#audioPanel {
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    background: #1a1a1a !important;
    color: #e2e8f0 !important;
    padding: 20px !important;
    border-radius: 10px !important;
    width: 280px !important;  /* Reduced width but increased padding */
    z-index: 10000 !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.5) !important;
}

/* Force buttons to fit within panel */
#audioPanel .btn-hitech {
    width: 100% !important;
    padding: 10px 8px !important;
    margin: 8px 0 !important;
    font-size: 13px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    box-sizing: border-box !important;
}

/* Mobile adjustments */
@media (max-width: 768px) {
    #audioPanel {
        width: 240px !important;
        padding: 15px !important;
    }
    
    #audioPanel .btn-hitech {
        font-size: 12px !important;
        padding: 8px 6px !important;
    }

    #audioPanel .form-check {
        display: flex !important;
        align-items: flex-start !important;
        gap: 8px !important;
        margin-bottom: 12px !important;
    }
    
    #audioPanel .form-check-input {
        width: 18px !important;
        height: 18px !important;
        margin: 2px 0 0 0 !important;
        flex-shrink: 0 !important;
    }
    
    #audioPanel .form-check-label {
        font-size: 13px !important;
        font-weight: normal !important;
        line-height: 1.3 !important;
    }
}

/* Severity-Based Toast Styles */
.alert-toast-critical {
    border-color: #dc3545;
    background: linear-gradient(135deg, #fff5f5 0%, #fef2f2 100%);
    color: #721c24;
    border-width: 2px;
    box-shadow: 0 8px 32px rgba(220, 53, 69, 0.2);
}

.alert-toast-critical .alert-toast-title {
    color: #dc3545;
    font-weight: 800;
}

.alert-toast-critical .alert-toast-icon {
    color: #dc3545;
}

.alert-toast-high {
    border-color: #fd7e14;
    background: linear-gradient(135deg, #fff8f0 0%, #fef3e2 100%);
    color: #8b4513;
    border-width: 2px;
    box-shadow: 0 8px 32px rgba(253, 126, 20, 0.15);
}

.alert-toast-high .alert-toast-title {
    color: #fd7e14;
    font-weight: 700;
}

.alert-toast-high .alert-toast-icon {
    color: #fd7e14;
}

.alert-toast-medium {
    border-color: #ffc107;
    background: linear-gradient(135deg, #fffbf0 0%, #fff3cd 100%);
    color: #856404;
    border-width: 1px;
    box-shadow: 0 8px 32px rgba(255, 193, 7, 0.1);
}

.alert-toast-medium .alert-toast-title {
    color: #856404;
    font-weight: 600;
}

.alert-toast-medium .alert-toast-icon {
    color: #ffc107;
}

.alert-toast-low {
    border-color: #17a2b8;
    background: linear-gradient(135deg, #f0fdff 0%, #e0f7fa 100%);
    color: #0c5460;
    border-width: 1px;
    box-shadow: 0 8px 32px rgba(23, 162, 184, 0.1);
}

.alert-toast-low .alert-toast-title {
    color: #17a2b8;
    font-weight: 500;
}

.alert-toast-low .alert-toast-icon {
    color: #17a2b8;
}

.alert-toast-critical .alert-toast-title {
    color: #dc3545 !important;
}

.alert-toast-critical {
    border-color: #dc3545 !important;
    background: linear-gradient(135deg, #fff5f5 0%, #fef2f2 100%) !important;
}