/* ==========================================================================
   CSS Khusus Komponen Feed (Mading)
   ========================================================================== */

/* --- 1. Area Tulis Postingan (Post Box) --- */
.post-box { 
    background: var(--bg-card); 
    border: var(--border-bold); 
    padding: 20px; 
    margin-bottom: 40px; 
}

textarea { 
    width: 100%; 
    background: var(--bg-main); 
    color: var(--text-main); 
    border: 1px solid #444; 
    padding: 12px; 
    font-size: 15px; 
    resize: none; 
    box-sizing: border-box; 
    overflow-y: hidden; /* Menyembunyikan scrollbar bawaan */
    min-height: 80px; /* Tinggi normal saat belum ada teks */
    line-height: 1.5; /* Jarak antar baris agar nyaman dibaca */
    transition: border 0.2s;
}

textarea:focus { 
    outline: none; 
    border: var(--border-focus); 
}

/* --- 2. Kontrol Upload Foto --- */
.upload-section { margin-top: 12px; }
.upload-controls { display: flex; align-items: center; gap: 12px; }

.custom-upload-btn { 
    display: inline-flex; 
    align-items: center; 
    gap: 8px; 
    padding: 8px 15px; 
    border: 1px dashed #555; 
    background: #1a1a1a; 
    color: var(--text-muted); 
    cursor: pointer; 
    font-size: 11px; 
    font-weight: bold; 
    text-transform: uppercase; 
    transition: 0.2s; 
}

.upload-info { font-size: 10px; color: #666; text-transform: uppercase; }

/* --- 3. Preview Foto yang Akan Diupload --- */
.preview-wrapper { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.preview-item-container { position: relative; width: 60px; height: 60px; }

.preview-item { 
    width: 100%; 
    height: 100%; 
    border: 1px solid var(--brand-color); 
    object-fit: cover; 
    background: #000; 
}

.remove-btn { 
    position: absolute; 
    top: -5px; 
    right: -5px; 
    background: var(--brand-color); 
    color: #fff; 
    border: none; 
    border-radius: 50%; 
    width: 18px; 
    height: 18px; 
    font-size: 10px; 
    cursor: pointer; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
}

.btn-post { 
    background: var(--brand-color); 
    color: var(--bg-main); 
    border: none; 
    padding: 12px 20px; 
    margin-top: 15px; 
    cursor: pointer; 
    font-weight: bold; 
    text-transform: uppercase; 
    width: 100%; 
    font-size: 13px; 
}

/* --- 4. Kartu Hasil Postingan (Card Feed) --- */
.card { 
    background: var(--bg-card); 
    border: var(--border-bold); 
    padding: 20px; 
    margin-bottom: 20px; 
}

.card-header { display: flex; align-items: center; margin-bottom: 15px; }

/* --- 5. Informasi Profil di Feed --- */
.profile-info-group {
    display: flex;
    align-items: center; /* Memastikan foto dan teks sejajar di tengah secara vertikal */
    gap: 12px;
}

.profile-link-avatar {
    display: block;
    line-height: 0; /* Menghilangkan spasi ekstra di bawah gambar */
}

.avatar { 
    width: 40px; 
    height: 40px; 
    border-radius: 50%; 
    border: 2px solid var(--brand-color); 
    object-fit: cover; 
    transition: border-color 0.2s ease; 
}

/* Mengelompokkan nama dan waktu agar menumpuk ke bawah */
.profile-text-group {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.profile-link-name {
    text-decoration: none;
    line-height: 1.2; /* Merapatkan jarak antara nama dan waktu */
}

.username { 
    font-weight: 800; 
    font-size: 14px; 
    color: var(--brand-color); 
    transition: color 0.2s ease; 
}

/* Waktu kini berada di bawah nama */
.timestamp { 
    font-size: 11px; 
    color: var(--text-muted); 
    margin-top: 2px; /* Jarak kecil dari nama */
}

/* Efek Hover Minimalis */
.profile-link-avatar:hover .avatar {
    border-color: #ffffff; 
}

.profile-link-name:hover .username {
    color: #ffffff; 
}

/* --- 6. Menu Tiga Titik & Dropdown (Modern) --- */
.post-menu-container {
    margin-left: auto;
    position: relative;
}

.post-menu-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s ease;
}

.post-menu-btn:hover {
    color: #fff;
    background: #2a2a2a;
}

.post-dropdown-menu {
    display: none; /* Sembunyikan default */
    position: absolute;
    right: 0;
    top: 100%;
    margin-top: 5px;
    background: #1e1e1e;
    border: 1px solid #333;
    border-radius: 8px;
    min-width: 120px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
    z-index: 100;
    overflow: hidden;
}

.post-dropdown-menu.show {
    display: block; /* Munculkan saat tombol ditekan */
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 12px 15px;
    background: transparent;
    border: none;
    color: #e0e0e0;
    font-size: 13px;
    font-family: inherit;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
    box-sizing: border-box;
    transition: background 0.2s;
}

.menu-item:hover {
    background: #2a2a2a;
    color: #fff;
}

.menu-item-danger {
    color: #ff5c5c;
}

.menu-item-danger:hover {
    background: rgba(255, 92, 92, 0.1);
    color: #ff5c5c;
}

/* --- 7. Teks Konten & Read More --- */
.content { 
    font-size: 14px; 
    line-height: 1.6; 
    white-space: pre-wrap; 
    color: #eaeaea;
}

.content.truncated { 
    display: -webkit-box; 
    -webkit-line-clamp: 5; 
    -webkit-box-orient: vertical; 
    overflow: hidden; 
}

.read-more-btn { 
    color: var(--brand-color); 
    cursor: pointer; 
    font-size: 13px; 
    font-weight: bold; 
    margin-top: 5px; 
    display: inline-block; 
    text-transform: uppercase; 
}

/* --- 8. Grid Foto Hasil Postingan --- */
.photo-grid { display: flex; gap: 8px; margin-bottom: 15px; flex-wrap: wrap; }

.photo-item { 
    width: 80px; 
    height: 80px; 
    border: 1px solid #444; 
    object-fit: cover; 
    cursor: pointer; 
    transition: 0.2s; 
}

.photo-item:hover { border-color: var(--brand-color); }

/* --- 9. Interaksi Postingan (Komentar & Tombol Aksi) --- */
.post-actions {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-top: 15px;
    padding-top: 12px;
    border-top: 1px solid #2a2a2a;
}

.action-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: color 0.2s;
    padding: 0;
}

.action-btn:hover {
    color: var(--brand-color);
}

/* --- 10. Daftar Komentar --- */
.comment-section {
    margin-top: 15px;
    background: #161616;
    border-radius: 8px;
    padding: 15px;
    display: none; /* Disembunyikan default, dibuka lewat JS */
}

.comment-list {
    max-height: 250px;
    overflow-y: auto;
    margin-bottom: 15px;
}

/* Sembunyikan scrollbar agar rapi */
.comment-list::-webkit-scrollbar { width: 4px; }
.comment-list::-webkit-scrollbar-thumb { background: #444; border-radius: 4px; }

.comment-item {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
}

.comment-item:last-child {
    margin-bottom: 0;
}

.comment-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid #444;
    flex-shrink: 0;
}

.comment-bubble {
    background: #222;
    padding: 8px 12px;
    border-radius: 0 10px 10px 10px;
    font-size: 13px;
    color: #ddd;
    flex-grow: 1;
}

.comment-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 3px;
}

