/* تنسيق عام لتطبيق موبايل مع تحسينات للقراءة */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

:root {
    --primary-color: #2196F3;
    --primary-dark: #1976D2;
    --text-primary: #333333;
    --text-secondary: #666666;
    --background: #f8fafc;
    --white: #ffffff;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    --radius: 16px;
}

body {
    background-color: var(--background);
    min-height: 100vh;
    font-size: 16px; /* زيادة حجم الخط الأساسي */
    line-height: 1.6;
}

/* تحسينات للجوال */
html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%; /* منع تصغير النص في iOS */
    text-size-adjust: 100%;
}

@media screen and (max-width: 768px) {
    html {
        font-size: 18px; /* زيادة حجم الخط للجوال */
    }
}

@media screen and (max-width: 480px) {
    html {
        font-size: 20px; /* زيادة أكبر للشاشات الصغيرة */
    }
}

/* الهيدر الرئيسي */
.header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: var(--white);
    padding: 20px 16px;
    display: flex;
    align-items: center;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
    height: 60px;
}

.back-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: var(--white);
    font-size: 28px; /* زيادة حجم السهم */
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    margin-left: auto;
    transition: all 0.2s ease;
    touch-action: manipulation;
}

.back-btn:active {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(0.95);
}

.header h1 {
    font-size: 24px; /* زيادة حجم العنوان */
    font-weight: 700;
    margin: 0;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    letter-spacing: -0.5px;
}

/* الحاوية الرئيسية */
.about-container {
    direction: rtl;
    min-height: calc(100vh - 60px);
    background: linear-gradient(180deg, #f0f7ff 0%, var(--white) 100%);
    padding-bottom: 20px;
}

.content-list {
    padding: 24px 16px;
}

/* تنسيق عناصر القائمة */
.list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 22px 20px; /* زيادة padding */
    margin-bottom: 16px;
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.06);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-right: 6px solid transparent; /* زيادة سماكة الحد */
    min-height: 70px; /* ارتفاع مناسب للمس */
}

.list-item:active {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(33, 150, 243, 0.15);
    border-right: 6px solid var(--primary-color);
}

.list-item span {
    font-size: 20px; /* زيادة حجم النص */
    color: var(--text-primary);
    font-weight: 600;
    line-height: 1.4;
}

.arrow-icon {
    color: var(--primary-color);
    font-size: 28px; /* زيادة حجم السهم */
    font-weight: bold;
    margin-left: 10px;
}

/* تنسيق النافذة المنبثقة للجوال */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    animation: fadeIn 0.3s ease-out;
    overflow: hidden;
}

.modal-content {
    background-color: var(--white);
    margin: 0;
    width: 100%;
    height: 100%;
    border-radius: 0;
    overflow: hidden;
    animation: slideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
}

/* هيدر النافذة المنبثقة */
.modal-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: var(--white);
    padding: 24px 16px;
    text-align: center;
    position: relative;
    box-shadow: 0 3px 15px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
    min-height: 70px;
}

.modal-header h2 {
    font-size: 22px; /* زيادة حجم عنوان النافذة */
    font-weight: 700;
    margin: 0;
    padding: 0 40px;
    line-height: 1.3;
}

.close-btn {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 24px; /* زيادة حجم زر الإغلاق */
    cursor: pointer;
    background: rgba(255, 255, 255, 0.2);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    touch-action: manipulation;
    z-index: 10;
}

.close-btn:active {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-50%) scale(0.95);
}

/* جسم النافذة المنبثقة */
.modal-body {
    padding: 24px 20px;
    line-height: 1.8;
    text-align: right;
    direction: rtl;
    height: calc(100vh - 70px);
    overflow-y: auto;
    overflow-x: hidden;
    font-size: 18px; /* زيادة كبيرة في حجم الخط */
    color: var(--text-primary);
    background: var(--background);
    flex-grow: 1;
    -webkit-overflow-scrolling: touch; /* تمرير سلس على iOS */
}

/* تحسين تنسيق النصوص داخل النافذة */
.modal-content-text {
    font-size: 18px;
    line-height: 1.8;
    color: var(--text-primary);
}

.modal-content-text br {
    margin-bottom: 12px;
    display: block;
    content: "";
}

.modal-content-text strong {
    color: var(--primary-dark);
    font-weight: 700;
    font-size: 19px;
}

/* تنسيق الأسطر المنقسمة */
.divider-line {
    display: block;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--primary-color), transparent);
    margin: 20px 0;
    width: 100%;
}

/* تنسيق شريط التمرير */
.modal-body::-webkit-scrollbar {
    width: 8px;
}

.modal-body::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.modal-body::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}

.modal-body::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

/* أنيميشن */
@keyframes slideUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* تنسيق للأجهزة الصغيرة */
@media screen and (max-width: 480px) {
    .header {
        padding: 18px 14px;
        height: 56px;
    }
    
    .header h1 {
        font-size: 22px;
    }
    
    .back-btn {
        font-size: 26px;
        width: 42px;
        height: 42px;
    }
    
    .content-list {
        padding: 20px 14px;
    }
    
    .list-item {
        padding: 20px 18px;
        margin-bottom: 14px;
        min-height: 66px;
    }
    
    .list-item span {
        font-size: 19px;
    }
    
    .arrow-icon {
        font-size: 26px;
    }
    
    .modal-header {
        padding: 22px 14px;
        min-height: 66px;
    }
    
    .modal-header h2 {
        font-size: 20px;
        padding: 0 36px;
    }
    
    .close-btn {
        right: 14px;
        font-size: 22px;
        width: 34px;
        height: 34px;
    }
    
    .modal-body {
        padding: 22px 18px;
        font-size: 17px; /* لا تقل عن 17px للجوال */
        height: calc(100vh - 66px);
    }
    
    .modal-content-text {
        font-size: 17px;
    }
    
    .modal-content-text strong {
        font-size: 18px;
    }
}

/* للأجهزة صغيرة جداً */
@media screen and (max-width: 360px) {
    .header h1 {
        font-size: 20px;
    }
    
    .list-item span {
        font-size: 18px;
    }
    
    .modal-body {
        font-size: 16px; /* الحد الأدنى للقراءة */
    }
    
    .modal-header h2 {
        font-size: 19px;
    }
}

/* تحسينات للعرض الأفقي */
@media screen and (orientation: landscape) and (max-height: 500px) {
    .modal-header {
        padding: 16px;
        min-height: 60px;
    }
    
    .modal-body {
        height: calc(100vh - 60px);
        padding: 16px;
    }
}

/* تحسينات الوصول وإمكانية الاستخدام */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* دعم الوضع الداكن */
@media (prefers-color-scheme: dark) {
    :root {
        --text-primary: #f0f0f0;
        --text-secondary: #cccccc;
        --background: #121212;
        --white: #1e1e1e;
    }
    
    body {
        background-color: #000000;
    }
    
    .about-container {
        background: linear-gradient(180deg, #0a1929 0%, #1e1e1e 100%);
    }
    
    .list-item {
        background: #2d2d2d;
    }
    
    .modal-content {
        background: #1e1e1e;
    }
    
    .modal-body {
        background: #121212;
        color: #f0f0f0;
    }
    
    .modal-body::-webkit-scrollbar-track {
        background: #2d2d2d;
    }
}