/* ===================================================== */
/* ستايلات السايد بار الجانبي (Sidebar) - مستخدم في: index.php, cat.php, pro.php, cart.php */
/* ===================================================== */

/* ===== MOBILE SIDEBAR (Left Side) ===== */
/* السايد بار الرئيسي (القائمة الجانبية) - يظهر في جميع الصفحات الرئيسية */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    pointer-events: none;
}

.sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.sidebar {
    position: fixed;
    top: 0;
    left: -100%;
    width: clamp(300px, 90vw, 400px);
    height: 100vh;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(15px);
    z-index: 1000;
    transition: left 0.3s ease;
    overflow-y: auto;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.3);
}

.sidebar.active {
    left: 0;
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 var(--padding-md);
    height: clamp(50px, 8vh, 60px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.02);
}

.close-btn {
    background: none;
    border: none;
    color: #ffffff;
    font-size: clamp(1.2rem, 3vw, 1.5rem);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 4px;
    transition: background-color 0.3s ease;
}

.close-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* مربع البحث داخل السايد بار الرئيسي - يظهر في القائمة الجانبية للموبايل */
.sidebar-search {
    padding: var(--padding-md);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-search .search-box {
    width: 100%;
}

.sidebar-search .search-box input {
    width: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-lg);
    padding: var(--padding-sm) var(--padding-md) var(--padding-sm) clamp(2rem, 4vw, 2.5rem);
    color: #ffffff;
    font-size: var(--font-medium);
    transition: all 0.3s ease;
}

.sidebar-search .search-box input:focus {
    background: rgba(0, 0, 0, 0.7);
    border-color: rgba(255, 255, 255, 0.4);
    outline: none;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.1);
}

.sidebar-search .search-box input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.sidebar-search .search-box i {
    position: absolute;
    left: var(--padding-md);
    color: rgba(255, 255, 255, 0.8);
}

.sidebar-nav {
    padding: var(--padding-md) 0;
}

.sidebar-nav ul {
    list-style: none;
}

.sidebar-nav li {
    margin-bottom: 0.5rem;
}

.sidebar-nav a {
    display: block;
    padding: clamp(0.6rem, 1.5vw, 0.75rem) var(--padding-md);
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    border-radius: 4px;
    margin: 0 var(--spacing-xs);
    font-size: clamp(0.9rem, 1.8vw, 1rem);
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
    color: #ffffff;
    background-color: rgba(255, 255, 255, 0.1);
}

/* ===================================================== */
/* ستايلات سايد بار البحث (Search Sidebar) - مستخدم في: index.php, cat.php, ... */
/* ===================================================== */

.search-sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    pointer-events: none;
}

.search-sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.search-sidebar {
    position: fixed;
    top: 0;
    right: -100%;
    width: clamp(300px, 90vw, 400px);
    height: 100vh;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(15px);
    z-index: 1000;
    transition: right 0.3s ease;
    overflow-y: auto;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.3);
}

.search-sidebar.active {
    right: 0;
}

.search-sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    height: clamp(50px, 8vh, 60px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.02);
}

.search-sidebar-title {
    color: #ffffff;
    font-size: 18px;
    font-weight: 600;
    margin: 0;
}

.search-sidebar-close {
    background: none;
    border: none;
    color: #ffffff;
    font-size: 20px;
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
    transition: background-color 0.3s ease;
}

.search-sidebar-close:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.search-sidebar-content {
    padding: 20px;
}

.search-sidebar-input {
    width: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    padding: 12px 16px 12px 45px;
    color: #ffffff;
    font-size: 16px;
    transition: all 0.3s ease;
    margin-bottom: 20px;
    position: relative;
}

.search-sidebar-input:focus {
    background: rgba(0, 0, 0, 0.7);
    border-color: rgba(255, 255, 255, 0.4);
    outline: none;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.1);
}

.search-sidebar-input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.search-sidebar-input-container {
    position: relative;
    margin-bottom: 20px;
}

.search-sidebar-input-container i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.8);
    font-size: 16px;
    z-index: 1;
    pointer-events: none;
}

.search-sidebar-input-container .search-icon {
    position: absolute;
    left: 16px;
    top: 35%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.8);
    font-size: 16px;
    z-index: 1;
    pointer-events: none;
    transition: all 0.3s ease;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-sidebar-input-container .search-icon:hover {
    color: rgba(255, 255, 255, 1);
}

.search-sidebar-input:focus + .search-icon {
    color: rgba(0, 112, 243, 1);
}


/* ===================================================== */
/* ستايلات سايد بار المستخدم (User Sidebar) - مستخدم في: index.php, cat.php, ... */
/* ===================================================== */

.user-sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    pointer-events: none;
}

