/**
 * Header Styles - أنماط الهيدر الاحترافي
 * يتم التحكم بالألوان من backend/settings/appearance.php
 */

/* ========================================
   Main Header
======================================== */
.main-header {
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    height: var(--header-height, 80px);
    z-index: 1000;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-light);
    transition: all var(--transition-normal);
    background-color: attr(data-header-color);
}

/* تطبيق لون الهيدر من قاعدة البيانات في الوضع الليلي */
[data-theme="dark"] .main-header,
:root:not([data-theme="light"]) .main-header {
    background-color: var(--dark-header-color, #1a1a1a);
}

.header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    max-width: var(--container-max-width, 1400px);
    margin: 0 auto;
    padding: 0 2rem;
    gap: 2rem;
}

/* ========================================
   Header Right - Logo Only
======================================== */
.header-right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

/* ========================================
   Header Center - Logo & Search
======================================== */
.header-center {
    display: flex;
    align-items: center;
    gap: 2rem;
    flex: 1;
    justify-content: center;
}

/* Logo - مقاس عالمي متعارف عليه */
.logo-link {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

.logo-link:hover {
    transform: scale(1.02);
}

.logo-img {
    height: 70px;
    min-width: 120px;
    width: auto;
    max-width: 300px;
    object-fit: contain;
}

.logo-text {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
}

.logo-icon {
    font-size: 1.5rem;
}

/* Search */
.search-wrapper {
    flex: 1;
    max-width: 500px;
}

.search-form {
    width: 100%;
}

.search-input-group {
    position: relative;
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 50px;
    transition: all var(--transition-normal);
}

.search-input-group:focus-within {
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.search-icon {
    position: absolute;
    right: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.1rem;
    pointer-events: none;
    z-index: 1;
    transition: color 0.3s ease;
}

.search-input-group:focus-within .search-icon {
    color: rgba(255, 255, 255, 0.9);
}

.search-input {
    flex: 1;
    padding: 0.875rem 3rem 0.875rem 3.5rem;
    background: transparent;
    color: var(--text-primary);
    font-size: 0.9375rem;
    text-align: right;
}

.search-input::placeholder {
    color: var(--text-muted);
}

.search-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 45px;
    height: 45px;
    margin: 3px;
    border-radius: 50%;
    color: white;
    font-size: 1rem;
    transition: all var(--transition-normal);
}

.search-btn:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-md);
}

/* ========================================
   Live Search Dropdown
======================================== */
.search-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.98), rgba(30, 41, 59, 0.98));
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 16px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.4),
                0 0 0 1px rgba(255, 255, 255, 0.05) inset;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    max-height: 400px;
}

.search-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.search-dropdown-header {
    padding: 12px 16px;
    background: rgba(99, 102, 241, 0.1);
    border-bottom: 1px solid rgba(99, 102, 241, 0.15);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.search-dropdown-title {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
    display: flex;
    align-items: center;
    gap: 8px;
}

.search-dropdown-title i {
    color: var(--primary-color);
}

.search-dropdown-count {
    font-size: 0.75rem;
    background: var(--primary-color);
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
}

.search-dropdown-list {
    list-style: none;
    padding: 8px;
    margin: 0;
    max-height: 320px;
    overflow-y: auto;
}

.search-dropdown-list::-webkit-scrollbar {
    width: 6px;
}

.search-dropdown-list::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

.search-dropdown-list::-webkit-scrollbar-thumb {
    background: rgba(99, 102, 241, 0.3);
    border-radius: 3px;
}

.search-dropdown-item {
    margin-bottom: 4px;
}

.search-dropdown-item:last-child {
    margin-bottom: 0;
}

.search-dropdown-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 12px;
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.search-dropdown-link::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(139, 92, 246, 0.05));
    opacity: 0;
    transition: opacity 0.2s ease;
}

.search-dropdown-link:hover::before,
.search-dropdown-link:focus::before {
    opacity: 1;
}

.search-dropdown-link:hover,
.search-dropdown-link:focus {
    transform: translateX(-4px);
}

.search-item-image {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    overflow: hidden;
    flex-shrink: 0;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(139, 92, 246, 0.15));
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
    border: 1px solid rgba(99, 102, 241, 0.2);
}

.search-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 11px;
}

.search-item-image i {
    font-size: 1.25rem;
    color: rgba(255, 255, 255, 0.5);
}

