/* ====================================================================
   MODERN COMPONENTS CSS
   Reusable component styles for modern aesthetics across the site
   ==================================================================== */

/* ===== MODERN LOADING PANEL ===== */
.modern-loading-panel {
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
    border-radius: 12px !important;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    transition: all 0.3s ease !important;
    z-index: 99999 !important;
}

.modern-loading-content {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 40px 30px !important;
    text-align: center !important;
    min-height: 120px !important;
}

.modern-loading-spinner {
    width: 50px !important;
    height: 50px !important;
    border: 4px solid rgba(0, 123, 255, 0.1) !important;
    border-top: 4px solid #007bff !important;
    border-radius: 50% !important;
    animation: modern-spin 1s linear infinite !important;
    margin-bottom: 20px !important;
}

.modern-loading-dots {
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    margin-bottom: 20px !important;
}

.modern-loading-dot {
    width: 12px !important;
    height: 12px !important;
    border-radius: 50% !important;
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%) !important;
    animation: modern-pulse 1.4s ease-in-out infinite both !important;
}

.modern-loading-dot:nth-child(1) { animation-delay: -0.32s !important; }
.modern-loading-dot:nth-child(2) { animation-delay: -0.16s !important; }
.modern-loading-dot:nth-child(3) { animation-delay: 0s !important; }

.modern-loading-text {
    color: #495057 !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    margin-bottom: 8px !important;
    line-height: 1.4 !important;
}

.modern-loading-subtext {
    color: #6c757d !important;
    font-size: 14px !important;
    font-weight: 400 !important;
    line-height: 1.3 !important;
}

/* Progress bar for loading panel */
.modern-loading-progress {
    width: 200px !important;
    height: 4px !important;
    background: rgba(0, 123, 255, 0.1) !important;
    border-radius: 2px !important;
    overflow: hidden !important;
    margin-top: 15px !important;
}

