/* RTL-specific styles for Arabic language */

/* GLOBAL HORIZONTAL OVERFLOW PREVENTION - CRITICAL FIX */
html {
    overflow-x: hidden !important;
    max-width: 100vw !important;
    box-sizing: border-box !important;
}

body {
    font-family: 'Tajawal', sans-serif;
    text-align: right;
    overflow-x: hidden !important;
    max-width: 100vw !important;
    box-sizing: border-box !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Prevent ANY element from causing horizontal overflow */
* {
    box-sizing: border-box !important;
}

*:not(.table):not(.table *):not(.login-page):not(.login-page *):not([class*="login"]):not([class*="login"] *) {
    max-width: 100% !important;
}

/* Fix for Font Awesome icons in RTL */
.fa, .fas, .far, .fal, .fab {
    margin-left: 1rem;
    margin-right: 0;
}

/* Make icons inside circles centered */
span.rounded-full .fa,
span.rounded-full .fas,
span.rounded-full .far,
span.rounded-full .fal,
span.rounded-full .fab {
    margin: 0;
}

/* Better spacing for inline block elements with icons */
span.inline-block {
    margin-right: 0.5rem;
}

/* Card title improvements */
h3.text-lg {
    margin-bottom: 0.5rem;
    font-weight: 600;
}

/* Correct text alignment for tables */
th, td {
    text-align: right;
}

/* Fix for margins in RTL context */
.me-1, .me-2, .me-3, .me-4 {
    margin-left: 0.25rem !important;
    margin-right: 0 !important;
}

.ms-1, .ms-2, .ms-3, .ms-4 {
    margin-right: 0.25rem !important;
    margin-left: 0 !important;
}

/* Better card layout for setup guide */
.bg-gray-50 {
    border-right: 4px solid #3b82f6;
    transition: all 0.2s ease;
}

.bg-gray-50:hover {
    border-right-width: 6px;
    transform: translateX(-2px);
}

.bg-gray-50:last-child {
    border-right-color: #3b82f6;
}

/* Status card borders */
.border-right-blue {
    border-right: 4px solid #3b82f6;
    transition: all 0.2s ease;
}

.border-right-blue:hover {
    border-right-width: 6px;
    transform: translateX(-2px);
}

/* Fix border directions for RTL */
.border-l-4 {
    border-left-width: 0;
    border-right-width: 4px;
}

.border-r-4 {
    border-right-width: 4px;
}

/* Fix for RTL button padding */
button.flex, a.inline-flex {
    flex-direction: row-reverse;
}

a.inline-flex i {
    margin-left: 1.5rem;
    margin-right: 0;
}

/* Better button spacing for Arabic text */
a.inline-flex {
    letter-spacing: 0.05em;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
    min-width: 110px;
    text-align: center;
    justify-content: center;
}

a.inline-flex i.fas {
    margin-left: 1.5rem;
}

/* Button text positioning */
a.inline-flex span.inline-block {
    margin-right: 0;
    position: relative;
    top: 1px;
}

/* Extra spacing for play icons */
a.inline-flex i.fa-play,
a.inline-flex i.fa-arrow-right {
    margin-left: 2rem;
}

/* Headings icon spacing */
h1 i, h2 i, h3 i {
    margin-left: 1rem;
    margin-right: 0;
}

/* RTL specific table fixes */
table thead th {
    text-align: right;
}

/* Fix for action columns */
th:last-child, td:last-child {
    text-align: left;
}

/* Animation for RTL */
@keyframes fadeInRTL {
    0% { opacity: 0; transform: translateX(20px); }
    100% { opacity: 1; transform: translateX(0); }
}

.fade-in-rtl {
    animation: fadeInRTL 0.5s ease-in;
}

/* Improve circle icon sizes */
.h-12.w-12 {
    height: 3.5rem;
    width: 3.5rem;
}

.fa-lg {
    font-size: 1.5rem;
}

/* General spacing improvements */
.p-5 {
    padding: 1.25rem;
}

.mt-5 {
    margin-top: 1.25rem;
}

.mr-4 {
    margin-right: 1rem;
}

.mr-6 {
    margin-right: 1.5rem;
}

.ml-4 {
    margin-left: 1rem;
}

/* Fix flex direction for RTL */
.flex {
    flex-direction: row-reverse;
}

/* Override for specific flex items that should keep original direction */
.flex.justify-between,
.flex.items-center,
table .flex {
    flex-direction: row;
}

/* Card spacing improvements */
.gap-6 {
    gap: 1.75rem;
}

/* Import Arabic font */
@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@300;400;500;700&display=swap');

/* Special class for button text */
.button-text {
    margin-right: 0;
    position: relative;
    top: 1px;
    font-weight: 500;
    font-size: 0.95rem;
    letter-spacing: 0.05em;
}

/* Increase the spacing more between the icon and text */
a.inline-flex i.fa-play,
a.inline-flex i.fa-arrow-right {
    margin-left: 2.5rem !important;
}

/* ========================================
   ENHANCED HIERARCHICAL FILTER BANNER STYLES
   ======================================== */

/* Horizontal Separator */
.filter-separator {
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, #e5e7eb 20%, #e5e7eb 80%, transparent 100%);
    margin: 0;
    opacity: 0.6;
}

/* Enhanced Ultra-Compact Filter Banner */
.enhanced-filter-banner {
    font-family: 'Tajawal', sans-serif;
    background: #ffffff !important;
    border: none !important;
    border-bottom: 1px solid #e5e7eb !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1) !important;
    margin: 0 !important;
    padding: 0 !important;
    transition: all 0.2s ease;
    z-index: 20; /* LOWER than nav */
    position: relative;
    min-height: 40px;
    max-height: 40px;
    overflow: visible !important; /* Was hidden: allowed to show all filters */
    
    /* Ensure no borders are clipped */
    box-sizing: border-box !important;
}

/* Enhanced Single Row Horizontal Layout */
.enhanced-filter-container {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important; /* Was space-between: pack filters together */
    gap: 8px !important; /* Increased spacing to ensure borders are fully visible */
    height: 40px !important;
    flex-wrap: nowrap !important;
    width: 100% !important;
    padding: 0 16px !important; /* Increased padding to prevent border cutoff */
    overflow: visible !important; /* Was hidden: allow all filters to be visible */
}

.enhanced-filter-controls {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important; /* Increased gap to ensure dropdown borders are fully visible */
    flex: 0 0 auto !important; /* keep controls compact; do not grow */
    min-width: 0 !important;
    height: 32px !important;
    flex-wrap: nowrap !important;
}

.enhanced-filter-actions {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    flex-shrink: 0 !important;
    height: 32px !important;
    padding-left: 12px !important;
    border-left: 1px solid #e5e7eb !important;
}

/* Enhanced Inline Filter Groups */
.filter-dropdown-container {
    transition: all 0.3s ease !important;
    opacity: 1 !important;
    display: flex !important;
    align-items: center !important;
    gap: 0 !important;
    min-width: 120px !important; /* Ultra-compact width */
    max-width: 150px !important; /* Ultra-compact width */
    height: 32px !important;
    flex-shrink: 0 !important;
    position: relative !important;
    margin: 0 2px !important; /* Add small margin to ensure borders are fully visible */
}

.filter-group {
    display: flex !important;
    align-items: center !important;
    gap: 0 !important;
    min-width: 120px !important; /* Ultra-compact width */
    max-width: 150px !important; /* Ultra-compact width */
    height: 32px !important;
    position: relative !important;
    flex-shrink: 0 !important;
    margin: 0 2px !important; /* Add small margin to ensure borders are fully visible */
}

/* Ultra-compact fixed widths to ensure visible reduction */
#hierarchical-filter-banner .filter-group,
#hierarchical-filter-banner .filter-dropdown-container {
    width: 176px !important;
    min-width: 160px !important;
    max-width: 208px !important;
}


/* Filter Dropdown Wrapper with Icon */
.filter-dropdown-wrapper {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important; /* Increased space between icon and dropdown border for better visibility */
    width: 100% !important;
    height: 32px !important;
}