.user-sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.user-sidebar {
    position: fixed;
    top: 0;
    right: -100%;
    width: clamp(300px, 90vw, 400px);
    height: 100vh;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(15px);
    z-index: 1000;
    transition: right 0.3s ease;
    overflow-y: auto;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.3);
    /* ضمان عدم ظهور السايد بار تلقائياً */
    transform: translateX(0);
}

.user-sidebar.active {
    right: 0;
    transform: translateX(0);
}

.user-sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 clamp(15px, 2vw, 20px);
    height: clamp(50px, 8vh, 60px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.02);
}

.user-sidebar-close {
    background: none;
    border: none;
    color: #ffffff;
    font-size: clamp(18px, 2.5vw, 20px);
    cursor: pointer;
    padding: clamp(6px, 1vw, 8px);
    border-radius: 4px;
    transition: background-color 0.3s ease;
}

.user-sidebar-close:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.user-sidebar-title {
    color: #ffffff;
    font-size: clamp(16px, 2.5vw, 18px);
    font-weight: 600;
    margin: 0;
}

.user-profile-section {
    padding: clamp(20px, 3vw, 25px);
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.user-profile-avatar {
    width: clamp(50px, 8vw, 60px);
    height: clamp(50px, 8vw, 60px);
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto clamp(10px, 2vw, 15px);
    font-size: clamp(18px, 3vw, 22px);
    color: white;
    font-weight: 600;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.user-profile-name {
    color: #ffffff;
    font-size: clamp(14px, 2.5vw, 16px);
    font-weight: 600;
    margin-bottom: clamp(4px, 1vw, 6px);
}

.user-profile-type {
    color: rgba(255, 255, 255, 0.7);
    font-size: clamp(11px, 2vw, 12px);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: clamp(8px, 2vw, 10px);
}

.user-profile-verified {
    display: inline-block;
    background: rgba(40, 167, 69, 0.2);
    color: #28a745;
    padding: clamp(3px, 0.8vw, 4px) clamp(8px, 1.5vw, 10px);
    border-radius: 12px;
    font-size: clamp(10px, 2vw, 11px);
    font-weight: 500;
}

.user-sidebar-nav {
    padding: clamp(15px, 3vw, 20px) 0;
}

.user-sidebar-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.user-sidebar-nav li {
    margin-bottom: clamp(3px, 1vw, 4px);
}

.user-nav-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: clamp(12px, 2.5vw, 15px) clamp(15px, 3vw, 20px);
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    border-radius: 4px;
    margin: 0 clamp(8px, 2vw, 12px);
    font-size: clamp(13px, 2.5vw, 14px);
}

.user-nav-link:hover,
.user-nav-link.active {
    color: #ffffff;
    background-color: rgba(255, 255, 255, 0.1);
}

.user-nav-link-left {
    display: flex;
    align-items: center;
}

.user-nav-icon {
    width: clamp(16px, 3vw, 18px);
    margin-right: clamp(12px, 2.5vw, 15px);
    text-align: center;
    font-size: clamp(14px, 2.5vw, 16px);
}

.user-nav-text {
    font-size: clamp(13px, 2.5vw, 14px);
    font-weight: 500;
}

.user-nav-counter {
    background: #0070f3;
    color: white;
    padding: clamp(2px, 0.8vw, 3px) clamp(6px, 1.5vw, 8px);
    border-radius: 8px;
    font-size: clamp(10px, 2vw, 11px);
    font-weight: 600;
    min-width: clamp(16px, 3vw, 18px);
    text-align: center;
}

.user-nav-arrow {
    color: rgba(255, 255, 255, 0.5);
    font-size: clamp(12px, 2.5vw, 14px);
}

.user-sidebar-footer {
    padding: clamp(15px, 3vw, 20px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
}

.logout-btn {
    display: inline-flex;
    align-items: center;
    background: linear-gradient(135deg, #ff4757 0%, #ff3742 100%);
    color: white;
    padding: clamp(12px, 2.5vw, 15px) clamp(15px, 3vw, 20px);
    border-radius: 4px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    font-size: clamp(13px, 2.5vw, 14px);
    width: 100%;
    justify-content: center;
}

.logout-btn:hover {
    background: linear-gradient(135deg, #ff3742 0%, #ff2d3a 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(255, 71, 87, 0.4);
}

.logout-btn i {
    margin-right: clamp(8px, 2vw, 10px);
    font-size: clamp(14px, 2.5vw, 16px);
}

/* أيقونة المستخدم في الهيدر - مستخدم في جميع الصفحات */
.user-display {
    display: flex;
    align-items: center;
    margin-left: clamp(15px, 2vw, 25px);
    cursor: pointer;
    transition: all 0.3s ease;
}

.user-avatar {
    width: clamp(35px, 6vw, 40px);
    height: clamp(35px, 6vw, 40px);
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(14px, 2.5vw, 16px);
    color: white;
    font-weight: 600;
    border: 2px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.user-avatar:hover {
    transform: scale(1.1);
    border-color: rgba(255, 255, 255, 0.4);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}










/* ===================================================== */
/* ستايلات التحميل والأنيميشن - مستخدم في جميع الصفحات */
/* ===================================================== */

/* تحسينات السايد بارات - منع فتح أكثر من سايد بار في نفس الوقت */
/* تأكد من أن overlay واحد فقط يكون نشط في نفس الوقت */
.sidebar-overlay.active,
.search-sidebar-overlay.active,
.user-sidebar-overlay.active {
    z-index: 1000;
}

/* تحسين الانتقالات عند فتح/إغلاق السايد بارات */
.sidebar,
.search-sidebar,
.user-sidebar {
    transition: transform 0.3s ease-in-out, opacity 0.3s ease-in-out;
}

.sidebar-overlay,
.search-sidebar-overlay,
.user-sidebar-overlay {
    transition: opacity 0.3s ease-in-out;
}

/* منع التمرير في الخلفية عند فتح أي سايد بار */
body.sidebar-open {
    overflow: hidden;
}

/* تحسين تجربة المستخدم عند فتح سايد بار البحث */
.search-sidebar.active .search-sidebar-input {
    animation: focusInput 0.3s ease-in-out;
}

@keyframes focusInput {
    0% {
        transform: scale(0.95);
        opacity: 0.8;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* ===================================================== */
/* تحسينات إضافية لمقاسات سايدبار المستخدم */
/* ===================================================== */



/* تحسين أداء الانتقالات */
.sidebar *,
.search-sidebar *,
.user-sidebar * {
    will-change: transform, opacity;
}

/* منع تداخل الأحداث بين السايد بارات */
.sidebar-overlay.active,
.search-sidebar-overlay.active,
.user-sidebar-overlay.active {
    pointer-events: auto;
}

.sidebar-overlay:not(.active),
.search-sidebar-overlay:not(.active),
.user-sidebar-overlay:not(.active) {
    pointer-events: none;
}





/* ===================================================== */
/* ستايلات فورمات المصادقة في userSidebar */
/* ===================================================== */

.auth-forms-container {
    margin: 18px 0 0 0;
    padding: 0 12px;
}

.auth-form {
    display: block;
    background: rgba(255,255,255,0.04);
    border-radius: 10px;
    padding: 18px 10px 10px 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    margin-bottom: 15px;
}

.auth-form[style*="display:none"] {
    display: none !important;
}

.form-group {
    margin-bottom: 13px;
}

.form-group label {
    color: #fff;
    font-size: 14px;
    margin-bottom: 4px;
    display: block;
}

.form-group input {
    width: 100%;
    padding: 8px 10px;
    border-radius: 6px;
    border: 1px solid rgba(255,255,255,0.18);
    background: rgba(255,255,255,0.09);
    color: #fff;
    font-size: 15px;
    outline: none;
    transition: border 0.2s;
}

.form-group input:focus {
    border-color: #0070f3;
    background: rgba(255,255,255,0.13);
}

.auth-submit-btn {
    width: 100%;
    background: #0070f3;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 10px 0;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 4px;
    transition: background 0.2s;
}

.auth-submit-btn:hover {
    background: #005bb5;
}

.auth-message {
    min-height: 22px;
    margin-bottom: 8px;
    font-size: 14px;
    text-align: center;
    color: #fff;
    padding: 2px 0;
}

.auth-message.error {
    color: #ff6b6b;
}

.auth-message.success {
    color: #2ecc40;
}

.auth-links {
    margin-top: 12px;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.auth-link {
    color: #0070f3;
    text-decoration: none;
    font-size: 13px;
    transition: color 0.2s;
}

.auth-link:hover {
    color: #005bb5;
    text-decoration: underline;
}



/* ===================================================== */
/* ستايلات موحدة لـ search-box */
/* ===================================================== */

/* Search Box Container - تصميم موحد */
.search-box {
    position: relative;
    display: flex;
    align-items: center;
}

/* Search Button Styles - تصميم موحد */
.search-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: clamp(8px, 2vw, 10px) clamp(12px, 3vw, 16px);
    color: #fff;
    font-size: clamp(12px, 2.5vw, 14px);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: clamp(6px, 1.5vw, 8px);
    font-weight: 500;
    text-decoration: none; /* prevent underline for anchor usage */
}

.search-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
    text-decoration: none;
}

.search-btn:active {
    transform: translateY(0);
    text-decoration: none;
}

.search-btn:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.4);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.1);
    text-decoration: none;
}

.search-btn i {
    font-size: clamp(12px, 2.5vw, 14px);
    color: #fff;
}

.search-btn span {
    font-weight: 500;
    font-size: clamp(12px, 2.5vw, 14px);
}


