/* css/header.css */

/* تعريف متغيرات الألوان للثيمات */
:root {
    --bg-body: #f7f9fc;
    --bg-side: #ffffff;
    --text-main: #333333;
    --border-color: #eeeeee;
}
[data-theme="dark"] {
    --bg-body: #000000;
    --bg-side: #121212;
    --text-main: #ffffff;
    --border-color: #222222;
}

body { 
    background-color: var(--bg-body) !important; 
    color: var(--text-main) !important; 
    transition: 0.3s; 
    padding-top: 65px; 
    font-family: 'Tajawal', sans-serif; 
}

/* =========================================
   --- القائمة الجانبية (Sidebar) --- 
   ========================================= */
.side-nav { 
    background-color: var(--bg-side) !important; 
    color: var(--text-main) !important; 
    width: 270px; 
    position: fixed; 
    top: 0; 
    right: -270px; 
    height: 100%; 
    z-index: 1500; 
    transition: 0.3s ease; 
    overflow-y: auto; 
    display: flex; 
    flex-direction: column; 
    box-shadow: -2px 0 15px rgba(0,0,0,0.05);
}
.side-nav.open { right: 0; }

.nav-links-sidebar { padding: 5px 15px !important; list-style: none; }
.nav-links-sidebar li { margin-bottom: 5px !important; }
.nav-links-sidebar a {
    display: flex !important;
    justify-content: flex-start !important;
    align-items: center !important;
    padding: 10px 15px !important;
    font-size: 0.85rem !important;
    gap: 12px !important;
    border-radius: 10px !important;
    color: var(--text-main) !important;
    text-decoration: none;
    transition: 0.2s;
}
.nav-links-sidebar a i { font-size: 1rem !important; width: 20px; text-align: center; }
.nav-links-sidebar a.active-link { background: rgba(46, 204, 113, 0.1) !important; color: #2ecc71 !important; font-weight: 800; }
.nav-links-sidebar a:hover { background: rgba(0,0,0,0.03); }
[data-theme="dark"] .nav-links-sidebar a:hover { background: rgba(255,255,255,0.03); }

/* قسم تسجيل الدخول للزوار */
.login-section-sidebar { padding: 20px 15px; margin: 10px; }
.login-section-sidebar h3 { font-size: 1.1rem; font-weight: 800; color: #ffffff !important; margin-bottom: 5px; }
.login-section-sidebar p { font-size: 0.8rem; opacity: 0.9; margin-bottom: 15px; color: #ffffff !important; }

.btn-green-sidebar { background-color: #2ecc71; color: white !important; padding: 10px; font-size: 0.85rem; display: block; text-align: center; text-decoration: none; margin-bottom: 10px; border-radius: 10px; font-weight: 700; transition: 0.3s; border: none; width: 100%; }
.btn-green-sidebar:hover { background-color: #27ae60; }
.btn-google-sidebar { background: #fff; color: #333; text-decoration: none; border-radius: 10px; padding: 10px; display: flex; align-items: center; justify-content: center; gap: 8px; font-weight: 700; width: 100%; border: 1px solid #ddd; }

/* قسم المستخدم المسجل في القائمة الجانبية */
.sidebar-profile { padding: 15px; border-bottom: 1px solid var(--border-color); }
.sidebar-avatar-container { display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 5px; margin-bottom: 15px; }
.sidebar-avatar { font-size: 3.5rem; color: var(--text-main); margin-bottom: 5px; }
.sidebar-badge { font-size: 0.65rem; display: inline-block; background: #f1c40f; color: #000; padding: 2px 8px; border-radius: 4px; }

.sidebar-username span:not(.sidebar-badge) { font-size: 1rem !important; font-weight: 800 !important; color: var(--text-main) !important; }
[data-theme="dark"] .sidebar-username span:not(.sidebar-badge) { color: #ffffff !important; }
[data-theme="dark"] .sidebar-avatar { color: #ffffff !important; }

.sidebar-balance { font-size: 1.4rem; font-weight: 800; color: var(--text-main) !important; background: var(--bg-body); padding: 10px; border-radius: 8px; text-align: center; margin-bottom: 15px; }

.sidebar-actions {
    display: flex !important;
    justify-content: space-between !important; 
    align-items: center !important;
    padding: 0 35px !important; 
    margin-top: 10px !important;
    margin-bottom: 10px !important;
}
.sidebar-actions a { color: var(--text-main) !important; font-size: 1.35rem !important; transition: 0.2s; }
.sidebar-actions a:hover { opacity: 0.7; }
.sidebar-actions a .fa-heart, .header-user-actions a .fa-heart { color: #e74c3c !important; }

/* زر تبديل الثيم */
.theme-switch-container { display: flex; align-items: center; justify-content: space-between; padding: 15px 20px; margin-top: 10px; border-top: 1px solid var(--border-color); }
.switch { position: relative; display: inline-block; width: 45px; height: 22px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #ccc; transition: .4s; border-radius: 34px; }
.slider:before { position: absolute; content: ""; height: 16px; width: 16px; left: 3px; bottom: 3px; background-color: white; transition: .4s; border-radius: 50%; }
input:checked + .slider { background-color: #2ecc71; }
input:checked + .slider:before { transform: translateX(23px); }

.sidebar-socials { display: flex; justify-content: center; gap: 20px; padding: 15px; }
.sidebar-socials a { text-decoration: none; font-size: 1.2rem; }
.fa-whatsapp { color: #25D366 !important; } 
.fa-telegram { color: #0088cc !important; } 
.fa-instagram { color: #E1306C !important; }

.wa-banner-container { padding: 0 15px 15px 15px; text-align: center; margin-top: auto; }
.wa-banner-link { display: inline-block; border-radius: 8px; overflow: hidden; box-shadow: none; transition: transform 0.3s ease; }
.wa-banner-link:hover { transform: scale(1.05); }

.dev-credit { padding: 10px 15px 20px 15px; text-align: center; font-size: 0.7rem; color: var(--text-main); opacity: 0.7; }
.dev-credit a { color: #2ecc71; text-decoration: none; font-weight: 800; }

#overlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: transparent; z-index: 1499; }

/* =========================================
   --- البار العلوي (Header) الجديد المينيمال --- 
   ========================================= */
.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center; 
    padding: 0 15px;
    border: none !important; 
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 65px;
    z-index: 1000;
}

/* 🚀 حاوية الأيقونات: مسافات واسعة جداً ومريحة 🚀 */
.header-icons { 
    display: flex; 
    align-items: center; 
    gap: 28px; /* 💡 كبرت لك المسافة هنا عشان يبعدوا عن بعض خالص 💡 */
    height: 100%;
}

/* توحيد الخصائص بدون ظلال */
#menu-btn, 
.currency-wrapper, 
.header-balance-btn, 
.notif-bell, 
.user-link {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: transparent !important;
    border: none !important;
    color: rgba(255, 255, 255, 0.9) !important; 
    box-shadow: none !important;
    text-shadow: none !important;
    margin: 0 !important;
    padding: 0 !important;
    line-height: 1 !important;
    text-decoration: none;
    font-weight: 400 !important; 
}

/* زر القائمة المينيمال (رفيع وصغير) */
#menu-btn { font-size: 1.1rem !important; cursor: pointer; outline: none; }

/* أيقونة العملات */
.currency-wrapper { position: relative; font-size: 1rem !important; }
.currency-select-hidden {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    opacity: 0; 
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
}

/* الرصيد المينيمال */
.header-balance-btn {
    font-weight: 500 !important; 
    font-size: 0.85rem !important; 
    font-family: 'Tajawal', sans-serif;
    transform: translateY(1px);
}

/* أيقونة الإشعارات */
.notif-bell { position: relative; font-size: 1.05rem !important; }
.notif-badge {
    position: absolute; 
    top: -5px; 
    right: -5px;
    background: #e74c3c; 
    color: #ffffff !important;
    border-radius: 50%;
    padding: 2px 4px; 
    font-size: 9px; 
    font-weight: bold !important;
    box-shadow: none !important;
    line-height: 1;
}

/* أيقونة الزائر */
.user-link { font-size: 1.15rem !important; }

/* اللوجو */
.logo-container { display: flex; align-items: center; height: 100%; }
.logo-container img { max-height: 40px; object-fit: contain; }

/* =========================================
   🚀 أكواد شاشة التحميل (Preloader) 🚀 
   ========================================= */
#global-preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg-body);
    z-index: 9999999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease-out, visibility 0.5s ease-out;
}
.loader-wrapper {
    position: relative;
    width: 130px;
    height: 130px;
    display: flex;
    justify-content: center;
    align-items: center;
}
.spinner-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 4px solid transparent;
    border-top-color: #2ecc71; 
    border-right-color: #2ecc71; 
    border-radius: 50%;
    animation: spin-loader 1s linear infinite;
}
.loader-logo {
    width: 75px;
    height: auto;
    z-index: 10;
    animation: pulse-logo 1.5s ease-in-out infinite alternate;
}
@keyframes spin-loader {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
@keyframes pulse-logo {
    0% { transform: scale(0.9); opacity: 0.8; }
    100% { transform: scale(1.05); opacity: 1; }
}
.preloader-hidden {
    opacity: 0;
    visibility: hidden;
}
body.loading-active {
    overflow: hidden;
}