/* assets/css/main.css - FINAL FIX 16:9 CONTAIN (Cleaned) */

/* --- GIỮ NGUYÊN PHẦN CHUNG --- */
body { 
    font-family: 'Inter', sans-serif; 
    background-color: var(--bg-body); 
    color: var(--text-main); 
    transition: background-color 0.3s ease, color 0.3s ease; 
    padding-left: 260px; 
    min-height: 100vh; 
}
.mesh-container { 
    max-width: 1000px; 
    margin: 0 auto; 
    padding: 30px 20px; 
    display: flex; 
    flex-direction: column; 
}
.layout-grid { 
    display: grid; 
    grid-template-columns: minmax(500px, 750px); 
    justify-content: center; 
    gap: 0; 
    align-items: start; 
    flex-grow: 1; 
    width: 100%; 
}
.sidebar { 
    display: none !important; 
}
.text-muted { 
    color: var(--text-muted); 
    font-size: 0.95rem; 
}
.avatar-small { 
    width: 36px; 
    height: 36px; 
    border-radius: 50%; 
    object-fit: cover; 
}
.avatar-medium { 
    width: 44px; 
    height: 44px; 
    border-radius: 50%; 
    object-fit: cover; 
}

/* --- POST FORM (CREATE POST CARD) --- */
.create-post-card { 
    border-bottom: 1px solid var(--border-color); 
    padding-bottom: 20px; 
    margin-bottom: 20px; 
}
.post-header-simple { 
    display: flex; 
    align-items: center; 
    gap: 12px; 
    margin-bottom: 10px; 
}
.post-form textarea { 
    width: 100%; 
    border: none; 
    background: transparent; 
    color: var(--text-main); 
    font-family: 'Inter', sans-serif; 
    font-size: 1rem; 
    resize: none; 
    outline: none; 
    padding: 10px 0 10px 56px; 
    min-height: 40px; 
    line-height: 1.4; 
}
.form-actions { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    padding-left: 56px; 
    margin-top: 15px; 
}
.attach-icons { 
    color: var(--text-muted); 
    font-size: 1.1rem; 
    display: flex; 
    gap: 18px; 
}
.attach-icons i { 
    cursor: pointer; 
    transition: color 0.2s; 
}
.attach-icons i:hover { 
    color: var(--primary-color); 
}
.btn-post { 
    background-color: var(--primary-color); 
    color: #fff; 
    border: none; 
    padding: 8px 20px; 
    border-radius: 20px; 
    font-weight: 600; 
    cursor: pointer; 
    font-size: 0.9rem; 
    transition: opacity 0.2s, transform 0.1s; 
}
.btn-post:hover { 
    opacity: 0.9; 
}
.error-msg { 
    color: #ff3b5b; 
    background-color: #ffeaea; 
    border: 1px solid #ff3b5b; 
    padding: 10px; 
    margin-top: 15px; 
    border-radius: 8px; 
    font-size: 0.9rem; 
}
.image-preview-grid { 
    display: flex; 
    overflow-x: auto; 
    gap: 10px; 
    margin-top: 15px; 
    margin-bottom: 15px; 
    padding-left: 56px; 
    padding-bottom: 10px; 
    scrollbar-width: none; 
}
.image-preview-grid::-webkit-scrollbar { 
    display: none; 
}
.preview-image-wrapper { 
    position: relative; 
    width: 100px; 
    height: 100px; 
    flex-shrink: 0; 
    border-radius: 8px; 
    overflow: hidden; 
}
.preview-image { 
    width: 100%; 
    height: 100%; 
    object-fit: cover; 
}
.delete-preview-btn { 
    position: absolute; 
    top: 5px; 
    right: 5px; 
    background: rgba(0, 0, 0, 0.5); 
    color: white; 
    border: none; 
    border-radius: 50%; 
    width: 24px; 
    height: 24px; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    font-size: 0.8rem; 
    cursor: pointer; 
    z-index: 10; 
}

/* --- POST ITEM --- */
.post-item { 
    display: flex; 
    gap: 16px; 
    padding: 20px 0; 
    border-bottom: 1px solid var(--border-color); 
    transition: background-color 0.3s; 
    cursor: pointer; /* Giữ lại cursor: pointer cho post-item trên Feed */
}
.post-item:hover { 
    background-color: var(--icon-hover-bg); 
}
.post-left { 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    position: relative; 
    padding-left: 4px; 
}
.post-right { 
    flex-grow: 1; 
}
.post-meta { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    margin-bottom: 6px; 
}
.user-name { 
    font-weight: 700; 
    color: var(--text-main); 
    font-size: 1rem; 
    transition: color 0.2s; 
}
.time-ago { 
    color: var(--text-muted); 
    font-size: 0.85rem; 
    margin-left: 10px; 
}
.post-options { 
    color: var(--text-muted); 
    cursor: pointer; 
    padding: 4px; 
    margin-left: auto; 
    transition: color 0.2s; 
    position: relative; 
}
.post-options-btn { 
    cursor: pointer; 
    padding: 4px; 
    transition: color 0.2s, background-color 0.2s; 
    border-radius: 50%; 
}
.options-dropdown { 
    display: none; 
    position: absolute; 
    top: 100%; 
    right: 0; 
    min-width: 160px; 
    background-color: var(--bg-body); 
    border: 1px solid var(--border-color); 
    border-radius: 8px; 
    box-shadow: 0 4px 12px rgba(0,0,0,0.15); 
    z-index: 1000; 
    padding: 5px 0; 
}
.options-dropdown.active { 
    display: block; 
}
.action-item { 
    display: flex; 
    align-items: center; 
    width: 100%; 
    padding: 8px 15px; 
    border: none; 
    background: none; 
    color: var(--text-main); 
    text-align: left; 
    cursor: pointer; 
    font-size: 0.9rem; 
}
.action-item:hover { 
    background-color: var(--icon-hover-bg); 
}
.action-item i { 
    margin-right: 8px; 
    width: 16px; 
    text-align: center; 
}
.post-content { 
    font-size: 1rem; 
    line-height: 1.6; 
    color: var(--text-main); 
    margin-bottom: 15px; 
}
.post-clickable-area { 
    cursor: pointer; 
    display: block; 
    color: inherit; 
    text-decoration: none; 
    padding-bottom: 5px; 
}

