/* Modern Header Styles */

/* Top Bar */
.modern-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.top-bar {
    background: linear-gradient(135deg, #2563eb 0%, #06b6d4 100%);
    color: white;
    padding: 8px 0;
    font-size: 0.85rem;
}

/* Ensure consistent width/centering on all pages */
.top-bar>.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

.top-bar-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.top-bar-left,
.top-bar-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.top-bar-link {
    color: white;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: opacity 0.2s ease;
}

.top-bar-link:hover {
    opacity: 0.9;
}

.top-bar .divider {
    color: rgba(255, 255, 255, 0.5);
}

/* Main Navigation */
.main-nav {
    background: #fff;
    padding: 15px 0;
    border-bottom: 1px solid #f0f0f0;
}

/* Ensure consistent width/centering on all pages */
.main-nav>.container {
    max-width: 1320px;
    margin: 0 auto;
    padding: 0 20px;
}

.nav-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
}

/* Logo */
.brand-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    transition: transform 0.3s ease;
}

.brand-logo:hover {
    transform: scale(1.02);
}

.logo-image {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

.logo-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.logo-text {
    display: flex;
    flex-direction: column;
}

.brand-name {
    font-size: 1.3rem;
    font-weight: 700;
    color: #2d3748;
    line-height: 1.2;
}

.brand-tagline {
    font-size: 0.75rem;
    color: #6c757d;
}

/* Navigation Menu */
.nav-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 5px;
    flex: 1;
    justify-content: center;
}

.nav-item {
    position: relative;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    color: #2d3748;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.nav-link i {
    font-size: 0.9em;
    opacity: 0.8;
}

.nav-link:hover {
    background: #f8f9fa;
    color: #2563eb;
}

.nav-link.active {
    background: rgba(37, 99, 235, 0.12);
    color: #1d4ed8;
    box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.2);
}

.dropdown-arrow {
    font-size: 0.7em;
    margin-right: 4px;
    transition: transform 0.2s ease;
}

.dropdown-nav:hover .dropdown-arrow {
    transform: rotate(180deg);
}

/* Mega Dropdown */
.mega-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 10px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
    z-index: 100;
    min-width: 600px;
}

.dropdown-nav:hover .mega-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-content {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    padding: 25px;
}

.dropdown-column h6 {
    color: #2d3748;
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid #2563eb;
}

.dropdown-column a {
    display: block;
    padding: 8px 0;
    color: #6c757d;
    text-decoration: none;
    font-size: 0.85rem;
    transition: all 0.2s ease;
}

.dropdown-column a:hover {
    color: #2563eb;
    padding-right: 5px;
}

/* Nav Actions */
.nav-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.nav-action-item {
    position: relative;
}

/* Icon Button */
.icon-btn {
    position: relative;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #2d3748;
}

.icon-btn:hover {
    background: #e9ecef;
    transform: scale(1.05);
}

.badge-dot {
    position: absolute;
    top: -4px;
    left: -4px;
    background: #dc3545;
    color: white;
    font-size: 0.65rem;
    padding: 3px 6px;
    border-radius: 12px;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

/* Notifications Dropdown */
.notifications-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%);
    width: 350px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 100;
}

.nav-action-item:hover .notifications-dropdown {
    opacity: 1;
    visibility: visible;
}

.dropdown-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #f0f0f0;
}

.dropdown-header h6 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 700;
    color: #2d3748;
}

.mark-all {
    font-size: 0.8rem;
    color: #2563eb;
    text-decoration: none;
}

.notifications-list {
    overflow-y: auto;
}

.notification-item {
    display: flex;
    gap: 12px;
    padding: 15px 20px;
    text-decoration: none;
    transition: background 0.2s ease;
}

.notification-item:hover {
    background: #f8f9fa;
}

.notification-item.unread {
    background: rgba(40, 167, 69, 0.05);
}

.notification-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    border-radius: 50%;
    flex-shrink: 0;
}

.notification-content {
    flex: 1;
}

.notification-text {
    margin: 0;
    font-size: 0.85rem;
    color: #2d3748;
    line-height: 1.4;
}

.notification-time {
    font-size: 0.75rem;
    color: #999;
}

.dropdown-footer {
    padding: 12px 20px;
    border-top: 1px solid #f0f0f0;
    text-align: center;
}

.dropdown-footer a {
    color: #2563eb;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
}

/* User Button */
.user-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 12px;
    background: #f8f9fa;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.user-btn:hover {
    background: #e9ecef;
}

.user-avatar {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    object-fit: cover;
}

.user-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: #2d3748;
}

.user-btn i {
    font-size: 0.7em;
    color: #6c757d;
}

/* User Dropdown */
.user-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    width: 280px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 100;
}

.nav-action-item:hover .user-dropdown {
    opacity: 1;
    visibility: visible;
}