/* Filter Icons */
.filter-icon {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 20px !important;
    height: 20px !important;
    min-width: 20px !important;
    background: #f1f5f9 !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 6px !important;
    color: #64748b !important;
    font-size: 12px !important;
    flex-shrink: 0 !important;
    transition: all 0.2s ease !important;
}

.filter-icon i {
    margin: 0 !important;
    font-size: 12px !important;
}

/* Icon hover effects */
.filter-group:hover .filter-icon {
    background: #e2e8f0 !important;
    border-color: #94a3b8 !important;
    color: #475569 !important;
}

.filter-dropdown-container.hidden {
    opacity: 0;
    transform: translateY(-10px);
    pointer-events: none;
}

.filter-dropdown-container.fade-in {
    animation: filterFadeIn 0.3s ease-out;
}

/* Enhanced Compact Inline Dropdowns */
.filter-dropdown {
    font-family: 'Tajawal', sans-serif !important;
    background: #f8fafc !important;
    border: 1px solid #d1d5db !important;
    border-radius: 6px !important;
    padding: 4px 6px !important; /* Ultra-compact padding */
    padding-right: 30px !important; /* Reserve space for arrow/spinner; avoid text overlap */
    font-size: 11.5px !important; /* Ultra-compact font size */
    font-weight: 500 !important;
    color: #374151 !important;
    transition: all 0.2s ease !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05) !important;
    min-width: 150px !important; /* wider to show full text */
    max-width: 176px !important; /* match container width */
    width: 100% !important;

    text-align: right !important;
    direction: rtl !important;
    height: 32px !important;
    line-height: 1.2 !important;
    box-sizing: border-box !important;

    appearance: none !important;
    cursor: pointer !important;
    display: block !important;
    flex: 1 !important;
    
    /* Ensure borders are always fully visible */
    margin: 0 !important;
    position: relative !important;
    z-index: 1 !important;
}

/* Truncate long labels without stretching width */
.filter-dropdown {
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}


.filter-dropdown:hover {
    background: #ffffff !important;
    border-color: #3b82f6 !important;
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.1) !important;
}

.filter-dropdown:focus {
    outline: none !important;
    background: #ffffff !important;
    border-color: #3b82f6 !important;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1) !important;
}

/* Force Hide Labels for Compact Design */
.filter-group label,
.filter-dropdown-container label {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Keep chevron/spinner width fixed so layout never shifts */
#hierarchical-filter-banner .relative > .pointer-events-none,
#hierarchical-filter-banner [id$='-loading'] {
    width: 22px !important;
    right: 0 !important;
    justify-content: center !important;
}

/* Override Any Conflicting Styles */
#hierarchical-filter-banner .filter-group label,
#hierarchical-filter-banner .filter-dropdown-container label {
    display: none !important;
}

/* Remove any margin/padding from containers */
#hierarchical-filter-banner .filter-group,
#hierarchical-filter-banner .filter-dropdown-container {
    margin: 0 !important;
    margin-bottom: 0 !important;
    padding: 0 !important;
}

/* Force single row layout */
#hierarchical-filter-banner .flex-wrap {
    flex-wrap: nowrap !important;
}

#hierarchical-filter-banner .flex-col {
    flex-direction: row !important;
}

/* Add Compact Labels via Pseudo Elements (Optional) */
.filter-group::before {
    content: attr(data-label);
    position: absolute;
    top: -16px;
    right: 0;
    font-size: 10px;
    font-weight: 600;
    color: #6b7280;
    white-space: nowrap;
    pointer-events: none;
    z-index: 1;
    display: none; /* Hide for now to keep ultra-compact */
}

/* Enhanced Hover & Focus States */
.filter-dropdown:hover {
    border-color: #94a3b8;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
    background: #fafbfc;
    transform: none; /* no vertical shift to avoid distortion */
}

.filter-dropdown:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
    background: #ffffff;
    transform: none; /* no vertical shift to avoid distortion */
}

.filter-dropdown:active {
    transform: none;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.filter-dropdown:disabled {
    background: #f9fafb;
    color: #9ca3af;
    border-color: #e5e7eb;
    cursor: not-allowed;
}

/* Active Filter State - White text on blue background */
.filter-dropdown.active {
    background: #3b82f6 !important;
    color: #ffffff !important;
    border-color: #2563eb;
    font-weight: 600;
}

.filter-dropdown.active:focus {
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.3);
}

/* Filter Labels */
.filter-dropdown-container label {
    font-family: 'Tajawal', sans-serif;
    font-size: 12px;
    font-weight: 600;
    color: #4b5563;
    margin-bottom: 4px;
    display: block;
    text-align: right;
}

/* Loading States */
.filter-dropdown-container .fa-spinner {
    color: #3b82f6;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Icon-Only Action Buttons */
#clear-all-filters,
#refresh-filters {
    font-family: 'Tajawal', sans-serif !important;
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    color: #6b7280 !important;
    font-weight: 500 !important;
    padding: 6px !important;
    border-radius: 6px !important;
    transition: all 0.2s ease !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05) !important;
    font-size: 14px !important;
    height: 32px !important;
    width: 32px !important;
    min-width: 32px !important;
    max-width: 32px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    flex-shrink: 0 !important;
    margin: 0 !important;
}

/* Enhanced Action Buttons - Icon Only Design */
.enhanced-action-btn {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 28px !important;
    height: 28px !important;
    min-width: 28px !important;
    max-width: 28px !important;
    padding: 0 !important;
    border: none !important; /* icon-only */
    background: transparent !important;
    color: #6b7280 !important;
    font-size: 13px !important;
    cursor: pointer !important;
    transition: color 0.2s ease !important;
    box-shadow: none !important;
}

.enhanced-action-btn:hover {
    background: transparent !important; /* icon-only */
    border: none !important;
    color: #374151 !important;
    box-shadow: none !important;
    transform: none !important;
}

.enhanced-action-btn:active {
    transform: none !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}
/* Icon colors for specific actions */
.enhanced-action-btn.refresh-btn i { color: #16a34a !important; }
.enhanced-action-btn.clear-btn i { color: #ef4444 !important; }
.enhanced-action-btn:hover i { filter: brightness(0.9); }


.enhanced-action-btn.clear-btn:hover {
    background: transparent !important;
    border: none !important;
    color: #dc2626 !important;
}

.enhanced-action-btn.refresh-btn:hover {
    background: transparent !important;
    border: none !important;
    color: #15803d !important;
}

.enhanced-action-btn i {
    margin: 0 !important;
    font-size: 13px !important;
}
/* Ensure action buttons never get clipped */
.enhanced-filter-actions,
.enhanced-action-btn {
    overflow: visible !important;
}

/* Hide any text in action buttons */
.enhanced-action-btn .button-text {
    display: none !important;
}

/* Override Tailwind Classes */
#hierarchical-filter-banner .gap-4 {
    gap: 4px !important; /* Ultra-compact spacing */
}

#hierarchical-filter-banner .flex-wrap {
    flex-wrap: nowrap !important;
}

#hierarchical-filter-banner .py-3 {
    padding-top: 8px !important;
    padding-bottom: 8px !important;
}

#hierarchical-filter-banner .mt-6 {
    margin-top: 0 !important;
}

/* Visual Separators */
.filter-controls::after {
    content: '';
    width: 1px;
    height: 20px;
    background: #e2e8f0;
    margin: 0 4px;
    flex-shrink: 0;
}

/* Enhanced Dropdown Icons */
.filter-group .absolute {
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    z-index: 10;
}

.filter-group .absolute i {
    font-size: 12px;
    color: #6b7280;
    transition: color 0.2s ease;
}

.filter-group:hover .absolute i {
    color: #3b82f6;
}

/* Loading States */
.filter-group .absolute .fa-spinner {
    color: #3b82f6;
    font-size: 10px;
}

/* Enhanced Visual Feedback for Disabled States */
.filter-dropdown[disabled] {
    background: #f3f4f6 !important;
    color: #9ca3af !important;
    cursor: not-allowed !important;
    border-color: #e5e7eb !important;
    opacity: 0.7 !important;
}

.filter-dropdown[disabled]:hover {
    transform: none !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05) !important;
    background: #f3f4f6 !important;
    border-color: #e5e7eb !important;
}

.filter-group.disabled .absolute i {
    color: #d1d5db !important;
}

