/* assets/css/style.css */

/* --- GLOBAL STYLES & RESET --- */
body {
    font-family: 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif; /* Font mirip Facebook */
    margin: 0;
    padding: 0;
    background-color: #f0f2f5; /* Latar belakang abu-abu muda khas FB */
    color: #050505; /* Warna teks utama lebih gelap */
    line-height: 1.34; /* Line height standar FB */
}

.container {
    width: 90%;
    max-width: 980px; /* Lebar konten utama FB lebih lebar dari 960px */
    margin: 0 auto;
    padding: 20px;
    box-sizing: border-box; /* Pastikan padding tidak menambah lebar */
}

a {
    text-decoration: none;
    color: #1877f2; /* Warna biru link khas FB */
}

a:hover {
    text-decoration: underline;
}

/* --- REUSABLE COMPONENTS --- */
.profile-pic-small {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 10px;
    border: 1px solid #e4e6eb; /* Border tipis untuk foto profil */
}

.card-panel { /* Gaya dasar untuk box konten seperti postingan, form, dll */
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.2); /* Shadow halus khas FB */
    padding: 20px;
    margin-bottom: 20px;
    box-sizing: border-box;
}

/* --- HEADER STYLING (FACEBOOK-LIKE & RESPONSIVE) --- */
.main-header.fb-header {
    background-color: #fff;
    border-bottom: 1px solid #e4e6eb; /* Border bawah halus */
    box-shadow: 0 1px 2px rgba(0,0,0,0.1); /* Shadow halus */
    display: flex;
    flex-direction: column; /* Susun baris atas dan bawah secara vertikal */
    position: sticky;
    top: 0;
    z-index: 1000;
    height: auto; /* Tinggi otomatis karena dua baris */
    box-sizing: border-box;
    padding: 0; /* Padding akan diatur di dalam baris */
}

/* Sembunyikan header mobile secara default di desktop */
.main-header.fb-header .header-mobile-content {
    display: none;
}

/* Header Desktop (Visible by default, hidden in mobile media query) */
.main-header.fb-header .header-desktop-content {
    display: flex; /* Aktifkan di desktop */
    justify-content: space-between;
    align-items: center;
    padding: 8px 16px; /* Padding baris atas */
    width: 100%;
    height: 56px; /* Tinggi baris atas */
    box-sizing: border-box;
}

.header-top-left {
    display: flex;
    align-items: center;
    flex-grow: 1;
}

.fb-header .logo a {
    font-size: 28px; /* Ukuran logo lebih besar */
    font-weight: bold;
    color: #1877f2;
    text-decoration: none;
    margin-right: 10px;
}

.fb-header .search-bar { /* Search bar Desktop */
    position: relative;
    background-color: #f0f2f5; /* Latar belakang search bar */
    border-radius: 20px;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    width: 240px;
}
.fb-header .search-bar i {
    color: #65676b; /* Warna ikon search */
    margin-right: 8px;
}
.fb-header .search-bar input {
    border: none;
    background: transparent;
    outline: none;
    padding: 0;
    font-size: 15px;
    color: #050505;
    width: calc(100% - 24px);
}
.fb-header .search-bar input::placeholder {
    color: #8a8d91;
}

/* Navigasi Tengah (Desktop) */
.fb-header .header-nav-desktop { /* Nama kelas baru untuk navigasi desktop */
    flex-grow: 1;
    justify-content: center;
    height: 100%;
}

.fb-header .nav-links-desktop { /* Nama kelas baru untuk ul navigasi desktop */
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    height: 100%;
    width: 100%;
    max-width: 800px; /* Batasi lebar maksimal seperti FB */
}

.fb-header .nav-links-desktop li {
    flex: 1;
    margin: 0 4px;
    position: relative;
    height: 100%;
}

.fb-header .nav-links-desktop li a {
    color: #65676b;
    font-size: 24px;
    text-decoration: none;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
    width: 100%;
    padding: 0;
    border-radius: 8px;
    transition: background-color 0.2s ease, color 0.2s ease;
}
.fb-header .nav-links-desktop li a:hover {
    background-color: #f0f2f5;
}
.fb-header .nav-links-desktop li a.active-nav-link {
    color: #1877f2;
}
.fb-header .nav-links-desktop li a.active-nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: #1877f2;
    border-top-left-radius: 2px;
    border-top-right-radius: 2px;
}

/* Header Right (Desktop) */
.header-right-desktop { /* Nama kelas baru untuk header kanan desktop */
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: 20px;
}

