* {
    box-sizing: border-box;
}

/* Top Menu Bar */
.top-menu {
    position: relative;
    width: 100%;
    max-width: 100%;
    height: 60px;
    z-index: 1000;
    margin-bottom: 20px;
    background-color: #1a73e8;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    /* Prevent layout shift */
    min-height: 60px;
}

.menu-container {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
    padding: 0 20px;
    position: relative;
    z-index: 2;
}

/* Logo on the LEFT */
.menu-logo {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    white-space: nowrap;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.menu-logo-image {
    height: 50px;
    width: auto;
    display: block;
}

.menu-logo-link {
    text-decoration: none;
    color: #ffffff;
    position: relative;
    z-index: 1;
}

.menu-logo-link:hover {
    opacity: 0.9;
}

/* Menu items on the RIGHT */
.menu-links {
    display: flex;
    flex-wrap: nowrap;
    gap: 7px;
    justify-content: flex-end;
    align-items: center;
    height: 100%;
    margin-right: 7px;
    /* Prevent layout shift when items appear/disappear */
    min-width: 0;
}

.menu-link {
    color: white;
    text-decoration: none;
    padding: 6px 10px;
    font-weight: 500;
    transition: all 0.2s;
    white-space: nowrap;
    border-radius: 4px;
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    display: inline-block;
    text-align: center;
    font-size: 0.9rem !important;
}

.menu-link:hover {
    background-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

/* Current page highlight */
.menu-link.active {
    background-color: rgba(76, 175, 80, 0.7) !important; /* Green with 0.7 opacity */
    border-color: rgba(76, 175, 80, 0.9);
    box-shadow: 0 0 5px rgba(76, 175, 80, 0.5);
}

.mobile-menu-link.active {
    background-color: rgba(76, 175, 80, 0.1);
    color: #4CAF50 !important; /* Solid green color for text */
    border-left: 3px solid #4CAF50;
}

/* Notification Badge */
.notification-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background-color: #f44336;
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* Mobile Menu Toggle Button */
.mobile-menu-toggle {
    display: none;
    cursor: pointer;
    background-color: #0d62d1;
    padding: 8px 16px;
    border-radius: 4px;
    font-weight: 500;
    color: white;
}

.mobile-menu-toggle span {
    position: relative;
    z-index: 1;
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    padding: 6px 10px;
    display: inline-block;
}

/* Mobile Dropdown Menu */
.mobile-dropdown {
    display: none;
    flex-direction: column;
    background-color: #f8f9fa;
    width: 100%;
    position: absolute;
    top: 60px;
    left: 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 999;
}

.mobile-dropdown.active {
    display: flex;
}

.mobile-menu-link {
    padding: 15px 20px;
    text-decoration: none;
    color: #1a73e8;
    font-weight: 500;
    border-bottom: 1px solid #eaeaea;
    transition: background-color 0.2s;
    text-align: center;
    margin: 5px 10px;
    border-radius: 4px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.mobile-menu-link span {
    position: relative;
    z-index: 1;
    text-align: center;
}

.mobile-menu-link:hover {
    background-color: #e8f0fe;
}

.mobile-menu-link .notification-badge {
    top: 8px;
    right: 8px;
}



/* Mobile menu admin link */
.mobile-menu-link.admin-link {
    color: #9c27b0 !important;
    background-color: rgba(156, 39, 176, 0.1);
    font-weight: bold;
}

.mobile-menu-link.admin-link:hover {
    background-color: rgba(156, 39, 176, 0.2);
}

.mobile-menu-link.admin-link.active {
    background-color: rgba(156, 39, 176, 0.1);
    color: #9c27b0 !important;
    border-left: 3px solid #9c27b0;
}

/* Mobile menu logout link */
.mobile-menu-link.logout-link.active {
    background-color: rgba(244, 67, 54, 0.1);
    color: #f44336 !important;
    border-left: 3px solid #f44336;
}

/* Mobile menu login link */
.mobile-menu-link.login-link {
    background: white !important;
    color: #1a73e8 !important;
    font-weight: 700;
    border: 2px solid #1a73e8 !important;
}

/* Mobile menu profile link */
.mobile-menu-link.my-profile-link {
    color: #1a73e8 !important;
    background-color: transparent;
}

/* Mobile only link */
.mobile-only-link {
    display: none;
}

/* Desktop-specific styles */
@media (min-width: 769px) {
    .mobile-menu-toggle,
    .mobile-dropdown {
        display: none !important;
    }
    
    .menu-links {
        display: flex !important;
    }
}

/* Mobile Responsive Adjustments */
@media (max-width: 768px) {
    .menu-links {
        display: none !important;
    }
    
    .mobile-menu-toggle {
        display: block !important;
        border-radius: 4px;
        border: 1px solid rgba(255, 255, 255, 0.3);
    }
    
    .mobile-dropdown {
        align-items: center;
    }
    
    .mobile-menu-link {
        width: calc(100% - 20px);
        padding: 12px 0;
        margin: 5px 10px;
        border-radius: 4px;
        border: 1px solid #eaeaea;
        display: flex;
        justify-content: center;
        align-items: center;
        text-align: center;
    }
    
    .mobile-menu-link span {
        text-align: center;
    }
    
    .mobile-only-link {
        display: block;
    }
}