/* عرض الأيقونة بدلاً من الصورة */
.search-item-image .icon-display,
.search-item-image .icon-fallback {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.3), rgba(139, 92, 246, 0.2));
}

.search-item-image .icon-display i,
.search-item-image .icon-fallback i {
    font-size: 1.3rem;
    color: #a5b4fc;
}

/* ألوان مختلفة حسب النوع */
.search-dropdown-item.main_category .search-item-image {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.3), rgba(99, 102, 241, 0.2));
    border-color: rgba(139, 92, 246, 0.3);
}

.search-dropdown-item.main_category .search-item-image .icon-display i {
    color: #c4b5fd;
}

.search-dropdown-item.sub_category .search-item-image {
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.3), rgba(8, 145, 178, 0.2));
    border-color: rgba(6, 182, 212, 0.3);
}

.search-dropdown-item.sub_category .search-item-image .icon-display i {
    color: #67e8f9;
}

.search-dropdown-item.ad_page .search-item-image {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.3), rgba(5, 150, 105, 0.2));
    border-color: rgba(16, 185, 129, 0.3);
}

.search-dropdown-item.ad_page .search-item-image .icon-display i {
    color: #6ee7b7;
}

.search-dropdown-item.ad .search-item-image {
    background: linear-gradient(135deg, rgba(251, 146, 60, 0.3), rgba(234, 88, 12, 0.2));
    border-color: rgba(251, 146, 60, 0.3);
}

.search-item-content {
    flex: 1;
    min-width: 0;
    position: relative;
    z-index: 1;
}

.search-item-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #f1f5f9;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
    gap: 6px;
}

.search-item-title .featured-badge {
    font-size: 0.65rem;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 700;
}

.search-item-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.6);
}

.search-item-category {
    display: flex;
    align-items: center;
    gap: 4px;
}

.search-item-category i {
    font-size: 0.7rem;
    color: var(--primary-color);
}

.search-item-price {
    color: #10b981;
    font-weight: 600;
}

.search-dropdown-footer {
    padding: 12px 16px;
    background: rgba(99, 102, 241, 0.05);
    border-top: 1px solid rgba(99, 102, 241, 0.1);
    text-align: center;
}

.search-view-all {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--primary-color);
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    padding: 8px 20px;
    border-radius: 20px;
    background: rgba(99, 102, 241, 0.1);
    transition: all 0.3s ease;
}

.search-view-all:hover {
    background: var(--primary-color);
    color: white;
    transform: scale(1.02);
}

.search-dropdown-empty {
    padding: 30px 20px;
    text-align: center;
    color: rgba(255, 255, 255, 0.6);
}

.search-dropdown-empty i {
    font-size: 2.5rem;
    margin-bottom: 12px;
    opacity: 0.4;
}

.search-dropdown-empty p {
    margin: 0;
    font-size: 0.9rem;
}

/* شارات نوع النتيجة */
.type-badge {
    position: absolute;
    bottom: -4px;
    right: -4px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6rem;
    color: white;
    border: 2px solid rgba(15, 23, 42, 0.9);
}

.type-badge.main-cat {
    background: linear-gradient(135deg, #8b5cf6, #6366f1);
}

.type-badge.sub-cat {
    background: linear-gradient(135deg, #06b6d4, #0891b2);
}

/* تمييز الفئات في القائمة */
.search-dropdown-item.main_category .search-item-price,
.search-dropdown-item.sub_category .search-item-price {
    color: #a5b4fc;
    font-weight: 500;
}

.search-dropdown-item.main_category .search-dropdown-link,
.search-dropdown-item.sub_category .search-dropdown-link {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.08), rgba(139, 92, 246, 0.05));
}

.search-dropdown-item.main_category .search-dropdown-link:hover,
.search-dropdown-item.sub_category .search-dropdown-link:hover {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(139, 92, 246, 0.1));
}

/* تمييز الصفحات الإعلانية */
.search-dropdown-item.ad_page .search-item-price {
    color: #6ee7b7;
    font-weight: 500;
}

.search-dropdown-item.ad_page .search-dropdown-link {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.08), rgba(5, 150, 105, 0.05));
}

.search-dropdown-item.ad_page .search-dropdown-link:hover {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(5, 150, 105, 0.1));
}