.fb-header .header-profile-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: #050505;
    font-weight: 600;
    padding: 6px 10px 6px 6px;
    border-radius: 20px;
    background-color: #e4e6eb;
    transition: background-color 0.2s ease;
}
.fb-header .header-profile-link:hover {
    background-color: #d8dadf;
}
.fb-header .header-profile-pic {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 6px;
    border: none;
}
.fb-header .header-username {
    font-size: 15px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100px;
}
.fb-header .header-icon-button { /* Gaya umum untuk tombol bulat di desktop kanan (settings, logout) */
    background-color: #e4e6eb;
    color: #050505;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 18px;
    text-decoration: none;
    transition: background-color 0.2s ease;
    border: none;
    cursor: pointer;
}
.fb-header .header-icon-button:hover {
    background-color: #d8dadf;
}
.fb-header .header-button { /* Gaya untuk tombol login/daftar di desktop */
    background-color: #1877f2;
    color: white;
    padding: 8px 15px;
    border-radius: 5px;
    font-weight: bold;
    font-size: 14px;
    transition: background-color 0.2s ease;
}
.fb-header .header-button:hover {
    background-color: #165bba;
}


/* Badge Notifikasi (Umum untuk Header) */
.notification-badge {
    background-color: #f02849;
    color: white;
    border-radius: 50%;
    padding: 3px 6px;
    font-size: 11px;
    font-weight: bold;
    position: absolute;
    top: -4px;
    right: -8px;
    line-height: 1;
    min-width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    box-sizing: border-box;
    border: 1px solid #fff;
    text-align: center;
}


