/* Directory Styles - تم نقله من directory.php */
/* ========================================== */

/* CSS Variables */
:root {
    --primary-color: #138275;
    --primary-hover: #0f6b5f;
    --primary-light: rgba(19,130,117,0.1);
    --secondary-color: #0891b2;
    --accent-color: #FFB347;
    --text-primary: #2c3e50;
    --text-secondary: #6c757d;
    --text-light: #95a5a6;
    --background: #f8f9fa;
    --white: #ffffff;
    --border-color: #e9ecef;
    --shadow: 0 4px 20px rgba(0,0,0,0.08);
    --shadow-hover: 0 8px 30px rgba(0,0,0,0.15);
    --shadow-strong: 0 10px 40px rgba(0,0,0,0.12);
    --border-radius: 16px;
    --border-radius-sm: 8px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --gradient-primary: linear-gradient(135deg, #1C9E97 0%, #009577 100%);
    --gradient-hero: linear-gradient(135deg, #138275 0%, #65BF83 50%, #4ECDC4 100%);
    --text-secondary: #64748b;
    --name-color:#FFB347;
}

/* Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Performance Optimizations */
* {
    -webkit-tap-highlight-color: transparent;
}

/* Font Loading States - حالات تحميل الخطوط */
.font-loading {
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.fonts-loaded {
    opacity: 1;
}

.fonts-fallback {
    /* Fallback fonts are already loaded */
}

/* Font Display Block - منع وميض الخطوط تماماً */
@font-face {
    font-family: 'Cairo';
    font-display: block;
}

@font-face {
    font-family: 'Inter';
    font-display: block;
}

/* Smooth Font Loading - تحميل سلس للخطوط */
.font-loading .hero-title,
.font-loading .hero-subtitle,
.font-loading .search-header h3 {
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.fonts-loaded .hero-title,
.fonts-loaded .hero-subtitle,
.fonts-loaded .search-header h3 {
    opacity: 1;
}

/* Prevent Font Flickering - منع وميض الخطوط */
.hero-title,
.hero-subtitle,
.search-header h3,
.contractor-name,
.contractor-type,
.contractor-location {
    font-family: 'Cairo', 'Segoe UI', 'Tahoma', 'Arial', sans-serif !important;
    font-display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    transition: none !important;
}

/* Hide text until fonts are loaded */
.font-loading .hero-title,
.font-loading .hero-subtitle,
.font-loading .search-header h3 {
    opacity: 0 !important;
    transition: opacity 0.5s ease !important;
}

/* Show text when fonts are loaded */
.fonts-loaded .hero-title,
.fonts-loaded .hero-subtitle,
.fonts-loaded .search-header h3 {
    opacity: 1 !important;
}

/* Fallback for older browsers */
.fonts-fallback .hero-title,
.fonts-fallback .hero-subtitle,
.fonts-fallback .search-header h3 {
    opacity: 1 !important;
}

/* Loading Animation - تأثير التحميل */
@keyframes fontLoadFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fonts-loaded .hero-title,
.fonts-loaded .hero-subtitle,
.fonts-loaded .search-header h3 {
    animation: fontLoadFadeIn 0.6s ease-out forwards;
}

/* Font Loading Progress Indicator */
.font-loading::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, #138275, #65BF83);
    z-index: 9999;
    animation: fontLoadingProgress 2s ease-in-out infinite;
}

@keyframes fontLoadingProgress {
    0% { transform: translateX(-100%); }
    50% { transform: translateX(0%); }
    100% { transform: translateX(100%); }
}

.fonts-loaded::before {
    display: none;
}

/* Force Font Rendering - إجبار عرض الخطوط */
.hero-title {
    font-weight: 800 !important;
    font-family: 'Cairo', 'Segoe UI', 'Tahoma', 'Arial', sans-serif !important;
    -webkit-font-smoothing: antialiased !important;
    -moz-osx-font-smoothing: grayscale !important;
    text-rendering: optimizeLegibility !important;
    font-display: block !important;
}

/* تم إزالة أنماط navbar-brand المتعارضة مع modern-header.php */

.search-header h3 {
    font-weight: 600 !important;
    font-family: 'Cairo', 'Segoe UI', 'Tahoma', 'Arial', sans-serif !important;
    -webkit-font-smoothing: antialiased !important;
    -moz-osx-font-smoothing: grayscale !important;
    font-display: block !important;
}

/* Additional Font Weight Fixes - إصلاحات إضافية لأوزان الخطوط */
.hero-subtitle {
    font-weight: 400 !important;
    font-family: 'Cairo', 'Segoe UI', 'Tahoma', 'Arial', sans-serif !important;
    font-display: block !important;
}

.contractor-name {
    font-weight: 600 !important;
    font-family: 'Cairo', 'Segoe UI', 'Tahoma', 'Arial', sans-serif !important;
    font-display: block !important;
}

.contractor-type {
    font-weight: 500 !important;
    font-family: 'Cairo', 'Segoe UI', 'Tahoma', 'Arial', sans-serif !important;
    font-display: block !important;
}

.contractor-location {
    font-weight: 400 !important;
    font-family: 'Cairo', 'Segoe UI', 'Tahoma', 'Arial', sans-serif !important;
    font-display: block !important;
}

/* Arabic Font Support - Cairo with correct weights */
/* Note: Google Fonts link in HTML already loads all weights */

/* Font Weight Fixes - إصلاح أوزان الخطوط */
.hero-title {
    font-weight: 800 !important;
    font-family: 'Cairo', 'Segoe UI', 'Tahoma', 'Arial', sans-serif !important;
    transition: font-family 0.3s ease;
}

/* تم إزالة أنماط navbar-brand المتعارضة مع modern-header.php */

.search-header h3 {
    font-weight: 600 !important;
    font-family: 'Cairo', 'Segoe UI', 'Tahoma', 'Arial', sans-serif !important;
    transition: font-family 0.3s ease;
}

/* Ensure Font Loading - ضمان تحميل الخطوط */
.hero-title,
.hero-subtitle,
.search-header h3 {
    font-family: 'Cairo', 'Segoe UI', 'Tahoma', 'Arial', sans-serif !important;
}

/* Override Any Conflicting CSS - تجاوز أي CSS متعارض */
.unified-fonts *,
.font-optimizations *,
.font-weight-fixes *,
.activities-font-override * {
    font-family: 'Cairo', 'Segoe UI', 'Tahoma', 'Arial', sans-serif !important;
}

/* Force Font Application - إجبار تطبيق الخطوط */
.hero-title,
.hero-subtitle,
.search-header h3,
.contractor-name,
.contractor-type,
.contractor-location,
.search-submit-btn,
.filters-toggle-btn,
.clear-filters-btn,
.load-more-btn,
.card-title,
.modal-title,
.badge {
    font-family: 'Cairo', 'Segoe UI', 'Tahoma', 'Arial', sans-serif !important;
    font-display: block !important;
}

/* Arabic Text Rendering */
* {
    font-variant-ligatures: common-ligatures;
    text-rendering: optimizeLegibility;
}

/* Global Font Anti-Flickering - منع وميض الخطوط عالمياً */
html, body {
    font-family: 'Cairo', 'Segoe UI', 'Tahoma', 'Arial', sans-serif !important;
    font-display: block !important;
}

/* Arabic Character Display */
.contractor-avatar,
.contractor-name,
.contractor-type,
.contractor-location {
    font-synthesis: none;
    font-kerning: auto;
    font-feature-settings: "liga", "kern";
}

/* Body Styles */
body {
    font-family: 'Cairo', 'Segoe UI', 'Tahoma', 'Arial', sans-serif;
    background: linear-gradient(135deg, #f8f9fa 0%, #e8f4f8 50%, #f0f8ff 100%);
    min-height: 100vh;
    color: var(--text-primary);
    direction: rtl;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    unicode-bidi: embed;
    text-rendering: optimizeLegibility;
    font-variant-ligatures: common-ligatures;
}

/* تم إزالة أنماط navbar المتعارضة مع modern-header.php */

/* Content Spacing for Fixed Header */
body {
    padding-top: 85px;
}

/* Content Spacing for Users with Modern Header */
body.has-modern-header {
    padding-top: 0;
}

body.has-modern-header .hero-section {
    margin-top: 0;
    padding-top: 2rem;
}

/* تم إزالة أنماط navbar-brand المتعارضة مع modern-header.php */

/* تم إزالة أنماط navbar-toggler المتعارضة مع modern-header.php */

/* تم إزالة أنماط navbar-collapse المتعارضة مع modern-header.php */

/* تم إزالة أنماط language-switcher المتعارضة مع modern-header.php */

/* تم إزالة أنماط Desktop Design المتعارضة مع modern-header.php */

/* تم إزالة أنماط Mobile Button Improvements المتعارضة مع modern-header.php */

/* تم إزالة أنماط Small Screen Improvements المتعارضة مع modern-header.php */

/* Hero Section */
.hero-section {
    background: var(--gradient-hero);
    padding: 4rem 0 6rem;
    text-align: center;
    color: white;
    position: relative;
    overflow: hidden;
    margin-top: 80px;
}

/* Hero Section with Site Mode Alert */
body:has(.site-mode-alert) .hero-section {
    margin-top: 60px;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="rgba(255,255,255,0.1)" stroke-width="0.5"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
    opacity: 0.3;
}

.verification-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    background: linear-gradient(135deg, #1e88e5 0%, #1565c0 100%);
    border-radius: 50%;
    color: white;
    font-size: 0.6rem;
    border: 2px solid white;
    box-shadow: 0 2px 8px rgba(30, 136, 229, 0.4), 0 1px 4px rgba(0, 0, 0, 0.1), inset 0 1px 2px rgba(255, 255, 255, 0.3);
    animation: pulse 2s infinite;
    margin-right: 0.4rem;
    vertical-align: middle;
    flex-shrink: 0;
    cursor: help;
    transition: all 0.3s ease;
}

.hero-content {
    position: relative;
    z-index: 2;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    text-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.hero-subtitle {
    font-size: 1.3rem;
    margin-bottom: 2rem;
    opacity: 0.95;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

/* Hero Section Responsive */
@media (max-width: 991px) {
    .hero-section {
        padding: 3rem 0 4rem;
    }

    .hero-title {
        font-size: 2.5rem;
    }

    .hero-subtitle {
        font-size: 1.1rem;
        margin-bottom: 1.5rem;
    }
}

@media (max-width: 576px) {
    .hero-section {
        padding: 2rem 0 3rem;
    }

    .hero-title {
        font-size: 2rem;
        margin-bottom: 1rem;
    }

    .hero-subtitle {
        font-size: 1rem;
        margin-bottom: 1rem;
        padding: 0 1rem;
    }
}

/* Search Section */
.search-section {
    background: white;
    margin-top: -3rem;
    margin-bottom: 3rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-strong);
    position: relative;
    z-index: 10;
}

.search-header {
    background: var(--gradient-primary);
    color: white;
    padding: 1.5rem;
    border-radius: var(--border-radius) var(--border-radius) 0 0;
    text-align: center;
}

.search-header h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
}

.search-form {
    padding: 2rem;
}

/* Main Search Container */
.main-search-container {
    margin-bottom: 2rem;
}

.main-search-input {
    position: relative;
    display: flex;
    align-items: center;
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 8px 30px rgba(19, 130, 117, 0.1);
    transition: all 0.3s ease;
}

.main-search-input:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 12px 40px rgba(19, 130, 117, 0.2);
}

.main-search-field {
    flex: 1;
    border: none;
    padding: 1.2rem 1.5rem;
    font-size: 1.1rem;
    outline: none;
    background: transparent;
    color: var(--text-primary);
    font-weight: 500;
    width: 100%;
}

.main-search-field::placeholder {
    color: var(--text-secondary);
    font-weight: 400;
}

.search-submit-btn {
    background: var(--gradient-primary);
    color: white;
    border: none;
    padding: 1.2rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-radius: 0 18px 18px 0;
    position: relative;
    z-index: 2;
}

.search-submit-btn:hover {
    background: var(--primary-hover);
    transform: scale(1.02);
}

.search-submit-btn:active {
    transform: scale(0.98);
}

/* Search Progress Bar */
.search-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 2px;
    background: linear-gradient(90deg, 
        var(--primary-color) 0%, 
        var(--secondary-color) 50%, 
        var(--primary-color) 100%);
    border-radius: 0 0 20px 20px;
    animation: searchProgress 3s infinite ease-in-out;
    opacity: 0.6;
}

@keyframes searchProgress {
    0% { 
        width: 0%; 
        transform: translateX(-100%);
    }
    50% { 
        width: 100%; 
        transform: translateX(0%);
    }
    100% { 
        width: 100%; 
        transform: translateX(100%);
    }
}

.main-search-input:hover .search-progress {
    opacity: 0.8;
    animation-duration: 2s;
}

.main-search-input:focus-within .search-progress {
    display: none;
}

/* Search Progress Mobile */
@media (max-width: 768px) {
    .search-progress {
        height: 3px;
        border-radius: 0 0 16px 16px;
    }
}

/* Secondary Filters */
.secondary-filters {
    border-top: 1px solid var(--border-color);
    padding-top: 1.5rem;
}

.filters-toggle {
    text-align: center;
    margin-bottom: 1rem;
}

.filters-toggle-btn {
    background: var(--primary-light);
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0 auto;
}

.filters-toggle-btn:hover {
    background: var(--primary-color);
    color: white;
}

.filters-badge {
    background: var(--accent-color);
    color: var(--text-primary);
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.2rem 0.5rem;
    border-radius: 50%;
    margin: 0 0.5rem;
    min-width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    animation: pulse 2s infinite;
}

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

.filters-toggle-btn.active .toggle-icon {
    transform: rotate(180deg);
}

.filters-content {
    max-height: 0;
    overflow: hidden;
    transition: all 0.4s ease;
    opacity: 0;
    display: flex;
    flex-direction: column;
}

.filters-content.show {
    max-height: 500px;
    opacity: 1;
    padding-top: 1rem;
    overflow: visible;
}

/* Filters Grid */
.filters-grid {
    display: grid;
    grid-template-columns: auto auto auto 2fr auto;
    align-items: end;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    order: 1;
}

/* Filter Items */
.filter-item {
    display: flex;
    flex-direction: column;
    position: relative;
}

.filter-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-label i {
    color: var(--primary-color);
    font-size: 1rem;
}

.filter-select, .filter-input {
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    transition: var(--transition);
    background: white;
    color: var(--text-primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.filter-select:focus, .filter-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.15rem rgba(19, 130, 117, 0.15);
    outline: none;
    transform: translateY(-1px);
}

.filter-select:hover, .filter-input:hover {
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Filter Select Styling */
.filter-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%23138275' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: left 0.8rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    padding-left: 8rem;
    cursor: pointer;
}

/* Filter Select Options */
.filter-select option {
    padding: 8px 12px;
    background: white;
    color: var(--text-primary);
    font-size: 0.9rem;
}

/* Filters Actions */
.filters-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: nowrap;
    flex-direction: row;
    align-items: center;
    border-top: 1px solid var(--border-color);
    padding-top: 1rem;
}

.btn-sm {
    padding: 0.6rem 1.2rem;
    font-size: 0.9rem;
}

.btn {
    padding: 0.75rem 2rem;
    border-radius: var(--border-radius-sm);
    font-weight: 600;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

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

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.btn-outline-secondary {
    background: transparent;
    color: var(--text-secondary);
    border: 2px solid var(--border-color);
}

.btn-outline-secondary:hover {
    background: var(--text-secondary);
    color: white;
}

/* Responsive Filters */
@media (max-width: 1200px) {
    .filters-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
}

@media (max-width: 900px) {
    .filters-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.8rem;
    }
    
    .filter-item {
        min-width: 0;
    }
    
    .filter-select, .activity-search-input {
        font-size: 0.9rem;
        padding: 0.7rem 2.5rem 0.7rem 0.8rem;
    }
}

@media (max-width: 768px) {
    .filters-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
        order: 1;
    }
    
    .filters-actions {
        flex-direction: row;
        order: 2;
        margin-top: 1rem;
        align-items: center;
    }
    
    .clear-filters-btn .clear-text {
        display: none;
    }
    
    .clear-filters-btn {
        padding: 0.75rem;
        min-width: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .filters-content {
        display: flex !important;
        flex-direction: column;
        max-height: none !important;
        overflow: visible !important;
        opacity: 1 !important;
    }
}

@media (max-width: 576px) {
    .filters-actions {
        margin-top: 1rem;
        gap: 0.8rem;
        flex-direction: row;
        align-items: center;
    }

    .filters-actions .btn {
        padding: 0.8rem 1rem;
        font-size: 0.9rem;
        justify-content: center;
    }
    
    .clear-filters-btn .clear-text {
        display: none;
    }
    
    .clear-filters-btn {
        padding: 0.75rem;
        min-width: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

/* Wide Screen Optimizations */
@media (min-width: 1400px) {
    .filters-grid {
        grid-template-columns: auto auto 1fr 2fr auto;
        gap: 2rem;
    }
    
    .filter-select, .activity-search-input {
        padding: 0.8rem 3.5rem 0.8rem 1.2rem;
        font-size: 1rem;
    }
}

/* Field Widths */
select[name=registration_type],
#verifiedFilter,
#wilayaFilter {
    width: 160px;
    max-width: 100%;
}

#domainFilter {
    width: 320px;
    max-width: 100%;
}

/* Field Padding */
select[name=registration_type],
#verifiedFilter,
#wilayaFilter {
    padding-right: 0.75rem;
    padding-left: 0.75rem;
}

/* Activity Dropdown */
.activity-dropdown-container {
    position: relative;
}

#activityDropdown {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    z-index: 1050;
}

