/* استيراد الخطوط */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans:wght@400;500;600;700&family=Tajawal:wght@400;500;700&display=swap');

:root {
    /* الألوان الأساسية - وضع الظلام الافتراضي */
    --themeBg: #100f10;
    --postBg: #1b1b1b;
    --contentBg-sec: #252526;
    --themeLink: #94f27f;
    --themeC: #d9e2f0;
    --sideBd-color: #3a3c3d;
    --buttonBd-radius: 7px;
    
    /* متغيرات إضافية */
    --headerBd-line: 1px;
    --headerBd-color: #3a3c3d;
    --alikernelBg: #ffffff; /* للزر المعكوس */
    --alikernelC: #171717;
    
    /* الخطوط */
    --fontBody: 'Noto Sans', 'Tajawal', sans-serif;
}

body {
    margin: 0;
    padding: 0;
    background-color: var(--themeBg);
    color: var(--themeC);
    font-family: var(--fontBody);
    direction: rtl;
    overflow-x: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

* {
    box-sizing: border-box;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.2s;
}

/* --- تنسيقات الحاويات والنوافذ --- */
.fullscreen-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--themeBg);
    z-index: 2500;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center; /* توسيط عمودي */
    padding: 20px;
    overflow-y: auto;
}

.login-container, .account-container {
    width: 100%;
    max-width: 385px;
    margin: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* زر الإغلاق */
.modal-close-btn {
    position: fixed;
    top: 20px;
    left: 20px;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: inherit;
    background: transparent;
    transition: background 0.3s ease;
    z-index: 2600;
}

.modal-close-btn:hover {
    background-color: var(--contentBg-sec);
}

.modal-close-btn svg {
    width: 24px;
    height: 24px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.5;
}

/* --- بطاقة تسجيل الدخول --- */
.login-header {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 18px;
    margin-bottom: 25px;
    color: #fff;
}

.site-logo-placeholder {
    width: 32px;
    height: 32px;
}

.login-card, .account-card {
    width: 100%;
    background-color: var(--postBg);
    padding: 25px;
    border-radius: 12px;
    border: 1px solid var(--sideBd-color);
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    text-align: center;
}

.login-card h2, .account-header h2 {
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 10px 0;
    color: #fff;
}

.login-card p, .account-header p {
    font-size: 14px;
    color: #aaa;
    margin: 0 0 25px 0;
}

/* --- أزرار التواصل الاجتماعي --- */
.social-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 42px;
    padding: 0 15px;
    margin-bottom: 12px;
    border: 1px solid var(--sideBd-color);
    background-color: var(--contentBg-sec);
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    color: #fff;
    font-weight: 600;
    font-family: inherit;
    transition: background-color 0.2s ease;
}

.social-btn:hover {
    background-color: #333;
}

.social-btn svg {
    width: 20px;
    height: 20px;
    margin-left: 10px; /* المسافة بين الأيقونة والنص */
}

/* --- الفوتر --- */
.login-footer {
    margin-top: 25px;
    text-align: center;
}

.login-footer p {
    font-size: 12px;
    color: #666;
    line-height: 1.6;
    max-width: 280px;
    margin: 0 auto;
}

.login-footer a {
    color: #888;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.login-footer a:hover {
    color: #fff;
}

/* --- صفحة الحساب (Account Page) --- */
.account-header {
    text-align: right;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--sideBd-color);
    padding-bottom: 15px;
}

.user-details {
    display: flex;
    align-items: center;
    margin-bottom: 25px;
    text-align: right;
}

#account-avatar {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    margin-left: 15px;
    background-color: var(--contentBg-sec);
    object-fit: cover;
    border: 1px solid var(--sideBd-color);
}

.user-info h3 {
    margin: 0 0 5px 0;
    font-size: 18px;
    color: #fff;
}

.user-info p {
    margin: 0;
    font-size: 13px;
    color: #aaa;
    line-height: 1.5;
}

.sessions-title {
    text-align: right;
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 10px;
    color: #fff;
}

.sessions-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 25px;
}

.session-item {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    background-color: var(--themeBg); /* أغمق قليلاً من البطاقة */
    padding: 12px;
    border-radius: 8px;
    border: 1px solid var(--sideBd-color);
    text-align: right;
}

.session-details {
    font-size: 13px;
    color: #ccc;
    line-height: 1.8;
}

.session-detail-line {
    display: flex;
    align-items: center;
    gap: 8px;
}

.session-detail-line svg {
    width: 14px;
    height: 14px;
    opacity: 0.7;
}

.current-session-indicator {
    color: var(--themeLink);
    font-weight: 600;
    margin-top: 5px;
}

.terminate-btn {
    width: 32px;
    height: 32px;
    border: 1px solid var(--sideBd-color);
    background-color: var(--contentBg-sec);
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.terminate-btn:hover {
    background-color: #d32f2f;
    border-color: #d32f2f;
}

.terminate-btn svg {
    width: 16px;
    height: 16px;
    stroke: #fff;
}

/* الأزرار السفلية */
.account-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding-top: 15px;
    border-top: 1px solid var(--sideBd-color);
}