/* Disabled state for filter icons */
.filter-group:has(.filter-dropdown[disabled]) .filter-icon {
    background: #f3f4f6 !important;
    border-color: #e5e7eb !important;
    color: #d1d5db !important;
    opacity: 0.7 !important;
}

.filter-group:has(.filter-dropdown[disabled]):hover .filter-icon {
    background: #f3f4f6 !important;
    border-color: #e5e7eb !important;
    color: #d1d5db !important;
}

/* Enhanced Loading States */
.filter-group .absolute .fa-spinner {
    color: #3b82f6 !important;
    font-size: 12px !important;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: translateY(-50%) rotate(0deg); }
    to { transform: translateY(-50%) rotate(360deg); }
}

/* Smooth Animations */
@keyframes filterSlideIn {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.filter-group.fade-in {
    animation: filterSlideIn 0.3s ease-out;
}

/* Enhanced Focus Ring */
.filter-dropdown:focus-visible {
    outline: 2px solid #3b82f6;
    outline-offset: 1px;
    border-color: #3b82f6;
}

/* Subtle Gradient on Hover */
.filter-dropdown:hover {
    background: linear-gradient(135deg, #ffffff 0%, #fafbfc 100%);
}

/* Active State Enhancement */
.filter-dropdown:active {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
}

/* Button Gradient Effects */
#clear-all-filters:hover,
#refresh-filters:hover {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
}

/* Loading State Enhancement */
.filter-group.loading .filter-dropdown {
    background: linear-gradient(135deg, #fefefe 0%, #f9fafb 100%);
    border-color: #3b82f6;
}

/* Micro-Interactions */
.filter-dropdown:not([disabled]):hover {
    transform: none; /* no hover lift to avoid distortion */
}

.filter-dropdown:not([disabled]):active {
    transform: none;
}

#clear-all-filters:hover,
#refresh-filters:hover {
    transform: translateY(-1px) scale(1.05);
}

#clear-all-filters:active,
#refresh-filters:active {
    transform: translateY(0) scale(0.98);
}

/* Success State */
.filter-dropdown.success {
    border-color: #10b981;
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.1);
}

/* Error State */
.filter-dropdown.error {
    border-color: #ef4444;
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.1);
}

/* Pulse Animation for Loading */
@keyframes filterPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.filter-group.loading::before {
    animation: filterPulse 1.5s ease-in-out infinite;
}

/* Smooth Transitions */
* {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Enhanced Separator */
.filter-controls::after {
    background: linear-gradient(to bottom, transparent, #e2e8f0, transparent);
    transition: background 0.3s ease;
}

.filter-container:hover .filter-controls::after {
    background: linear-gradient(to bottom, transparent, #cbd5e1, transparent);
}

/* BREADCRUMB VISIBILITY CONTROL - Toggle by commenting/uncommenting */

/* OPTION 1: Hide Breadcrumbs (Current - Ultra Compact Design) */
#filter-breadcrumbs,
.filter-breadcrumbs-container,
.filter-breadcrumb-item,
#hierarchical-filter-banner #filter-breadcrumbs,
#hierarchical-filter-banner .filter-breadcrumbs-container,
#hierarchical-filter-banner .filter-breadcrumb-item,
nav[aria-label*="مسار التصفية"],
[role="navigation"][aria-label*="مسار التصفية"] {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    position: absolute !important;
    left: -9999px !important;
}

/* OPTION 2: Show Enhanced Breadcrumbs (Uncomment to enable) */
/*
#filter-breadcrumbs,
.filter-breadcrumbs-container,
.enhanced-breadcrumbs {
    display: flex !important;
    visibility: visible !important;
    height: auto !important;
    width: auto !important;
    margin: 4px 0 !important;
    padding: 8px 16px !important;
    overflow: visible !important;
    position: relative !important;
    left: auto !important;
}
*/

/* Ensure no breadcrumb-related spacing affects layout */
#hierarchical-filter-banner .container > *:has(#filter-breadcrumbs),
#hierarchical-filter-banner .container > *:has(.filter-breadcrumbs-container) {
    display: none !important;
}

/* Enhanced Breadcrumbs Styles - For Future Use When Re-enabled */
.enhanced-breadcrumbs {
    direction: rtl;
    text-align: center;
}

.enhanced-breadcrumbs .breadcrumbs-wrapper {
    direction: rtl;
}

.enhanced-breadcrumbs .breadcrumb-text {
    direction: rtl;
    text-align: center;
}

/* RTL-specific adjustments for enhanced breadcrumbs */
.enhanced-breadcrumbs .breadcrumb-separator {
    transform: scaleX(-1); /* Flip chevron for RTL */
}

/* Auto-resize breadcrumb containers for Arabic text */
.enhanced-breadcrumbs .filter-breadcrumb-item.enhanced-item {
    min-width: auto;
    width: auto;
    max-width: none;
    flex-shrink: 0;
}

/* Ensure proper spacing for Arabic text */
.enhanced-breadcrumbs .breadcrumb-text {
    letter-spacing: 0.5px;
    word-spacing: 1px;
}

/* Final Layout Enforcement */
#hierarchical-filter-banner {
    max-height: 48px !important;
    overflow: visible !important;
}

#hierarchical-filter-banner * {
    box-sizing: border-box !important;
}

/* Ensure no elements break the single row */
#hierarchical-filter-banner .filter-group,
#hierarchical-filter-banner .filter-dropdown-container,
#hierarchical-filter-banner .filter-dropdown {
    flex-shrink: 0 !important;
    white-space: nowrap !important;
}

/* Ensure all filter borders are fully visible */
#hierarchical-filter-banner .filter-dropdown,
#hierarchical-filter-banner .filter-icon {
    border: 1px solid #d1d5db !important;
    border-radius: 6px !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05) !important;
}

/* Prevent any border clipping */
#hierarchical-filter-banner .enhanced-filter-container {
    overflow: visible !important;
    padding-left: 20px !important;
    padding-right: 20px !important;
}

/* Remove any margins that might break layout */
#hierarchical-filter-banner .mb-1,
#hierarchical-filter-banner .mb-2,
#hierarchical-filter-banner .mb-3,
#hierarchical-filter-banner .mb-4,
#hierarchical-filter-banner .mb-6 {
    margin-bottom: 0 !important;
}

/* Force horizontal alignment */
#hierarchical-filter-banner .flex {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
}

/* Perfect Single Row Organization */
#hierarchical-filter-banner .container {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    width: 100% !important;
    max-width: none !important;
}

#hierarchical-filter-banner .filter-container {
    width: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important; /* Pack filters together */
    flex-wrap: nowrap !important;
    gap: 6px !important; /* REDUCED: Was 16px, now 6px for closer spacing */
    overflow-x: auto !important; /* Allow scrolling if needed */
}

/* Ensure dropdowns stay in line */
.filter-controls > * {
    display: inline-flex !important;
    align-items: center !important;
    vertical-align: middle !important;
}

/* Enhanced Responsive Design */
@media (max-width: 1200px) {
    .enhanced-filter-container {
        gap: 10px !important;
        padding: 0 10px !important;
    }

    .enhanced-filter-controls {
        gap: 10px !important;
    }

    .filter-dropdown {
        min-width: 120px !important;
        max-width: 150px !important;
        font-size: 12px !important;
        height: 30px !important;
        padding: 5px 8px !important;
        padding-right: 24px !important;
    }

    .filter-group,
    .filter-dropdown-container {
        min-width: 160px !important;
        max-width: 190px !important;
        height: 30px !important;
    }

    .filter-dropdown-wrapper {
        height: 30px !important;
        gap: 6px !important;
    }

    .filter-icon {
        width: 20px !important;
        height: 20px !important;
        min-width: 20px !important;
        font-size: 10px !important;
    }

    .enhanced-action-btn {
        width: 30px !important;
        height: 30px !important;
        min-width: 30px !important;
        max-width: 30px !important;
        font-size: 12px !important;
    }
}