#activityDropdown.show {
    display: block !important;
}

.activity-option {
    padding: 15px 20px;
    font-size: 0.9rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    min-height: 50px;
    display: flex;
    align-items: center;
    cursor: pointer;
}

.activity-option:hover {
    background-color: var(--primary-light);
    color: var(--primary-color);
}

.activity-option:last-child {
    border-bottom: none;
}

/* Activity Dropdown Scrollbar */
#activityDropdown::-webkit-scrollbar {
    width: 8px;
}

#activityDropdown::-webkit-scrollbar-track {
    background: #f1f1f1;
}

#activityDropdown::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}

#activityDropdown::-webkit-scrollbar-thumb:hover {
    background: var(--primary-hover);
}

/* Mobile Activity Dropdown */
@media (max-width: 768px) {
    #activityDropdown {
        position: fixed !important;
        left: 10px !important;
        right: 10px !important;
        top: auto !important;
        bottom: 20px !important;
        max-height: 60vh;
        border-radius: 12px;
        box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.3);
        z-index: 9999;
    }
    
    .activity-option {
        padding: 15px 20px;
        font-size: 0.9rem;
        border-bottom: 1px solid rgba(0, 0, 0, 0.1);
        min-height: 50px;
        display: flex;
        align-items: center;
    }

    #activityDropdown.show::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.3);
        z-index: -1;
    }
}