.type-badge.ad-page {
    background: linear-gradient(135deg, #10b981, #059669);
}

.search-dropdown-loading {
    padding: 30px 20px;
    text-align: center;
}

.search-loading-spinner {
    width: 30px;
    height: 30px;
    border: 3px solid rgba(99, 102, 241, 0.2);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 10px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ========================================
   Header Left - Action Buttons
======================================== */
.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* ========================================
   Theme Toggle - تصميم جذاب
======================================== */
.theme-toggle-btn {
    position: relative;
    width: 70px;
    height: 36px;
    padding: 0;
    background: transparent;
    cursor: pointer;
}

.theme-toggle-track {
    position: relative;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1e3a5f 0%, #0f172a 100%);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 50px;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.3);
}

.theme-toggle-btn:hover .theme-toggle-track {
    border-color: var(--primary-color);
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.3), inset 0 2px 10px rgba(0, 0, 0, 0.3);
}

/* أيقونات الخلفية */
.theme-toggle-icons {
    position: absolute;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 10px;
}

.theme-toggle-icons .sun-icon {
    color: #fbbf24;
    font-size: 0.9rem;
    opacity: 0.4;
    transition: all 0.3s ease;
}

.theme-toggle-icons .moon-icon {
    color: #60a5fa;
    font-size: 0.85rem;
    opacity: 1;
    transition: all 0.3s ease;
}

/* الكرة المتحركة */
.theme-toggle-thumb {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 28px;
    height: 28px;
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    border-radius: 50%;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 10px rgba(59, 130, 246, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-toggle-thumb .thumb-icon-light,
.theme-toggle-thumb .thumb-icon-dark {
    position: absolute;
    font-size: 0.8rem;
    transition: all 0.3s ease;
}

.theme-toggle-thumb .thumb-icon-light {
    color: #fbbf24;
    opacity: 0;
    transform: rotate(-90deg) scale(0);
}

.theme-toggle-thumb .thumb-icon-dark {
    color: #ffffff;
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

/* الوضع النهاري */
[data-theme="light"] .theme-toggle-track {
    background: linear-gradient(135deg, #87ceeb 0%, #60a5fa 100%);
    border-color: rgba(255, 255, 255, 0.5);
}

[data-theme="light"] .theme-toggle-thumb {
    right: auto;
    left: 4px;
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    box-shadow: 0 2px 10px rgba(251, 191, 36, 0.5);
}

[data-theme="light"] .theme-toggle-icons .sun-icon {
    opacity: 1;
}

[data-theme="light"] .theme-toggle-icons .moon-icon {
    opacity: 0.4;
}

[data-theme="light"] .theme-toggle-thumb .thumb-icon-light {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

[data-theme="light"] .theme-toggle-thumb .thumb-icon-dark {
    opacity: 0;
    transform: rotate(90deg) scale(0);
}

/* Action Buttons */
.header-action-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.25rem;
    border-radius: 50px;
    font-size: 0.875rem;
    font-weight: 600;
    transition: all var(--transition-normal);
}

.call-btn {
    background: rgba(99, 102, 241, 0.15);
    color: var(--primary-color);
    border: 1px solid rgba(99, 102, 241, 0.3);
}

.call-btn:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(99, 102, 241, 0.4);
}

.whatsapp-btn {
    background: rgba(37, 211, 102, 0.15);
    color: #25d366;
    border: 1px solid rgba(37, 211, 102, 0.3);
}

.whatsapp-btn:hover {
    background: #25d366;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(37, 211, 102, 0.4);
}

.header-action-btn i {
    font-size: 1rem;
}

/* ========================================
   Mobile Menu Toggle - تصميم عصري جديد
======================================== */
.mobile-menu-toggle {
    display: none;
    position: fixed;
    top: 15px;
    left: 15px;
    z-index: 10001;
    width: 48px;
    height: 48px;
    background: linear-gradient(145deg, rgba(30, 41, 59, 0.95) 0%, rgba(15, 23, 42, 0.98) 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.mobile-menu-toggle:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
    border-color: var(--primary-color);
}

.hamburger-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    width: 100%;
    height: 100%;
}

.hamburger-line {
    width: 22px;
    height: 2.5px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    border-radius: 3px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: center;
}

.mobile-menu-toggle.active {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-color: transparent;
}

.mobile-menu-toggle.active .hamburger-line {
    background: white;
}

.mobile-menu-toggle.active .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-toggle.active .hamburger-line:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.mobile-menu-toggle.active .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* ========================================
   Mobile Menu Overlay - تأثير ضبابي
======================================== */
.mobile-menu-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* ========================================
   Mobile Menu - تصميم عصري فاخر
======================================== */
.mobile-menu {
    display: none;
    position: fixed;
    top: 0;
    right: 0;
    width: 320px;
    height: 100vh;
    height: 100dvh;
    background: linear-gradient(180deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
    border-left: 1px solid rgba(255, 255, 255, 0.08);
    z-index: 10001;
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    overflow-x: hidden;
    flex-direction: column;
}

.mobile-menu::-webkit-scrollbar {
    width: 4px;
}

.mobile-menu::-webkit-scrollbar-track {
    background: transparent;
}

.mobile-menu::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.mobile-menu.active {
    transform: translateX(0);
}

/* رأس القائمة */
.mobile-menu-header {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15) 0%, rgba(236, 72, 153, 0.1) 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.mobile-header-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    opacity: 0.05;
}

.mobile-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: #f8fafc;
    z-index: 1;
}

.mobile-logo img {
    height: 45px;
    max-width: 150px;
    object-fit: contain;
}

.mobile-logo-text {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.2rem;
    font-weight: 700;
}

.mobile-menu-close {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border-radius: 10px;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    z-index: 1;
}

.mobile-menu-close:hover {
    background: #ef4444;
    color: white;
    transform: rotate(90deg);
}

/* صندوق البحث */
.mobile-search {
    padding: 1rem 1.5rem;
}

.mobile-search-box {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.mobile-search-box:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.mobile-search-icon {
    padding: 0 1rem;
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.9rem;
}

.mobile-search-box input {
    flex: 1;
    padding: 0.875rem 0;
    background: transparent;
    color: #f8fafc;
    font-size: 0.9rem;
}

.mobile-search-box input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.mobile-search-btn {
    width: 45px;
    height: 45px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.mobile-search-btn:hover {
    filter: brightness(1.1);
}

/* قسم التنقل */
.mobile-nav {
    padding: 1rem 0;
}

.mobile-nav-section {
    padding: 0 1.5rem;
}

.mobile-nav-title {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.4);
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 0.5rem 0;
    margin-bottom: 0.5rem;
}

.mobile-nav-title i {
    font-size: 0.8rem;
    color: var(--primary-color);
}

.mobile-nav-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.mobile-nav-list li {
    margin-bottom: 4px;
}

.mobile-nav-link {
    display: flex;
    align-items: center;
    padding: 0.875rem 1rem;
    color: #e2e8f0;
    border-radius: 12px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.mobile-nav-link::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 3px;
    height: 100%;
    background: linear-gradient(180deg, var(--primary-color), var(--secondary-color));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-nav-link:hover,
.mobile-nav-link.active {
    background: rgba(255, 255, 255, 0.05);
    color: white;
}

.mobile-nav-link:hover::before,
.mobile-nav-link.active::before {
    opacity: 1;
}

.nav-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(99, 102, 241, 0.1);
    border-radius: 10px;
    margin-left: 0.875rem;
    transition: all 0.3s ease;
}

.nav-icon i {
    font-size: 0.95rem;
    color: var(--primary-color);
}

.mobile-nav-link:hover .nav-icon {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
}

.mobile-nav-link:hover .nav-icon i {
    color: white;
}

.nav-text {
    flex: 1;
    font-size: 0.95rem;
    font-weight: 500;
}

.nav-arrow {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
}

.mobile-nav-link:hover .nav-arrow {
    color: var(--primary-color);
    transform: translateX(-3px);
}

/* قسم التواصل */
.mobile-contact-section {
    padding: 1rem 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.mobile-contact-grid {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.mobile-contact-btn {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    transition: all 0.3s ease;
}

.mobile-contact-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
}

.mobile-contact-btn.call {
    border-color: rgba(99, 102, 241, 0.3);
}

.mobile-contact-btn.call:hover {
    background: rgba(99, 102, 241, 0.15);
    border-color: var(--primary-color);
}

.mobile-contact-btn.whatsapp {
    border-color: rgba(37, 211, 102, 0.3);
}

.mobile-contact-btn.whatsapp:hover {
    background: rgba(37, 211, 102, 0.15);
    border-color: #25d366;
}

.contact-btn-icon {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    font-size: 1.2rem;
}

.mobile-contact-btn.call .contact-btn-icon {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
}

.mobile-contact-btn.whatsapp .contact-btn-icon {
    background: linear-gradient(135deg, #25d366, #128c7e);
    color: white;
}

.contact-btn-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.contact-btn-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #f8fafc;
}

.contact-btn-value {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
}

/* ========================================
   قسم تبديل المظهر - تصميم عصري جديد
======================================== */
.mobile-theme-section {
    padding: 1rem 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.mobile-theme-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 1rem 1.25rem;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(139, 92, 246, 0.05) 100%);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.mobile-theme-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.1) 0%, rgba(245, 158, 11, 0.05) 100%);
    opacity: 1;
    transition: opacity 0.4s ease;
}

[data-theme="dark"] .mobile-theme-card::before {
    opacity: 0;
}

.mobile-theme-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.2);
    border-color: var(--primary-color);
}

