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

/* ============================================
   المتغيرات - Dark Mode (الافتراضي)
   ============================================ */
:root {
    --fontBody: 'Noto Sans', 'Tajawal', sans-serif;
}

body {
    /* Dark Mode Colors */
    --themeBg: #100f10;
    --postBg: #1b1b1b;
    --headerBg: #1b1b1b;
    --contentBg-sec: #252526;
    --themeLink: #94f27f;
    --themeC: #d9e2f0;
    --themeC-alt: #a0a0a0;
    --sideBd-color: #3a3c3d;
    --alikernelBg: #ffffff;
    --alikernelC: #171717;
}

body[data-theme="light"] {
    --themeBg: #f6f8fa;
    --postBg: #ffffff;
    --headerBg: #ffffff;
    --contentBg-sec: #f5f3f2;
    --themeLink: #1976d2;
    --themeC: #0e2045;
    --themeC-alt: #666666;
    --sideBd-color: #d2d3d7;
    --alikernelBg: #171717;
    --alikernelC: #ffffff;
}

/* ============================================
   Reset & Base
   ============================================ */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--fontBody);
    background-color: var(--themeBg);
    color: var(--themeC);
    direction: rtl;
    min-height: 100vh;
    line-height: 1.6;
}

a {
    text-decoration: none;
    color: inherit;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
}

.hidden {
    display: none !important;
}

/* ============================================
   Page Wrapper
   ============================================ */
.page-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ============================================
   Header - مطابق للصورة
   ============================================ */
.site-header {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 15px 30px;
    border-bottom: 1px solid var(--sideBd-color);
    background-color: var(--headerBg);
}

.header-logo-link {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--themeC);
    font-weight: 700;
    font-size: 16px;
}

.header-logo-icon {
    width: 32px;
    height: 32px;
}

/* ============================================
   Page Content
   ============================================ */
.page-content {
    flex: 1;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 40px 20px;
}

.account-container {
    width: 100%;
    max-width: 900px;
}

/* ============================================
   Account Header - مطابق للصورة
   ============================================ */
.account-header {
    text-align: center;
    margin-bottom: 30px;
}

.account-header h2 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 5px;
    color: var(--themeC);
}

.account-header p {
    font-size: 14px;
    color: var(--themeC-alt);
}

/* ============================================
   User Details - مطابق للصورة (الصورة يمين، النص يسار)
   ============================================ */
.user-details {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 20px;
    margin-bottom: 30px;
}

.user-info {
    text-align: right;
}

.user-info h3 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 5px;
    color: var(--themeC);
}

.user-info p {
    font-size: 13px;
    color: var(--themeC-alt);
    margin: 2px 0;
}

/* Avatar - مربع مع حدود دائرية وإطار أخضر */
.avatar-wrapper {
    position: relative;
}

#account-avatar {
    width: 90px;
    height: 90px;
    border-radius: 12px;
    object-fit: cover;
    background-color: var(--contentBg-sec);
    border: 3px solid var(--themeLink);
}

/* ============================================
   Sessions - مطابق للصورة
   ============================================ */
.sessions-title {
    text-align: right;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 15px;
    color: var(--themeC);
}

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

.loading-text {
    text-align: center;
    padding: 20px;
    color: var(--themeC-alt);
}

/* Session Item - مطابق للصورة */
.session-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    border: 1px solid var(--sideBd-color);
    border-radius: 10px;
    background-color: transparent;
}

.session-details {
    text-align: right;
    font-size: 13px;
    color: var(--themeC);
    line-height: 1.9;
}

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

.session-detail-line svg {
    width: 16px;
    height: 16px;
    opacity: 0.7;
    stroke: currentColor;
    fill: none;
}

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

/* Terminate Button - أبيض مع أيقونة سوداء كما في الصورة */
.terminate-btn {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--alikernelBg);
    border: 1px solid var(--sideBd-color);
    cursor: pointer;
    transition: all 0.2s;
}

.terminate-btn svg {
    width: 18px;
    height: 18px;
    stroke: var(--alikernelC);
    fill: none;
}

.terminate-btn:hover {
    opacity: 0.8;
}