@media (max-width: 768px) {
    .enhanced-filter-banner {
        min-height: 36px !important;
        max-height: 36px !important;
    }

    .enhanced-filter-container {
        gap: 6px !important;
        padding: 0 6px !important;
        height: 36px !important;
    }

    .enhanced-filter-controls {
        gap: 6px !important;
        height: 28px !important;
    }

    .filter-dropdown {
        min-width: 100px !important;
        max-width: 130px !important;
        font-size: 11px !important;
        height: 28px !important;
        padding: 4px 6px !important;
        padding-right: 20px !important;
    }

    .filter-group,
    .filter-dropdown-container {
        min-width: 140px !important;
        max-width: 170px !important;
        height: 28px !important;
    }

    .filter-dropdown-wrapper {
        height: 28px !important;
        gap: 4px !important;
    }

    .filter-icon {
        width: 18px !important;
        height: 18px !important;
        min-width: 18px !important;
        font-size: 9px !important;
    }

    .enhanced-action-btn {
        width: 28px !important;
        height: 28px !important;
        min-width: 28px !important;
        max-width: 28px !important;
        font-size: 11px !important;
    }

    .enhanced-filter-actions {
        padding-left: 6px !important;
        gap: 4px !important;
    }
}

/* Enhanced Icon Button States */
#clear-all-filters:hover,
#refresh-filters:hover {
    background: #f1f5f9 !important;
    border-color: #94a3b8 !important;
    color: #374151 !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important;
    transform: translateY(-1px) scale(1.05) !important;
}

#clear-all-filters:active,
#refresh-filters:active {
    transform: translateY(0) scale(0.95) !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05) !important;
    background: #e2e8f0 !important;
}

#clear-all-filters:focus,
#refresh-filters:focus {
    outline: none !important;
    border-color: #3b82f6 !important;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15) !important;
}

/* Special styling for clear button */
#clear-all-filters {
    border-color: #ef4444 !important;
    color: #ef4444 !important;
}

#clear-all-filters:hover {
    background: #fef2f2 !important;
    border-color: #dc2626 !important;
    color: #dc2626 !important;
}

/* Special styling for refresh button */
#refresh-filters {
    border-color: #10b981 !important;
    color: #10b981 !important;
}

#refresh-filters:hover {
    background: #f0fdf4 !important;
    border-color: #059669 !important;
    color: #059669 !important;
}

#clear-all-filters:focus,
#refresh-filters:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Filter Breadcrumbs */
#filter-breadcrumbs {
    font-family: 'Tajawal', sans-serif;
    direction: rtl;
    text-align: right;
}

.filter-breadcrumb-item {
    display: inline-flex;
    align-items: center;
    font-size: 13px;
    font-weight: 500;
    color: #6b7280;
    padding: 6px 12px;
    border-radius: 8px;
    background: #f1f5f9;
    margin: 0 3px;
    transition: all 0.2s ease;
    border: 1px solid #e2e8f0;
    position: relative;
    overflow: hidden;
}

.filter-breadcrumb-item.interactive {
    cursor: pointer;
}

.filter-breadcrumb-item.interactive:hover,
.filter-breadcrumb-item.hover {
    background: #e2e8f0;
    color: #374151;
    border-color: #cbd5e1;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.filter-breadcrumb-item.active {
    background: #3b82f6;
    color: #ffffff;
    font-weight: 600;
    border-color: #2563eb;
    box-shadow: 0 2px 6px rgba(59, 130, 246, 0.3);
}

.filter-breadcrumb-item.readonly {
    background: #f9fafb;
    color: #9ca3af;
    border-color: #e5e7eb;
    cursor: not-allowed;
}

.filter-breadcrumb-item .breadcrumb-text {
    cursor: inherit;
    user-select: none;
}

/* X button styles removed - cleaner breadcrumb design without remove buttons */

.filter-breadcrumb-separator {
    color: #9ca3af;
    margin: 0 8px;
    font-size: 14px;
    font-weight: 600;
}

/* Breadcrumb Actions */
.breadcrumb-actions {
    border-left: 1px solid #e2e8f0;
    padding-left: 12px;
    margin-left: 12px;
}

.breadcrumb-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 6px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #6b7280;
    transition: all 0.2s ease;
    cursor: pointer;
}

.breadcrumb-action-btn:hover {
    background: #e2e8f0;
    color: #374151;
    border-color: #cbd5e1;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.breadcrumb-action-btn:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Filter Status Bar */
#filter-status-bar {
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    padding: 8px 0;
    margin-top: 12px;
    border-radius: 6px;
    transition: all 0.3s ease;
}

#filter-status-bar.show {
    animation: slideDown 0.3s ease-out;
}

#filter-status-message {
    font-family: 'Tajawal', sans-serif;
    font-size: 12px;
    color: #6b7280;
}

#filter-last-updated {
    font-family: 'Tajawal', sans-serif;
    font-size: 11px;
    color: #9ca3af;
}

/* Animations */
@keyframes filterFadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        max-height: 50px;
        transform: translateY(0);
    }
}

@keyframes filterClearing {
    0% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.5;
        transform: scale(0.95);
        background: #fef3cd;
        border-color: #fbbf24;
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes resetPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(239, 68, 68, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
    }
}

/* Filter clearing animation */
.filter-clearing {
    animation: filterClearing 0.6s ease-in-out;
}

/* Reset button pulse animation */
#clear-all-filters:hover {
    animation: resetPulse 1.5s infinite;
}

/* Filter removal animations */
.filter-removing {
    animation: fadeOutScale 0.3s ease-in-out forwards;
}

@keyframes fadeOutScale {
    from {
        opacity: 1;
        transform: scale(1);
    }
    to {
        opacity: 0;
        transform: scale(0.8);
    }
}

@keyframes filterChanging {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.4);
    }
    50% {
        transform: scale(1.02);
        box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.2);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0);
    }
}

@keyframes loadingShimmer {
    0% {
        background-position: -200px 0;
    }
    100% {
        background-position: calc(200px + 100%) 0;
    }
}

@keyframes successPulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Loading States */
.filter-loading {
    position: relative;
    overflow: hidden;
}

.filter-loading::before {
    content: '';
    position: absolute;
    top: 0;
    left: -200px;
    width: 200px;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.4),
        transparent
    );
    animation: loadingShimmer 2s infinite;
}

.loading-state {
    background: linear-gradient(
        90deg,
        #f8fafc 25%,
        #e2e8f0 50%,
        #f8fafc 75%
    );
    background-size: 200px 100%;
    animation: loadingShimmer 2s infinite;
    color: #9ca3af;
}

.filter-changing {
    animation: filterChanging 0.6s ease-in-out;
}

/* Progress Indicators */
.filter-progress-bar {
    z-index: 10;
    border-radius: 0 0 6px 6px;
}

.filter-success-indicator {
    animation: successPulse 0.6s ease-in-out;
    z-index: 20;
}

.filter-error-indicator {
    animation: shake 0.5s ease-in-out;
    z-index: 20;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-2px); }
    75% { transform: translateX(2px); }
}

/* Global Loading States */
.filters-loading {
    position: relative;
}

/* Hide blue loading line over the global filter (UI only) */
#hierarchical-filter-banner.filters-loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0; right: 0;
    height: 0 !important;
    background: transparent !important;
    opacity: 0 !important;
    animation: none !important;
    pointer-events: none !important;
}

.filter-refresh-indicator {
    animation: slideInFromTop 0.3s ease-out;
}