/* Domain Icons */
.filter-item:nth-child(1) .filter-label::before {
    content: "👔";
    margin-left: 0.5rem;
}

.filter-item:nth-child(2) .filter-label::before {
    content: "🏗️";
    margin-left: 0.5rem;
}

.filter-item:nth-child(3) .filter-label::before {
    content: "⚙️";
    margin-left: 0.5rem;
}

.filter-item:nth-child(4) .filter-label::before {
    content: "🌍";
    margin-left: 0.5rem;
}

/* Results Section */
.results-section {
    margin-bottom: 4rem;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.results-count {
    font-size: 1.1rem;
    color: var(--text-secondary);
}

.results-count strong {
    color: var(--primary-color);
    font-weight: 700;
}

/* Contractor Cards Grid */
.contractors-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
    padding: 10px 0;
}

/* Performance Optimizations */
.contractors-grid * {
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.contractor-card,
.contractor-avatar,
.contractor-name,
.social-link {
    contain: layout style paint;
}

/* Contractor Card */
.contractor-card {
	background: #ffffff;
	border-radius: 20px;
	box-shadow: 0 4px 12px rgba(19, 130, 117, 0.08);
	transition: transform 0.2s ease, box-shadow 0.2s ease;
	border: 1px solid rgba(19, 130, 117, 0.1);
	position: relative;
	will-change: transform;
	overflow: visible;
	margin: 8px 0;
	height: 100%;
	/* اجعل البطاقة حاوية عمودية لضمان تثبيت الفوتر في الأسفل */
	display: flex;
	flex-direction: column;
}

/* اجعل المحتوى قبل الفوتر يتمدد ليدفع الفوتر للأسفل */
.contractor-card > .card-header,
.contractor-card > .contractor-info {
	flex: 0 0 auto;
}

/* الفوتر يبقى في الأسفل عبر margin-top:auto في تعريفه الحالي */

.contractor-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-primary);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.contractor-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(19, 130, 117, 0.12);
}

