/* ===== RESET & BASE ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    padding-top: 80px;
}

/* ===== NAVBAR ===== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    z-index: 9999;
    height: 80px;
    display: flex;
    align-items: center;
}

.navbar-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Logo */
.logo-img {
    height: 45px;
    width: auto;
}

/* Mobile Toggle */
.mobile-toggle {
    display: none;
    font-size: 28px;
    background: none;
    border: none;
    color: #881D6B;
    cursor: pointer;
}

/* ===== NAVIGATION MENU LAYOUT FIXES ===== */
.nav-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    align-items: center;
    gap: 20px; /* Consistent spacing between items */
}

.nav-item {
    position: relative;
    margin-left: 0; /* Remove old margin */
}

.nav-link {
    color: #333;
    text-decoration: none;
    font-weight: 500;
    padding: 8px 12px; /* Better click area */
    display: flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap; /* Prevent text wrapping */
}

.nav-link:hover {
    color: #881D6B;
}

/* Special styling for Portal dropdown (last item) */
.nav-item:last-child .nav-link {
    background: #881D6B;
    color: white;
    border-radius: 30px;
    padding: 8px 20px;
    margin-left: 10px;
}

.nav-item:last-child .nav-link i {
    color: white;
}

.nav-item:last-child .nav-link:hover {
    background: #6e1655;
}

/* Fix divider */
.nav-divider {
    width: 1px;
    height: 30px;
    background: #e0e0e0;
    margin: 0 10px;
}

/* Hide search icon if it appears */
.fa-search {
    display: none;
}

/* ===== DROPDOWNS ===== */
.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 10px;
    background: white;
    min-width: 280px;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    border: 1px solid #e0e0e0;
    z-index: 10000;
    
    /* Hidden by default */
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
}

/* Align portal dropdown to the right */
.nav-item:last-child .dropdown-menu {
    left: auto;
    right: 0;
}

.dropdown-menu.active {
    /* Show when active */
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
}

/* Desktop hover */
@media (min-width: 769px) {
    .nav-item.dropdown:hover .dropdown-menu {
        display: block !important;
        opacity: 1 !important;
        visibility: visible !important;
    }
}

/* Dropdown items */
.dropdown-header {
    padding: 12px 20px;
    background: #881D6B;
    color: white;
    font-weight: 600;
    border-radius: 8px 8px 0 0;
    font-size: 13px;
    letter-spacing: 0.5px;
}

.dropdown-item {
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: #333;
    text-decoration: none;
    border-bottom: 1px solid #f0f0f0;
    transition: all 0.2s;
}

.dropdown-item:last-child {
    border-bottom: none;
}

.dropdown-item:hover {
    background: #f5f5f5;
    color: #881D6B;
    transform: translateX(5px);
}

.dropdown-item i {
    width: 20px;
    color: #881D6B;
}

.dropdown-item-content strong {
    display: block;
    font-size: 14px;
}

.dropdown-item-content small {
    display: block;
    font-size: 12px;
    color: #666;
}

/* Special style for the info message in dropdown */
.dropdown-item[style*="cursor: default"] {
    background: #f9f9f9 !important;
    border-top: 1px solid #e0e0e0;
    margin-top: 5px;
}

.dropdown-item[style*="cursor: default"] small {
    color: #666;
    font-style: italic;
}

.dropdown-divider {
    height: 1px;
    background: #e0e0e0;
    margin: 5px 0;
}

/* Dropdown toggle icon rotation */
.dropdown-toggle i {
    font-size: 10px;
    transition: transform 0.2s;
}

.dropdown-toggle.active i {
    transform: rotate(180deg);
}

/* ===== MOBILE STYLES ===== */
@media (max-width: 768px) {
    .mobile-toggle {
        display: block;
    }
    
    .nav-menu {
        position: fixed;
        top: 70px;
        left: -100%;
        width: 100%;
        height: calc(100vh - 70px);
        background: white;
        flex-direction: column;
        align-items: flex-start;
        padding: 20px;
        transition: left 0.3s;
        overflow-y: auto;
        gap: 0; /* Remove gap on mobile */
    }
    
    .nav-menu.active {
        left: 0;
    }
    
    .nav-item {
        margin: 0;
        width: 100%;
        border-bottom: 1px solid #f0f0f0;
    }
    
    .nav-link {
        padding: 15px 0;
        width: 100%;
    }
    
    /* Reset portal button style on mobile */
    .nav-item:last-child .nav-link {
        background: transparent;
        color: #333;
        border-radius: 0;
        padding: 15px 0;
        margin-left: 0;
    }
    
    .nav-item:last-child .nav-link i {
        color: #881D6B;
    }
    
    .nav-item:last-child .nav-link:hover {
        background: transparent;
        color: #881D6B;
    }
    
    .dropdown-menu {
        position: static;
        box-shadow: none;
        border-left: 3px solid #881D6B;
        margin-left: 15px;
        margin-top: 5px;
        
        /* Mobile hidden by default */
        display: none !important;
        opacity: 1 !important;
        visibility: visible !important;
    }
    
    .dropdown-menu.active {
        display: block !important;
    }
    
    /* Reset portal dropdown alignment on mobile */
    .nav-item:last-child .dropdown-menu {
        left: 0;
        right: auto;
    }
    
    .nav-divider {
        width: 100%;
        height: 1px;
        margin: 10px 0;
    }
    
    /* Better mobile dropdown items */
    .dropdown-item {
        padding: 15px 20px !important;
    }
}

/* ===== WHATSAPP BUTTON ===== */
.whatsapp-float {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: #25D366;
    color: white;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    box-shadow: 0 5px 15px rgba(37,211,102,0.3);
    z-index: 999;
    text-decoration: none;
}

.whatsapp-tooltip {
    position: absolute;
    right: 70px;
    background: white;
    color: #333;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 14px;
    white-space: nowrap;
    display: none;
}

.whatsapp-float:hover .whatsapp-tooltip {
    display: block;
}

/* ===== ULTIMATE OVERRIDE - ENSURES DROPDOWNS WORK ===== */
.navbar .dropdown-menu {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
}

.navbar .dropdown-menu.active,
.navbar .nav-item.dropdown:hover .dropdown-menu {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
}