/* ================= GLOBAL ================= */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: Arial, sans-serif;
}

body {
    background: #f0f2f5;
    overflow-x: hidden;
}

/* ================= HEADER STRUCTURE & DESIGN ================= */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px; /* الـ Padding الجانبي */
    background: #1f2937; /* اللون الغامق الشيك */
    position: sticky;
    top: 0;
    height: 65px; /* ارتفاع ثابت يضمن التناسق */
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    box-sizing: border-box;
}

/* توزيع الأقسام الثلاثة لضمان عدم التداخل */
.header .right, .header .center, .header .left {
    flex: 1;
    display: flex;
    align-items: center;
}

.header .center { justify-content: center; }
.header .left { justify-content: flex-end; } /* اللوجو جهة اليسار */
.header .right { gap: 15px; } /* المسافة بين أيقونة الإعدادات وصورة البروفايل */

/* ================= LOGO STYLE ================= */
.header .left h2 {
    font-size: 24px;
    font-weight: 700;
    color: white;
    margin: 0;
    cursor: pointer;
    transition: 0.3s ease;
}

.header .left h2:hover {
    letter-spacing: 2px;
    color: #60a5fa;
    text-shadow: 0 0 10px rgba(96,165,250,0.5);
    transform: scale(1.05);
}

/* ================= LINKS & ANIMATION ================= */
.links {
    display: flex;
    gap: 15px;
}

.links a {
    text-decoration: none;
    color: white;
    font-weight: 600;
    font-size: 14px;
    transition: 0.3s ease;
    position: relative;
}

.links a:hover {
    color: #60a5fa;
    transform: translateY(-3px);
}

.links a::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -5px;
    width: 0%;
    height: 2px;
    background: #60a5fa;
    transition: 0.3s;
}

.links a:hover::after {
    width: 100%;
}

/* ================= ICONS & BUTTONS ================= */
#navProfilePic, #ht {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid transparent;
    transition: 0.3s;
}

#navProfilePic:hover, #ht:hover {
    border-color: #60a5fa;
}

#but {
    background: #374151; /* لون متناسق مع الهيدر */
    color: white;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 22px;
    cursor: pointer;
    font-weight: bold;
    transition: 0.3s;
}

#but:hover {
    background: #60a5fa;
    transform: rotate(90deg);
}

/* ================= MOBILE RESPONSIVE ================= */
@media (max-width: 600px) {
    /* إخفاء اللينكات في الموبايل عشان الزحمة */
    .header .links {
        display: none;
    }

    .header .left h2 {
        font-size: 20px;
    }

    .header {
        padding: 0 12px;
        height: 60px; /* تقليل الارتفاع شوية في الموبايل */
    }

    .header .right {
        gap: 10px;
    }
}
/* ================= POSTS ================= */
.section {
    max-width: 600px;
    margin: 20px auto;
    padding: 0 10px;
}

.post {
    background: white; border-radius: 12px; margin: 15px auto; padding: 15px;
    max-width: 600px; width: 95%; box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    border: 1px solid #e5e7eb; transition: 0.3s;
}

.post-header { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.post-header img { width: 45px; height: 45px; border-radius: 50%; object-fit: cover; }
.username { font-weight: bold; color: #1c1e21; font-size: 15px; }
.post-time { font-size: 12px; color: #65676b; }

.post-text { font-size: 16px; color: #050505; line-height: 1.4; margin-bottom: 12px; }

.post-media { width: calc(100% + 30px); margin-left: -15px; margin-right: -15px; max-height: 450px; object-fit: cover; border-top: 1px solid #eee; border-bottom: 1px solid #eee; }

.post-stats { display: flex; justify-content: space-between; padding: 10px 0; font-size: 13px; color: #65676b; border-bottom: 1px solid #ebedf0; }

.post-actions { display: flex; justify-content: space-around; padding-top: 10px; }
.post-actions button { 
    background: none; border: none; padding: 8px; color: #65676b; font-weight: 600; 
    cursor: pointer; flex: 1; border-radius: 5px; transition: 0.2s;
}
.post-actions button:hover { background: #f2f2f2; }
.like-active { color: #1877f2 !important; }
/* شكل اللايك لما يتعمل active */
.like-active {
    color: #ef4444 !important;
}
#tex {
    width: 90%;
    max-width: 600px;

    padding: 14px;
    border-radius: 12px;

    border: 1px solid #e5e7eb;
    outline: none;

    font-size: 15px;

    margin: 10px auto;
    display: block;

    resize: none;

    transition: 0.2s ease;
    background: #f9fafb;
}

#tex:focus {
    border-color: #3b82f6;
    background: #fff;
    box-shadow: 0 0 10px rgba(59,130,246,0.2);
}

#se {
    display: block;
    margin: 8px auto;

    padding: 10px 18px;
    border-radius: 10px;

    border: none;
    cursor: pointer;

    background: #2563eb;
    color: white;

    font-weight: bold;
    font-size: 14px;

    transition: 0.2s ease;
}

#se:hover {
    background: #1d4ed8;
    transform: scale(1.05);
}

#se:active {
    transform: scale(0.98);
}
#imgBtn, #videoBtn {
    margin: 5px;
    padding: 8px 12px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    background: #f3f4f6;
}

#imgBtn:hover, #videoBtn:hover {
    background: #e5e7eb;
}
.chat-toggle {
    position: fixed;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    background: #2563eb;
    color: white;
    width: 40px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-top-right-radius: 10px;
    border-bottom-right-radius: 10px;
    text-decoration: none;
    font-size: 20px;
    box-shadow: 0 0 10px rgba(0,0,0,0.2);
    transition: 0.3s;
}

.chat-toggle:hover {
    width: 50px;
}
.right {
    display: flex;
    align-items: center;
    gap: 10px;
}
/* ================= PROFILE IMAGE ================= */
#navProfilePic {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid white;
    cursor: pointer;
    transition: all 0.3s ease;
}

