/* Employee Reports Styles */

/* Report Container */
.report-container {
    padding: 1.5rem;
}

/* Table Container with Scroll */
.table-container-scroll {
    display: flex;
    flex-direction: column;
    overflow: auto;
    position: relative;
}

.table-container-scroll::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.table-container-scroll::-webkit-scrollbar-track {
    background: #f1f5f9;
}

.table-container-scroll::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.table-container-scroll::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Ensure table takes full width for horizontal scroll */
.table-container-scroll .table {
    min-width: 100%;
}

/* Modern Filter Section */
.filter-section-modern {
    min-height: fit-content;
    background: linear-gradient(180deg,  #ffffff 0%,
    color-mix(in srgb, var(--df-panel-bg, #f8f9fa) 98%, #ffffff) 100%);
    border: 1px solid color-mix(in srgb, var(--df-primary-bg) 15%, transparent);
    border-radius: 8px;
    padding: 0;
    box-shadow: 0 2px 8px color-mix(in srgb, var(--df-primary-bg) 8%, transparent), 0 1px 2px color-mix(in srgb, var(--df-primary-bg) 5%, transparent);
    transition: all 0.3s ease;
    position: relative;
}

.filter-section-modern .filter-header-wrapper {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg,
        color-mix(in srgb, var(--df-primary-bg) 5%, var(--df-panel-bg, white)) 0%,
        color-mix(in srgb, var(--df-primary-bg) 10%, var(--df-panel-bg, white)) 100%);
    border-radius: 8px 0 8px 0;
    position: relative;
}

.filter-section-modern .filter-header-wrapper::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg,
        var(--df-primary-bg) 0%,
        color-mix(in srgb, var(--df-primary-bg) 70%, transparent) 100%);
    opacity: 0.8;
    transition: opacity 0.2s ease;
}

.filter-section-modern:hover .filter-header-wrapper::after {
    opacity: 1;
}

.clickable-row{
    cursor: pointer;
}

/* Clickable portion of header */
.filter-section-modern .filter-header-clickable {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    cursor: pointer;
    user-select: none;
    padding: 16px;
    transition: background 0.2s ease;
    border-radius: 8px 0 0 0;
}

.filter-section-modern .filter-header-clickable:hover {
    background: color-mix(in srgb, var(--df-primary-bg) 5%, transparent);
}

.filter-section-modern .filter-header-clickable:active {
    background: color-mix(in srgb, var(--df-primary-bg) 10%, transparent);
}

.filter-section-modern .filter-header-clickable:focus {
    outline: none;
}

/* Action buttons section */
.filter-header-actions {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 16px;
    border-left: 1px solid color-mix(in srgb, var(--df-primary-bg) 15%, transparent);
}

/* Make filter action buttons different if needed */
.filter-header-actions .btn {

}

.filter-header-actions .btn i {

}



.filter-section-modern[data-collapsible-filters-collapsed-value="true"] .filter-header-wrapper {
    border-bottom: none;
    border-radius: 8px;
}

.filter-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.filter-icon {
    font-size: 1.1rem;
    color: var(--df-secondary-bg, var(--df-primary-bg));
    transition: color 0.2s ease;
}

.filter-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--df-panel-text, #1e293b);
    letter-spacing: -0.025em;
}

/* Toggle indicator */
.filter-toggle-indicator {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: color-mix(in srgb, var(--df-secondary-bg, var(--df-primary-bg)) 10%, transparent);
    margin-left: auto;
}

/* Toggle icon rotation */
.filter-toggle-indicator .toggle-icon {
    font-size: 1rem;
    color: var(--df-secondary-bg, var(--df-primary-bg));
    transition: transform 0.3s ease;
    display: inline-block;
}

.filter-header-clickable[aria-expanded="false"] .toggle-icon {
    transform: rotate(180deg);
}

.filter-content {
    padding: 24px;
    background: white;
    transition: all 0.3s ease;
    border-radius: 0 0 16px 16px;
    position: relative;
    /* Higher z-index to ensure dropdowns appear above tables */
    z-index: 100;
}

/* Bootstrap dropdowns and select2-style dropdowns need even higher z-index */
.dropdown-menu,
.select2-container,
.choices__list--dropdown,
.autocomplete-results,
.filter-content select,
.filter-content .dropdown {
    z-index: 1050 !important; /* Bootstrap modal z-index level */
}

/* Ensure the dropdown container itself doesn't clip */
.filter-section-modern {
    overflow: visible !important;
}

/* Keep the visible overflow for the filter content when expanded */
.filter-content:not(.collapsed) {
    overflow: visible !important;
}