.contractor-card:hover::before {
    opacity: 1;
}

.contractor-card:hover .card-footer {
    background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
}

.contractor-card:hover .social-link {
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(0,0,0,0.2);
}

/* Card Header */
.card-header {
    background: linear-gradient(135deg, #138275 0%, #65BF83 100%);
    color: white;
    padding: 1.2rem 1rem 1.2rem;
    text-align: center;
    position: relative;
    overflow: visible;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.1rem;
    border-radius: 20px 20px 0 0;
    min-height: 140px;
}

.card-header::before {
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="rgba(255,255,255,0.1)" stroke-width="1"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
    opacity: 1;
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    min-height: 214px;
}

/* Avatar Container */
.avatar-container {
    position: relative;
    width: 70px;
    height: 70px;
    margin: 0 auto 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.contractor-avatar {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 3px solid rgba(255,255,255,0.9);
    background: rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    text-decoration: none;
    color: white;
    font-family: 'Cairo', 'Segoe UI', 'Tahoma', 'Arial', sans-serif;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-variant-ligatures: common-ligatures;
    font-synthesis: none;
    font-kerning: auto;
}

.contractor-avatar:hover {
    transform: scale(1.03);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    border-color: rgba(255,255,255,1);
}

.contractor-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

/* Contractor Name */
.contractor-name {
    font-size: 1.1rem;
    font-weight: 700;
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: color 0.2s ease, transform 0.2s ease;
    text-decoration: none;
    color: inherit;
    text-align: center;
    line-height: 1.2;
}

.contractor-name-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    margin-bottom: 0.4rem;
    width: 100%;
}

.contractor-name:hover {
    color: var(--name-color);
    text-decoration: none;
}

.contractor-name-container:hover .contractor-name {
    color: var(--name-color);
}

/* Contractor Type */
.contractor-type {
    background: rgba(255,255,255,0.25);
    color: white;
    padding: 0.2rem 0.6rem;
    border-radius: 16px;
    font-size: 0.7rem;
    font-weight: 600;
    display: inline-block;
    border: 1px solid rgba(255,255,255,0.2);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.3rem;
    text-align: center;
    align-self: center;
}

/* Contractor Location */
.contractor-location {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.9);
    margin-top: 0.3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.2rem;
    background: rgba(255,255,255,0.15);
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    margin-left: auto;
    margin-right: auto;
    width: fit-content;
    align-self: center;
}

/* Rating Display */
.rating-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    margin-bottom: 0.8rem;
    padding: 0.4rem 0.8rem;
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.1) 0%, rgba(255, 152, 0, 0.05) 100%);
    border-radius: 16px;
    border: 1px solid rgba(255, 193, 7, 0.2);
    position: relative;
}

.stars {
    display: flex;
    gap: 0.05rem;
}

.star {
    color: #ffc107;
    font-size: 0.85rem;
    transition: all 0.2s ease;
}

.star.empty {
    color: #e9ecef;
}

.rating-text {
    font-size: 0.75rem;
    color: var(--text-primary);
    font-weight: 600;
    white-space: nowrap;
}

/* Card Body */
.card-body {
    padding: 1rem;
    padding-bottom: 0.5rem;
    flex: 1;
}

.contractor-card:not(.has-social) .card-body {
    padding-bottom: 1rem;
}

/* Contractor Activity */
.contractor-activity {
    font-size: 0.85rem;
    color: var(--text-primary);
    margin-bottom: 0.8rem;
    font-weight: 600;
    background: linear-gradient(135deg, var(--primary-light) 0%, rgba(19, 130, 117, 0.05) 100%);
    padding: 0.5rem 0.8rem;
    border-radius: 14px;
    text-align: center;
    border: 1px solid rgba(19, 130, 117, 0.1);
    position: relative;
    overflow: hidden;
}

/* Contractor Bio */
.contractor-bio {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.4;
    margin-bottom: 0.8rem;
    text-align: center;
    font-style: italic;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 0.6rem;
    border-radius: 12px;
    border-left: 3px solid var(--primary-color);
}

/* Contractor Info */
.contractor-info {
    margin-bottom: 1rem;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.4rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
    padding: 0.3rem 0.5rem;
    border-radius: 8px;
    background: rgba(248, 249, 250, 0.5);
}

.info-item i {
    width: 14px;
    color: var(--primary-color);
    font-size: 0.75rem;
}

.info-item i.fa-whatsapp {
    color: #25d366;
}

.whatsapp-number {
    color: #25d366;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    /* ضمان عرض الرقم من اليسار إلى اليمين دائماً */
    direction: ltr !important;
    text-align: left !important;
    unicode-bidi: bidi-override;
}

.whatsapp-number:hover {
    color: #128c7e;
    text-decoration: none;
    transform: translateX(-2px);
}

.phone-number {
    color: #007bff;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    /* ضمان عرض الرقم من اليسار إلى اليمين دائماً */
    direction: ltr !important;
    text-align: left !important;
    unicode-bidi: bidi-override;
}

.phone-number:hover {
    color: #0056b3;
    text-decoration: none;
    transform: translateX(-2px);
}

/* أنماط إضافية لضمان عرض الأرقام بشكل صحيح في جميع الحالات */
.info-item .whatsapp-number,
.info-item .phone-number {
    direction: ltr !important;
    text-align: left !important;
    unicode-bidi: bidi-override;
}

/* أنماط خاصة بالعناوين التي تحتوي على أرقام الهاتف */
.info-value .whatsapp-number,
.info-value .phone-number {
    direction: ltr !important;
    text-align: left !important;
    unicode-bidi: bidi-override;
}

/* أنماط للروابط التي تحتوي على أرقام الهاتف */
a.whatsapp-number,
a.phone-number {
    direction: ltr !important;
    text-align: left !important;
    unicode-bidi: bidi-override;
}

/* أنماط للعناصر المخفية التي تحتوي على أرقام الهاتف */
.hidden-number.whatsapp-number,
.hidden-number.phone-number {
    direction: ltr !important;
    text-align: left !important;
    unicode-bidi: bidi-override;
}