@keyframes slideInFromTop {
    from { opacity: 0; transform: translateY(-20px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Kill any residual loading bar render in the banner (UI only) */
#hierarchical-filter-banner::before,
#hierarchical-filter-banner::after {
    content: none !important;
    height: 0 !important;
}
#hierarchical-filter-banner [role='progressbar'],
#hierarchical-filter-banner [class*='progress'],
#hierarchical-filter-banner [class*='indicator'] {
    display: none !important;
    height: 0 !important;
}

/* Bulk Loading Overlay */
#filter-bulk-loading-overlay {
    backdrop-filter: blur(2px);
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Enhanced Visual Feedback */
.filter-dropdown.loading-state {
    cursor: wait;
    pointer-events: none;
}

.filter-dropdown.error-state {
    border-color: #ef4444;
    background-color: #fef2f2;
    color: #dc2626;
}

.filter-dropdown.success-state {
    border-color: #10b981;
    background-color: #f0fdf4;
    animation: successPulse 0.6s ease-in-out;
}

/* Loading option styling */
.loading-option {
    font-style: italic;
    color: #9ca3af !important;
    background: #f9fafb !important;
}

/* Performance Optimization Styles */
.filter-optimized {
    position: relative;
}

.filter-optimized::after {
    content: '⚡';
    position: absolute;
    top: 2px;
    left: 2px;
    font-size: 10px;
    color: #10b981;
    opacity: 0.7;
}

.filter-cached {
    background: linear-gradient(135deg, #ffffff 0%, #f0fdf4 100%);
    border-color: #10b981;
}

.filter-cached::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 8px;
    height: 8px;
    background: #10b981;
    border-radius: 50%;
    transform: translate(50%, -50%);
}

.filter-lazy-loading {
    background: linear-gradient(135deg, #ffffff 0%, #fef3cd 100%);
    border-color: #f59e0b;
}

.filter-lazy-loading::after {
    content: '📦';
    position: absolute;
    top: 2px;
    left: 2px;
    font-size: 10px;
    opacity: 0.7;
}

/* Performance indicators */
.performance-indicator {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #3b82f6;
    color: white;
    font-size: 10px;
    padding: 2px 4px;
    border-radius: 4px;
    z-index: 10;
    font-weight: 600;
}

.performance-indicator.fast {
    background: #10b981;
}

.performance-indicator.slow {
    background: #ef4444;
}

.performance-indicator.cached {
    background: #8b5cf6;
}

/* Memory usage warning */
.memory-warning {
    position: fixed;
    top: 10px;
    right: 10px;
    background: #fef3cd;
    border: 1px solid #f59e0b;
    color: #92400e;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    z-index: 1000;
    animation: slideInFromTop 0.3s ease-out;
}

/* Offline mode styling */
.offline-mode {
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    border-color: #9ca3af;
}

.offline-mode::before {
    content: '📴';
    position: absolute;
    top: 4px;
    left: 4px;
    font-size: 12px;
    opacity: 0.7;
}

/* Request queue indicator */
.request-queue-indicator {
    position: fixed;
    bottom: 10px;
    left: 10px;
    background: #3b82f6;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    z-index: 1000;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

/* Lazy loading progress */
.lazy-loading-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: #e5e7eb;
    overflow: hidden;
}

.lazy-loading-progress::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, #3b82f6, transparent);
    animation: lazyLoadingSlide 2s infinite;
}

@keyframes lazyLoadingSlide {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* Performance stats tooltip */
.performance-stats-tooltip {
    position: absolute;
    background: #1f2937;
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 11px;
    z-index: 1000;
    max-width: 200px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.performance-stats-tooltip::before {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 4px solid transparent;
    border-top-color: #1f2937;
}

/* ===== MOBILE RESPONSIVE DESIGN ===== */

/* Ultra-Compact Mobile Layout */
@media (max-width: 768px) {
    /* Maintain single row on mobile with smaller elements */
    #hierarchical-filter-banner {
        padding: 6px 8px;
        margin: 8px;
        min-height: 36px;
        max-height: 36px;
    }

    .filter-container {
        gap: 6px;
        height: 24px;
    }

    .filter-controls {
        gap: 6px;
        height: 24px;
    }

    .filter-group {
        min-width: 100px;
        max-width: 130px;
        height: 24px;
    }

    .filter-dropdown {
        height: 24px;
        font-size: 11px;
        padding: 2px 6px;
        padding-right: 20px;
        min-width: 100px;
        max-width: 130px;
    }

    .filter-actions {
        gap: 4px;
        height: 24px;
    }

    #clear-all-filters,
    #refresh-filters {
        height: 24px;
        font-size: 10px;
        padding: 2px 6px;
        min-width: 50px;
        gap: 2px;
    }

    .filter-group .absolute i {
        font-size: 8px;
    }

    .filter-group::before {
        font-size: 9px;
        top: -16px;
    }
}

    .filter-dropdown {
        width: 100%;
        height: 44px; /* Touch-friendly height */
        font-size: 16px; /* Prevent zoom on iOS */
        padding: 12px 16px;
        border-radius: 8px;
        border: 2px solid #e5e7eb;
        background: #ffffff;
        -webkit-appearance: none;
        -moz-appearance: none;
        appearance: none;
        background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
        background-repeat: no-repeat;
        background-position: left 12px center;
        background-size: 20px;
        padding-left: 44px;
    }

    /* RTL adjustments for mobile */
    [dir="rtl"] .filter-dropdown {
        background-position: right 12px center;
        padding-right: 44px;
        padding-left: 16px;
    }

    /* Action buttons mobile layout */
    .filter-actions {
        flex-direction: column;
        gap: 8px;
        width: 100%;
        margin-top: 16px;
    }

    .filter-actions button {
        width: 100%;
        height: 44px;
        font-size: 16px;
        padding: 12px 16px;
        border-radius: 8px;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
    }

    /* Breadcrumb mobile layout */
    .filter-breadcrumb {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        margin-top: 12px;
        padding: 12px;
        background: #f8fafc;
        border-radius: 8px;
        font-size: 14px;
    }

    .breadcrumb-item {
        display: flex;
        align-items: center;
        gap: 6px;
        padding: 4px 8px;
        background: #ffffff;
        border-radius: 6px;
        border: 1px solid #e5e7eb;
        width: 100%;
        justify-content: space-between;
    }

    .breadcrumb-separator {
        display: none; /* Hide separators on mobile */
    }

    /* Status bar mobile */
    #filter-status-bar {
        position: fixed;
        bottom: 60px; /* Position above footer */
        left: 0;
        right: 0;
        margin: 0;
        border-radius: 0;
        border-left: none;
        border-right: none;
        border-bottom: none;
        z-index: 1050;
    }

    /* Loading states mobile */
    .filter-loading-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        display: flex;
        align-items: center;
        justify-content: center;
        z-index: 9999;
    }

    .filter-loading-content {
        background: white;
        padding: 24px;
        border-radius: 12px;
        text-align: center;
        max-width: 280px;
        margin: 20px;
    }

    /* Touch-friendly interactive elements */
    .filter-clear-btn,
    .filter-refresh-btn {
        min-height: 44px;
        min-width: 44px;
        padding: 12px;
        border-radius: 8px;
        touch-action: manipulation;
    }

    /* Collapsible filter section */
    .filter-toggle-btn {
        display: block;
        width: 100%;
        height: 44px;
        background: #3b82f6;
        color: white;
        border: none;
        border-radius: 8px;
        font-size: 16px;
        font-weight: 600;
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0 16px;
        margin-bottom: 12px;
        touch-action: manipulation;
    }

    .filter-toggle-icon {
        transition: transform 0.3s ease;
    }

    .filter-toggle-btn.collapsed .filter-toggle-icon {
        transform: rotate(180deg);
    }

    .filter-content {
        transition: max-height 0.3s ease, opacity 0.3s ease;
        overflow: hidden;
    }

    .filter-content.collapsed {
        max-height: 0;
        opacity: 0;
    }

    .filter-content.expanded {
        max-height: 1000px;
        opacity: 1;
    }
}

/* Tablet styles */
@media (min-width: 769px) and (max-width: 1024px) {
    #hierarchical-filter-banner {
        padding: 16px;
        margin: 12px;
    }

    .filter-container {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 16px;
    }

    .filter-group {
        flex: 1;
        min-width: 200px;
        max-width: 300px;
    }

    .filter-dropdown {
        height: 40px;
        font-size: 15px;
        padding: 10px 14px;
    }

    .filter-actions {
        flex-direction: row;
        gap: 12px;
        margin-top: 16px;
    }

    .filter-actions button {
        height: 40px;
        padding: 10px 16px;
        font-size: 14px;
    }

    .filter-breadcrumb {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 8px;
        margin-top: 12px;
    }

    .breadcrumb-item {
        padding: 6px 12px;
        border-radius: 6px;
        font-size: 14px;
    }
}