/* --- MOBILE HEADER & OVERLAY (MEDIA QUERY) --- */
@media (max-width: 768px) {
    /* Sembunyikan header desktop sepenuhnya */
    .main-header.fb-header .header-desktop-content {
        display: none;
    }

    /* Tampilkan header mobile */
    .main-header.fb-header .header-mobile-content {
        display: flex; /* Aktifkan tampilan header mobile */
        flex-direction: column; /* Tetap dua baris */
        height: auto;
        padding: 0;
        width: 100%;
        box-sizing: border-box;
        background-color: #fff;
        box-shadow: 0 1px 2px rgba(0,0,0,0.1);
        position: sticky;
        top: 0;
        z-index: 999; /* Pastikan di bawah overlay penuh */
    }

    /* Baris Atas Mobile (Logo & Tombol Kanan) */
    .mobile-top-bar {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0 12px;
        height: 56px; /* Tinggi standar */
        border-bottom: 1px solid #f0f2f5; /* Garis pemisah */
    }

    .mobile-logo a {
        font-size: 24px;
        font-weight: bold;
        color: #1877f2;
        text-decoration: none;
    }

    .mobile-top-actions {
        display: flex;
        align-items: center;
        gap: 8px; /* Jarak antar tombol */
    }
    .mobile-top-actions .mobile-search-button-trigger,
    .mobile-top-actions .mobile-menu-button-trigger,
    .mobile-top-actions .mobile-logout-button-trigger { /* Tambah class trigger logout mobile */
        background-color: #e4e6eb;
        color: #050505;
        width: 36px;
        height: 36px;
        border-radius: 50%;
        display: flex;
        justify-content: center;
        align-items: center;
        font-size: 18px;
        text-decoration: none;
        transition: background-color 0.2s ease;
    }
    .mobile-top-actions .mobile-search-button-trigger:hover,
    .mobile-top-actions .mobile-menu-button-trigger:hover,
    .mobile-top-actions .mobile-logout-button-trigger:hover {
        background-color: #d8dadf;
    }

    /* Navigasi Ikon Utama Mobile (Baris Kedua) */
    .mobile-main-nav {
        width: 100%;
        height: 48px; /* Tinggi bar navigasi mobile */
        display: flex;
        justify-content: center;
        align-items: center;
        box-sizing: border-box;
        border-bottom: 1px solid #e4e6eb; /* Garis bawah navigasi */
    }
    .mobile-main-nav ul {
        list-style: none;
        padding: 0;
        margin: 0;
        display: flex;
        height: 100%;
        width: 100%; /* Lebar penuh */
        max-width: 600px; /* Batasi lebar agar tidak terlalu melebar di tablet */
    }
    .mobile-main-nav ul li {
        flex: 1; /* Setiap ikon mengambil ruang yang sama */
        height: 100%;
        position: relative;
    }
    .mobile-main-nav ul li a {
        color: #65676b;
        font-size: 24px; /* Ukuran ikon utama mobile */
        text-decoration: none;
        display: flex;
        justify-content: center;
        align-items: center;
        height: 100%;
        width: 100%;
        transition: background-color 0.2s ease;
    }
    .mobile-main-nav ul li a:hover {
        background-color: #f0f2f5;
    }
    .mobile-main-nav ul li a.active-nav-link {
        color: #1877f2;
    }
    .mobile-main-nav ul li a.active-nav-link::after {
        content: '';
        position: absolute;
        bottom: 0;
        left: 0;
        width: 100%;
        height: 3px;
        background-color: #1877f2;
        border-top-left-radius: 2px;
        border-top-right-radius: 2px;
    }
    .mobile-main-nav ul li .notification-badge { /* Badge di ikon mobile nav */
        top: 4px;
        right: 4px;
        font-size: 10px;
        padding: 2px 5px;
        min-width: 14px;
        height: 14px;
    }

    /* Mobile Search Bar Overlay */
    .mobile-search-bar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 56px; /* Tinggi sama dengan header */
        background-color: #fff;
        z-index: 1001;
        display: none; /* Hidden by default */
        align-items: center;
        padding: 0 12px;
        box-sizing: border-box;
        box-shadow: 0 2px 4px rgba(0,0,0,.1);
    }
    .mobile-search-bar-overlay.active {
        display: flex; /* Tampilkan saat aktif */
    }
    .mobile-search-bar-overlay .mobile-search-form {
        display: flex;
        align-items: center;
        flex-grow: 1;
        background-color: #f0f2f5;
        border-radius: 20px;
        padding: 8px 12px;
    }
    .mobile-search-bar-overlay .mobile-search-form i.fa-search {
        color: #606770;
        margin-right: 8px;
    }
    .mobile-search-bar-overlay .mobile-search-form input {
        border: none;
        background: transparent;
        outline: none;
        padding: 0;
        font-size: 16px;
        flex-grow: 1;
        color: #050505;
    }
    .mobile-search-bar-overlay .mobile-search-form .back-button-search-mobile {
        background: none;
        border: none;
        font-size: 20px;
        color: #65676b;
        margin-right: 10px;
        cursor: pointer;
    }
    .mobile-search-bar-overlay .mobile-search-form .submit-search-mobile {
        background: none;
        border: none;
        color: #1877f2;
        font-size: 18px;
        cursor: pointer;
        margin-left: 10px;
    }


    /* Mobile Overlay Menu (Samping Kanan) */
    .mobile-overlay-menu {
        position: fixed;
        top: 0;
        right: -300px; /* Sembunyikan di luar layar kanan */
        width: 300px; /* Lebar menu overlay */
        height: 100%;
        background-color: #fff;
        z-index: 1002;
        display: flex;
        flex-direction: column;
        box-shadow: -2px 0 8px rgba(0,0,0,0.2);
        transition: right 0.3s ease-in-out;
    }
    .mobile-overlay-menu.active {
        right: 0;
    }
    .mobile-overlay-menu .overlay-header {
        background-color: #fff;
        padding: 15px;
        border-bottom: 1px solid #ddd;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    .mobile-overlay-menu .overlay-header .profile-info {
        display: flex;
        align-items: center;
        font-weight: bold;
    }
    .mobile-overlay-menu .overlay-header .overlay-profile-pic {
        width: 40px;
        height: 40px;
        border-radius: 50%;
        object-fit: cover;
        margin-right: 10px;
    }
    .mobile-overlay-menu .overlay-header .overlay-username {
        font-size: 17px;
        color: #050505;
    }
    .mobile-overlay-menu .overlay-header .overlay-guest {
        font-style: italic;
        color: #65676b;
    }
    .mobile-overlay-menu .overlay-header .close-overlay-menu {
        background: none;
        border: none;
        font-size: 20px;
        cursor: pointer;
        color: #65676b;
    }
    .mobile-overlay-menu .overlay-links {
        list-style: none;
        padding: 0;
        margin: 0;
        flex-grow: 1;
        overflow-y: auto;
    }
    .mobile-overlay-menu .overlay-links li a {
        display: flex;
        align-items: center;
        padding: 15px;
        text-decoration: none;
        color: #050505;
        border-bottom: 1px solid #f0f2f5;
        font-size: 17px;
        transition: background-color 0.2s ease;
    }
    .mobile-overlay-menu .overlay-links li a:hover {
        background-color: #f0f2f5;
    }
    .mobile-overlay-menu .overlay-links li a i {
        margin-right: 10px;
        font-size: 20px;
        color: #65676b;
    }

    /* Penyesuaian padding-top main-content agar tidak tertutup header mobile */
    .main-content {
        padding-top: 104px; /* Tinggi header mobile (56px top bar + 48px nav bar) */
    }
}