/* ============================================
   Account Actions - أزرار بعرض كامل كما في الصورة
   ============================================ */
.account-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

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

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

/* زر الخروج - أبيض مع نص أسود (Primary) */
.account-btn.primary {
    background-color: var(--alikernelBg);
    color: var(--alikernelC);
    border: none;
}

.account-btn.primary svg {
    stroke: var(--alikernelC);
}

.account-btn.primary:hover {
    opacity: 0.9;
}

/* زر الرئيسية - شفاف مع حدود (Secondary) */
.account-btn.secondary {
    background-color: transparent;
    color: var(--themeC);
    border: 1px solid var(--sideBd-color);
}

.account-btn.secondary svg {
    stroke: currentColor;
}

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

/* ============================================
   Footer - مطابق للصورة
   ============================================ */
.site-footer {
    border-top: 1px solid var(--sideBd-color);
    padding: 15px 30px;
    background-color: var(--headerBg);
    margin-top: auto;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
}

.footer-logo-section {
    display: flex;
    align-items: center;
    gap: 20px;
}

.footer-logo-link {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--themeC);
    font-weight: 700;
    font-size: 14px;
}

.footer-logo-icon {
    width: 28px;
    height: 28px;
}

.footer-logo-section a:not(.footer-logo-link) {
    font-size: 12px;
    color: var(--themeC-alt);
}

.footer-logo-section a:not(.footer-logo-link):hover {
    text-decoration: underline;
}

/* Theme Controls - أزرار الثيم كما في الصورة */
.theme-controls {
    display: flex;
    border: 1px solid var(--sideBd-color);
    border-radius: 8px;
    overflow: hidden;
}

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

.theme-btn:not(:last-child) {
    border-left: 1px solid var(--sideBd-color);
}

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

.theme-btn svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    fill: none;
}

/* ============================================
   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;
}

.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: var(--themeC);
}

.custom-modal-content p {
    color: var(--themeC-alt);
    font-size: 14px;
    margin-bottom: 20px;
}

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

.modal-btn {
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
}

.modal-btn.primary {
    background-color: var(--alikernelBg);
    color: var(--alikernelC);
    border: none;
}

.modal-btn.secondary {
    background-color: transparent;
    border: 1px solid var(--sideBd-color);
    color: var(--themeC);
}

/* ============================================
   Login Page Styles
   ============================================ */
.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 {
    width: 100%;
    max-width: 385px;
    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: var(--themeC);
    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;
}

.login-header {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 18px;
    margin-bottom: 25px;
    color: var(--themeC);
}

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

.login-card {
    width: 100%;
    background-color: var(--postBg);
    padding: 25px;
    border-radius: 12px;
    border: 1px solid var(--sideBd-color);
    text-align: center;
}

.login-card h2 {
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 10px 0;
    color: var(--themeC);
}

.login-card p {
    font-size: 14px;
    color: var(--themeC-alt);
    margin: 0 0 25px 0;
}

.social-btn {
    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: var(--themeC);
    font-weight: 600;
    transition: background-color 0.2s ease;
}

.social-btn:hover {
    opacity: 0.8;
}

.social-btn svg {
    width: 20px;
    height: 20px;
    margin-left: 10px;
}
.social-btn:last-child {
    margin-bottom: 0;
}
.login-footer {
    margin-top: 25px;
    text-align: center;
}

.login-footer p {
    font-size: 12px;
    color: var(--themeC-alt);
    line-height: 1.6;
    max-width: 280px;
    margin: 0 auto;
}

.login-footer a {
    color: var(--themeC-alt);
    text-decoration: underline;
}

.login-footer a:hover {
    color: var(--themeC);
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 768px) {
    .site-header,
    .site-footer {
        padding: 15px 20px;
    }
    
    .footer-content {
        flex-direction: column;
        gap: 15px;
    }
    
    .footer-logo-section {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .account-actions {
        grid-template-columns: 1fr;
    }
    
    .user-details {
        flex-direction: column-reverse;
        text-align: center;
    }
    
    .user-info {
        text-align: center;
    }
    
    .session-detail-line {
        justify-content: center;
    }
    
    .sessions-title {
        text-align: center;
    }
}