/* Filter Badges */
.filter-badges-container {
    flex: 1;
    display: flex;
    align-items: center;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}

.filter-badges-container::-webkit-scrollbar {
    height: 4px;
}

.filter-badges-container::-webkit-scrollbar-track {
    background: transparent;
}

.filter-badges-container::-webkit-scrollbar-thumb {
    background-color: color-mix(in srgb, var(--df-primary-bg) 30%, transparent);
    border-radius: 2px;
}

.filter-badges {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
}

.filter-badge {
    padding: 7px!important;
}

.filter-badge:hover {
    opacity: 0.9;
}

.filter-badge-label {
    font-weight: 600;
    opacity: 0.9;
}

.filter-badge-value {
    font-weight: 400;
}

.filter-badge .btn-close {
    width: 0.65rem;
    height: 0.65rem;
    padding: 0;
    opacity: 0.6;
    transition: opacity 0.2s ease;
    background-size: 0.65rem;
    filter: none;
}

.filter-badge .btn-close:hover {
    opacity: 1;
}

/* No active filters message */
.filter-badges-container .text-muted {
    color: var(--bs-secondary) !important;
    font-size: 0.875rem;
    font-style: italic;
}

/* Clear all button */
.filter-badges .btn-outline-secondary {
    font-size: 0.825rem;
    padding: 0.325rem 0.75rem;
    border-radius: 20px;
    flex-shrink: 0;
    white-space: nowrap;
}

/* Filter Panel Collapsed State */
.filter-content.collapsed {
    display: none;
}

.filter-content.show {
    display: block;
}

/* Filter Section */
.report-filters {
    background-color: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 2rem;
}

.report-filters .card {
    border: none;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.report-filters .card-header {
    background-color: transparent;
    border-bottom: 1px solid #dee2e6;
}

.report-filters .form-label {
    font-weight: 600;
    color: #495057;
    margin-bottom: 0.5rem;
}

/* Pagination */
.report-pagination {
    padding: 1rem;
    background-color: #f8f9fa;
    border-top: 1px solid #dee2e6;
}

.report-pagination .pagination {
    margin-bottom: 0;
}

/* Report Summary Stats */
.report-stats {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.report-stat-card {
    flex: 1;
    background: white;
    border-radius: 8px;
    padding: 1.25rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.report-stat-card h6 {
    color: #6c757d;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.report-stat-card .stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: #212529;
}

/* Filter Form Improvements */
.report-filters .form-control,
.report-filters .form-select {
    border: 1px solid #ced4da;
    border-radius: 4px;
    padding: 0.5rem 0.75rem;
}

.report-filters .form-control:focus,
.report-filters .form-select:focus {
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* Export Buttons */
.report-export-buttons {
    display: flex;
    gap: 0.5rem;
    margin-left: auto;
}

.report-export-buttons .btn {
    font-size: 0.875rem;
    padding: 0.375rem 0.75rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .report-stats {
        flex-direction: column;
    }

    .report-filters .row {
        margin-bottom: 1rem;
    }

    .report-table {
        overflow-x: auto;
    }

    .report-export-buttons {
        flex-direction: column;
        width: 100%;
    }

    .report-export-buttons .btn {
        width: 100%;
    }
}

/* Print Styles */
@media print {
    .report-filters,
    .report-pagination,
    .report-export-buttons {
        display: none !important;
    }

    .report-table {
        box-shadow: none;
        border: 1px solid #dee2e6;
    }

    .report-table thead {
        background-color: #f8f9fa !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}

.media-selector,
.product-selector,
#enhancedImageZoomModal,
#turbo_stream_messages .modal,
#turbo_stream_messages_2 .modal,
#turbo_stream_messages_3 .modal,
#turbo_stream_messages_4 .modal,
#toast-container .modal
{
    padding-top: 15px;
    background-color: rgba(0,0,0,0.25);
}

#turbo_stream_messages .modal-body,
#turbo_stream_messages_2 .modal-body,
#turbo_stream_messages_3 .modal-body,
#turbo_stream_messages_4 .modal-body,
#toast-container .modal-body{
    max-height: 70vh;
    min-height: 300px;
    overflow: auto;
}

#turbo_stream_messages .modal-dialog{

}
#turbo_stream_messages_2 .modal-dialog{
    padding:10px;
}
#turbo_stream_messages_3 .modal-dialog{
    padding:20px;
}
#turbo_stream_messages_4 .modal-dialog{
    padding:30px;
}
#toast-container .modal-dialog{
    padding:40px;
}