/* Penyesuaian untuk layar ponsel yang lebih kecil lagi (misal < 480px) */
@media (max-width: 480px) {
    .mobile-logo a {
        font-size: 22px;
    }
    .mobile-main-nav ul li a {
        font-size: 20px; /* Ikon lebih kecil */
        padding: 0 6px; /* Padding lebih sempit */
    }
    .mobile-top-actions a {
        width: 32px;
        height: 32px;
        font-size: 16px;
    }
    .mobile-overlay-menu {
        width: 100%;
        right: -100%;
    }
    .mobile-overlay-menu.active {
        right: 0;
    }
    .mobile-search-bar-overlay .mobile-search-form input {
        font-size: 15px;
    }
    .mobile-search-bar-overlay .mobile-search-form .back-button-search-mobile,
    .mobile-search-bar-overlay .mobile-search-form .submit-search-mobile {
        font-size: 14px;
    }

    .main-content {
        padding-top: 100px; /* Sesuaikan padding-top untuk header yang lebih kecil (56+44 = 100) */
    }
}


/* --- General Layout & Other Styles (Pertahankan yang sudah ada di bawah ini) --- */

/* Footer (Sudah disederhanakan) */
.main-footer {
    background-color: #fff;
    padding: 20px 0;
    text-align: center;
    border-top: 1px solid #ddd;
    margin-top: 20px;
}

.main-footer p {
    margin: 0;
    color: #666;
    font-size: 14px;
}

/* Form Styling (basic) */
form {
    background-color: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,.1);
    margin-top: 20px;
}

form label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
}

form input[type="text"],
form input[type="email"],
form input[type="password"] {
    width: calc(100% - 20px);
    padding: 10px;
    margin-bottom: 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
}

form button {
    background-color: #1877f2;
    color: white;
    padding: 12px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s ease;
}

form button:hover {
    background-color: #165bba;
}

/* Styling untuk form postingan baru */
.post-creation-box {
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,.1);
    margin-bottom: 30px;
}

.post-creation-box h3 {
    margin-top: 0;
    color: #555;
    text-align: center;
    margin-bottom: 20px;
}

.post-creation-box textarea {
    width: calc(100% - 20px);
    padding: 10px;
    margin-bottom: 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    resize: vertical;
    font-size: 16px;
}

.post-creation-box input[type="file"] {
    margin-bottom: 15px;
    border: 1px solid #ddd;
    padding: 8px;
    border-radius: 5px;
    background-color: #f9f9f9;
}

.post-creation-box button {
    width: 100%;
    padding: 12px;
    font-size: 18px;
}

/* Styling untuk daftar postingan */
.posts-feed {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.post-card {
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,.1);
}

