/* SL24 Report - UX Enhancements CSS */
/* Loading states, notifications, and user feedback styles */

/* Loading States */
.loading {
    position: relative;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    border-radius: inherit;
    z-index: 1;
}

.form-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    border-radius: inherit;
}

.loading-spinner {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    color: #667eea;
    font-weight: 500;
}

.global-loading {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-content {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 18px;
    color: #333;
}

/* Button Loading States */
.btn.loading {
    opacity: 0.7;
    cursor: not-allowed;
}

.btn.loading .fa-spinner {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Form Validation */
.is-valid {
    border-color: #28a745 !important;
    box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.25) !important;
}

.is-invalid {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25) !important;
}

.field-error {
    color: #dc3545;
    font-size: 14px;
    margin-top: 5px;
    display: block;
    font-weight: 500;
}

.field-error::before {
    content: '⚠ ';
    margin-right: 4px;
}

/* Notification System */
.notification-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1050;
    max-width: 400px;
}

.notification {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    margin-bottom: 10px;
    transform: translateX(100%);
    opacity: 0;
    transition: all 0.3s ease;
    border-left: 4px solid #667eea;
}

.notification.show {
    transform: translateX(0);
    opacity: 1;
}

.notification-content {
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.notification-close {
    background: none;
    border: none;
    color: #6c757d;
    cursor: pointer;
    padding: 4px;
    margin-left: auto;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.notification-close:hover {
    background: #f8f9fa;
    color: #495057;
}

/* Notification Types */
.notification-success {
    border-left-color: #28a745;
}

.notification-success .fas {
    color: #28a745;
}

.notification-error {
    border-left-color: #dc3545;
}

.notification-error .fas {
    color: #dc3545;
}

.notification-warning {
    border-left-color: #ffc107;
}

.notification-warning .fas {
    color: #ffc107;
}

.notification-info {
    border-left-color: #17a2b8;
}

.notification-info .fas {
    color: #17a2b8;
}

/* Tooltips */
.tooltip {
    position: absolute;
    background: #333;
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 14px;
    z-index: 1000;
    max-width: 200px;
    word-wrap: break-word;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #333 transparent transparent transparent;
}

/* Enhanced Form Elements */
.form-group {
    margin-bottom: 20px;
    position: relative;
}

.form-label {
    font-weight: 500;
    margin-bottom: 8px;
    display: block;
    color: #495057;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    font-size: 16px;
    transition: all 0.2s ease;
    background: white;
}

.form-control:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    outline: none;
}

.form-control:disabled {
    background: #f8f9fa;
    color: #6c757d;
    cursor: not-allowed;
}

/* Progress Indicators */
.progress-bar {
    width: 100%;
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
    margin: 10px 0;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 4px;
    transition: width 0.3s ease;
    width: 0%;
}

/* Enhanced Tables */
.table-enhanced {
    border-collapse: collapse;
    width: 100%;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.table-enhanced th {
    background: #f8f9fa;
    font-weight: 600;
    padding: 16px;
    text-align: left;
    border-bottom: 2px solid #dee2e6;
}

.table-enhanced td {
    padding: 16px;
    border-bottom: 1px solid #dee2e6;
}

.table-enhanced tbody tr:hover {
    background: #f8f9fa;
}

.table-enhanced tbody tr:last-child td {
    border-bottom: none;
}

/* Enhanced Cards */
.card-enhanced {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    padding: 24px;
    margin-bottom: 24px;
    transition: all 0.3s ease;
}

.card-enhanced:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.card-header-enhanced {
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 2px solid #f8f9fa;
}

.card-title-enhanced {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #333;
}

/* Lazy Loading */
.lazy {
    opacity: 0;
    transition: opacity 0.3s;
}

.lazy.loaded {
    opacity: 1;
}

/* Search Enhancement */
.search-container {
    position: relative;
    margin-bottom: 20px;
}

.search-input {
    width: 100%;
    padding: 12px 16px 12px 48px;
    border: 2px solid #e9ecef;
    border-radius: 25px;
    font-size: 16px;
    transition: all 0.2s ease;
}

.search-input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
    pointer-events: none;
}

/* Mobile Enhancements */
@media (max-width: 768px) {
    .notification-container {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
    }
    
    .notification {
        margin-bottom: 8px;
    }
    
    .notification-content {
        padding: 12px 16px;
        font-size: 14px;
    }
    
    .tooltip {
        font-size: 12px;
        padding: 6px 10px;
        max-width: 150px;
    }
    
    .form-control {
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    .card-enhanced {
        padding: 16px;
        margin-bottom: 16px;
    }
    
    .loading-content {
        padding: 20px;
        font-size: 16px;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .notification,
    .card-enhanced,
    .form-control,
    .btn {
        transition: none;
    }
    
    .fa-spinner {
        animation: none;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .notification {
        border: 2px solid #000;
    }
    
    .form-control {
        border: 2px solid #000;
    }
    
    .card-enhanced {
        border: 2px solid #000;
    }
}