/* Large mobile devices (landscape) */
@media (max-width: 768px) and (orientation: landscape) {
    .filter-container {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .filter-group {
        flex: 1;
        min-width: 200px;
        margin-bottom: 8px;
    }

    .filter-actions {
        flex-direction: row;
        margin-top: 12px;
    }

    .filter-actions button {
        flex: 1;
        height: 40px;
        font-size: 14px;
    }
}

/* Small mobile devices */
@media (max-width: 480px) {
    #hierarchical-filter-banner {
        margin: 4px;
        padding: 8px;
        border-radius: 6px;
    }

    .filter-group label {
        font-size: 13px;
        margin-bottom: 4px;
    }

    .filter-dropdown {
        height: 42px;
        font-size: 15px;
        padding: 10px 14px;
    }

    .filter-actions button {
        height: 42px;
        font-size: 15px;
        padding: 10px 14px;
    }

    .filter-breadcrumb {
        font-size: 13px;
        padding: 8px;
    }

    .breadcrumb-item {
        padding: 6px 10px;
        font-size: 13px;
    }

    /* Compact status messages */
    #filter-status-bar {
        padding: 8px 12px;
        font-size: 14px;
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    .filter-dropdown:focus {
        outline: 2px solid #3b82f6;
        outline-offset: 2px;
    }

    .filter-actions button:active {
        transform: scale(0.98);
        transition: transform 0.1s ease;
    }

    .breadcrumb-item:active {
        background: #e5e7eb;
        transition: background 0.1s ease;
    }

    /* Increase touch targets */
    .filter-clear-individual {
        min-height: 44px;
        min-width: 44px;
        padding: 12px;
    }
}

/* High DPI displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .filter-dropdown {
        border-width: 1px;
    }

    .breadcrumb-item {
        border-width: 1px;
    }
}

/* Mobile-specific component styles */
.mobile-layout {
    transition: all 0.3s ease;
}

.mobile-device .filter-dropdown {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-size: 20px;
    background-position: left 12px center;
    padding-left: 44px;
}

[dir="rtl"] .mobile-device .filter-dropdown {
    background-position: right 12px center;
    padding-right: 44px;
    padding-left: 16px;
}

.mobile-dropdown.touch-active {
    background-color: #f3f4f6;
    transform: scale(0.98);
    transition: all 0.1s ease;
}

.mobile-dropdown.mobile-focused {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    outline: none;
}

/* Mobile loading overlay */
.mobile-loading {
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}

.mobile-spinner {
    font-size: 24px;
    color: #3b82f6;
    margin-bottom: 12px;
}

.mobile-loading-text {
    font-size: 16px;
    color: #374151;
    font-weight: 500;
}

/* Mobile error messages */
.mobile-error-message {
    animation: slideUpMobile 0.3s ease-out;
}

.mobile-error-content {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #dc2626;
}

.mobile-error-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.mobile-error-text {
    flex: 1;
    font-size: 14px;
    line-height: 1.4;
}

.mobile-error-close {
    background: none;
    border: none;
    color: #dc2626;
    font-size: 16px;
    padding: 4px;
    border-radius: 4px;
    cursor: pointer;
    flex-shrink: 0;
}

.mobile-error-close:hover {
    background: rgba(220, 38, 38, 0.1);
}

@keyframes slideUpMobile {
    from {
        opacity: 0;
        transform: translateY(100%);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Touch feedback */
.touch-active {
    background-color: #f3f4f6 !important;
    transform: scale(0.98);
    transition: all 0.1s ease;
}

/* Landscape mode optimizations */
.landscape-mode {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 12px;
}

.landscape-mode .filter-group {
    flex: 1;
    min-width: 150px;
    max-width: 200px;
}

/* Portrait mode optimizations */
.portrait-mode {
    flex-direction: column;
    gap: 12px;
}

.portrait-mode .filter-group {
    width: 100%;
}

/* Mobile status bar */
.mobile-status-bar {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    margin: 0 !important;
    border-radius: 0 !important;
    border-left: none !important;
    border-right: none !important;
    border-bottom: none !important;
    z-index: 1000 !important;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.1);
}

/* Tablet-specific styles */
.tablet-device .filter-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.tablet-device .filter-actions {
    grid-column: 1 / -1;
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-top: 16px;
}

/* Accessibility improvements for mobile */
@media (prefers-reduced-motion: reduce) {
    .mobile-layout * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Dark mode support for mobile */
@media (prefers-color-scheme: dark) {
    .mobile-device #hierarchical-filter-banner {
        background: #1f2937;
        border-color: #374151;
        color: #f9fafb;
    }

    .mobile-device .filter-dropdown {
        background: #374151;
        border-color: #4b5563;
        color: #f9fafb;
    }

    .mobile-device .filter-toggle-btn {
        background: #1e40af;
        color: #f9fafb;
    }

    .mobile-loading-content {
        background: #1f2937;
        color: #f9fafb;
    }
}

/* Print styles - hide filters on print */
@media print {
    #hierarchical-filter-banner,
    .mobile-error-message,
    .mobile-loading-overlay {
        display: none !important;
    }
}

/* Reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
    .filter-toggle-icon,
    .filter-content,
    .mobile-dropdown,
    .touch-active {
        transition: none !important;
        animation: none !important;
    }
}

/* ===== ACCESSIBILITY FEATURES ===== */

/* Screen reader only content */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Show screen reader content when focused */
.sr-only:focus,
.focus\:not-sr-only:focus {
    position: static;
    width: auto;
    height: auto;
    padding: inherit;
    margin: inherit;
    overflow: visible;
    clip: auto;
    white-space: normal;
}

/* Skip links */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: #3b82f6;
    color: white;
    padding: 8px 16px;
    text-decoration: none;
    border-radius: 0 0 4px 4px;
    z-index: 1000;
    font-weight: 600;
    transition: top 0.3s ease;
}

.skip-link:focus {
    top: 0;
}

/* High contrast mode support */
.high-contrast-mode #hierarchical-filter-banner {
    border: 2px solid #000 !important;
    background: #fff !important;
    color: #000 !important;
}

.high-contrast-mode .filter-dropdown {
    border: 2px solid #000 !important;
    background: #fff !important;
    color: #000 !important;
}

.high-contrast-mode .filter-dropdown:focus {
    outline: 3px solid #000 !important;
    outline-offset: 2px !important;
}

.high-contrast-mode .filter-actions button {
    border: 2px solid #000 !important;
    background: #fff !important;
    color: #000 !important;
}

.high-contrast-mode .filter-actions button:focus {
    outline: 3px solid #000 !important;
    outline-offset: 2px !important;
}

/* Focus indicators */
.filter-dropdown:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

.filter-actions button:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

/* Keyboard navigation indicators */
.filter-dropdown[aria-expanded="true"] {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* ARIA live region styling */
#filter-announcements {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* Status indicators for screen readers */
.filter-status {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* Enhanced focus styles for better visibility */
.filter-group:focus-within {
    background: rgba(59, 130, 246, 0.05);
    border-radius: 6px;
    padding: 4px;
    margin: -4px;
}

/* Disabled state accessibility */
.filter-dropdown:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background-color: #f9fafb;
    color: #6b7280;
}

.filter-dropdown:disabled:focus {
    outline: 2px solid #9ca3af;
    outline-offset: 2px;
}

/* Loading state accessibility */
.filter-dropdown.loading-state {
    background-image: none;
    cursor: wait;
}

.filter-dropdown.loading-state:focus {
    outline-color: #f59e0b;
}

/* Error state accessibility */
.filter-dropdown.error-state {
    border-color: #ef4444;
    background-color: #fef2f2;
}

.filter-dropdown.error-state:focus {
    outline-color: #ef4444;
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.1);
}

/* Success state accessibility */
.filter-dropdown.success-state {
    border-color: #10b981;
    background-color: #f0fdf4;
}

.filter-dropdown.success-state:focus {
    outline-color: #10b981;
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.1);
}

/* RTL accessibility improvements */
[dir="rtl"] .skip-link {
    left: auto;
    right: 6px;
}

[dir="rtl"] .filter-dropdown {
    text-align: right;
}

/* Keyboard navigation help */
.keyboard-help {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #1f2937;
    color: white;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 12px;
    z-index: 1000;
    max-width: 300px;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.keyboard-help.show {
    opacity: 1;
    transform: translateY(0);
}

[dir="rtl"] .keyboard-help {
    right: auto;
    left: 20px;
}

/* Color contrast improvements */
@media (prefers-contrast: high) {
    .filter-dropdown {
        border-width: 2px;
        border-color: #000;
    }

    .filter-actions button {
        border-width: 2px;
        border-color: #000;
    }

    .filter-breadcrumb {
        border-width: 2px;
        border-color: #000;
    }
}

/* Motion sensitivity */
.reduced-motion * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
}