/* --- ACTIONS (LIKE, COMMENT, SHARE) --- */
.post-actions { 
    display: flex; 
    align-items: center; 
    gap: 15px; 
    margin-bottom: 10px; 
}
.action-btn { 
    background: none; 
    border: none; 
    color: var(--text-main); 
    cursor: pointer; 
    font-size: 1.1rem; 
    padding: 8px; 
    border-radius: 50%; 
    transition: all 0.2s; 
}
.like-btn:hover, .comment-btn:hover, .share-btn:hover, .send-btn:hover { 
    background-color: var(--primary-light); 
    color: var(--primary-color); 
}
.action-btn.liked { 
    color: #ff3b5b; 
}
.count-text { 
    font-size: 0.85rem; 
    color: var(--text-muted); 
    font-weight: 500; 
    margin-right: 5px; 
}
.post-footer-stats { 
    padding-top: 10px; 
    border-top: 1px solid var(--border-color); 
    display: flex; 
    gap: 15px; 
}
.post-actions .comment-btn { 
    display: flex; 
    align-items: center; 
    justify-content: center; 
}

/* --- FOOTER & MODAL LIKERS --- */
.main-footer { 
    width: 100%; 
    text-align: center; 
    padding: 30px 0 20px 0; 
    margin-top: 50px; 
    font-size: 0.85rem; 
    color: var(--text-muted); 
    border-top: 1px solid var(--border-color); 
}
.main-footer p { 
    margin: 5px 0; 
}
.modal-list { 
    display: none; 
    position: fixed; 
    z-index: 100000; 
    left: 0; 
    top: 0; 
    width: 100%; 
    height: 100%; 
    background-color: rgba(0, 0, 0, 0.5); 
    justify-content: center; 
    align-items: center; 
}
.modal-list-content { 
    background-color: var(--bg-body); 
    width: 400px; 
    max-width: 90%; 
    border-radius: 12px; 
    box-shadow: 0 5px 20px rgba(0,0,0,0.3); 
    overflow: hidden; 
    display: flex; 
    flex-direction: column; 
    max-height: 80vh; 
    border: 1px solid var(--border-color); 
}
.modal-list-header { 
    padding: 15px; 
    border-bottom: 1px solid var(--border-color); 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
}
.modal-list-header h3 { 
    margin: 0; 
    font-size: 1.1rem; 
    color: var(--text-main); 
}
.close-list-btn { 
    font-size: 24px; 
    cursor: pointer; 
    color: var(--text-muted); 
    line-height: 1; 
}
.close-list-btn:hover { 
    color: var(--text-main); 
}
.modal-list-body { 
    padding: 0; 
    overflow-y: auto; 
    flex-grow: 1; 
}
.liker-item { 
    display: flex; 
    align-items: center; 
    padding: 10px 15px; 
    gap: 12px; 
    transition: background 0.2s; 
}
.liker-item:hover { 
    background-color: var(--icon-hover-bg); 
}
.liker-avatar-link img { 
    width: 40px; 
    height: 40px; 
    border-radius: 50%; 
    object-fit: cover; 
}
.liker-info { 
    display: flex; 
    flex-direction: column; 
}
.liker-name { 
    font-weight: 600; 
    color: var(--text-main); 
    text-decoration: none; 
    font-size: 0.95rem; 
}
.liker-name:hover { 
    text-decoration: underline; 
}
.liker-username { 
    color: var(--text-muted); 
    font-size: 0.85rem; 
}
.no-likes { 
    padding: 20px; 
    text-align: center; 
    color: var(--text-muted); 
}
.loading-spinner { 
    padding: 20px; 
    text-align: center; 
    color: var(--text-muted); 
}
.likes-remaining { 
    padding: 15px; 
    text-align: center; 
    font-size: 0.95rem; 
    color: var(--text-muted); 
    border-top: 1px solid var(--border-color); 
    background-color: rgba(0, 0, 0, 0.02); 
    margin-top: 5px; 
}
.likes-remaining b { 
    color: var(--text-main); 
    font-weight: 700; 
}
.like-count-display:hover { 
    text-decoration: underline; 
    color: var(--text-main); 
}

/* --- RESPONSIVE --- */
@media (max-width: 900px) { 
    .layout-grid { 
        grid-template-columns: 1fr; 
    } 
}
@media (max-width: 768px) { 
    body { 
        padding-left: 0; 
        padding-bottom: 70px; 
    } 
    .mesh-container { 
        padding: 15px; 
    } 
}

/* --- MISC --- */
@keyframes fadeIn { 
    from { 
        opacity: 0; 
    } 
    to { 
        opacity: 1; 
    } 
}