.post-header {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.profile-pic-small {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 10px;
    border: 1px solid #eee;
}

.post-header h4 {
    margin: 0;
    font-size: 16px;
}

.post-header h4 a {
    text-decoration: none;
    color: #1877f2;
}

.post-header .post-time {
    font-size: 13px;
    color: #777;
    margin-left: auto;
}

.post-content {
    margin-bottom: 15px;
}

.post-content p {
    margin-top: 0;
    margin-bottom: 10px;
    line-height: 1.6;
}

.post-media-image,
.post-media-video {
    max-width: 100%;
    height: auto;
    display: block;
    margin-top: 10px;
    border-radius: 5px;
}

.post-actions {
    display: flex;
    justify-content: space-around;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.post-actions .action-button {
    background: none;
    border: none;
    color: #606770;
    cursor: pointer;
    font-size: 15px;
    padding: 8px 12px;
    border-radius: 5px;
    transition: background-color 0.2s ease;
    text-decoration: none; /* Untuk link */
    display: flex;
    align-items: center;
}

.post-actions .action-button:hover {
    background-color: #f0f2f5;
}

.post-actions .view-count {
    font-weight: bold;
    margin-right: 5px;
}

.no-posts {
    text-align: center;
    color: #777;
    margin-top: 50px;
}

/* Untuk Post Card di halaman detail agar lebih menonjol */
.post-card.detail-view {
    padding: 30px;
    margin-bottom: 30px;
    border-left: 5px solid #1877f2;
}

/* Chat Section */
.chat-section {
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,.1);
    margin-top: 30px;
}

.chat-section h3 {
    margin-top: 0;
    color: #555;
    margin-bottom: 20px;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

.chat-messages-container {
    max-height: 400px; /* Batasi tinggi container chat */
    overflow-y: auto; /* Aktifkan scroll jika konten chat terlalu panjang */
    padding-right: 10px; /* Ruang untuk scrollbar */
    margin-bottom: 20px;
}

.chat-message {
    display: flex;
    align-items: flex-start;
    margin-bottom: 15px;
    background-color: #f9f9f9;
    padding: 10px 15px;
    border-radius: 15px;
    border: 1px solid #eee;
    position: relative; /* Untuk tombol hapus */
}

.chat-message:last-child {
    margin-bottom: 0;
}

.chat-message .profile-pic-small {
    width: 30px;
    height: 30px;
    margin-right: 10px;
    flex-shrink: 0; /* Mencegah gambar menyusut */
}

.chat-message .chat-content {
    flex-grow: 1;
    padding-right: 30px; /* Ruang untuk tombol hapus */
}

.chat-message .chat-username {
    font-weight: bold;
    color: #333; /* Warna standar */
    margin-right: 5px;
    font-size: 14px;
    display: block; /* Agar username di baris sendiri */
    margin-bottom: 3px;
}

/* Styling untuk tautan nama pengguna di chat */
.chat-content .chat-username-link {
    text-decoration: none;
    color: #1877f2; /* Warna link standar Smansab */
    font-weight: bold;
    font-size: 14px; /* Sesuaikan dengan ukuran chat-username */
    display: block; /* Agar username berada di baris sendiri */
    margin-bottom: 3px;
}

.chat-content .chat-username-link:hover {
    text-decoration: underline;
}

.chat-message .chat-time {
    font-size: 12px;
    color: #999;
}

.chat-message p {
    margin: 5px 0 0 0;
    line-height: 1.5;
    font-size: 15px;
}

.no-chats {
    text-align: center;
    color: #777;
    padding: 20px;
    background-color: #f0f2f5;
    border-radius: 5px;
}

.chat-form textarea {
    width: calc(100% - 20px);
    padding: 10px;
    margin-bottom: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    resize: vertical;
    font-size: 15px;
}

.chat-form button {
    width: 100%;
    padding: 10px;
    font-size: 16px;
}

/* Tombol Hapus Chat di Postingan */
.chat-message .delete-post-chat-button {
    background: none;
    border: none;
    color: rgba(0, 0, 0, 0.4);
    font-size: 14px;
    cursor: pointer;
    position: absolute;
    top: 5px;
    right: 8px;
    padding: 2px;
    transition: color 0.2s ease;
    opacity: 0; /* Sembunyikan default */
}

.chat-message:hover .delete-post-chat-button {
    opacity: 1; /* Tampilkan saat hover */
}

.chat-message .delete-post-chat-button:hover {
    color: #f44336;
}

/* Styling untuk Tombol Edit/Hapus Chat Diskusi */
.chat-message {
    /* Pastikan padding-right cukup untuk tombol */
    position: relative;
}

.chat-message .chat-actions-overlay {
    position: absolute;
    top: 5px; /* Sesuaikan posisi vertikal */
    right: 5px; /* Sesuaikan posisi horizontal */
    display: flex;
    gap: 5px; /* Jarak antar tombol */
    opacity: 0; /* Sembunyikan secara default */
    transition: opacity 0.2s ease;
    z-index: 5; /* Pastikan di atas konten chat */
}

.chat-message:hover .chat-actions-overlay {
    opacity: 1; /* Tampilkan saat hover */
}

.chat-actions-overlay button {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 3px 5px;
    border-radius: 3px;
    transition: background-color 0.2s ease;
}

.chat-actions-overlay .edit-post-chat-button {
    color: #1877f2; /* Biru */
}
.chat-actions-overlay .edit-post-chat-button:hover {
    background-color: #e7f3ff;
}

.chat-actions-overlay .delete-post-chat-button {
    color: #f44336; /* Merah */
}
.chat-actions-overlay .delete-post-chat-button:hover {
    background-color: #ffe6e6;
}

/* Styling untuk Form Edit Chat */
.edit-chat-form {
    display: flex; /* Default disembunyikan oleh JS */
    align-items: center;
    gap: 5px;
    margin-top: 5px;
    width: 100%; /* Lebar penuh */
}

.edit-chat-form textarea {
    flex-grow: 1;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 5px;
    resize: vertical;
    font-size: 14px;
    min-height: 30px;
    line-height: 1.4;
}

.edit-chat-form button {
    background-color: #1877f2;
    color: white;
    border: none;
    border-radius: 5px;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s ease;
}

.edit-chat-form button.cancel-edit-chat {
    background-color: #6c757d; /* Abu-abu untuk cancel */
}
.edit-chat-form button.cancel-edit-chat:hover {
    background-color: #5a6268;
}

.edit-chat-form .fa-check,
.edit-chat-form .fa-times {
    margin: 0; /* Hapus margin ikon */
}


/* Profile Page Styling */
.profile-header-section {
    background-color: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,.1);
    text-align: center;
    margin-bottom: 30px;
}

.profile-pic-large {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #eee;
    margin-bottom: 15px;
}

.profile-header-section h2 {
    margin-top: 10px;
    margin-bottom: 5px;
    color: #333;
    font-size: 28px;
}

.profile-header-section p {
    color: #666;
    font-size: 15px;
}

.edit-profile-button {
    display: inline-block;
    background-color: #1877f2;
    color: white;
    padding: 8px 15px;
    border-radius: 5px;
    text-decoration: none;
    margin-top: 15px;
    font-size: 14px;
    transition: background-color 0.3s ease;
}

.edit-profile-button:hover {
    background-color: #165bba;
}

/* Share Indicator in Posts */
.shared-indicator {
    background-color: #e7f3ff;
    color: #1877f2;
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: bold;
    margin-right: 10px;
}

/* Penyesuaian untuk post-header saat ada share indicator */
.post-card .post-header {
    flex-wrap: wrap; /* Agar elemen bisa wrap ke baris baru jika terlalu panjang */
}

.post-card .post-header a {
    order: 2; /* Menempatkan username setelah indikator share */
}

.post-card .post-header .post-time {
    order: 3; /* Menempatkan waktu setelah username */
    margin-left: 0; /* Reset margin */
    width: 100%; /* Ambil lebar penuh */
    text-align: left; /* Sesuaikan alignment */
    margin-top: 5px; /* Sedikit jarak */
    font-size: 12px;
}

/* Mengatur kembali tampilan post-header untuk original post */
.post-card .post-header:not(:has(.shared-indicator)) .profile-pic-small {
    margin-right: 10px;
}
.post-card .post-header:not(:has(.shared-indicator)) .post-time {
    margin-left: auto;
    width: auto;
    text-align: right;
    margin-top: 0;
}

/* Admin Panel Styling */
.admin-dashboard-summary {
    display: flex;
    justify-content: space-around;
    gap: 20px;
    margin-bottom: 30px;
}

.summary-card {
    background-color: #1877f2;
    color: white;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    flex: 1;
    box-shadow: 0 4px 8px rgba(0,0,0,.1);
}

.summary-card h3 {
    margin-top: 0;
    font-size: 18px;
    opacity: 0.8;
}

.summary-card p {
    font-size: 36px;
    font-weight: bold;
    margin: 0;
}

.admin-section {
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,.1);
    margin-bottom: 20px;
}