/* هوفر */
#navProfilePic:hover {
    transform: scale(1.1);
    box-shadow: 0 0 10px rgba(96,165,250,0.7);
    border-color: #60a5fa;
}

/* عند الضغط */
#navProfilePic:active {
    transform: scale(0.95);
}


/* ================= SETTINGS ICON ================= */
#ht {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: white;
    padding: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
}

/* هوفر */
#ht:hover {
    transform: rotate(90deg) scale(1.1);
    background: #60a5fa;
    box-shadow: 0 0 12px rgba(96,165,250,0.6);
}

/* عند الضغط */
#ht:active {
    transform: scale(0.9) rotate(180deg);
}
/* =============================================
   النظام الموحد للوضع المظلم - Kirafix Final Dark Mode
   ============================================= */

body.dark-mode {
    background-color: #111212 !important; /* خلفية الصفحة الغامقة */
    color: #ffffff !important; /* اللون الأساسي للنصوص */
}

/* 1. الحاويات الرئيسية (البوستات، الكروت، المودال) */
body.dark-mode .chat-container, 
body.dark-mode .profile-header, 
body.dark-mode .post, 
body.dark-mode .composer,
body.dark-mode .modal-content,
body.dark-mode .setting-card,
body.dark-mode .profile-card {
    background-color: #1c1e21 !important;
    border-color: #3e4042 !important;
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.5) !important;
}

/* 2. الهيدر وبار الإدخال */
body.dark-mode .header,
body.dark-mode .chat-header, 
body.dark-mode .input-bar {
    background-color: #242526 !important;
    border-bottom: 1px solid #3e4042 !important;
    color: #ffffff !important;
}

/* 3. النصوص العامة (عناوين، فقرات، سبان) */
body.dark-mode h1, 
body.dark-mode h2, 
body.dark-mode h3, 
body.dark-mode p, 
body.dark-mode span, 
body.dark-mode div,
body.dark-mode label,
body.dark-mode small {
    color: #ffffff !important;
}

/* 4. حقول الكتابة (Input, Textarea, Select) */
body.dark-mode #messageInput, 
body.dark-mode #tex,
body.dark-mode input, 
body.dark-mode textarea,
body.dark-mode select {
    background-color: #3a3b3c !important;
    color: #ffffff !important;
    border: 1px solid #4e4f50 !important;
}

/* 5. فقاعات الشات (رسائل الآخرين) */
body.dark-mode .theirs .msg-bubble {
    background-color: #3a3b3c !important;
    color: #ffffff !important;
}

/* 6. الروابط والاستثناءات (لألوان مريحة للعين) */
body.dark-mode a {
    color: #4da3ff !important; /* أزرق فاتح مريح في الضلمة */
}

body.dark-mode #handle, 
body.dark-mode .post-footer small,
body.dark-mode .post-time,
body.dark-mode .del-hint {
    color: #b0b3b8 !important; /* رمادي فاتح للنصوص الثانوية */
}

/* 7. الأزرار في الوضع المظلم (اختياري لتحسين الشكل) */
body.dark-mode .btn-edit, 
body.dark-mode .upload-btns button {
    background-color: #4e4f50 !important;
    color: #ffffff !important;
}
body.dark-mode #but {
    color: #1c1e21 !important; /* أو أي لون تحبه يظهر بوضوح جوه الدائرة الصفراء/البيضاء */
    background-color: #ffffff !important; /* لو عايز الدائرة نفسها تفضل فاتحة */
}
/* زرار المنيو (مخفي في الكمبيوتر) */
.menu-icon {
    display: none;
    font-size: 28px;
    color: white;
    cursor: pointer;
    order: 0; /* عشان يجي في الأول خالص */
}

/* القائمة الجانبية */
.side-nav {
    position: fixed;
    top: 0;
    left: -280px; /* مخفية جهة اليسار */
    width: 260px;
    height: 100%;
    background: #111827; /* أغمق من الهيدر لشكل احترافي */
    z-index: 2000;
    transition: 0.4s ease-in-out;
    padding: 20px;
    box-shadow: 5px 0 15px rgba(0,0,0,0.3);
}

.side-nav.active {
    left: 0; /* تظهر لما تاخد Class active */
}

.close-btn {
    font-size: 35px;
    color: #60a5fa;
    text-align: right;
    cursor: pointer;
    margin-bottom: 30px;
}

.side-links {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.side-links a {
    color: white;
    text-decoration: none;
    font-size: 18px;
    font-weight: 600;
    border-bottom: 1px solid #374151;
    padding-bottom: 10px;
    transition: 0.3s;
}

.side-links a:hover {
    color: #60a5fa;
    padding-left: 10px;
}

/* تعديل الموبايل */
@media (max-width: 600px) {
    .menu-icon {
        display: block; /* يظهر في الموبايل بس */
    }
    
    .header .links {
        display: none; /* إخفاء اللينكات العادية */
    }
}