.comment-name {
    font-weight: 800;
    color: var(--brand-color);
}

.comment-time {
    font-size: 10px;
    color: #666;
}

/* --- 11. Form Input Komentar (Diperbaiki) --- */
.comment-form {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.comment-input-wrapper {
    flex-grow: 1;
    display: flex;
    background: #000;
    border: 1px solid #333;
    border-radius: 20px;
    overflow: hidden;
    align-items: flex-end; /* Memastikan ikon selalu sejajar di bawah saat teks melar */
}

/* Menggabungkan style input dan textarea agar seragam dan bersih */
.comment-input, .comment-textarea {
    flex-grow: 1;
    background: transparent !important;
    border: none !important;
    color: #fff;
    padding: 10px 15px;
    font-size: 13px;
    font-family: inherit;
    resize: none;
    line-height: 1.5;
    min-height: 40px; /* Tinggi standar 1 baris */
    height: 40px; /* Memaksa input sejajar dengan ikon di awal */
    box-sizing: border-box;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.comment-textarea::-webkit-scrollbar {
    display: none;
}

/* Mematikan garis orange/biru bawaan browser secara paksa */
.comment-input:focus, .comment-textarea:focus {
    outline: none !important;
    box-shadow: none !important;
}

/* --- 12. Tombol Kirim Komentar (Ikon Pesawat) --- */
.comment-submit-btn {
    background: transparent;
    border: none;
    color: var(--brand-color);
    padding: 0 15px;
    height: 40px; /* Tingginya disamakan persis dengan min-height textarea */
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: 0.2s;
}

.comment-submit-btn svg {
    transition: transform 0.2s ease;
}

.comment-submit-btn:hover svg {
    transform: scale(1.1) translateX(2px);
}

.comment-submit-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* --- 13. Tombol Hapus & Lapor Komentar --- */
.comment-delete-btn {
    background: none;
    border: none;
    color: #555;
    cursor: pointer;
    padding: 2px 5px;
    display: flex;
    align-items: center;
    border-radius: 4px;
    transition: 0.2s ease;
}

.comment-delete-btn:hover {
    color: #ff5c5c;
    background: rgba(255, 92, 92, 0.1);
}

.comment-report-btn {
    background: none;
    border: none;
    color: #555;
    cursor: pointer;
    padding: 2px 5px;
    display: flex;
    align-items: center;
    border-radius: 4px;
    transition: color 0.2s ease, background 0.2s ease;
    margin-left: 0;
}

.comment-report-btn:hover {
    color: #ff5c5c; /* Berubah merah saat disentuh */
    background: rgba(255, 92, 92, 0.1);
}