/* Card Footer */
.card-footer {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-top: 1px solid rgba(19, 130, 117, 0.1);
    padding: 0.8rem 1rem;
    border-radius: 0 0 20px 20px;
    margin-top: auto;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60px;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.card-footer {
    padding: 0.8rem 1rem;
    background: linear-gradient(135deg, #138275 0%, #65BF83 100%);
    border-top: 1px solid rgba(19, 130, 117, 0.1);
    text-align: center;
}

.card-footer::before {
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="rgba(255,255,255,0.1)" stroke-width="1"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
    opacity: 1;
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    min-height: 214px;
}

/* Social Links */
.social-links {
    display: flex;
    gap: 0.6rem;
    justify-content: center;
    flex-wrap: nowrap;
    align-items: center;
    width: 100%;
}

.social-link {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: white;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    border: 2px solid rgba(255,255,255,0.3);
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    flex-shrink: 0;
    backdrop-filter: blur(10px);
}

.social-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255,255,255,0.1);
    transition: opacity 0.3s ease;
    z-index: 1;
}

.social-link i {
    position: relative;
    z-index: 2;
}

.social-link:hover {
    transform: translateY(-3px) scale(1.1);
    box-shadow: 0 8px 25px rgba(0,0,0,0.3);
    color: white;
    text-decoration: none;
    border-color: rgba(255,255,255,0.5);
}

.social-link:hover::before {
    background: rgba(255,255,255,0.2);
}