/* Touch target size compliance (minimum 44px) */
@media (pointer: coarse) {
    .filter-dropdown {
        min-height: 44px;
        padding: 12px 16px;
    }

    .filter-actions button {
        min-height: 44px;
        min-width: 44px;
        padding: 12px 16px;
    }
}

/* Voice control support */
.filter-dropdown[aria-label] {
    /* Ensure voice control can identify elements */
}

.filter-actions button[aria-label] {
    /* Ensure voice control can identify buttons */
}

/* Responsive Design */
@media (max-width: 768px) {
    #hierarchical-filter-banner .container {
        padding-left: 16px;
        padding-right: 16px;
    }

    .filter-dropdown-container {
        margin-bottom: 12px;
    }

    .filter-dropdown {
        min-width: 140px;
        font-size: 13px;
    }

    #clear-all-filters,
    #refresh-filters {
        padding: 6px 12px;
        font-size: 13px;
    }

    .filter-breadcrumb-item {
        font-size: 12px;
        padding: 3px 6px;
    }
}

@media (max-width: 640px) {
    #hierarchical-filter-banner .flex {
        flex-direction: column;
        align-items: stretch;
    }

    #hierarchical-filter-banner .gap-4 {
        gap: 12px;
    }

    .filter-dropdown {
        width: 100%;
        min-width: auto;
    }

    #filter-breadcrumbs {
        margin-top: 8px;
        justify-content: center;
    }
}

/* Wider spacing for all links with icons */
a i.fas {
    margin-left: 1rem;
}

/* Even more spacing for specific button icons */
a.inline-flex i.fa-play,
a.inline-flex i.fa-arrow-right {
    margin-left: 2.5rem !important;
}

/* Add some spacing to the status cards links */
.border-right-blue a i.fas {
    margin-left: 1.25rem;
}

/* ========================================
   LOGO SIZING AND RTL FIXES
   ======================================== */

/* Consistent logo sizing for RTL layout */
img[src*="logo.png"],
img[alt*="Logo"],
img[alt*="logo"] {
    max-height: 2rem !important;
    width: auto !important;
    object-fit: contain !important;
}

/* Header logo RTL spacing */
nav img[src*="logo.png"],
header img[src*="logo.png"] {
    max-height: 1.5rem !important;
    margin-left: 0.5rem !important;
    margin-right: 0.5rem !important;
}

/* RTL-specific logo positioning */
[dir="rtl"] nav img[src*="logo.png"],
[dir="rtl"] header img[src*="logo.png"] {
    margin-left: 0.5rem !important;
    margin-right: 0 !important;
}

/* Login page logo for RTL */
[dir="rtl"] .login img[src*="logo.png"],
[dir="rtl"] [class*="login"] img[src*="logo.png"] {
    max-height: 3rem !important;
    margin: 0 auto !important;
}

/* ========================================
   LOGO TEXT VERTICAL SCROLL FIXES
   ======================================== */

/* Prevent vertical scroll in logo text */
nav span,
header span,
nav a span,
header a span {
    line-height: 1.2 !important;
    max-height: 2rem !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    display: inline-block !important;
    vertical-align: middle !important;
}

/* Arabic text specific fixes */
[dir="rtl"] nav span,
[dir="rtl"] header span {
    font-family: 'Tajawal', sans-serif !important;
    line-height: 1.1 !important;
    max-height: 1.5rem !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
}

/* Self-center spans (logo text) */
nav span[class*="self-center"],
header span[class*="self-center"] {
    font-size: 1.125rem !important; /* text-lg */
    line-height: 1.1 !important;
    max-height: 1.5rem !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    vertical-align: middle !important;
}

/* RTL specific text adjustments */
[dir="rtl"] nav span[class*="self-center"],
[dir="rtl"] header span[class*="self-center"] {
    font-family: 'Tajawal', sans-serif !important;
    font-weight: 600 !important;
    letter-spacing: 0.025em !important;
}

/* Mobile responsive text sizing */
@media (max-width: 768px) {
    nav span[class*="self-center"],
    header span[class*="self-center"] {
        font-size: 1rem !important; /* text-base */
        max-height: 1.25rem !important;
        line-height: 1.1 !important;
    }
}

@media (max-width: 480px) {
    nav span[class*="self-center"],
    header span[class*="self-center"] {
        font-size: 0.875rem !important; /* text-sm */
        max-height: 1rem !important;
        line-height: 1 !important;
    }

    /* Hide logo text on very small screens if needed */
    nav span[class*="self-center"],
    header span[class*="self-center"] {
        display: none !important;
    }
}

/* ========================================
   RTL SCROLLBAR POSITIONING FIXES
   ======================================== */

/* CRITICAL: Remove left scrollbar, keep right scrollbar only */
html {
    scrollbar-gutter: stable !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
}

body {
    overflow-y: hidden !important;
    overflow-x: hidden !important;
}

/* RTL-specific scrollbar styling */
[dir="rtl"] html {
    scrollbar-width: thin !important;
    scrollbar-color: #cbd5e1 #f8fafc !important;
}

/* Webkit scrollbar styling for RTL */
[dir="rtl"] html::-webkit-scrollbar {
    width: 8px !important;
    height: 0px !important;
}

[dir="rtl"] html::-webkit-scrollbar-track {
    background: #f8fafc !important;
    border-radius: 4px !important;
    margin: 2px !important;
}

[dir="rtl"] html::-webkit-scrollbar-thumb {
    background: #cbd5e1 !important;
    border-radius: 4px !important;
    border: 1px solid #e2e8f0 !important;
}

[dir="rtl"] html::-webkit-scrollbar-thumb:hover {
    background: #94a3b8 !important;
}

[dir="rtl"] html::-webkit-scrollbar-thumb:active {
    background: #64748b !important;
}

/* Ensure no scrollbars on body or containers */
[dir="rtl"] body,
[dir="rtl"] .container,
[dir="rtl"] .container-fluid,
[dir="rtl"] .main-content,
[dir="rtl"] .content-wrapper {
    overflow-y: visible !important;
    overflow-x: hidden !important;
}

/* Table scrollbar positioning */
[dir="rtl"] .table-responsive {
    scrollbar-width: thin !important;
    scrollbar-color: #cbd5e1 #f8fafc !important;
    overflow-y: hidden !important;
    overflow-x: auto !important;
}

[dir="rtl"] .table-responsive::-webkit-scrollbar {
    width: 0px !important;
    height: 6px !important;
}

[dir="rtl"] .table-responsive::-webkit-scrollbar-track {
    background: #f8fafc !important;
    border-radius: 3px !important;
}

[dir="rtl"] .table-responsive::-webkit-scrollbar-thumb {
    background: #cbd5e1 !important;
    border-radius: 3px !important;
}

/* Modal scrollbar fixes */
[dir="rtl"] .modal-body {
    scrollbar-width: thin !important;
    scrollbar-color: #cbd5e1 #f8fafc !important;
}

[dir="rtl"] .modal-body::-webkit-scrollbar {
    width: 6px !important;
    height: 0px !important;
}

[dir="rtl"] .modal-body::-webkit-scrollbar-track {
    background: #f8fafc !important;
    border-radius: 3px !important;
}

[dir="rtl"] .modal-body::-webkit-scrollbar-thumb {
    background: #cbd5e1 !important;
    border-radius: 3px !important;
}

/* Navigation - no scrollbars */
[dir="rtl"] nav,
[dir="rtl"] header,
[dir="rtl"] .navbar,
[dir="rtl"] .nav {
    overflow: visible !important; /* Was hidden: ensures notification badge isn't clipped */
}

/* Notification popup scrollbar */
[dir="rtl"] .notification-modal-overlay .modal-container {
    scrollbar-width: thin !important;
}

[dir="rtl"] .notification-modal-overlay .modal-container::-webkit-scrollbar {
    width: 6px !important;
}

