﻿:root {
    --bg-color: #f8f6f2;
    --card-bg: #ffffff;
    --text-dark: #222;
    --text-muted: #666;
    --primary-btn: #1d5374;
    --border-color: #e5e5e5;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Tajawal', sans-serif;
    background-color: #e0e0e0; /* خلفية رمادية للشاشات الكبيرة */
    display: flex;
    justify-content: center;
}

/* حاوية محاكاة شاشة الهاتف */
.app-container {
    width: 100%;
    margin: 0 auto;
    max-width: 480px; /* أقصى عرض ليكون مثل الهاتف */
    background-color: var(--bg-color);
    min-height: 100vh;
    position: relative;
    box-shadow: 0 0 15px rgba(0,0,0,0.1);
    overflow-x: hidden;
    padding-bottom: 80px !important;
}

/* الرأس - Header */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background-color: var(--bg-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    text-align: center;
    line-height: 1.2;
}

    .header-logo i {
        font-size: 24px;
    }

.header-icon {
    font-size: 22px;
    cursor: pointer;
    color: var(--text-dark);
}

/* العناوين الفرعية */
.section-title {
    padding: 0 20px;
    font-size: 18px;
    font-weight: 700;
    margin: 15px 0 10px;
    color: var(--text-dark);
}

/* القصص - Stories */
.stories-wrapper {
    display: flex;
    overflow-x: auto;
    padding: 0 20px 15px;
    gap: 15px;
    scrollbar-width: none; /* إخفاء شريط التمرير */
}

    .stories-wrapper::-webkit-scrollbar {
        display: none;
    }

.story-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    min-width: 65px;
}

.story-circle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--card-bg);
    border: 2px solid #cd9a5b; /* لون إطار القصة */
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    font-size: 24px;
    color: var(--text-dark);
}

    .story-circle img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

.story-title {
    font-size: 12px;
    text-align: center;
    white-space: nowrap;
}

/* بطاقة المنشور - Post Card */
.post-card {
    background-color: var(--card-bg);
    border-radius: 15px;
    margin: 0 15px 20px;
    padding: 15px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.03);
}

.post-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.user-name {
    font-weight: 700;
    font-size: 14px;
    margin: 0;
}

.user-handle {
    color: var(--text-muted);
    font-size: 12px;
    margin: 0;
    direction: ltr;
}

.post-image {
    width: 100%;
    border-radius: 10px;
    margin-bottom: 15px;
    object-fit: cover;
}

.post-actions {
    display: flex;
    justify-content: space-between;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 15px;
}

.action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    color: var(--text-dark);
    font-size: 13px;
}

    .action-btn i {
        font-size: 20px;
    }

.post-content .rating {
    color: #f39c12;
    margin-bottom: 5px;
    font-weight: bold;
}

.post-content h3 {
    margin: 0 0 5px;
    font-size: 18px;
}

.post-content p {
    margin: 0;
    font-size: 14px;
    color: var(--text-muted);
}

.hashtags {
    color: #3498db;
}

/* الكتب المتداولة - Trending Books */
/* الحاوية الأساسية للتمرير الأفقي */
.trending-wrapper {
    display: flex;
    overflow-x: auto;
    padding: 0 15px 15px;
    gap: 15px;
    scrollbar-width: none; /* إخفاء شريط التمرير */
}

    .trending-wrapper::-webkit-scrollbar {
        display: none;
    }

/* بطاقة الكتاب */
.book-card {
    min-width: 130px; /* عرض ثابت للبطاقة */
    max-width: 130px; /* منع البطاقة من التمدد بسبب النصوص الطويلة */
    flex-shrink: 0; /* ✨ السر هنا: يمنع البطاقة من الانكماش لما الشاشة تصغر */
    background: var(--card-bg);
    border-radius: 12px;
    padding: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.03);
    display: flex;
    flex-direction: column;
}

 
.book-cover-img {
    width: 100%;
    height: 180px; 
    object-fit: cover;  
    border-radius: 8px;
    margin-bottom: 10px;
}

 
.book-card h4 {
    margin: 0 0 5px;
    font-size: 14px;
    text-align: center;
    white-space: nowrap;  
    overflow: hidden;
    text-overflow: ellipsis;  
}

.book-card p {
    margin: 0 0 10px;
    font-size: 12px;
    color: var(--text-muted);
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-grow: 1;  
}

.add-btn {
    background-color: var(--primary-btn);
    color: white;
    border: none;
    width: 100%;
    padding: 8px;
    border-radius: 20px;
    font-family: 'Tajawal', sans-serif;
    font-weight: bold;
    cursor: pointer;
    margin-top: auto;  
}

 
.bottom-nav {
    position: absolute;
    bottom: 0;
    width: 100%;
    background: var(--card-bg);
    display: flex;
    justify-content: space-around;
    padding: 10px 0;
    border-top: 1px solid var(--border-color);
    z-index: 100;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: var(--text-muted);
    font-size: 11px;
    text-decoration: none;
}

    .nav-item i {
        font-size: 20px;
    }

    .nav-item.active {
        color: var(--text-dark);
        font-weight: 700;
    }

    .nav-item .add-circle {
        border: 1px solid var(--text-dark);
        border-radius: 8px;
        padding: 2px 8px;
    }





:root {
    --bg-color: #f8f6f2;
    --card-bg: #ffffff;
    --text-dark: #222;
    --text-muted: #666;
    --primary-btn: #1d5374;
    --border-color: #e5e5e5;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Tajawal', sans-serif;
    background-color: #e0e0e0;
    display: flex;
    justify-content: center;
}

.app-container {
    width: 100%;
    max-width: 480px;
    background-color: var(--bg-color);
    min-height: 100vh;
    position: relative;
    padding-bottom: 70px;
    box-shadow: 0 0 15px rgba(0,0,0,0.1);
    overflow-x: hidden;
}
 

.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background-color: #fff;
    border-bottom: 1px solid #eaeaea;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-logo {
    text-align: center;
    font-weight: bold;
    color: #21618C; 
    line-height: 1.1;
    font-size: 1.1rem;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;  
}


.user-greeting {
    font-size: 0.85rem;
    color: #555;
    display: none;
}

@media (min-width: 360px) {
    .user-greeting {
        display: inline-block;
    }
}

.login-btn {
    font-size: 0.85rem;
    padding: 5px 15px;
    border-radius: 20px;
    text-decoration: none;
    background-color: #21618C;
    color: white;
    font-weight: bold;
}

.ks-logo-img {
    height: 28px; /* نفس ارتفاع النص تقريباً */
    width: auto;
    display: inline-block;
}