/* --- CSS Khusus Header --- */
.custom-header { 
    display: flex; justify-content: space-between; align-items: center; 
    padding: 15px 0; margin-bottom: 20px; position: sticky; top: 0; 
    background: var(--bg-main); z-index: 1000; 
}

/* --- LOGO BRAND KETAT 42px --- */
.brand-link {
    display: flex; 
    align-items: center; 
    justify-content: center;
    width: 42px; 
    height: 42px; 
    min-width: 42px; 
    max-width: 42px; 
    min-height: 42px;
    max-height: 42px;
    border-radius: 50%;
    border: var(--border-bold); 
    background: var(--bg-card);
    overflow: hidden; 
    transition: 0.2s ease; 
    text-decoration: none; 
    box-sizing: border-box;
    flex-shrink: 0; 
}

.brand-logo {
    width: 100%; 
    height: 100%; 
    max-width: 100%;
    display: block; 
    object-fit: cover; 
}

.brand-link:hover { 
    border-color: #ffffff; 
}

/* --- NAVIGASI KANAN --- */
.nav-links { display: flex; align-items: center; gap: 12px; }

.nav-icon-link {
    display: flex; align-items: center; justify-content: center;
    width: 42px; height: 42px; border-radius: 50%;
    border: var(--border-bold); background: var(--bg-card);
    color: var(--text-main); overflow: hidden; transition: 0.2s ease; text-decoration: none; box-sizing: border-box;
}
.nav-avatar { width: 100%; height: 100%; object-fit: cover; }

.nav-icon-link:hover { border-color: var(--brand-color); color: var(--brand-color); }

/* Tombol Keluar */
.btn-action-icon { color: var(--brand-color); border-color: #444; }
.btn-action-icon:hover { 
    background: var(--brand-color) !important; 
    color: var(--bg-main) !important; 
    border-color: var(--brand-color) !important; 
}

/* Tombol Login */
.btn-google-login {
    display: flex; align-items: center; gap: 8px; 
    background: transparent; color: var(--text-main);
    padding: 8px 15px; text-decoration: none;
    font-size: 11px; font-weight: bold; text-transform: uppercase; 
    border: var(--border-bold); transition: 0.2s;
}
.btn-google-login:hover { border-color: var(--brand-color); color: var(--brand-color); }

/* --- GAYA SEARCH BAR TENGAH HEADER --- */
.header-search-form {
    flex: 1;
    max-width: 380px; /* Lebar maksimal kolom search */
    margin: 0 20px;
}

.search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 12px;
    color: #666;
    pointer-events: none;
    transition: 0.2s;
}

.search-wrapper input {
    width: 100%;
    padding: 8px 12px 8px 38px;
    background: #161616;
    border: 1px solid #333;
    border-radius: 6px;
    color: #fff;
    font-size: 13px;
    font-family: inherit;
    transition: 0.2s;
    box-sizing: border-box;
}

.search-wrapper input:focus {
    outline: none;
    border-color: var(--brand-color);
    background: #1a1a1a;
}

.search-wrapper input:focus + .search-icon {
    color: var(--brand-color);
}

/* Responsif Mobile: Kecilkan bar jika layar sempit */
@media (max-width: 480px) {
    .header-search-form {
        margin: 0 10px;
    }
    .search-wrapper input {
        padding: 6px 10px 6px 32px;
        font-size: 12px;
    }
    .search-icon {
        left: 10px;
        width: 14px;
        height: 14px;
    }
}

/* --- DROPDOWN PROFILE MENU --- */
.profile-dropdown-container {
    position: relative; /* Menjadi jangkar untuk menu melayang */
    display: inline-block;
}

/* Mengubah link menjadi tombol agar tidak ada efek loading saat diklik */
.profile-toggle-btn {
    background: none;
    cursor: pointer;
    padding: 0;
    outline: none;
}

.profile-dropdown-menu {
    position: absolute;
    top: 120%; /* Muncul tepat di bawah foto profil */
    right: 0;
    background: var(--bg-card); /* Warna latar sama dengan kartu postingan */
    border: 1px solid #333;
    border-radius: 8px;
    width: 180px;
    display: none; /* Disembunyikan secara default */
    flex-direction: column;
    box-shadow: 0 8px 16px rgba(0,0,0,0.5);
    z-index: 1001; /* Selalu di atas elemen lain */
    overflow: hidden;
    /* Animasi muncul */
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

/* Class ini akan ditambahkan oleh JavaScript saat diklik */
.profile-dropdown-menu.show {
    display: flex;
    opacity: 1;
    transform: translateY(0);
}

.dropdown-header {
    padding: 12px 15px;
    border-bottom: 1px solid #333;
    font-size: 13px;
    font-weight: 800;
    color: var(--brand-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis; /* Teks kepanjangan jadi titik-titik (...) */
}

.dropdown-item {
    padding: 10px 15px;
    color: #ccc;
    text-decoration: none;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: 0.2s ease;
}

.dropdown-item:hover {
    background: #2a2a2a;
    color: #ffffff;
}

.dropdown-item svg {
    width: 16px;
    height: 16px;
    color: inherit;
}

.dropdown-divider {
    height: 1px;
    background: #333;
    margin: 2px 0;
}

/* Gaya khusus tombol keluar */
.text-danger {
    color: #e74c3c;
}

.text-danger:hover {
    background: rgba(231, 76, 60, 0.1);
    color: #ff6b5b;
}

/* --- CSS NOTIFIKASI (SUDAH DIRAPIKAN) --- */
.notif-dot-header {
    position: absolute; 
    top: 0; 
    right: 0; 
    width: 10px; 
    height: 10px;
    background: #ff4444; 
    border-radius: 50%; 
    border: 2px solid var(--bg-card);
}

.notif-badge-header {
    position: absolute; 
    top: -5px; 
    right: -5px; 
    background: #ff4444; 
    color: white;
    font-size: 10px; 
    font-weight: bold; 
    padding: 2px 6px; 
    border-radius: 10px;
    border: 2px solid var(--bg-main); 
    z-index: 2; 
    pointer-events: none;
}

.notif-badge-menu {
    background: #ff4444; 
    color: white;
    font-size: 10px; 
    font-weight: bold; 
    padding: 2px 6px; 
    border-radius: 10px;
    margin-left: auto; /* Menggeser badge mentok ke kanan */
    display: inline-block;
    position: static; /* Menghapus paksa efek terbang (absolute) sebelumnya */
}