.user-info {
    display: flex;
    gap: 12px;
    padding: 20px;
}

.user-info img {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
}

.user-info h6 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 700;
    color: #2d3748;
}

.user-info p {
    margin: 4px 0 0;
    font-size: 0.8rem;
    color: #6c757d;
}

.dropdown-divider {
    height: 1px;
    background: #f0f0f0;
    margin: 0;
}

.dropdown-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: #2d3748;
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.dropdown-link:hover {
    background: #f8f9fa;
    padding-right: 25px;
}

.dropdown-link.text-danger {
    color: #dc3545;
}

.dropdown-link .badge {
    margin-right: auto;
    background: #2563eb;
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.75rem;
}

/* Add Listing Button */
.btn-add-adv {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: linear-gradient(135deg, #2563eb 0%, #06b6d4 100%);
    color: white;
    text-decoration: none;
    border-radius: 25px;
    font-weight: 600;
    font-size: 0.9rem;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
    transition: all 0.3s ease;
}

.btn-add-adv:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.4);
}

/* Mobile Toggle */
.mobile-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
}

.mobile-toggle span {
    display: block;
    width: 25px;
    height: 3px;
    background: #2d3748;
    border-radius: 3px;
    transition: all 0.3s ease;
}

/* Mobile Menu */
.mobile-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 300px;
    height: 100vh;
    background: #fff;
    box-shadow: -5px 0 20px rgba(0, 0, 0, 0.1);
    z-index: 1001;
    transition: right 0.3s ease;
    overflow-y: auto;
}

.mobile-menu.active {
    right: 0;
}

.mobile-menu-header {
    padding: 20px;
    background: linear-gradient(135deg, #2563eb 0%, #06b6d4 100%);
    color: white;
}

.user-profile-mobile {
    display: flex;
    gap: 12px;
    align-items: center;
}

.user-profile-mobile img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.3);
}

.user-profile-mobile h6 {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
}

.user-profile-mobile p {
    margin: 4px 0 0;
    font-size: 0.85rem;
    opacity: 0.9;
}

.mobile-nav-list {
    list-style: none;
    margin: 0;
    padding: 15px 0;
}

.mobile-nav-list li {
    border-bottom: 1px solid #f0f0f0;
}

.mobile-nav-list a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px 20px;
    color: #2d3748;
    text-decoration: none;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.mobile-nav-list a:hover {
    background: #f8f9fa;
    color: #2563eb;
}

.mobile-nav-list i {
    width: 20px;
    font-size: 1.1em;
}

.mobile-menu-footer {
    padding: 20px;
}

.btn-mobile-add {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #2563eb 0%, #06b6d4 100%);
    color: white;
    text-decoration: none;
    border-radius: 12px;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
}

/* Responsive Design */
@media (max-width: 1200px) {
    .nav-menu {
        gap: 2px;
    }

    .nav-link {
        padding: 10px 12px;
        font-size: 0.9rem;
    }

    .mega-dropdown {
        min-width: 500px;
    }

    .dropdown-content {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 992px) {

    .nav-menu,
    .user-name {
        display: none;
    }

    .mobile-toggle {
        display: flex;
    }

    /* RTL: keep mobile toggle on the right side by default */
    :root[dir="rtl"] .nav-wrapper .mobile-toggle {
        order: -1;
    }

    .btn-add-adv span {
        display: none;
    }

    .btn-add-adv {
        width: 40px;
        height: 40px;
        padding: 0;
        justify-content: center;
        border-radius: 50%;
    }
}

@media (max-width: 768px) {
    .top-bar-content {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }

    .top-bar-left,
    .top-bar-right {
        justify-content: center;
        flex-wrap: wrap;
    }

    .nav-wrapper {
        gap: 14px;
    }

    .nav-actions {
        gap: 10px;
    }

    .icon-btn,
    .btn-add-adv {
        width: 36px;
        height: 36px;
    }

    .icon-btn i {
        font-size: 0.95rem;
    }

    /* Hide website text, keep only logo icon */
    .brand-logo .logo-text {
        display: none;
    }

    .brand-logo {
        gap: 8px;
    }
}

/* Extra small phones (e.g., iPhone 12 Pro ~390px) */
@media (max-width: 400px) {
    .nav-wrapper {
        gap: 14px;
    }

    .nav-actions {
        gap: 10px;
    }

    .icon-btn,
    .btn-add-adv {
        width: 36px;
        height: 36px;
    }

    .icon-btn i {
        font-size: 0.95rem;
    }

    /* Hide website text, keep only logo icon */
    .brand-logo .logo-text {
        display: none;
    }

    .brand-logo {
        gap: 8px;
    }
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Header Scroll Effect */
.modern-header.scrolled {
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.modern-header.scrolled .main-nav {
    padding: 10px 0;
}