.theme-card-content {
    display: flex;
    align-items: center;
    gap: 1rem;
    z-index: 1;
}

.theme-card-icon {
    position: relative;
    width: 48px;
    height: 48px;
}

.theme-icon-wrapper {
    width: 100%;
    height: 100%;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    box-shadow: 0 4px 15px rgba(251, 191, 36, 0.4);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] .theme-icon-wrapper {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

.theme-icon-wrapper i {
    color: white;
    position: absolute;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.light-mode-icon {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

.dark-mode-icon {
    opacity: 0;
    transform: rotate(-90deg) scale(0.5);
}

[data-theme="dark"] .light-mode-icon {
    opacity: 0;
    transform: rotate(90deg) scale(0.5);
}

[data-theme="dark"] .dark-mode-icon {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

.theme-card-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    z-index: 1;
}

.theme-card-title {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
    font-weight: 500;
}

.theme-card-status {
    font-size: 1rem;
    font-weight: 600;
    color: #f8fafc;
}

.theme-card-status .light-text {
    display: inline;
}

.theme-card-status .dark-text {
    display: none;
}

[data-theme="dark"] .theme-card-status .light-text {
    display: none;
}

[data-theme="dark"] .theme-card-status .dark-text {
    display: inline;
}

/* مؤشر التبديل الجديد */
.theme-switch-indicator {
    z-index: 1;
}

.switch-track {
    width: 56px;
    height: 30px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 20px;
    padding: 3px;
    position: relative;
    transition: all 0.4s ease;
}

.switch-thumb {
    position: absolute;
    top: 3px;
    right: 3px;
    width: 24px;
    height: 24px;
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    border-radius: 50%;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.27, 1.55);
    box-shadow: 0 2px 10px rgba(251, 191, 36, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
}

.thumb-glow {
    width: 12px;
    height: 12px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    animation: pulse-glow 2s infinite;
}

@keyframes pulse-glow {
    0%, 100% {
        transform: scale(1);
        opacity: 0.6;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.3;
    }
}

[data-theme="dark"] .switch-thumb {
    right: calc(100% - 27px);
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    box-shadow: 0 2px 10px rgba(99, 102, 241, 0.5);
}

[data-theme="dark"] .switch-track {
    background: rgba(99, 102, 241, 0.2);
}

/* Light Mode للقسم */
[data-theme="light"] .mobile-theme-section {
    border-top-color: rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .mobile-theme-card {
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.1) 0%, rgba(245, 158, 11, 0.05) 100%);
    border-color: rgba(251, 191, 36, 0.3);
}

[data-theme="light"] .mobile-theme-card:hover {
    box-shadow: 0 8px 25px rgba(251, 191, 36, 0.2);
    border-color: #f59e0b;
}

[data-theme="light"] .theme-card-title {
    color: #64748b;
}

[data-theme="light"] .theme-card-status {
    color: #1e293b;
}

[data-theme="light"] .switch-track {
    background: rgba(0, 0, 0, 0.1);
}

/* ذيل القائمة */
.mobile-menu-footer {
    margin-top: auto;
    padding: 1.25rem 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    background: rgba(0, 0, 0, 0.2);
}

.mobile-footer-links {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.mobile-footer-links a {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
    transition: color 0.3s ease;
}

.mobile-footer-links a:hover {
    color: var(--primary-color);
}

.footer-divider {
    color: rgba(255, 255, 255, 0.2);
}

.mobile-footer-copy {
    text-align: center;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.3);
    margin: 0;
}

/* ========================================
   Light Mode - الوضع النهاري
======================================== */
[data-theme="light"] .main-header {
    /* استخدام لون الهيدر من قاعدة البيانات في الوضع النهاري أيضاً */
    background-color: var(--header-color, #1e293b);
    border-bottom-color: rgba(0, 0, 0, 0.1);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* عناصر الهيدر في الوضع النهاري */
[data-theme="light"] .logo-text {
    color: #f8fafc;
}

[data-theme="light"] .search-input-group {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.15);
}

[data-theme="light"] .search-input-group:focus-within {
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--primary-color);
}

[data-theme="light"] .search-input {
    color: #f8fafc;
}

[data-theme="light"] .search-input::placeholder {
    color: #94a3b8;
}

[data-theme="light"] .search-icon {
    color: #94a3b8;
}

[data-theme="light"] .theme-toggle-track {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.15);
}

[data-theme="light"] .call-btn {
    background: rgba(99, 102, 241, 0.15);
    border-color: rgba(99, 102, 241, 0.3);
}

[data-theme="light"] .whatsapp-btn {
    background: rgba(37, 211, 102, 0.15);
    border-color: rgba(37, 211, 102, 0.3);
}

/* Mobile Menu Light Mode */
[data-theme="light"] .mobile-menu-toggle {
    background: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);
    border-color: rgba(0, 0, 0, 0.08);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .hamburger-line {
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
}

[data-theme="light"] .mobile-menu {
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 50%, #ffffff 100%);
    border-left-color: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .mobile-menu-header {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.08) 0%, rgba(236, 72, 153, 0.05) 100%);
    border-bottom-color: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .mobile-logo {
    color: #1e293b;
}

[data-theme="light"] .mobile-search-box {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .mobile-search-box input {
    color: #1e293b;
}

[data-theme="light"] .mobile-search-box input::placeholder {
    color: #94a3b8;
}

[data-theme="light"] .mobile-search-icon {
    color: #94a3b8;
}

[data-theme="light"] .mobile-nav-title {
    color: #64748b;
}

[data-theme="light"] .mobile-nav-link {
    color: #475569;
}

[data-theme="light"] .mobile-nav-link:hover,
[data-theme="light"] .mobile-nav-link.active {
    background: rgba(99, 102, 241, 0.08);
    color: #1e293b;
}

[data-theme="light"] .nav-icon {
    background: rgba(99, 102, 241, 0.08);
}

[data-theme="light"] .nav-arrow {
    color: #94a3b8;
}

[data-theme="light"] .mobile-contact-section {
    border-top-color: rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .mobile-contact-btn {
    background: #ffffff;
    border-color: rgba(0, 0, 0, 0.08);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .contact-btn-label {
    color: #1e293b;
}

[data-theme="light"] .contact-btn-value {
    color: #64748b;
}

[data-theme="light"] .mobile-menu-footer {
    background: rgba(0, 0, 0, 0.02);
    border-top-color: rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .mobile-footer-links a {
    color: #64748b;
}

[data-theme="light"] .footer-divider {
    color: #cbd5e1;
}

[data-theme="light"] .mobile-footer-copy {
    color: #94a3b8;
}

/* ========================================
   Responsive
======================================== */
@media (max-width: 1024px) {
    .header-container {
        padding: 0 1.5rem;
        gap: 1.5rem;
    }
    
    .search-wrapper {
        max-width: 350px;
    }
    
    .btn-text {
        display: none;
    }
    
    .header-action-btn {
        padding: 0.6rem;
        border-radius: 50%;
    }
}

@media (max-width: 768px) {
    .main-header {
        height: 70px;
    }
    
    .header-right,
    .search-wrapper,
    .header-left {
        display: none;
    }
    
    .header-center {
        justify-content: flex-start;
    }
    
    .mobile-menu-toggle,
    .mobile-menu-overlay,
    .mobile-menu {
        display: flex;
    }
    
    .mobile-menu {
        display: block;
    }
}

@media (max-width: 480px) {
    .mobile-menu {
        width: 100%;
    }
}
