/* Modern Data Tables Styling */

:root {
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --success-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --info-gradient: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --dark-gradient: linear-gradient(135deg, #2d3748 0%, #1a202c 100%);
    --card-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    --card-shadow-hover: 0 15px 50px rgba(0, 0, 0, 0.15);
    --border-radius: 16px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Modern Page Headers */
.modern-page-header {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid #e2e8f0;
}

.modern-page-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
}

.modern-page-header h4 {
    color: #64748b;
    font-weight: 500;
    font-size: 1.1rem;
}

/* Modern Filter Card */
.modern-filter-card {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
    border: none;
    margin-bottom: 2rem;
    overflow: hidden;
}


.modern-filter-card .card-body {
    padding: 2rem;
}

.modern-filter-card .card-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 1.5rem;
}

/* Modern Form Controls */
.modern-form-control {
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    transition: var(--transition);
}

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

/* Modern Select/Dropdown Styling */
select.modern-form-control,
select.form-select.modern-form-control,
.modern-form-control.form-select {
    background-color: #ffffff;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23667eea' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 16px 12px;
    padding-right: 2.5rem;
    appearance: none;
    cursor: pointer;
}

select.modern-form-control:focus,
select.form-select.modern-form-control:focus {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23667eea' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
}

select.modern-form-control:disabled,
select.form-select.modern-form-control:disabled {
    background-color: #f1f5f9;
    cursor: not-allowed;
    opacity: 0.6;
}

select.modern-form-control option {
    padding: 0.5rem;
    background-color: #ffffff;
    color: #1e293b;
}

select.modern-form-control option:hover,
select.modern-form-control option:checked {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

/* Try to style the dropdown panel (limited browser support) */
select.modern-form-control optgroup {
    background-color: #f8fafc;
    font-weight: 600;
}

/* Modern Buttons */
.modern-btn {
    border-radius: 12px;
    padding: 0.75rem 1.75rem;
    font-weight: 600;
    font-size: 0.95rem;
    transition: var(--transition);
    border: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.modern-btn-primary {
    background: var(--primary-gradient);
    color: white;
}

.modern-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
    color: white;
}

.modern-btn-secondary {
    background: #f8fafc;
    color: #64748b;
    border: 2px solid #e2e8f0;
}

.modern-btn-secondary:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
    transform: translateY(-2px);
    color: #475569;
}

/* Modern Table */
.modern-table-container {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
    overflow: hidden;
    margin-bottom: 2rem;
}

.modern-table {
    margin-bottom: 0;
    font-size: 0.9rem;
}

.modern-table thead {
    background: var(--dark-gradient);
    background-color: #2d3748 !important;
}

.modern-table thead th,
table.modern-table thead th,
.modern-table-container .modern-table thead th {
    border: none;
    padding: 1.25rem 1rem;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    color: #ffffff !important;
    background-color: transparent !important;
    vertical-align: middle !important;
}

.modern-table thead th a,
table.modern-table thead th a,
.modern-table-container .modern-table thead th a {
    color: #ffffff !important;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: var(--transition);
}

.modern-table thead th a:hover,
table.modern-table thead th a:hover,
.modern-table-container .modern-table thead th a:hover {
    color: #a5b4fc !important;
}

.modern-table thead th a span,
table.modern-table thead th a span {
    color: inherit !important;
}

.modern-table tbody tr {
    border-bottom: 1px solid #e2e8f0;
    transition: background-color 0.2s ease;
}

.modern-table tbody tr:hover {
    background: #f8fafc;
}

.modern-table tbody td {
    padding: 1.25rem 1rem;
    vertical-align: middle;
    color: #475569;
}

.modern-table tbody td:first-child {
    font-weight: 600;
    color: #1e293b;
    white-space: nowrap;
}

/* Prevent line breaks in time/date columns */
.modern-table td:first-child,
.modern-table th:first-child {
    white-space: nowrap;
}

.modern-table tfoot {
    background: linear-gradient(to right, #f8fafc, #f1f5f9);
    font-weight: 600;
}

.modern-table tfoot th {
    padding: 1.25rem 1rem;
    color: #475569;
    border-top: 2px solid #e2e8f0;
    vertical-align: middle;
}

.modern-table tfoot td {
    vertical-align: middle;
}

/* Sort Icons */
.sort-icon {
    font-size: 1rem;
    opacity: 0.6;
    transition: var(--transition);
}

.sort-icon-active {
    opacity: 1;
    color: #a5b4fc;
}

/* Sortable table headers */
.modern-table thead th.sortable {
    cursor: pointer;
    user-select: none;
}

.modern-table thead th.sortable a {
    cursor: pointer;
}

/* Modern Alert/Legend */
.modern-alert {
    border: none;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.modern-alert-info {
    background: linear-gradient(135deg, #e0f2fe 0%, #dbeafe 100%);
    color: #075985;
}

.modern-alert-warning {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: #92400e;
}

.modern-alert-danger {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    color: #991b1b;
}

.modern-alert-success {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    color: #065f46;
}

.modern-alert strong {
    font-weight: 700;
    font-size: 1.05rem;
}

.modern-alert ul {
    margin-bottom: 0;
    margin-top: 0.75rem;
}

.modern-alert li {
    margin-bottom: 0.5rem;
}

/* Badge Styling */
.modern-badge {
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.85rem;
}

.modern-badge-success {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    color: #065f46;
}

.modern-badge-warning {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: #92400e;
}

/* Info Cards (for forecast run info) */
.modern-info-card {
    background: linear-gradient(135deg, #fefce8 0%, #fef3c7 100%);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    margin-bottom: 2rem;
}

.modern-info-card h6 {
    font-weight: 700;
    color: #78350f;
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.modern-info-card p {
    margin-bottom: 0;
    color: #92400e;
    line-height: 1.6;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .modern-page-header h1 {
        font-size: 2rem;
    }

    .modern-filter-card .card-body {
        padding: 1.5rem;
    }

    .modern-table {
        font-size: 0.85rem;
    }

    .modern-table thead th,
    .modern-table tbody td,
    .modern-table tfoot th {
        padding: 0.75rem 0.5rem;
    }
}

/* Modern Form Select */
.modern-form-select {
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 0.75rem 2.5rem 0.75rem 1rem;
    font-size: 0.95rem;
    transition: var(--transition);
    background-color: #ffffff;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23667eea' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 16px 12px;
    appearance: none;
    cursor: pointer;
}

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

.modern-form-select:disabled {
    background-color: #f1f5f9;
    cursor: not-allowed;
    opacity: 0.6;
}

/* Utility classes */
.text-gradient {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}


/* Modern Breadcrumb */
.modern-breadcrumb .breadcrumb {
    margin-bottom: 0.75rem;
    font-size: 0.875rem;
}

.modern-breadcrumb .breadcrumb-item + .breadcrumb-item::before {
    content: "\203A";
    color: var(--theme-text-muted, #94a3b8);
}

.modern-breadcrumb .breadcrumb-item a {
    color: var(--theme-primary, #667eea);
    text-decoration: none;
    transition: var(--transition);
}

.modern-breadcrumb .breadcrumb-item a:hover {
    color: var(--theme-primary-hover, #5a67d8);
    text-decoration: underline;
}

.modern-breadcrumb .breadcrumb-item.active {
    color: var(--theme-text-secondary, #64748b);
}