.admin-section h3 {
    margin-top: 0;
    color: #555;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
    margin-bottom: 15px;
}

.admin-section table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 15px;
}

.admin-section table th,
.admin-section table td {
    border: 1px solid #ddd;
    padding: 10px;
    text-align: left;
}

.admin-section table th {
    background-color: #f0f2f5;
    font-weight: bold;
    color: #333;
}

.admin-section table tr:nth-child(even) {
    background-color: #f9f9f9;
}

.admin-section table a {
    color: #1877f2;
    text-decoration: none;
}

.admin-section table a:hover {
    text-decoration: underline;
}

/* Styling untuk action buttons di tabel admin */
.admin-section table td.action-buttons {
    white-space: nowrap; /* Mencegah tombol wrap ke baris baru */
    text-align: center;
}

.admin-section table td.action-buttons form {
    margin: 0; /* Hapus margin default form */
}

/* Link kembali */
.admin-section .back-link {
    display: inline-block;
    margin-top: 20px;
    background-color: #6c757d;
    color: white;
    padding: 8px 15px;
    border-radius: 5px;
    text-decoration: none;
    transition: background-color 0.3s ease;
}

.admin-section .back-link:hover {
    background-color: #5a6268;
}


/* --- */
/* Styling untuk Halaman Pesan Langsung (Direct Message) - Mirip Facebook Messenger */
/* --- */
.messages-container.fb-messenger-layout {
    display: flex;
    max-width: 1200px; /* Batasi lebar total */
    margin: 20px auto; /* Pusatkan */
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,.1); /* Shadow yang lebih lembut */
    min-height: calc(100vh - 180px); /* Sesuaikan tinggi agar tidak terlalu pendek */
    overflow: hidden; /* Pastikan konten tidak meluber */
}

/* Daftar Percakapan (Sidebar Kiri) */
.conversations-list {
    flex: 0 0 320px; /* Lebar tetap 320px */
    border-right: 1px solid #e4e6eb; /* Garis pemisah */
    padding: 15px 0;
    overflow-y: auto; /* Untuk scrolling daftar percakapan */
    box-sizing: border-box; /* Pastikan padding dan border termasuk dalam lebar */
}

