/* =========================================
   LAYOUT MODULE
   Navbar, Map View, Utilities
   ========================================= */

/* UI Container */
.app-ui {
    position: relative;
    z-index: 10;
    height: 100%;
    display: flex;
    flex-direction: column;
    pointer-events: none;
}

/* Navbar */
.navbar {
    pointer-events: auto;
    position: absolute;
    top: 19px;
    left: 50%;
    transform: translateX(-50%);
    z-index: var(--z-header, 1100);
    width: 1058px;
    max-width: calc(100% - 40px);
    height: 76px;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding: 12px 14px;
    gap: 21px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 2px solid rgba(78, 32, 61, 0.08);
    border-radius: 48px;
    box-shadow: 0 4px 30px rgba(74, 32, 64, 0.08);
    box-sizing: border-box;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'Bricolage Grotesque', sans-serif;
    font-weight: 800;
    font-size: 1.1rem;
    color: var(--blackberry-cream);
    letter-spacing: -0.03em;
}

.logo img {
    height: 42px;
    width: auto;
    object-fit: contain;
}

/* --- Navigation Links (Center) --- */
/* --- Navigation Icons (Center) --- */
.nav-center-group {
    display: flex;
    align-items: center;
    gap: 24px;
    /* Increased gap between links and search */
    flex: 1;
    justify-content: center;
    margin: 0 16px;
}

.nav-links {
    display: flex;
    gap: 8px;
    align-items: center;
    background: transparent;
    /* Clean look without background container */
    padding: 0;
}

.nav-item-icon {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 41px;
    height: 41px;
    border-radius: 32px;
    color: #4E203D;
    font-size: 1rem;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
    background: rgba(245, 247, 250, 0.5);
    /* Subtle background */
}

.nav-item-icon:hover {
    color: var(--primary);
    background: white;
}

.nav-item-icon.active {
    background: var(--primary);
    color: white;
}

/* Tooltip (Hover Popup) */
.nav-item-icon::after {
    content: attr(data-tooltip);
    position: absolute;
    top: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 6px 12px;
    border-radius: 8px;
    font-family: 'Outfit', sans-serif;
    font-size: 0.8rem;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: all 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
    z-index: 100;
}

/* Tooltip Arrow */
.nav-item-icon::before {
    content: '';
    position: absolute;
    top: calc(100% + 4px);
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    border-width: 6px;
    border-style: solid;
    border-color: transparent transparent rgba(0, 0, 0, 0.8) transparent;
    opacity: 0;
    pointer-events: none;
    transition: all 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
    z-index: 100;
}

.nav-item-icon:hover::after,
.nav-item-icon:hover::before {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* --- Global Search Bar --- */
.nav-search {
    position: relative;
    width: 220px;
    height: 30px;
    transition: all 0.3s ease;
}

.nav-search-input {
    width: 100%;
    height: 100%;
    padding: 0 16px 0 36px;
    /* Center text vertically with padding-left for icon */
    border: 1px solid rgba(0, 0, 0, 0.08);
    background: rgba(245, 247, 250, 0.6);
    backdrop-filter: blur(10px);
    border-radius: var(--r-full);
    font-family: 'Outfit', sans-serif;
    font-size: 0.85rem;
    color: var(--text-main);
    transition: all 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.nav-search-input::placeholder {
    color: var(--text-muted);
    font-weight: 500;
}

.nav-search-input:focus {
    outline: none;
    background: white;
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    width: 260px;
    /* Expand on focus */
}

.nav-search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.9rem;
    pointer-events: none;
    transition: color 0.2s;
}

.nav-search-input:focus+.nav-search-icon {
    color: var(--primary);
}

/* --- Right Actions Group --- */
.nav-right-group {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 30px;
}

/* New Trip Button */
.btn-new-trip {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--primary-gradient);
    border: none;
    color: white;
    padding: 6px 14px;
    border-radius: var(--r-full);
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-weight: 700;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-new-trip:hover {
    opacity: 0.9;
}

/* Notification Bell */
.nav-icon-btn {
    position: relative;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1rem;
    cursor: pointer;
    border-radius: 50%;
    transition: all 0.2s;
}

.nav-icon-btn:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-main);
}

.notification-dot {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 6px;
    height: 6px;
    background: #fa5252;
    border: 1px solid white;
    border-radius: 50%;
}



/* User Menu Container */
.user-menu-container {
    position: relative;
    margin-left: 4px;
}

/* Profile Button */
.user-profile-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: var(--r-full);
    transition: all 0.2s ease;
}

.user-profile-btn:hover,
.user-profile-btn.active {
    background: rgba(0, 0, 0, 0.05);
}

.user-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 2px solid white;
}

.user-name-display {
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--blackberry-cream);
}

.chevron-icon {
    font-size: 0.7rem;
    color: var(--text-muted);
    transition: transform 0.3s ease;
}

.user-profile-btn.active .chevron-icon {
    transform: rotate(180deg);
}

/* --- Premium Dropdown Menu (Restored) --- */
.dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 260px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 20px;
    box-shadow:
        0 4px 6px -1px rgba(0, 0, 0, 0.05),
        0 10px 30px -3px rgba(0, 0, 0, 0.1),
        0 0 0 1px rgba(0, 0, 0, 0.02);
    padding: 8px;
    opacity: 0;
    transform: translateY(-10px) scale(0.98);
    pointer-events: none;
    transition:
        opacity 0.2s cubic-bezier(0.16, 1, 0.3, 1),
        transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    transform-origin: top right;
    z-index: 1000;
}

.dropdown-menu.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

/* Dropdown Header */
.dropdown-header-info {
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.dropdown-avatar {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, var(--blackberry-cream), var(--baltic-blue));
    color: white;
    font-family: 'Bricolage Grotesque', sans-serif;
    font-weight: 700;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    box-shadow: 0 4px 10px rgba(73, 37, 50, 0.2);
}

.dropdown-name {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 1rem;
    color: var(--text-main);
    line-height: 1.2;
}

.dropdown-email {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.dropdown-divider {
    height: 1px;
    background: rgba(0, 0, 0, 0.06);
    margin: 8px 0;
}

/* Dropdown Items */
.dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    text-decoration: none;
    color: var(--text-main);
    font-family: 'Outfit', sans-serif;
    font-weight: 500;
    font-size: 0.95rem;
    border-radius: 12px;
    transition: all 0.2s ease;
    cursor: pointer;
    border: none;
    background: transparent;
    width: 100%;
    text-align: left;
}

.dropdown-item:hover {
    background: rgba(0, 0, 0, 0.04);
    transform: translateX(4px);
    color: var(--primary);
}

.dropdown-item i {
    width: 20px;
    text-align: center;
    color: var(--text-muted);
    transition: color 0.2s;
}

.dropdown-item:hover i {
    color: var(--primary);
}

.dropdown-item .badge-mini {
    background: var(--primary);
    color: white;
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 10px;
    margin-left: auto;
    font-weight: 700;
}

/* Utilities */
.hidden {
    display: none !important;
}