/* Social Network Colors */
.social-link.whatsapp {
    background: linear-gradient(135deg, #25d366 0%, #128c7e 100%);
}

.social-link.whatsapp:hover {
    background: linear-gradient(135deg, #128c7e 0%, #075e54 100%);
    box-shadow: 0 8px 25px rgba(37, 211, 102, 0.4);
}

.social-link.facebook {
    background: linear-gradient(135deg, #1877f2 0%, #42a5f5 100%);
}

.social-link.facebook:hover {
    background: linear-gradient(135deg, #166fe5 0%, #1565c0 100%);
    box-shadow: 0 8px 25px rgba(24, 119, 242, 0.4);
}

.social-link.instagram {
    background: linear-gradient(135deg, #e4405f 0%, #fd1d1d 50%, #fcb045 100%);
}

.social-link.instagram:hover {
    background: linear-gradient(135deg, #fd1d1d 0%, #fcb045 50%, #833ab4 100%);
    box-shadow: 0 8px 25px rgba(228, 64, 95, 0.4);
}

.social-link.linkedin {
    background: linear-gradient(135deg, #0077b5 0%, #00a0dc 100%);
}

.social-link.linkedin:hover {
    background: linear-gradient(135deg, #005885 0%, #0077b5 100%);
    box-shadow: 0 8px 25px rgba(0, 119, 181, 0.4);
}

.social-link.twitter {
    background: linear-gradient(135deg, #1da1f2 0%, #0d8bd9 100%);
}

.social-link.twitter:hover {
    background: linear-gradient(135deg, #0d8bd9 0%, #0a6cb3 100%);
    box-shadow: 0 8px 25px rgba(29, 161, 242, 0.4);
}

.social-link.website {
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
}

.social-link.website:hover {
    background: linear-gradient(135deg, #495057 0%, #343a40 100%);
    box-shadow: 0 8px 25px rgba(108, 117, 125, 0.4);
}

.social-link.phone {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
}

.social-link.phone:hover {
    background: linear-gradient(135deg, #0056b3 0%, #004085 100%);
    box-shadow: 0 8px 25px rgba(0, 123, 255, 0.4);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .contractors-grid {
        grid-template-columns: 1fr;
        gap: 1.2rem;
    }

    .contractor-card {
        margin: 0 0.5rem;
    }

    .card-header {
        padding: 1rem 0.8rem 0.6rem;
    }

    .contractor-avatar {
        width: 60px;
        height: 60px;
    }

    .card-body {
        padding: 0.8rem;
    }

    .card-footer {
        padding: 0.6rem 0.8rem;
        min-height: 50px;
    }

    .card-footer .social-links {
        gap: 0.4rem;
        flex-wrap: wrap;
        justify-content: center;
        padding: 0 0.2rem;
    }

    .social-link {
        width: 32px;
        height: 32px;
        font-size: 0.85rem;
    }

    .results-header {
        flex-direction: column;
        text-align: center;
    }

    .search-section {
        margin-top: -2rem;
    }
}

@media (max-width: 576px) {
    .search-form {
        padding: 1rem;
    }

    .main-search-input {
        flex-direction: column;
        border-radius: 16px;
    }

    .search-icon {
        width: 100%;
        justify-content: center;
        padding: 1rem;
        border-radius: 16px 16px 0 0;
    }

    .main-search-field {
        padding: 1rem;
        text-align: center;
    }

    .search-submit-btn {
        width: 100%;
        justify-content: center;
        padding: 1rem;
        border-radius: 0 0 16px 16px;
    }

    .filters-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    select[name=registration_type],
    #verifiedFilter,
    #wilayaFilter {
        width: 100% !important;
        max-width: 100% !important;
    }

    .filters-actions {
        flex-direction: row;
        display: flex !important;
        opacity: 1 !important;
        max-height: none !important;
        visibility: visible !important;
        margin-top: 1rem;
        align-items: center;
        gap: 0.8rem;
    }
    
    .clear-filters-btn .clear-text {
        display: none;
    }
    
    .clear-filters-btn {
        padding: 0.75rem;
        min-width: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

/* Pagination */
.pagination-wrapper {
    display: flex;
    justify-content: center;
    margin-top: 3rem;
}

.pagination {
    display: flex;
    gap: 0.5rem;
    list-style: none;
}

.page-link {
    padding: 0.75rem 1rem;
    color: var(--primary-color);
    text-decoration: none;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    transition: var(--transition);
}

.page-link:hover, .page-link.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

.empty-icon {
    font-size: 4rem;
    color: var(--text-light);
    margin-bottom: 1rem;
}

.empty-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.empty-description {
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

/* Rating System */
.rating-star {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.85rem !important;
    cursor: pointer;
    filter: drop-shadow(0 1px 2px rgba(255, 193, 7, 0.3));
}

.rating-star:hover {
    transform: scale(1.2) rotate(10deg);
    filter: drop-shadow(0 2px 4px rgba(255, 193, 7, 0.5)) brightness(1.2);
}

.stars.not-logged-in .rating-star {
    cursor: not-allowed;
    opacity: 0.7;
}

.stars.not-logged-in .rating-star:hover {
    transform: none;
    filter: none;
}

/* Rating Message */
.rating-message {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(145deg, #ffffff 0%, #f8fffe 100%);
    padding: 2rem;
    border-radius: 20px;
    box-shadow: 
        0 20px 60px rgba(0,0,0,0.15),
        0 8px 24px rgba(0,0,0,0.1);
    z-index: 10000;
    border: 2px solid var(--primary-color);
    text-align: center;
    backdrop-filter: blur(10px);
    animation: messageSlideIn 0.3s ease-out;
}

@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translate(-50%, -60%) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

.rating-message.success {
    border-color: #28a745;
    background: linear-gradient(145deg, #f8fff9 0%, #e8f5e8 100%);
}

.rating-message.error {
    border-color: #dc3545;
    background: linear-gradient(145deg, #fff8f8 0%, #f5e8e8 100%);
}

.rating-message button {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border: none;
    border-radius: 12px;
    color: white;
    padding: 0.6rem 1.2rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.rating-message button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(19, 130, 117, 0.3);
}

/* Overlay */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(5px);
    z-index: 9999;
    animation: overlayFadeIn 0.3s ease-out;
}

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

/* Mobile Menu Styles */
.mobile-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1100;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-overlay.show {
    display: block;
    opacity: 1;
}

.mobile-menu {
    position: fixed;
    top: 0;
    left: -100%;
    width: 280px;
    height: 100vh;
    background: white;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.25);
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1200;
    padding: 1rem;
    overflow-y: auto;
}

.mobile-menu.show {
    left: 0;
}

.mobile-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e2e8f0;
    margin-bottom: 1rem;
}

.mobile-menu-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary-color);
    font-weight: 600;
    font-size: 1.1rem;
}

.mobile-menu-title i {
    font-size: 1.2rem;
}

.mobile-menu-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #1e293b;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.mobile-menu-close:hover {
    background: #f1f5f9;
    color: var(--primary-color);
}

.mobile-nav-links {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.mobile-nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    color: #64748b;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s ease;
    text-align: right;
    justify-content: flex-start;
}

.mobile-nav-link:hover,
.mobile-nav-link.active {
    background: rgba(28, 158, 151, 0.1);
    color: var(--primary-color);
}

.mobile-nav-link i {
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
}

/* Mobile Language Switcher */
.mobile-language-switcher {
    margin: 1rem 0;
    padding: 0;
    text-align: center;
}

.language-switcher-mobile {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    border-radius: 8px;
    color: var(--primary-color);
    justify-content: center;
}

.language-select-mobile {
    max-width: 120px;
    background: white;
    border: 1px solid #e2e8f0;
    color: #1e293b;
    border-radius: 6px;
    padding: 0.5rem;
    font-size: 0.9rem;
}

.language-select-mobile:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(28, 158, 151, 0.25);
}

/* Mobile Auth Buttons */
.mobile-auth-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid #e2e8f0;
}

.mobile-auth-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.3s ease;
    font-weight: 500;
    text-align: right;
    justify-content: flex-start;
}

.mobile-auth-btn.login-btn {
    color: #0891b2;
    background: rgba(8, 145, 178, 0.1);
    border: 1px solid rgba(8, 145, 178, 0.2);
}

.mobile-auth-btn.login-btn:hover {
    background: #0891b2;
    color: white;
}

.mobile-auth-btn.register-btn {
    color: white;
    background: var(--gradient-primary);
    border: 1px solid transparent;
}

.mobile-auth-btn.register-btn:hover {
    background: var(--gradient-secondary);
    transform: translateY(-1px);
}

.mobile-auth-btn i {
    font-size: 1rem;
}

/* Hide mobile menu on desktop */
@media (min-width: 992px) {
    .mobile-menu,
    .mobile-overlay {
        display: none !important;
    }
}

/* تم إزالة أنماط navbar-toggler المتعارضة مع modern-header.php */

/* Performance Optimizations */
.contractor-card,
.search-form,
.main-search-input,
.search-progress {
    will-change: transform, opacity;
}

/* Scrollbar Styling */

::-webkit-scrollbar-track {
    background: var(--border-color);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-hover);
}

/* Focus States */
.main-search-field:focus,
.filter-select:focus,
.filter-input:focus,
.btn:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Disabled States */
.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* Loading Spinner */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.contractor-card {
    animation: fadeInUp 0.5s ease-out;
}

/* Mobile Animation Disable */
@media (max-width: 768px) {
    .contractor-card {
        animation: none;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* GPU Optimizations */
.main-search-input,
.contractor-card,
.filters-toggle-btn {
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
}

/* Content Visibility */
.contractor-card {
    content-visibility: auto;
    contain-intrinsic-size: 0 400px;
}

/* Wide Screen Grid */
@media (min-width: 1200px) {
    .contractors-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Hover vs Touch */
@media (hover: hover) {
    .contractor-card:hover {
        transform: translateY(-3px);
    }
}

@media (hover: none) {
    .contractor-card:active {
        transform: scale(0.98);
    }
}

/* Additional Mobile Fixes */
@media (max-width: 768px) {
    .search-form {
        padding: 1.5rem;
    }

    .main-search-input {
        flex-direction: column;
        border-radius: 16px;
    }

    .search-icon {
        width: 100%;
        justify-content: center;
        padding: 1rem;
        border-radius: 16px 16px 0 0;
    }

    .main-search-field {
        padding: 1rem;
        text-align: center;
    }

    .search-submit-btn {
        width: 100%;
        justify-content: center;
        padding: 1rem;
        border-radius: 0 0 16px 16px;
    }

    .filters-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    select[name=registration_type],
    #verifiedFilter,
    #wilayaFilter {
        width: 100% !important;
        max-width: 100% !important;
    }

    .filters-actions {
        flex-direction: row;
        display: flex !important;
        opacity: 1 !important;
        max-height: none !important;
        visibility: visible !important;
        margin-top: 1rem;
        align-items: center;
        gap: 0.8rem;
    }
    
    .clear-filters-btn .clear-text {
        display: none;
    }
    
    .clear-filters-btn {
        padding: 0.75rem;
        min-width: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

/* Final Mobile Optimizations */
@media (max-width: 576px) {
    .search-form {
        padding: 1rem;
    }

    .filters-actions {
        display: flex !important;
        opacity: 1 !important;
        max-height: none !important;
        visibility: visible !important;
        margin-top: 1rem;
        gap: 0.8rem;
        order: 2;
        flex-direction: row;
        align-items: center;
    }
    
    .filters-grid {
        order: 1;
    }
    
    .filters-content {
        display: flex !important;
        flex-direction: column;
        max-height: none !important;
        overflow: visible !important;
        opacity: 1 !important;
    }

    .filters-actions .btn {
        padding: 0.8rem 1rem;
        font-size: 0.9rem;
    }

    .search-header {
        padding: 1rem;
    }

    .search-header h3 {
        font-size: 1.2rem;
    }

    .main-search-field {
        font-size: 1rem;
        padding: 1rem 1.2rem;
    }

    .main-search-field::placeholder {
        font-size: 0.9rem;
    }

    .search-submit-btn {
        font-size: 0.9rem;
        padding: 1rem 1.5rem;
    }

    .filters-toggle-btn {
        padding: 0.6rem 1.2rem;
        font-size: 0.9rem;
    }

    .filters-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .filter-select, .filter-input, .activity-search-input {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
        width: 100%;
    }

    .filter-select {
        padding-left: 2.5rem;
    }

    .activity-search-input {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
        width: 100% !important;
        min-width: 0;
    }

    .btn-sm {
        padding: 0.7rem 1rem;
        font-size: 0.85rem;
    }

    .contractor-card {
        margin: 0;
    }

    .pagination {
        gap: 0.25rem;
    }

    .page-link {
        padding: 0.5rem 0.75rem;
        font-size: 0.85rem;
    }

    .search-section {
        margin-top: -1.5rem;
    }

    .filter-item:nth-child(1) .filter-label::before,
    .filter-item:nth-child(2) .filter-label::before,
    .filter-item:nth-child(3) .filter-label::before,
    .filter-item:nth-child(4) .filter-label::before {
        font-size: 0.9rem;
        margin-left: 0.3rem;
    }
}

/* Ensure Filters Actions Visibility */
.filters-actions {
    display: flex !important;
    opacity: 1 !important;
    visibility: visible !important;
    max-height: none !important;
    overflow: visible !important;
    position: static !important;
    transform: none !important;
    clip: auto !important;
    clip-path: none !important;
    z-index: 1000 !important;
}

/* Final CSS Fixes for Mobile */
@media (max-width: 768px) {
    .filters-content {
        display: flex !important;
        flex-direction: column;
        max-height: none !important;
        overflow: visible !important;
        opacity: 1 !important;
    }
    
    .filters-actions {
        display: flex !important;
        opacity: 1 !important;
        max-height: none !important;
        visibility: visible !important;
        margin-top: 1rem;
        gap: 0.8rem;
        flex-direction: row;
        align-items: center;
    }
}

/* Complete the card-header::before rule */
.card-header::before {
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="rgba(255,255,255,0.1)" stroke-width="1"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
    opacity: 1;
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    min-height: 214px;
}

/* View Profile Button */
.btn-view-profile {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 0.6rem 1.2rem;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.85rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    position: relative;
    overflow: hidden;
    border: none;
    cursor: pointer;
}

.btn-view-profile::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.btn-view-profile:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 8px 24px rgba(19, 130, 117, 0.3);
    color: white;
}

.btn-view-profile:hover::before {
    left: 100%;
}

/* Card Lighting Effect */
.contractor-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 20% 50%, rgba(19, 130, 117, 0.03) 0%, transparent 50%);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.contractor-card:hover::after {
    opacity: 1;
}

/* Enhanced Responsive Design */
@media (max-width: 768px) {
    .search-form {
        padding: 1.5rem;
    }

    .main-search-input {
        flex-direction: column;
        border-radius: 16px;
    }

    .search-icon {
        width: 100%;
        justify-content: center;
        padding: 1rem;
        border-radius: 16px 16px 0 0;
    }

    .main-search-field {
        padding: 1rem;
        text-align: center;
    }

    .search-submit-btn {
        width: 100%;
        justify-content: center;
        padding: 1rem;
        border-radius: 0 0 16px 16px;
    }

    .filters-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    /* Make fields take full width on mobile */
    select[name=registration_type],
    #verifiedFilter,
    #wilayaFilter {
        width: 100% !important;
        max-width: 100% !important;
    }

    .filters-actions {
        flex-direction: row;
        display: flex !important;
        opacity: 1 !important;
        max-height: none !important;
        visibility: visible !important;
        margin-top: 1rem;
        align-items: center;
        gap: 0.8rem;
    }

    /* Hide text in clear filters button on mobile */
    .clear-filters-btn .clear-text {
        display: none;
    }

    .clear-filters-btn {
        padding: 0.75rem;
        min-width: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .contractors-grid {
        grid-template-columns: 1fr;
        gap: 1.2rem;
    }

    .contractor-card {
        margin: 0 0.5rem;
    }

    .card-header {
        padding: 1rem 0.8rem 0.6rem;
    }

    .contractor-avatar {
        width: 60px;
        height: 60px;
    }

    .card-body {
        padding: 0.8rem;
    }

    .card-footer {
        padding: 0.6rem 0.8rem;
        min-height: 50px;
    }

    .card-footer .social-links {
        gap: 0.4rem;
        flex-wrap: wrap;
        justify-content: center;
        padding: 0 0.2rem;
    }

    .social-link {
        width: 32px;
        height: 32px;
        font-size: 0.85rem;
    }

    .results-header {
        flex-direction: column;
        text-align: center;
    }

    .search-section {
        margin-top: -2rem;
    }
}

/* Enhanced Small Screen Optimizations */
@media (max-width: 576px) {
    .search-form {
        padding: 1rem;
    }

    .filters-actions {
        display: flex !important;
        opacity: 1 !important;
        max-height: none !important;
        visibility: visible !important;
        margin-top: 1rem;
        gap: 0.8rem;
        order: 2;
        flex-direction: row;
        align-items: center;
    }

    .filters-grid {
        order: 1;
    }

    .filters-content {
        display: flex !important;
        flex-direction: column;
        max-height: none !important;
        overflow: visible !important;
        opacity: 1 !important;
    }

    .filters-actions .btn {
        padding: 0.8rem 1rem;
        font-size: 0.9rem;
    }

    .search-header {
        padding: 1rem;
    }

    .search-header h3 {
        font-size: 1.2rem;
    }

    .main-search-field {
        font-size: 1rem;
        padding: 1rem 1.2rem;
    }

    .main-search-field::placeholder {
        font-size: 0.9rem;
    }

    .search-submit-btn {
        font-size: 0.9rem;
        padding: 1rem 1.5rem;
    }

    .filters-toggle-btn {
        padding: 0.6rem 1.2rem;
        font-size: 0.9rem;
    }

    .filters-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .filter-select, .filter-input, .activity-search-input {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
        width: 100%;
    }

    .filter-select {
        padding-left: 2.5rem;
    }

    .activity-search-input {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
        width: 100% !important;
        min-width: 0;
    }

    .btn-sm {
        padding: 0.7rem 1rem;
        font-size: 0.85rem;
    }

    .contractor-card {
        margin: 0;
    }

    .pagination {
        gap: 0.25rem;
    }

    .page-link {
        padding: 0.5rem 0.75rem;
        font-size: 0.85rem;
    }

    .search-section {
        margin-top: -1.5rem;
    }

    /* Improve domain icons for small devices */
    .filter-item:nth-child(1) .filter-label::before,
    .filter-item:nth-child(2) .filter-label::before,
    .filter-item:nth-child(3) .filter-label::before,
    .filter-item:nth-child(4) .filter-label::before {
        font-size: 0.9rem;
        margin-left: 0.3rem;
    }
}

/* Enhanced Animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.contractor-card {
    animation: fadeInUp 0.5s ease-out;
}

/* Performance Optimization for Animations */
.contractor-card, .search-form, .main-search-input, .search-progress {
    will-change: transform, opacity;
}

/* Performance Optimization for Small Screens */
@media (max-width: 768px) {
    .contractor-card {
        animation: none;
    }
}

/* Enhanced Scrollbar Styling */
::-webkit-scrollbar-track {
    background: var(--border-color);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-hover);
}

/* Page Transition Enhancement */
.page-transition {
    transition: all 0.3s ease;
}

/* Enhanced Focus States for Accessibility */
.main-search-field:focus, .filter-select:focus, .filter-input:focus, .btn:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Enhanced Disabled Button States */
.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* Enhanced Empty State Display */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-secondary);
}

.empty-state .empty-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: var(--text-light);
}

/* General Performance Optimization */
* {
    box-sizing: border-box;
}

img {
    max-width: 100%;
    height: auto;
}

/* Input Field Performance Optimization */
input, select, textarea {
    font-family: inherit;
}

/* Smooth Transition Enhancement */
* {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* GPU Performance Optimization */
.main-search-input, .contractor-card, .filters-toggle-btn {
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
}

/* Enhanced User Experience for Accessibility */
.main-search-field:focus, .filter-select:focus, .filter-input:focus {
    box-shadow: 0 0 0 3px rgba(19, 130, 117, 0.2);
    border-color: var(--primary-color);
}

/* Smooth Scrolling Enhancement */
html {
    scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Special Case Display Optimization */
.filters-content {
    contain: layout style paint;
}

/* Image Performance Optimization */
.contractor-avatar img {
    object-fit: cover;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

/* Animation Performance Enhancement */
@media (min-width: 769px) {
    .contractor-card {
        transition: transform 0.3s ease, box-shadow 0.3s ease;
    }

    .contractor-card:hover {
        transform: translateY(-5px);
        box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12);
    }
}

/* High DPI Device Performance Optimization */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .search-progress {
        height: 1px;
    }
}

/* Enhanced Loading Display */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* تم إزالة أنماط navbar المتعارضة مع modern-header.php */

/* Web Vitals Performance Optimization */
.main-search-input, .contractor-card, .search-progress {
    contain: layout style paint;
}

/* User Experience Speed Enhancement */
.contractor-card {
    content-visibility: auto;
    contain-intrinsic-size: 0 400px;
}

/* Large Screen Performance Optimization */
@media (min-width: 1200px) {
    .contractors-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Dark Mode Performance Optimization */
@media (prefers-color-scheme: dark) {
    .main-search-input {
        filter: brightness(0.95);
    }
}

/* Different Device Performance Optimization */
@media (hover: hover) {
    .contractor-card:hover {
        transform: translateY(-3px);
    }
}

@media (hover: none) {
    .contractor-card:active {
        transform: scale(0.98);
    }
}

/* Mobile Menu Styles - Similar to mobileMenu in chat.php */
.mobile-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1100;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-overlay.show {
    display: block;
    opacity: 1;
}

.mobile-menu {
    position: fixed;
    top: 0;
    left: -100%;
    width: 280px;
    height: 100vh;
    background: white;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.25);
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1200;
    padding: 1rem;
    overflow-y: auto;
}

.mobile-menu.show {
    left: 0;
}

.mobile-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e2e8f0;
    margin-bottom: 1rem;
}

.mobile-menu-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary-color);
    font-weight: 600;
    font-size: 1.1rem;
}

.mobile-menu-title i {
    font-size: 1.2rem;
}

.mobile-menu-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #1e293b;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.mobile-menu-close:hover {
    background: #f1f5f9;
    color: var(--primary-color);
}

.mobile-nav-links {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.mobile-nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    color: #64748b;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s ease;
    text-align: right;
    justify-content: flex-start;
}

.mobile-nav-link:hover,
.mobile-nav-link.active {
    background: rgba(28, 158, 151, 0.1);
    color: var(--primary-color);
}

.mobile-nav-link i {
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
}

/* Mobile Language Switcher */
.mobile-language-switcher {
    margin: 1rem 0;
    padding: 0;
    text-align: center;
}

.language-switcher-mobile {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    border-radius: 8px;
    color: var(--primary-color);
    justify-content: center;
}

.language-select-mobile {
    max-width: 120px;
    background: white;
    border: 1px solid #e2e8f0;
    color: #1e293b;
    border-radius: 6px;
    padding: 0.5rem;
    font-size: 0.9rem;
}

.language-select-mobile:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(28, 158, 151, 0.25);
}

/* Mobile Auth Buttons */
.mobile-auth-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid #e2e8f0;
}