.account-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
    text-decoration: none;
    font-family: inherit;
}

.account-btn svg {
    width: 18px;
    height: 18px;
}

/* زر الخروج (Primary) */
.account-btn.primary {
    background-color: #fff;
    color: #000;
    border: none;
}

.account-btn.primary:hover {
    background-color: #e0e0e0;
}

/* زر الرئيسية (Secondary) */
.account-btn.secondary {
    background-color: transparent;
    color: #fff;
    border: 1px solid var(--sideBd-color);
}

.account-btn.secondary:hover {
    background-color: var(--contentBg-sec);
}

/* --- نافذة التأكيد (Modal) --- */
.custom-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3000;
}

.hidden {
    display: none !important;
}

.custom-modal-content {
    background: var(--postBg);
    padding: 25px;
    border-radius: 12px;
    width: 90%;
    max-width: 400px;
    text-align: right;
    border: 1px solid var(--sideBd-color);
}

.custom-modal-content h2 {
    margin: 0 0 15px;
    font-size: 18px;
    color: #fff;
}

.custom-modal-content p {
    color: #ccc;
    font-size: 14px;
    margin-bottom: 20px;
}

.custom-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.modal-btn {
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    border: none;
}

.modal-btn.primary {
    background-color: #d32f2f;
    color: #fff;
}

.modal-btn.secondary {
    background-color: transparent;
    border: 1px solid var(--sideBd-color);
    color: #fff;
}
/* --- أزرار التحكم بالثيم --- */
.theme-controls {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid var(--sideBd-color);
}

.theme-btn {
    background: transparent;
    border: 1px solid var(--sideBd-color);
    color: var(--themeC);
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.theme-btn:hover {
    background-color: var(--contentBg-sec);
}

.theme-btn.active {
    background-color: var(--themeLink);
    color: var(--themeBg);
    border-color: var(--themeLink);
}

/* دعم الوضع الفاتح (Light Mode) */
[data-theme="light"] {
    --themeBg: #f6f8fa;
    --postBg: #ffffff;
    --contentBg-sec: #f0f0f0;
    --themeLink: #1976d2;
    --themeC: #0e2045;
    --sideBd-color: #d2d3d7;
    --headerBd-color: #d2d3d7;
    --alikernelBg: #171717; 
    --alikernelC: #ffffff;
}

[data-theme="light"] .login-header, 
[data-theme="light"] .login-card h2, 
[data-theme="light"] .account-header h2,
[data-theme="light"] .user-info h3,
[data-theme="light"] .sessions-title {
    color: #000;
}

[data-theme="light"] .social-btn {
    background-color: #fff;
    color: #000;
    border-color: #ccc;
}
[data-theme="light"] .social-btn:hover {
    background-color: #f5f5f5;
}

/* Loading State */
.loading {
    opacity: 0.5;
    pointer-events: none;
}
/* --- تنسيقات هيدر المستخدم والقائمة المنسدلة --- */
.mainH {
    position: absolute; /* أو fixed لتثبيته */
    top: 0;
    left: 0;
    width: 100%;
    padding: 15px 20px;
    display: flex;
    justify-content: flex-end; /* وضع الأيقونة في اليسار (لأن الموقع RTL) */
    z-index: 2000;
    pointer-events: none; /* يسمح بالنقر خلال الهيدر */
}

.headB {
    pointer-events: auto; /* إعادة تفعيل النقر للأزرار */
    position: relative;
}

/* أيقونة الحساب */
.account-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 50%;
    background: var(--contentBg-sec);
    border: 1px solid var(--sideBd-color);
    transition: all 0.2s;
}

.account-icon:hover {
    background: var(--sideBd-color);
}

.account-icon svg {
    width: 24px;
    height: 24px;
    stroke: var(--themeC);
    fill: none;
}

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

/* القائمة المنسدلة (Popup) */
.profI { display: none; } /* إخفاء الـ Checkbox */

.ipopUp-ov {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    display: none;
    z-index: 1999;
}

/* إظهار القائمة عند تحديد الـ Checkbox */
.profI:checked ~ .settB .iProf {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.profI:checked ~ .ipopUp-ov {
    display: block;
}

.settB {
    position: absolute;
    top: 50px;
    left: 0; /* في وضع RTL سيظهر في الجهة الصحيحة */
    z-index: 2001;
}

.iProf {
    background: var(--postBg);
    border: 1px solid var(--sideBd-color);
    border-radius: 10px;
    width: 200px;
    padding: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
}

.profile-inner {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.menu-text-label {
    font-size: 12px;
    color: #888;
    padding: 5px 10px;
    border-bottom: 1px solid var(--sideBd-color);
    margin-bottom: 5px;
    display: block;
}

.iProf a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border-radius: 6px;
    font-size: 14px;
    color: var(--themeC);
    text-decoration: none;
}

.iProf a:hover {
    background: var(--contentBg-sec);
    color: var(--themeLink);
}

.iProf a svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.5;
}
