:root {
    --primary-pink: #f4dede;
    --accent-pink: #d63384;
    --accent-green: #2ed573;
    --white: #ffffff;
    --text-main: #333333;
    --transition: all 0.4s cubic-bezier(0.77, 0, 0.175, 1);
}

.navbar {
    background: var(--white);
    height: 75px;
    display: flex;
    align-items: center;
    box-shadow: 0 2px 15px rgba(0,0,0,0.08);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-container {
    width: 92%;
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo a {
    font-weight: 900;
    font-size: 1.5rem;
    color: var(--accent-pink);
    text-decoration: none;
    letter-spacing: -0.5px;
}

/* SVG Icon Sizing */
.menu-trigger svg, .icon-search svg, #closeMenu svg {
    width: 24px;
    height: 24px;
    display: block;
    color: var(--text-main);
    cursor: pointer;
}

.icon-search:hover svg { color: var(--accent-pink); transform: scale(1.1); }

/* Desktop Menu */
.nav-links { display: flex; list-style: none; gap: 30px; align-items: center; }
.nav-links a { text-decoration: none; color: var(--text-main); font-weight: 600; font-size: 0.95rem; transition: 0.3s; }
.nav-links a:hover { color: var(--accent-pink); }

.btn-post {
    background: var(--accent-pink);
    color: white !important;
    padding: 10px 24px;
    border-radius: 50px;
    box-shadow: 0 4px 12px rgba(214, 51, 132, 0.2);
}

.btn-login {
    background: var(--accent-green);
    color: white !important;
    padding: 10px 40px;
    border-radius: 50px;
    box-shadow: 0 4px 12px rgba(214, 51, 132, 0.2);
}

/* User Profile Styles */
.user-profile-nav {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 5px 15px;
    background: #f8f9fa;
    border-radius: 50px;
    cursor: pointer;
    position: relative;
}

.user-avatar {
    width: 32px;
    height: 32px;
    background: var(--accent-pink);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
}

.user-name {
    font-size: 0.9rem;
    color: var(--text-main);
    max-width: 100px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Dropdown logic for Logout */
.user-profile-nav:hover .dropdown-menu {
    display: block;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    border-radius: 8px;
    list-style: none;
    min-width: 120px;
    padding: 10px 0;
    z-index: 1001;
}

.dropdown-menu li a {
    padding: 10px 20px;
    display: block;
    color: #ff4757 !important; /* Logout Red */
}

/* Sidebar Avatar */
.user-avatar-large {
    width: 60px;
    height: 60px;
    background: var(--accent-pink);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 15px;
}

.sidebar-user-info {
    display: flex;
    flex-direction: column;
}

.password-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.password-wrapper input {
    width: 100%;
    padding-right: 40px; /* Make space for the icon */
}

.toggle-password {
    position: absolute;
    right: 15px;
    cursor: pointer;
    color: #666;
    transition: color 0.3s;
}

.toggle-password:hover {
    color: #333;
}

/* Sidebar Styling */
.sidebar {
    position: fixed;
    top: 0;
    left: -320px;
    width: 300px;
    height: 100%;
    background: var(--white);
    z-index: 2000;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

.sidebar.active { left: 0; }

.sidebar-header {
    padding: 50px 25px 25px;
    background: linear-gradient(to bottom, #fdf2f2, #ffffff);
    border-bottom: 1px solid #f0f0f0;
    position: relative;
}

/* Ensure hidden on refresh */
.search-bar-container {
    display: none; /* Default state */
    position: absolute;
    top: 75px;
    left: 0;
    width: 100%;
    background: var(--white);
    padding: 15px 0;
    box-shadow: 0 10px 15px rgba(0,0,0,0.05);
    justify-content: center;
    z-index: 999;
}

.search-bar-container.active {
    display: flex !important;
}

.search-input-wrapper {
    position: relative;
    width: 85%;
    max-width: 600px;
}

/* Search Icon inside the input */
.search-icon-inside {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: var(--accent-pink);
}

.search-icon-inside svg {
    width: 20px;
    height: 20px;
}

#searchInput {
    width: 100%;
    padding: 12px 50px 12px 25px; /* Extra right padding for the icon */
    border: 2px solid var(--primary-pink);
    border-radius: 50px;
    outline: none;
}

/* --- SUGGESTION BOX CONTAINER --- */
.suggestion-box {
    position: absolute;
    top: 100%; /* Sits exactly under the input */
    left: 0;
    width: 100%;
    background: white;
    border: 1px solid #eee;
    border-top: none; /* Merges with the input bar */
    border-radius: 0 0 20px 20px; /* Rounds only the bottom corners */
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
    display: none;
    z-index: 1000;
    overflow: hidden; /* Ensures hover effects stay inside the rounded corners */
    padding: 0; /* Remove the padding you had before */
}

/* --- INDIVIDUAL SUGGESTION ITEMS --- */
.suggestion-item {
    padding: 12px 20px;
    cursor: pointer;
    font-size: 0.95rem;
    color: #444;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid #f9f9f9;
    transition: background 0.2s ease;
}

.suggestion-item:last-child {
    border-bottom: none;
}

/* Hover Effect using your Accent Pink */
.suggestion-item:hover {
    background-color: #fff0f5; /* Very light pink background */
    color: var(--accent-pink);
}

/* Icon inside the suggestion */
.suggestion-item span {
    color: #bbb;
    font-size: 0.85rem;
    transition: color 0.2s ease;
}

.suggestion-item:hover span {
    color: var(--accent-pink);
}

/* Fix for Search Input when suggestions are visible */
.search-bar-container.active #searchInput {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

#closeMenu { position: absolute; top: 20px; right: 20px; transition: 0.3s; }
#closeMenu:hover svg { color: var(--accent-pink); transform: rotate(90deg); }

.sidebar-brand { font-size: 1.3rem; font-weight: 800; color: var(--accent-pink); }
.sidebar-subtitle { font-size: 0.8rem; color: #888; margin-top: 5px; }

.sidebar-menu { list-style: none; padding: 20px 10px; flex-grow: 1; }
.sidebar-menu li a {
    text-decoration: none; color: var(--text-main); display: block;
    padding: 15px 20px; font-weight: 500; border-radius: 12px; margin-bottom: 5px; transition: 0.2s;
}
.sidebar-menu li a:hover { background: #fff0f5; color: var(--accent-pink); }

.sidebar-footer { padding: 20px; border-top: 1px solid #eee; }
.btn-post-sidebar {
    display: block; background: var(--accent-pink); color: white;
    text-align: center; text-decoration: none; padding: 16px;
    border-radius: 12px; font-weight: 700;
}
.btn-login-sidebar {
    display: block; background: var(--accent-green); color: white;
    text-align: center; text-decoration: none; padding: 16px;
    border-radius: 12px; font-weight: 700;
}

/* Overlay */
.sidebar-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.4); backdrop-filter: blur(4px);
    z-index: 1500; display: none; opacity: 0; transition: 0.3s;
}
.sidebar-overlay.active { display: block; opacity: 1; }

/* Search Bar */
.search-bar-container {
    position: absolute; top: 75px; left: 0; width: 100%; background: var(--white);
    padding: 15px 0; box-shadow: 0 10px 15px rgba(0,0,0,0.05);
    display: none; justify-content: center; z-index: 999;
}
.search-bar-container.active { display: flex; animation: slideDown 0.3s ease-out; }

#searchInput {
    width: 85%; max-width: 600px; padding: 12px 25px;
    border: 2px solid var(--primary-pink); border-radius: 50px; outline: none;
}

@keyframes slideDown { from { transform: translateY(-20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

@media (max-width: 899px) { .desktop-only { display: none; } }
@media (min-width: 900px) { .mobile-only { display: none; } }