/* ====================================================================
   MODERN DATA CSS
   Styles for tables, grids, logs, and data display components
   ==================================================================== */

/* ===== MODERN TABLES ===== */
.modern-table {
    width: 100%;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.modern-table table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
}

.modern-table th {
    background: linear-gradient(135deg, #6c757d 0%, #5a6268 100%);
    color: white;
    padding: 12px 15px;
    text-align: left;
    font-weight: 600;
    font-size: 14px;
    border: none;
}

.modern-table th.primary {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
}

.modern-table th.success {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
}

.modern-table th.warning {
    background: linear-gradient(135deg, #ffc107 0%, #e0a800 100%);
    color: #212529;
}

.modern-table th.danger {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
}

.modern-table th.info {
    background: linear-gradient(135deg, #17a2b8 0%, #138496 100%);
}

.modern-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #dee2e6;
    color: #495057;
    vertical-align: top;
}

.modern-table tbody tr {
    transition: background-color 0.3s ease;
}

.modern-table tbody tr:hover {
    background: #f8f9fa;
}

.modern-table tbody tr:last-child td {
    border-bottom: none;
}

/* ===== MODERN LOG ENTRIES ===== */
.modern-log-container {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    overflow: hidden;
    margin-bottom: 20px;
}

.modern-log-entry {
    border: none;
    border-radius: 8px;
    margin: 0 0 15px 0;
    background: #fff;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
    overflow: hidden;
    transition: all 0.3s ease;
}

.modern-log-entry:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transform: translateY(-1px);
}

.modern-log-entry legend {
    background: linear-gradient(135deg, #6c757d 0%, #5a6268 100%);
    color: white;
    border: none;
    border-radius: 0;
    padding: 12px 20px;
    margin: 0;
    width: 100%;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}

.modern-log-entry.unread legend {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    font-weight: 600;
}

.modern-log-entry.unread {
    border-left: 4px solid #dc3545;
}

.modern-log-entry.success legend {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
}

.modern-log-entry.warning legend {
    background: linear-gradient(135deg, #ffc107 0%, #e0a800 100%);
    color: #212529;
}

.modern-log-entry.info legend {
    background: linear-gradient(135deg, #17a2b8 0%, #138496 100%);
}

.modern-log-entry-content {
    padding: 20px;
    background: #f8f9fa;
}

.modern-log-field {
    margin-bottom: 15px;
    padding: 12px;
    background: white;
    border-radius: 6px;
    border-left: 4px solid #007bff;
}

.modern-log-field:last-child {
    margin-bottom: 0;
}

.modern-log-field em {
    font-weight: 600;
    color: #495057;
    font-style: normal;
    display: inline-block;
    min-width: 120px;
}

.modern-log-field-content {
    margin-top: 5px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.4;
    white-space: pre-wrap;
}

/* Log field type indicators */
.modern-log-field.critical { border-left-color: #dc3545; }
.modern-log-field.error { border-left-color: #fd7e14; }
.modern-log-field.warning { border-left-color: #ffc107; }
.modern-log-field.info { border-left-color: #17a2b8; }
.modern-log-field.success { border-left-color: #28a745; }

/* ===== MODERN DATA LISTS ===== */
.modern-data-list {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    overflow: hidden;
}

.modern-data-item {
    padding: 15px 20px;
    border-bottom: 1px solid #dee2e6;
    transition: background-color 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modern-data-item:hover {
    background: #f8f9fa;
}

.modern-data-item:last-child {
    border-bottom: none;
}

.modern-data-item-content {
    flex: 1;
}

.modern-data-item-title {
    font-weight: 600;
    color: #495057;
    margin-bottom: 5px;
}

.modern-data-item-subtitle {
    color: #6c757d;
    font-size: 14px;
}

.modern-data-item-actions {
    display: flex;
    gap: 10px;
}

/* ===== CREW CARDS (from previous design) ===== */
.modern-crew-card {
    background: #fff;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 18px;
    margin-bottom: 15px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.modern-crew-card:hover {
    border-color: #007bff;
    box-shadow: 0 4px 12px rgba(0,123,255,0.15);
    transform: translateY(-2px);
}

.modern-crew-card legend {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    border-radius: 6px;
    padding: 8px 16px;
    margin-bottom: 12px;
    font-weight: 600;
    font-size: 16px;
    border: none;
    box-shadow: 0 2px 4px rgba(40,167,69,0.3);
    width: auto;
}

.modern-crew-members {
    background: #f8f9fa;
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 15px;
    min-height: 50px;
    border-left: 4px solid #28a745;
}

.modern-crew-member {
    display: inline-block;
    background: white;
    padding: 4px 8px;
    margin: 2px 4px 2px 0;
    border-radius: 4px;
    border: 1px solid #dee2e6;
    font-size: 14px;
    transition: all 0.2s ease;
    position: relative;
}

.modern-crew-member:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

.modern-crew-member .remove-btn {
    margin-left: 6px;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.modern-crew-member .remove-btn:hover {
    opacity: 1;
}

/* ===== PAGINATION ===== */
.modern-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin: 20px 0;
}

.modern-pagination .page-btn {
    padding: 8px 12px;
    border: 1px solid #dee2e6;
    background: white;
    color: #495057;
    border-radius: 4px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.modern-pagination .page-btn:hover {
    background: #f8f9fa;
    border-color: #adb5bd;
}

.modern-pagination .page-btn.active {
    background: #007bff;
    border-color: #007bff;
    color: white;
}

.modern-pagination .page-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ===== STATUS BADGES ===== */
.modern-status-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.modern-status-badge.active {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.modern-status-badge.inactive {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.modern-status-badge.pending {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.modern-status-badge.processing {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* ===== NO DATA MESSAGES ===== */
.modern-no-data {
    text-align: center;
    padding: 60px 20px;
    background: #f8f9fa;
    border-radius: 8px;
    margin: 20px 0;
}

.modern-no-data h2,
.modern-no-data h3 {
    color: #6c757d;
    margin-bottom: 15px;
}

.modern-no-data p {
    color: #6c757d;
    font-size: 16px;
}

.modern-no-data a {
    color: #007bff;
    text-decoration: none;
    font-weight: 600;
}

.modern-no-data a:hover {
    text-decoration: underline;
}

/* ===== LOG MANAGEMENT STYLES ===== */

/* Improved toolbar layout */
.logs-toolbar-container {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}

.logs-filter-section {
    flex: 1;
    min-width: 250px;
    max-width: 400px;
}

.logs-filter-section .modern-form-label {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 6px;
    color: #495057;
}

.logs-buttons-section {
    display: flex;
    gap: 0px;
    flex-shrink: 0;
    align-items: stretch;
}

/* Consistent sizing for all toolbar elements */
.logs-filter-section .RadDropDownList,
.logs-buttons-section .modern-btn,
.logs-buttons-section .RadButton {
    height: 38px !important;
    box-sizing: border-box;
}

.logs-buttons-section .modern-btn,
.logs-buttons-section .RadButton {
    min-width: 120px;
    font-size: 13px;
    padding: 0px !important;
    margin: 0px 10px 0px 0px !important;
    line-height: 1.2;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%) !important;
    border: none !important;
    color: white !important;
    box-shadow: 0 2px 4px rgba(0,123,255,0.3) !important;
    border-radius: 6px !important;
    font-weight: 500 !important;
    white-space: nowrap;
    transition: all 0.3s ease;
    text-decoration: none !important;
    vertical-align: top !important;
}

.logs-buttons-section .RadButton:last-child {
    margin-right: 0px !important;
}

/* Force RadButton inner elements */
.logs-buttons-section .RadButton .rbText {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 8px 16px !important;
    margin: 0 !important;
    line-height: 1.2 !important;
    height: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

.logs-buttons-section .modern-btn:hover,
.logs-buttons-section .RadButton:hover {
    background: linear-gradient(135deg, #0056b3 0%, #004085 100%) !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,123,255,0.4) !important;
}

.logs-buttons-section .modern-btn:focus,
.logs-buttons-section .RadButton:focus {
    outline: 0;
    box-shadow: 0 0 0 3px rgba(0,123,255,0.25) !important;
}

.logs-buttons-section .modern-btn.info,
.logs-buttons-section .RadButton.info {
    background: linear-gradient(135deg, #17a2b8 0%, #138496 100%) !important;
    box-shadow: 0 2px 4px rgba(23,162,184,0.3) !important;
}

.logs-buttons-section .modern-btn.info:hover,
.logs-buttons-section .RadButton.info:hover {
    background: linear-gradient(135deg, #138496 0%, #117a8b 100%) !important;
    box-shadow: 0 4px 8px rgba(23,162,184,0.4) !important;
}

.logs-filter-section .rddlSlide {
    height: 36px !important;
    line-height: 34px !important;
}

/* ===== COMPACT LOG ENTRIES ===== */

/* Compact log entry styling */
.compact-log-entry {
    margin-bottom: 12px;
    border: none;
    border-radius: 6px;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
    overflow: hidden;
}

.compact-log-entry:last-child {
    margin-bottom: 0;
}

.compact-log-entry legend {
    background: linear-gradient(135deg, #495057 0%, #343a40 100%);
    color: white;
    margin: 0;
    padding: 8px 16px;
    border: none;
    width: 100%;
    font-size: 13px;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.compact-log-entry.unread legend {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    font-weight: 600;
}

.compact-log-content {
    padding: 12px 16px;
    background: #f8f9fa;
}

/* Compact log fields - side by side layout */
.log-fields-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.log-field-compact {
    background: white;
    border-radius: 4px;
    padding: 8px 10px;
    border-left: 3px solid #007bff;
    font-size: 12px;
}

.log-field-compact.full-width {
    grid-column: 1 / -1;
}

.log-field-label {
    font-weight: 600;
    color: #495057;
    font-size: 11px;
    margin-bottom: 3px;
    display: block;
}

.log-field-value {
    color: #6c757d;
    line-height: 1.3;
    word-wrap: break-word;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Color coding for different field types */
.log-field-compact.type-info { border-left-color: #17a2b8; }
.log-field-compact.type-warning { border-left-color: #ffc107; }
.log-field-compact.type-error { border-left-color: #fd7e14; }
.log-field-compact.type-critical { border-left-color: #dc3545; }
.log-field-compact.type-success { border-left-color: #28a745; }

/* Delete button in legend */
.log-delete-btn-compact {
    background: rgba(220,53,69,0.1) !important;
    border: 1px solid #dc3545 !important;
    color: #dc3545 !important;
    padding: 2px 8px !important;
    font-size: 11px !important;
    border-radius: 3px !important;
    text-decoration: none !important;
    transition: all 0.2s ease !important;
}

.log-delete-btn-compact:hover {
    background: #dc3545 !important;
    color: white !important;
}

/* ===== MODAL IMPROVEMENTS ===== */

/* Modal improvements */
.modal-content-improved {
    padding: 20px;
}

.modal-fieldset-improved {
    height: 100%;
    display: flex;
    flex-direction: column;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 15px;
}

.modal-checkbox-section {
    flex: 1;
    max-height: 300px;
    overflow-y: auto;
    background: #f8f9fa;
    padding: 10px;
    border-radius: 4px;
    margin: 10px 0;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
    .modern-table {
        overflow-x: auto;
    }
    
    .modern-table th,
    .modern-table td {
        padding: 8px 10px;
        font-size: 13px;
    }
    
    .modern-log-entry legend {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }
    
    .modern-data-item {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    
    .modern-data-item-actions {
        justify-content: center;
    }
    
    .modern-pagination {
        flex-wrap: wrap;
    }
    
    .modern-crew-card {
        padding: 15px;
    }
    
    .logs-toolbar-container {
        flex-direction: column;
        align-items: stretch;
    }
    
    .logs-filter-section {
        max-width: none;
        min-width: auto;
    }
    
    .logs-buttons-section {
        justify-content: stretch;
    }
    
    .logs-buttons-section .modern-btn,
    .logs-buttons-section .RadButton {
        flex: 1;
        min-width: auto;
    }
    
    .log-fields-grid {
        grid-template-columns: 1fr;
    }
    
    .log-field-compact.full-width {
        grid-column: auto;
    }
}