/* 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: 55px; 
    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: 9999999 !important; 
    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 8px !important; list-style: none; }
.nav-links-sidebar li { margin-bottom: 15px !important; }
.nav-links-sidebar a {
    display: flex !important;
    justify-content: flex-start !important;
    align-items: center !important;
    padding: 8px 10px !important;
    font-size: 0.85rem !important;
    font-weight: 400 !important;
    gap: 10px !important;
    border-radius: 10px !important;
    color: var(--text-main) !important;
    text-decoration: none;
    transition: 0.2s;
}

.nav-links-sidebar a i { font-size: 0.75rem !important; width: 18px; text-align: center; }

.nav-links-sidebar a i.icon-home { color: #198754 !important; }
.nav-links-sidebar a i.icon-balance { color: #0d6efd !important; }
.nav-links-sidebar a i.icon-payments { color: #0d6efd !important; }
.nav-links-sidebar a i.icon-wallet { color: #ffc107 !important; }
.nav-links-sidebar a i.icon-orders { color: #dc3545 !important; }
.nav-links-sidebar a i.icon-telegram { color: #0088cc !important; }
.nav-links-sidebar a i.icon-agents { color: #0d6efd !important; }
.nav-links-sidebar a i.icon-security { color: #198754 !important; }
.nav-links-sidebar a i.icon-verify { color: #198754 !important; }
.nav-links-sidebar a i.icon-api { color: #28a745 !important; }
.nav-links-sidebar a i.icon-about { color: #0dcaf0 !important; }

.nav-links-sidebar a.active-link { 
    background: #f1f5f9 !important; 
    color: var(--text-main) !important; 
    font-weight: 500 !important; 
}
[data-theme="dark"] .nav-links-sidebar a.active-link { 
    background: #1e293b !important; 
    color: #ffffff !important; 
}

.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 { display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; margin-bottom: 5px; }
.sidebar-username span:not(.sidebar-badge):not(.user-id) { font-size: 1rem !important; font-weight: 800 !important; color: var(--text-main) !important; }
[data-theme="dark"] .sidebar-username span:not(.sidebar-badge):not(.user-id) { color: #ffffff !important; }
[data-theme="dark"] .sidebar-avatar { color: #ffffff !important; }

.user-id { font-size: 0.85rem !important; font-weight: 800; color: #6c757d !important; background: #e9ecef; padding: 2px 6px; border-radius: 6px; }
[data-theme="dark"] .user-id { background: #2b3035; color: #adb5bd !important; }

.sidebar-balance { font-size: 1.4rem; font-weight: 800; color: #0d6efd !important; background: transparent; 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;
    width: 100% !important;
    box-sizing: border-box !important;
    padding: 0 45px !important; 
    margin-top: 15px !important;
    margin-bottom: 15px !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: auto; 
    border-top: 1px solid var(--border-color); margin-bottom: 25px; 
}
.pro-theme-btn {
    background: var(--bg-body); border: 1px solid var(--border-color);
    border-radius: 50%; width: 40px; height: 40px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; transition: 0.3s; color: var(--text-main); font-size: 1.1rem;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05); outline: none;
}
.pro-theme-btn:hover { transform: rotate(15deg) scale(1.1); }
.pro-theme-btn .sun-icon { color: #f59e0b; } 
.pro-theme-btn .moon-icon { color: #818cf8; } 

.sidebar-socials { 
    display: flex; 
    justify-content: center; 
    gap: 20px; 
    padding: 0 15px; 
    margin-bottom: 30px; 
}
.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; 
    text-align: center; 
    margin-bottom: 30px; 
}
.wa-banner-link { 
    display: inline-block; 
    border-radius: 8px; 
    overflow: hidden; 
    transition: transform 0.3s ease; 
}
.wa-banner-link img { 
    max-height: 55px !important; 
    width: auto !important;
    object-fit: contain; 
}
.wa-banner-link:hover { transform: scale(1.05); }

.dev-credit { 
    padding: 0 15px 30px 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: 9999998 !important; 
}

/* =========================================
   --- البار العلوي (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;
    /* 🚀 تم التعديل: تقليل الارتفاع من 65px لـ 55px 🚀 */
    height: 55px; 
    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; }

/* 🚀 جروب اللوجو وزرار الرجوع 🚀 */
.header-left-side {
    display: flex;
    align-items: center;
    gap: 15px; /* المسافة اللي بتزق اللوجو عن السهم */
    height: 100%;
}

.back-btn-header {
    color: rgba(255, 255, 255, 0.9) !important;
    font-size: 1.2rem !important;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
    margin-left: 5px;
}

.back-btn-header:hover {
    transform: translateX(-3px);
}

.logo-container {
    display: flex;
    align-items: center;
    height: 100%;
}
.logo-container img {
    /* 🚀 تم التعديل: تصغير اللوجو عشان يتناسب مع الهيدر الجديد بعد التقليل 🚀 */
    height: 50px !important; 
    max-height: 50px !important; 
    width: auto !important; 
    object-fit: contain;
}

/* =========================================
   🚀 أكواد شاشة التحميل (Preloader) بدون تمويه 🚀 
   ========================================= */
#global-preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* 🚀 تم الحذف: شيلنا الـ blur خالص عشان المحتوى يبان، وخلينا الخلفية شفافة بيضاء فقط 🚀 */
    background-color: rgba(255, 255, 255, 0.75) !important;
    z-index: 10000000;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease-out, visibility 0.5s ease-out;
}

/* 🚀 الوضع الداكن (أسود شفاف مريح للعين) 🚀 */
[data-theme="dark"] #global-preloader {
    background-color: rgba(18, 18, 18, 0.75) !important;
}

.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;
}