.modern-loading-progress-bar {
    height: 100% !important;
    background: linear-gradient(90deg, #007bff, #20c997, #007bff) !important;
    background-size: 200% 100% !important;
    animation: modern-progress 2s ease-in-out infinite !important;
}

/* Animations */
@keyframes modern-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes modern-pulse {
    0%, 80%, 100% { 
        transform: scale(0.6);
        opacity: 0.4;
    }
    40% { 
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes modern-progress {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Overlay styles */
.modern-loading-overlay {
    background: rgba(248, 249, 250, 0.8) !important;
    backdrop-filter: blur(2px) !important;
    -webkit-backdrop-filter: blur(2px) !important;
}

/* Dark theme variant */
.modern-loading-panel.dark {
    background: rgba(33, 37, 41, 0.95) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

.modern-loading-panel.dark .modern-loading-text {
    color: #f8f9fa !important;
}

.modern-loading-panel.dark .modern-loading-subtext {
    color: #adb5bd !important;
}

.modern-loading-panel.dark .modern-loading-spinner {
    border: 4px solid rgba(255, 255, 255, 0.1) !important;
    border-top: 4px solid #20c997 !important;
}

.modern-loading-panel.dark .modern-loading-dot {
    background: linear-gradient(135deg, #20c997 0%, #17a2b8 100%) !important;
}

/* Success/Error states */
.modern-loading-panel.success .modern-loading-spinner {
    border-top: 4px solid #28a745 !important;
}

.modern-loading-panel.success .modern-loading-dot {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%) !important;
}

.modern-loading-panel.error .modern-loading-spinner {
    border-top: 4px solid #dc3545 !important;
}

.modern-loading-panel.error .modern-loading-dot {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%) !important;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .modern-loading-content {
        padding: 30px 20px !important;
        min-height: 100px !important;
    }
    
    .modern-loading-spinner {
        width: 40px !important;
        height: 40px !important;
        border-width: 3px !important;
    }
    
    .modern-loading-text {
        font-size: 15px !important;
    }
    
    .modern-loading-subtext {
        font-size: 13px !important;
    }
    
    .modern-loading-progress {
        width: 160px !important;
    }
}

/* ===== PAGE CONTAINERS ===== */
.modern-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 15px;
}

.modern-container.narrow {
    max-width: 1200px;
}

.modern-container.wide {
    max-width: 1600px;
}

/* ===== MODERN CARDS ===== */
.modern-card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-bottom: 20px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.modern-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transform: translateY(-2px);
}

.modern-card.interactive:hover {
    transform: translateY(-2px);
}

.modern-card-header {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 15px 20px;
    border-bottom: 1px solid #dee2e6;
}

.modern-card-header.primary {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    color: white;
}

.modern-card-header.success {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
}

.modern-card-header.warning {
    background: linear-gradient(135deg, #ffc107 0%, #e0a800 100%);
    color: #212529;
}

.modern-card-header.danger {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: white;
}

.modern-card-header.info {
    background: linear-gradient(135deg, #17a2b8 0%, #138496 100%);
    color: white;
}

.modern-card-header h4,
.modern-card-header h5,
.modern-card-header h6 {
    margin: 0;
    font-weight: 600;
}

.modern-card-body {
    padding: 20px;
}

.modern-card-footer {
    background: #f8f9fa;
    padding: 15px 20px;
    border-top: 1px solid #dee2e6;
}

/* ===== MODERN FIELDSETS - FIXED STYLES ===== */
.modern-fieldset {
    padding: 20px !important;
    margin-bottom: 20px !important;
    background: rgba(0, 0, 0, 0.02) !important;
    border: none !important;
    border-radius: 8px !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1) !important;
    text-align: left !important;
}

.modern-fieldset.primary {
    background: rgba(0, 123, 255, 0.05) !important;
    border-left: 4px solid #007bff !important;
}

.modern-fieldset.secondary {
    background: rgba(108, 117, 125, 0.05) !important;
    border-left: 4px solid #6c757d !important;
}

.modern-fieldset.warning {
    background: rgba(255, 193, 7, 0.05) !important;
    border-left: 4px solid #ffc107 !important;
}

.modern-fieldset.success {
    background: rgba(40, 167, 69, 0.05) !important;
    border-left: 4px solid #28a745 !important;
}

.modern-fieldset.danger {
    background: rgba(220, 53, 69, 0.05) !important;
    border-left: 4px solid #dc3545 !important;
}

.modern-fieldset.info {
    background: rgba(23, 162, 184, 0.05) !important;
    border-left: 4px solid #17a2b8 !important;
}

/* LEGEND STYLING - COMFORTABLE SPACING */
.modern-fieldset legend {
    padding: 8px 15px !important;
    margin-bottom: 15px !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    background: inherit !important;
    border: none !important;
    width: auto !important;
    max-width: none !important;
    margin-left: -15px !important;
    display: block !important;
    color: inherit !important;
    border-radius: 4px !important;
    box-shadow: none !important;
    line-height: 1.4 !important;
}

.modern-fieldset.primary legend {
    background: #007bff !important;
    color: white !important;
    width: 100% !important;
}

.modern-fieldset.secondary legend {
    background: #6c757d !important;
    color: white !important;
    width: 100% !important;
}

.modern-fieldset.warning legend {
    background: #ffc107 !important;
    color: #212529 !important;
    width: 100% !important;
}

.modern-fieldset.success legend {
    background: #28a745 !important;
    color: white !important;
    width: 100% !important;
}

.modern-fieldset.danger legend {
    background: #dc3545 !important;
    color: white !important;
    width: 100% !important;
}

.modern-fieldset.info legend {
    background: #17a2b8 !important;
    color: white !important;
    width: 100% !important;
}

/* ===== MODERN SECTIONS ===== */
.modern-section {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    padding: 25px;
    margin-bottom: 25px;
}

.modern-section-header {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 3px solid #007bff;
    text-align: left !important;
}

.modern-section-header h3,
.modern-section-header h4 {
    color: #2a2d33;
    margin: 0;
    font-weight: 600;
}

.modern-section-header.primary { border-bottom-color: #007bff; }
.modern-section-header.success { border-bottom-color: #28a745; }
.modern-section-header.warning { border-bottom-color: #ffc107; }
.modern-section-header.danger { border-bottom-color: #dc3545; }
.modern-section-header.info { border-bottom-color: #17a2b8; }
.modern-section-header.secondary { border-bottom-color: #6c757d; }

/* ===== MODERN GRIDS ===== */
.modern-grid {
    display: grid;
    gap: 20px;
}

.modern-grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.modern-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.modern-grid.cols-4 { grid-template-columns: repeat(4, 1fr); }

.modern-grid.responsive-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.modern-grid.responsive-3 { grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
.modern-grid.responsive-4 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }

/* ===== MODERN INFO PANELS ===== */
.modern-info-panel {
    background: #f8f9fa;
    border-left: 4px solid #007bff;
    padding: 12px 16px;
    margin-bottom: 15px;
    border-radius: 0 4px 4px 0;
    font-size: 14px;
    text-align: left !important;
}

.modern-info-panel.primary { border-left-color: #007bff; }
.modern-info-panel.success { border-left-color: #28a745; }
.modern-info-panel.warning { border-left-color: #ffc107; }
.modern-info-panel.danger { border-left-color: #dc3545; }
.modern-info-panel.info { border-left-color: #17a2b8; }
.modern-info-panel.secondary { border-left-color: #6c757d; }

.modern-info-panel b,
.modern-info-panel strong {
    color: #495057;
    font-weight: 600;
}

.modern-info-panel em {
    color: #007bff;
    font-style: normal;
    font-weight: 500;
}

/* Ensure all nested elements maintain left alignment */
.modern-info-panel *,
.modern-fieldset *,
.modern-section-header * {
    text-align: left !important;
}

/* ===== MODERN EMPLOYEE ITEMS - COMPACT 2-COLUMN STYLING ===== */
.modern-employee-list {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr)) !important;
    gap: 8px !important;
    margin-top: 10px !important;
}

.modern-employee-item {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 8px 15px !important;
    margin-bottom: 0 !important;
    background: #f8f9fa !important;
    border-radius: 6px !important;
    border-left: 3px solid #007bff !important;
    transition: all 0.2s ease !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

.modern-employee-item:hover {
    background: #e9ecef !important;
    transform: translateX(2px) !important;
}

.modern-employee-name {
    font-weight: 600 !important;
    color: #2c3e50 !important;
    font-size: 14px !important;
    flex-grow: 1 !important;
    margin-right: 15px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

.modern-employee-controls {
    display: flex !important;
    gap: 12px !important;
    align-items: center !important;
    flex-shrink: 0 !important;
}

.modern-employee-controls .RadCheckBox {
    margin: 0 !important;
    font-size: 11px !important;
}

.modern-employee-controls .RadCheckBox .rbText {
    font-size: 11px !important;
    font-weight: 500 !important;
    color: #495057 !important;
    white-space: nowrap !important;
}

/* Alternate row colors for better readability */
.modern-employee-item:nth-child(even) {
    background: #ffffff !important;
    border-left-color: #6c757d !important;
}

.modern-employee-item:nth-child(even):hover {
    background: #f8f9fa !important;
}

/* ===== MODERN FORM STYLING ===== */
.modern-form-row {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 20px !important;
    align-items: flex-start !important;
}

.modern-form-field {
    flex: 1 !important;
    min-width: 250px !important;
    max-width: 400px !important;
}

.modern-input {
    border-radius: 6px !important;
    border: 1px solid #ced4da !important;
    transition: all 0.3s ease !important;
}

.modern-input:focus {
    border-color: #007bff !important;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1) !important;
}

/* RadTextBox specific styling */
.modern-form-field .RadInput {
    width: 100% !important;
    max-width: 100% !important;
}

.modern-form-field .RadInput .riTextBox {
    width: 100% !important;
    border-radius: 6px !important;
    border: 1px solid #ced4da !important;
    transition: all 0.3s ease !important;
    padding: 8px 12px !important;
}

.modern-form-field .RadInput .riTextBox:focus {
    border-color: #007bff !important;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1) !important;
    outline: none !important;
}

.modern-form-field .RadInput .riLabel {
    font-weight: 600 !important;
    color: #495057 !important;
    margin-bottom: 5px !important;
    display: block !important;
}

.form-text {
    margin-top: 5px !important;
    font-size: 12px !important;
    color: #6c757d !important;
    display: block !important;
}

/* ===== DIVISION SELECTION STYLING ===== */
.division-selection-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)) !important;
    gap: 15px !important;
    padding: 10px 0 !important;
}

.modern-checkbox-list {
    display: contents !important;
}

.modern-checkbox-list .RadCheckBoxList {
    display: contents !important;
}

.modern-checkbox-list .rcblItem {
    background: #f8f9fa !important;
    border: 2px solid #e9ecef !important;
    border-radius: 8px !important;
    padding: 12px 15px !important;
    margin: 0 !important;
    transition: all 0.3s ease !important;
    cursor: pointer !important;
}

.modern-checkbox-list .rcblItem:hover {
    border-color: #007bff !important;
    background: rgba(0, 123, 255, 0.05) !important;
}

.modern-checkbox-list .rcblItem.rcblChecked {
    border-color: #007bff !important;
    background: rgba(0, 123, 255, 0.1) !important;
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.2) !important;
}

.modern-checkbox-list .rcblItem label {
    font-weight: 600 !important;
    color: #2c3e50 !important;
    cursor: pointer !important;
    font-size: 14px !important;
    display: block !important;
    width: 100% !important;
}

/* ===== ACTION SECTION STYLING ===== */
.modern-action-section {
    text-align: center !important;
    padding: 30px 20px !important;
    background: rgba(0, 123, 255, 0.02) !important;
    border-radius: 8px !important;
    margin-top: 25px !important;
    border: 1px solid rgba(0, 123, 255, 0.1) !important;
}

.modern-btn.large {
    padding: 15px 30px !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    border-radius: 8px !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
    transition: all 0.3s ease !important;
}

.modern-btn.large:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2) !important;
}

.modern-download-link {
    display: inline-block !important;
    margin-top: 15px !important;
    padding: 10px 20px !important;
    background: #28a745 !important;
    color: white !important;
    text-decoration: none !important;
    border-radius: 6px !important;
    font-weight: 600 !important;
    transition: all 0.3s ease !important;
}

.modern-download-link:hover {
    background: #218838 !important;
    transform: translateY(-1px) !important;
    text-decoration: none !important;
    color: white !important;
}

/* ===== LOG STYLING - COMPACT LOG ENTRIES ===== */
.compact-log-entry {
    background: #fff !important;
    border: 1px solid #dee2e6 !important;
    border-radius: 8px !important;
    margin-bottom: 15px !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08) !important;
    transition: all 0.3s ease !important;
}

.compact-log-entry:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12) !important;
    transform: translateY(-1px) !important;
}

.compact-log-entry.unread {
    border-left: 4px solid #dc3545 !important;
    background: rgba(220, 53, 69, 0.02) !important;
}

.compact-log-entry legend {
    background: #f8f9fa !important;
    border: 1px solid #dee2e6 !important;
    border-radius: 6px !important;
    padding: 8px 15px !important;
    margin-bottom: 15px !important;
    font-weight: 600 !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    width: calc(100% - 20px) !important;
    margin-left: 0 !important;
    color: #212529 !important;
}

.compact-log-entry.unread legend {
    background: rgba(220, 53, 69, 0.1) !important;
    border-color: #dc3545 !important;
    color: #212529 !important;
}

.compact-log-entry legend span {
    color: #212529 !important;
}

.compact-log-entry legend small {
    color: #6c757d !important;
}

.compact-log-content {
    padding: 15px !important;
}

.log-fields-grid {
    display: grid !important;
    gap: 12px !important;
    grid-template-columns: 1fr 1fr !important;
    grid-template-areas: 
        "type source"
        "message message"
        "trace trace" !important;
}

.log-field-compact {
    background: #f8f9fa !important;
    border-radius: 6px !important;
    padding: 10px 12px !important;
    border-left: 3px solid #6c757d !important;
}

.log-field-compact.type-info:nth-child(1) {
    grid-area: type !important;
    border-left-color: #17a2b8 !important;
    background: rgba(23, 162, 184, 0.05) !important;
}

.log-field-compact.type-info:nth-child(2) {
    grid-area: source !important;
    border-left-color: #17a2b8 !important;
    background: rgba(23, 162, 184, 0.05) !important;
}

.log-field-compact.type-warning.full-width {
    grid-area: message !important;
    border-left-color: #ffc107 !important;
    background: rgba(255, 193, 7, 0.05) !important;
}

.log-field-compact.type-error.full-width {
    grid-area: trace !important;
    border-left-color: #dc3545 !important;
    background: rgba(220, 53, 69, 0.05) !important;
}

.log-field-compact.type-critical {
    border-left-color: #6f42c1 !important;
    background: rgba(111, 66, 193, 0.05) !important;
}

.log-field-compact.full-width {
    grid-column: 1 / -1 !important;
}

/* Force text visibility in log content */
.compact-log-entry * {
    color: inherit !important;
}

.compact-log-entry .log-field-value * {
    color: #212529 !important;
}

/* ===== LOG DELETE BUTTON - IMPROVED VISIBILITY ===== */
.log-delete-btn-compact {
    background: #dc3545 !important;
    color: white !important;
    border: none !important;
    border-radius: 6px !important;
    padding: 6px 12px !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    text-decoration: none !important;
    transition: all 0.3s ease !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 4px !important;
    box-shadow: 0 2px 4px rgba(220, 53, 69, 0.3) !important;
}

.log-delete-btn-compact:hover {
    background: #c82333 !important;
    color: white !important;
    text-decoration: none !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 8px rgba(220, 53, 69, 0.4) !important;
}

.log-delete-btn-compact:focus {
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.25) !important;
    color: white !important;
}

.log-delete-btn-compact:active {
    transform: translateY(0) !important;
    box-shadow: 0 2px 4px rgba(220, 53, 69, 0.3) !important;
    color: white !important;
}

/* Override any potential Telerik/ASP.NET color conflicts */
.log-delete-btn-compact,
.log-delete-btn-compact:visited,
.log-delete-btn-compact:link {
    color: white !important;
}