.conversations-list h3 {
    padding: 0 15px 10px;
    margin-top: 0;
    border-bottom: none; /* Hapus border bawah yang lama */
    color: #333;
    font-size: 20px;
    font-weight: bold;
}

.conversations-list .conversation-item {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    border-bottom: none; /* Hapus border lama */
    text-decoration: none;
    color: #333;
    transition: background-color 0.2s ease;
    border-radius: 0; /* Hapus border radius yang lama */
    margin-bottom: 0; /* Hapus margin bawah yang lama */
    position: relative; /* Untuk unread badge */
}

.conversations-list .conversation-item:hover {
    background-color: #f0f2f5;
}

.conversations-list .conversation-item.active {
    background-color: #e7f3ff;
    border-left: 3px solid #1877f2;
    padding-left: 12px; /* Sesuaikan padding karena border kiri */
}

.conversations-list .conversation-item .profile-pic-small {
    width: 50px; /* Ukuran lebih besar */
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 12px;
    border: 1px solid #ccc; /* Border tipis */
}

.conversations-list .conversation-item .conv-info {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.conversations-list .conversation-item .conv-info h4 {
    font-size: 16px;
    font-weight: 600; /* Lebih tebal sedikit */
    color: #050505;
}

.conversations-list .conversation-item .last-message-time {
    font-size: 13px;
    color: #65676b;
}

.conversations-list .conversation-item .unread-badge {
    background-color: #f02849;
    color: white;
    border-radius: 50%;
    padding: 3px 6px;
    font-size: 11px;
    font-weight: bold;
    position: absolute;
    top: 5px;
    right: 5px;
    line-height: 1;
    min-width: 15px;
    text-align: center;
}

.no-conversations {
    color: #777;
    font-style: italic;
    text-align: center;
    padding: 20px 15px;
}

/* Antarmuka Chat (Area Kanan) */
.chat-interface {
    flex: 1; /* Mengambil sisa ruang */
    display: flex;
    flex-direction: column;
    position: relative; /* Untuk scrollbar */
}

.no-chat-selected {
    text-align: center;
    color: #65676b;
    padding: 40px;
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    background-color: #f8f8f8; /* Warna latar belakang untuk area kosong */
}

.chat-header {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #e4e6eb;
    background-color: #f0f2f5; /* Latar belakang header chat */
    gap: 10px; /* Jarak antar elemen di header */
}
.chat-header .profile-pic-small {
    width: 40px;
    height: 40px;
}
.chat-header h4 {
    margin: 0;
    font-size: 17px;
    font-weight: 600;
    color: #050505;
}

/* Tombol Hapus Percakapan */
.delete-conversation-button {
    background-color: #fa383e; /* Merah cerah */
    color: white;
    padding: 8px 12px;
    border: none;
    border-radius: 20px; /* Lebih membulat */
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s ease;
    margin-left: auto; /* Dorong ke kanan */
    display: flex;
    align-items: center;
    gap: 5px;
}

.delete-conversation-button:hover {
    background-color: #d82e30;
}

.delete-conversation-button i {
    font-size: 15px;
}


/* Area Display Pesan */
.messages-display {
    flex-grow: 1;
    padding: 20px;
    overflow-y: auto; /* Untuk scrolling pesan */
    display: flex;
    flex-direction: column;
    background-color: #f8f8f8; /* Latar belakang area pesan */
    scroll-behavior: smooth; /* Scroll lebih halus */
}

.message-bubble {
    display: flex;
    margin-bottom: 8px; /* Sedikit lebih rapat */
    max-width: 80%; /* Batasi lebar bubble pesan */
    position: relative; /* Untuk panah bubble */
}

.message-bubble.sent {
    margin-left: auto; /* Pesan terkirim di kanan */
    justify-content: flex-end;
}

.message-bubble.received {
    margin-right: auto; /* Pesan diterima di kiri */
    justify-content: flex-start;
}

.message-bubble .message-content {
    padding: 10px 15px;
    border-radius: 18px; /* Lebih membulat */
    position: relative;
    word-wrap: break-word;
    font-size: 15px;
    line-height: 1.4;
}

.message-bubble.sent .message-content {
    background-color: #0084ff; /* Biru khas Messenger */
    color: white;
    border-bottom-right-radius: 4px; /* Sudut bawah kanan agak rata */
}

.message-bubble.received .message-content {
    background-color: #e4e6eb; /* Abu-abu khas Messenger */
    color: #050505;
    border-bottom-left-radius: 4px; /* Sudut bawah kiri agak rata */
}

/* Panah bubble pesan (contoh sederhana) */
.message-bubble.sent .message-content::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: -8px; /* Sesuaikan posisi panah */
    width: 0;
    height: 0;
    border: 10px solid transparent;
    border-left-color: #0084ff; /* Warna panah sesuai bubble */
    border-bottom-color: #0084ff;
    border-bottom-left-radius: 8px; /* Bentuk panah */
    transform: rotate(45deg);
    z-index: -1; /* Pastikan di belakang bubble */
}
.message-bubble.received .message-content::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: -8px; /* Sesuaikan posisi panah */
    width: 0;
    height: 0;
    border: 10px solid transparent;
    border-right-color: #e4e6eb;
    border-bottom-color: #e4e6eb;
    border-bottom-right-radius: 8px;
    transform: rotate(-45deg);
    z-index: -1;
}

