/* Navbar Styles */
.navbar {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    box-shadow: 0 2px 8px rgba(255, 215, 0, 0.2);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 2px solid #FF8C00;
}

.navbar-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 50px;
}

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

.navbar-brand:hover {
    transform: scale(1.05);
}

.navbar-logo {
    filter: drop-shadow(0 4px 8px rgba(139, 69, 19, 0.3));
    transition: transform 0.3s ease;
}

.navbar-brand:hover .navbar-logo {
    transform: rotate(10deg);
}

.navbar-title {
    font-size: 1.2rem;
    font-weight: bold;
    color: #8B4513;
    text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.5);
    font-family: 'Comic Sans MS', cursive, sans-serif;
}

.navbar-nav {
    display: flex;
    align-items: center;
    gap: 20px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-link {
    color: #8B4513;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    padding: 8px 12px;
    border-radius: 20px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid transparent;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.4);
    color: #654321;
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(255, 140, 0, 0.4);
    border-color: #FF8C00;
}

.nav-link.active {
    background: rgba(255, 255, 255, 0.6);
    color: #654321;
    border-color: #FF8C00;
    box-shadow: 0 4px 12px rgba(255, 140, 0, 0.3);
}

.nav-button {
    background: linear-gradient(135deg, #FF6B35 0%, #FF8C00 100%);
    color: white;
    text-decoration: none;
    font-weight: bold;
    font-size: 0.9rem;
    padding: 8px 16px;
    border-radius: 20px;
    transition: all 0.3s ease;
    border: 1px solid #FF8C00;
    box-shadow: 0 2px 6px rgba(255, 107, 53, 0.3);
}

.nav-button:hover {
    background: linear-gradient(135deg, #FF8C00 0%, #FF6B35 100%);
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(255, 107, 53, 0.5);
    color: white;
}

/* User Profile Styles */
.nav-user-profile {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.2);
    padding: 8px 12px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
    height: 40px;
}

.nav-user-profile:hover {
    background: rgba(255, 255, 255, 0.4);
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(255, 140, 0, 0.3);
}

.user-avatar-small {
    width: 24px;
    height: 24px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
}

.avatar-emoji-small {
    font-size: 0.8rem;
}

.user-info-small {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1px;
}

.user-name {
    font-size: 0.75rem;
    font-weight: 600;
    color: #8B4513;
    line-height: 1;
}

.user-grade {
    font-size: 0.55rem;
    color: #654321;
    opacity: 0.8;
    line-height: 1;
}

.nav-dropdown {
    position: relative;
}

.dropdown-toggle {
    background: none;
    border: none;
    color: #8B4513;
    font-size: 0.7rem;
    cursor: pointer;
    padding: 2px;
    border-radius: 50%;
    transition: all 0.3s ease;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dropdown-toggle:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    padding: 8px 0;
    min-width: 180px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1001;
    border: 1px solid rgba(255, 255, 255, 0.3);
    margin-top: 5px;
}

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

/* Profile page specific navbar fixes */
.profile-page .navbar {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    box-shadow: 0 2px 8px rgba(255, 215, 0, 0.2);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.profile-page .nav-user-profile {
    z-index: 1001;
}

.profile-page .dropdown-menu {
    z-index: 1002;
}

/* Ensure dropdown works properly on profile page */
.profile-page .nav-dropdown {
    position: relative;
}

.profile-page .dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 5px;
}

.dropdown-item {
    display: block;
    padding: 8px 16px;
    color: #8B4513;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    border-radius: 8px;
    margin: 2px 8px;
}

.dropdown-item:hover {
    background: linear-gradient(135deg, #FFD700, #FFA500);
    color: #8B4513;
    transform: translateX(5px);
}

.dropdown-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, #FFA500, transparent);
    margin: 8px 16px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .navbar-container { padding: 8px 12px; gap: 12px; }
    .navbar-nav { flex-wrap: wrap; justify-content: center; gap: 8px; }
    .nav-link { padding: 8px 10px; font-size: 0.9rem; }
    .nav-button { padding: 9px 16px; font-size: 0.9rem; }
    .navbar-title { font-size: 1.2rem; }
}

@media (max-width: 480px) {
    .navbar-container { flex-direction: column; align-items: stretch; }
    .navbar-nav { flex-direction: column; width: 100%; }
    .nav-link, .nav-button { width: 100%; text-align: center; }
}