.mobile-auth-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.3s ease;
    font-weight: 500;
    text-align: right;
    justify-content: flex-start;
}

.mobile-auth-btn.login-btn {
    color: #0891b2;
    background: rgba(8, 145, 178, 0.1);
    border: 1px solid rgba(8, 145, 178, 0.2);
}

.mobile-auth-btn.login-btn:hover {
    background: #0891b2;
    color: white;
}

.mobile-auth-btn.register-btn {
    color: white;
    background: var(--gradient-primary);
    border: 1px solid transparent;
}

.mobile-auth-btn.register-btn:hover {
    background: var(--gradient-secondary);
    transform: translateY(-1px);
}

.mobile-auth-btn i {
    font-size: 1rem;
}

/* Hide mobile menu on desktop */
@media (min-width: 992px) {
    .mobile-menu, .mobile-overlay {
        display: none !important;
    }
}

/* تم إزالة أنماط navbar-toggler المتعارضة مع modern-header.php */

/* CSS إضافي لضمان ترتيب صحيح للفلاتر على الجوال */
/* ضمان عدم وجود flex-direction معكوس في أي مكان */
.filters-content,
.filters-grid {
    flex-direction: column !important;
}

/* ضمان أن الأزرار في سطر واحد */
.filters-actions {
    flex-direction: row !important;
    display: flex !important;
    align-items: center !important;
    gap: 0.8rem !important;
}

/* ضمان ترتيب صحيح للعناصر */
.filters-grid {
    order: 1 !important;
}

.filters-actions {
    order: 2 !important;
}

/* إلغاء أي order معكوس */
.filters-content * {
    order: unset !important;
}

.filters-grid {
    order: 1 !important;
}

.filters-actions {
    order: 2 !important;
}

/* إخفاء النص في زر مسح الفلاتر في الجوال */
@media (max-width: 768px) {
    .clear-filters-btn .clear-text {
        display: none !important;
    }
    
    .clear-filters-btn {
        padding: 0.75rem !important;
        min-width: 44px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }
}