/* Supply chain specific scrollbar fixes */
[dir="rtl"] .supply-chain-tabs .nav-tabs {
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
}

[dir="rtl"] .supply-chain-tabs .nav-tabs::-webkit-scrollbar {
    display: none !important;
}

/* ========================================
   COMPREHENSIVE HORIZONTAL OVERFLOW FIXES
   ======================================== */

/* COMPREHENSIVE CONTAINER AND LAYOUT FIXES */
.container,
.container-fluid,
.container-sm,
.container-md,
.container-lg,
.container-xl,
.container-xxl {
    overflow-x: hidden !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    padding-left: 15px !important;
    padding-right: 15px !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

/* Bootstrap row and column fixes */
.row {
    margin-left: 0 !important;
    margin-right: 0 !important;
    max-width: 100% !important;
    overflow-x: hidden !important;
}

.col,
.col-1, .col-2, .col-3, .col-4, .col-5, .col-6,
.col-7, .col-8, .col-9, .col-10, .col-11, .col-12,
.col-sm, .col-sm-1, .col-sm-2, .col-sm-3, .col-sm-4, .col-sm-5, .col-sm-6,
.col-sm-7, .col-sm-8, .col-sm-9, .col-sm-10, .col-sm-11, .col-sm-12,
.col-md, .col-md-1, .col-md-2, .col-md-3, .col-md-4, .col-md-5, .col-md-6,
.col-md-7, .col-md-8, .col-md-9, .col-md-10, .col-md-11, .col-md-12,
.col-lg, .col-lg-1, .col-lg-2, .col-lg-3, .col-lg-4, .col-lg-5, .col-lg-6,
.col-lg-7, .col-lg-8, .col-lg-9, .col-lg-10, .col-lg-11, .col-lg-12,
.col-xl, .col-xl-1, .col-xl-2, .col-xl-3, .col-xl-4, .col-xl-5, .col-xl-6,
.col-xl-7, .col-xl-8, .col-xl-9, .col-xl-10, .col-xl-11, .col-xl-12 {
    padding-left: 8px !important;
    padding-right: 8px !important;
    max-width: 100% !important;
    overflow-x: hidden !important;
    box-sizing: border-box !important;
}

/* TABLE LAYOUT FIXES - PREVENT HORIZONTAL OVERFLOW */
.table-responsive {
    overflow-x: auto !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    margin: 0 !important;
    padding: 0 !important;
}

.table {
    width: 100% !important;
    max-width: 100% !important;
    table-layout: fixed !important;
    box-sizing: border-box !important;
    margin-bottom: 0 !important;
}

.table th,
.table td {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    white-space: normal !important;
    max-width: 0 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

/* MODAL FIXES - PREVENT VIEWPORT OVERFLOW */
.modal,
.modal-dialog,
.modal-content {
    max-width: 100% !important;
    overflow-x: hidden !important;
    box-sizing: border-box !important;
}

.modal-dialog {
    margin: 1rem auto !important;
    max-width: min(90vw, 800px) !important;
    width: 100% !important;
}

.modal-body {
    max-width: 100% !important;
    overflow-x: hidden !important;
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
}

/* FORM ELEMENT FIXES */
.form-control,
.form-select,
input,
select,
textarea {
    max-width: 100% !important;
    box-sizing: border-box !important;
}

/* NAVIGATION AND HEADER FIXES */
nav,
.navbar,
.nav {
    max-width: 100% !important;
    overflow-x: hidden !important;
    box-sizing: border-box !important;
}

/* CARD AND COMPONENT FIXES */
.card,
.card-body,
.card-header,
.card-footer {
    max-width: 100% !important;
    overflow-x: hidden !important;
    box-sizing: border-box !important;
}

/* BUTTON AND ACTION FIXES */
.btn,
.button,
button {
    max-width: 100% !important;
    box-sizing: border-box !important;
    white-space: nowrap !important;
}

/* FLEX LAYOUT FIXES */
.d-flex,
.flex,
.flex-row,
.flex-column {
    max-width: 100% !important;
    overflow-x: hidden !important;
    box-sizing: border-box !important;
}

/* GRID LAYOUT FIXES */
.grid,
.d-grid {
    max-width: 100% !important;
    overflow-x: hidden !important;
    box-sizing: border-box !important;
}

/* TEXT AND CONTENT FIXES */
p, h1, h2, h3, h4, h5, h6, span, div {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
}

/* IMAGE AND MEDIA FIXES */
img,
video,
iframe,
embed,
object {
    max-width: 100% !important;
    height: auto !important;
    box-sizing: border-box !important;
}

/* SPECIFIC COMPONENT FIXES */
.notification-modal-overlay,
.modal-overlay {
    max-width: 100vw !important;
    overflow-x: hidden !important;
}

.notification-modal-overlay .modal-container {
    max-width: min(90vw, 600px) !important;
    margin: 1rem auto !important;
    box-sizing: border-box !important;
}

/* SUPPLY CHAIN SPECIFIC FIXES */
.work-order-spare-parts-section,
.spare-parts-table-container,
.section-header {
    max-width: 100% !important;
    overflow-x: hidden !important;
    box-sizing: border-box !important;
}

/* MOBILE RESPONSIVE FIXES */
@media (max-width: 768px) {
    .container,
    .container-fluid {
        padding-left: 10px !important;
        padding-right: 10px !important;
    }

    .modal-dialog {
        margin: 0.5rem !important;
        max-width: calc(100vw - 1rem) !important;
    }

    .table {
        font-size: 0.8rem !important;
    }

    .btn {
        font-size: 0.9rem !important;
        padding: 0.5rem 1rem !important;
    }
}

@media (max-width: 480px) {
    .container,
    .container-fluid {
        padding-left: 5px !important;
        padding-right: 5px !important;
    }

    .modal-dialog {
        margin: 0.25rem !important;
        max-width: calc(100vw - 0.5rem) !important;

/* ===== High-priority overrides for Global Filter (icon-only buttons, wider dropdowns) ===== */
#hierarchical-filter-banner #clear-all-filters,
#hierarchical-filter-banner #refresh-filters {
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
    width: 28px !important; height: 28px !important;
    min-width: 28px !important; max-width: 28px !important;
    padding: 0 !important;
}
#hierarchical-filter-banner #clear-all-filters:hover,
#hierarchical-filter-banner #refresh-filters:hover,
#hierarchical-filter-banner #clear-all-filters:active,
#hierarchical-filter-banner #refresh-filters:active {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    transform: none !important;
}
#hierarchical-filter-banner #clear-all-filters i { color: #ef4444 !important; }
#hierarchical-filter-banner #refresh-filters i { color: #16a34a !important; }

/* Ensure a small visual gap around each dropdown so rounded borders are fully visible */
#hierarchical-filter-banner .filter-group,
#hierarchical-filter-banner .filter-dropdown-container {
    margin-inline: 3px !important; /* RTL-safe left/right spacing */
}
/* Prevent any clipping of the dropdown rounded corners (especially left edge) */
#hierarchical-filter-banner .filter-dropdown-container,
#hierarchical-filter-banner .filter-group,
#hierarchical-filter-banner .filter-dropdown-wrapper,
#hierarchical-filter-banner .filter-dropdown-wrapper > .relative {
    overflow: visible !important;
}
#hierarchical-filter-banner .filter-dropdown {
    position: relative !important;
    z-index: 1 !important;
    margin-left: 2px; /* tiny breathing room on the left so the border is fully visible */
}
/* Wider containers to show full text + arrow */
#hierarchical-filter-banner #franchise-filter-container,
#hierarchical-filter-banner #company-filter-container,
#hierarchical-filter-banner #service-center-filter-container {
    width: 208px !important;
    min-width: 192px !important;
    max-width: 240px !important;
}
#hierarchical-filter-banner #franchise-filter,
#hierarchical-filter-banner #company-filter,
#hierarchical-filter-banner #service-center-filter {
    max-width: 208px !important;
    min-width: 192px !important;
    padding-right: 34px !important; /* clear room for chevron/spinner */
}
#hierarchical-filter-banner .relative > .pointer-events-none,
#hierarchical-filter-banner [id$='-loading'] {
    width: 26px !important;
    right: 0 !important;
    justify-content: center !important;
}

    }
}