/* Info pengirim dan waktu (di dalam bubble) */
.message-bubble .sender-name {
    display: none; /* Biasanya tidak ditampilkan di dalam bubble Messenger */
}

.message-bubble .message-time {
    font-size: 10px;
    position: absolute;
    bottom: -15px; /* Posisikan di luar bubble */
    color: #888;
    white-space: nowrap; /* Jangan memecah baris */
}
.message-bubble.sent .message-time {
    right: 0;
}
.message-bubble.received .message-time {
    left: 0;
}

.no-messages {
    text-align: center;
    color: #65676b;
    padding: 20px;
    font-style: italic;
    font-size: 16px;
}

/* Input Form Pesan */
.message-form {
    display: flex;
    padding: 10px 15px; /* Padding lebih kecil */
    border-top: 1px solid #e4e6eb;
    background-color: #f0f2f5; /* Latar belakang input */
    align-items: flex-end; /* Rata bawah untuk textarea */
}

.message-form textarea {
    flex-grow: 1;
    padding: 10px 15px;
    border: none; /* Hapus border */
    border-radius: 20px; /* Lebih membulat */
    margin-right: 10px;
    resize: none; /* Nonaktifkan resize manual */
    overflow: hidden; /* Sembunyikan scrollbar */
    font-size: 15px;
    background-color: #e4e6eb; /* Warna latar belakang input */
    min-height: 40px; /* Tinggi minimum */
    max-height: 100px; /* Tinggi maksimum */
    line-height: 1.4;
    box-sizing: border-box; /* Pastikan padding termasuk dalam tinggi */
    outline: none; /* Hilangkan outline saat fokus */
}
.message-form textarea:focus {
    box-shadow: 0 0 0 1px #1877f2; /* Shadow tipis saat fokus */
}

.message-form button {
    background-color: #1877f2;
    color: white;
    border: none;
    border-radius: 20px;
    padding: 10px 15px;
    cursor: pointer;
    font-size: 15px;
    transition: background-color 0.2s ease;
    min-width: 80px; /* Lebar minimum tombol kirim */
    height: 40px; /* Tinggi sama dengan input */
    display: flex;
    align-items: center;
    justify-content: center;
}

.message-form button:hover {
    background-color: #165bba;
}


/* Responsiveness for Messages Page */
@media (max-width: 768px) {
    .messages-container.fb-messenger-layout {
        flex-direction: column;
        max-width: none;
        margin: 10px;
        min-height: auto;
    }

    .conversations-list {
        flex: auto; /* Mengisi ruang yang tersedia */
        border-right: none;
        border-bottom: 1px solid #e4e6eb; /* Garis pemisah horizontal */
        max-width: none;
        padding-bottom: 10px;
    }

    .conversations-list h3 {
        text-align: center;
        padding: 0 0 10px;
    }

    .chat-interface {
        flex: auto;
        min-height: 50vh; /* Tinggi minimum agar area chat terlihat */
    }

    .no-chat-selected {
        font-size: 16px;
    }

    .messages-display {
        min-height: 300px; /* Agar ada ruang scroll */
        height: auto; /* Sesuaikan tinggi berdasarkan konten */
    }
}

@media (max-width: 480px) {
    .conversations-list .conversation-item {
        padding: 8px 10px;
    }
    .conversations-list .conversation-item .profile-pic-small {
        width: 40px;
        height: 40px;
    }
    .conversations-list .conversation-item .conv-info h4 {
        font-size: 14px;
    }
    .conversations-list .conversation-item .last-message-time {
        font-size: 11px;
    }
    .chat-header h4 {
        font-size: 16px;
    }
    .delete-conversation-button {
        font-size: 12px;
        padding: 6px 10px;
    }
    .messages-display {
        padding: 15px;
    }
    .message-bubble .message-content {
        font-size: 14px;
        padding: 8px 12px;
    }
    .message-form textarea {
        font-size: 14px;
        padding: 8px 12px;
    }
    .message-form button {
        font-size: 14px;
        padding: 8px 12px;
    }
}