/* ============================
   إعدادات عامة للصفحة
============================ */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: Arial, sans-serif;
    background-color: #f0f2f5;
    padding-bottom: 70px; /* مساحة للشريط السفلي */
    overflow-x: hidden;
}

/* ============================
   Container للبوستات
============================ */
.container {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* ============================
   تصميم البوست (Full-width)
============================ */
.post {
    background-color: white;
    border-radius: 5;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    margin-bottom: 20px;
    overflow: hidden;
    width: 100vw;
    max-width: 100vw;
    position: relative;
    margin-left: calc(-50vw + 50%);
}

/* ===== رأس البوست مع صورة المستخدم ===== */
.post-header {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    font-weight: bold;
    font-size: 18px;
    gap: 10px;
}

.post-header .profile-pic {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #1877f2;
    margin-left: 8px; /* ✅ تحريك الصورة شوي على اليمين */
}

.post-text {
    padding: 15px 20px;
    font-size: 16px;
    line-height: 1.5;
    word-wrap: break-word;
    color: #000;
    white-space: pre-wrap; /* يحافظ على الأسطر الجديدة */

    /* خصائص عرض أول سطرين فقط */
    display: -webkit-box;
    -webkit-line-clamp: 2; /* الحد الأقصى: سطرين */
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
}
/* الصور داخل البوست */
.post img {
    width: 100vw;
    max-width: 100vw;
    height: auto;
    display: block;
    margin-left: calc(-50vw + 50%);
    border-radius: 0;
    cursor: pointer;
}

/* ============================
   أيقونات تعديل وحذف أعلى يمين البوست
============================ */
.post-controls {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    gap: 8px;
    z-index: 1000;
}

.post-controls button {
    width: 32px;
    height: 32px;
    background: white;
    border: none;
    padding: 0;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    transition: transform 0.2s, background 0.2s;
}

.post-controls button:hover {
    transform: scale(1.1);
    background-color: #eee;
}

.post-controls svg {
    width: 18px;
    height: 18px;
    stroke: #555;
    fill: none;
}

/* ============================
   أزرار التفاعل (إعجاب، تعليق، مشاركة)
============================ */
..actions {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start; /* الأيقونات تجي على اليسار */
    gap: 18px; /* المسافة بين الأيقونات */
    padding: 12px 16px;
    border-top: 1px solid #ddd;
}

.actions button {
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    padding: 0;
}

.actions svg {
    width: 30px;
    height: 30px;
    stroke: #333;
    fill: none;
}
/* أيقونة القلب */
.heart {
    width: 36px;
    height: 36px;
    fill: none;
    stroke: #555;
    transition: fill 0.3s, stroke 0.3s, transform 0.2s;
}

.like-btn.liked .heart {
    fill: red;
    stroke: red;
    animation: pop 0.3s;
}

@keyframes pop {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

.like-count {
    font-size: 15px;
    color: #555;
}

/* أيقونات التعليق والمشاركة */
.comment, .share {
    width: 36px;
    height: 36px;
    stroke: #555;
    transition: stroke 0.3s;
}

/* ============================
   قسم التعليقات داخل البوست
============================ */
.comments {
    padding: 12px 20px;
    border-top: 1px solid #ddd;
    display: none;
}

.comments input {
    width: 75%;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 5px;
}

.comments button {
    padding: 8px 14px;
    margin-left: 5px;
    border: none;
    background-color: #1877f2;
    color: white;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.2s;
}

.comments button:hover {
    background-color: #145dbf;
}

.comment-list div {
    display: flex;
    align-items: flex-start;
    padding: 8px 14px;
    border-bottom: 1px solid #eee;
    background-color: #f0f2f5;
    border-radius: 5px;
    margin-bottom: 5px;
    gap: 10px;
}

.comment-list .comment-pic {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid #1877f2;
}

/* ============================
   Fullscreen Modal للتعليقات
============================ */
.comment-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    z-index: 9999;
    justify-content: center;
    align-items: center;
}

.comment-modal .modal-content {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 750px;
    height: 90%;
    background-color: white;
    border-radius: 10px;
    overflow: hidden;
}

.comment-modal .modal-header {
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #fff;
    border-bottom: 1px solid #ddd;
    font-weight: bold;
}

.comment-modal .modal-body {
    flex: 1;
    padding: 15px 20px;
    overflow-y: auto;
    background-color: #f9f9f9;
}

.comment-modal .modal-footer {
    display: flex;
    gap: 10px;
    padding: 15px 20px;
    border-top: 1px solid #ddd;
    background-color: #fff;
}

.comment-modal .modal-footer input {
    flex: 1;
    padding: 12px 15px;
    border-radius: 5px;
    border: 1px solid #ccc;
}

.comment-modal .modal-footer button {
    padding: 12px 20px;
    border: none;
    background-color: red;
    color: white;
    border-radius: 5px;
    cursor: pointer;
}

.comment-modal .close-btn {
    font-size: 28px;
    cursor: pointer;
    user-select: none;
}

/* ============================
   Fullscreen Image Modal
============================ */
.image-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.9);
    z-index: 10000;
    justify-content: center;
    align-items: center;
}

.image-modal img {
    max-width: 95%;
    max-height: 95%;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
}

.image-modal .close-image {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 30px;
    color: white;
    cursor: pointer;
    user-select: none;
}

/* ============================
   Bottom Bar أسفل الصفحة
============================ */
.bottom-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 46px;
    background: linear-gradient(90deg, #222, #000, #222);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 999;
    box-shadow: 0 -2px 12px rgba(0,0,0,0.3);
    border-top-left-radius: 15px;
    border-top-right-radius: 15px;
}

.bottom-bar .icon-container {
    width: 60px;
    height: 60px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    border-radius: 50%;
}
}

.bottom-bar svg {
    width: 36px;
    height: 36px;
    stroke: white;
    fill: none;
}

.plus-btn { 
    margin-top: -24px;
}

.comment-btn {
  width: 50px !important;
  height: 50px !important;
  border-radius: 50% !important;
  background: none !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  border: none !important;
  cursor: pointer !important;
  transition: 0.2s !important;
}

.comment-btn svg {
  width: 50px !important;
  height: 50px !important;
  stroke: #000 !important;
}

/* ============================
   استجابة الهاتف (Responsive)
============================ */
@media screen and (max-width: 1024px){
    .post { max-width: 95%; margin-left: calc(-50vw + 50%); }
}

@media screen and (max-width: 768px){
    .post { max-width: 100%; margin-left: calc(-50vw + 50%); }
    .actions button { gap: 5px; padding: 5px; }
    .bottom-bar .icon-container { width: 50px; height: 50px; }
    .bottom-bar svg { width: 28px; height: 28px; }
    .plus-btn { margin-top: -20px; }
}

@media screen and (max-width: 480px){
    .post { max-width: 100%; margin-left: calc(-50vw + 50%); }
    .actions button { gap: 4px; padding: 4px; }
    .bottom-bar .icon-container { width: 45px; height: 45px; }
    .bottom-bar svg { width: 24px; height: 24px; }
    .plus-btn { margin-top: -16px; }
}