/* ============================================
   TOPBAR.CSS - Topbar/Header Styles
   Royal Blue Theme | Mobile Optimized
   ============================================ */

/* Fixed Topbar */
.fixed-topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: var(--bg-primary);
    box-shadow: var(--shadow-md);
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    border-bottom: 1px solid var(--border-color);
    transition: all var(--transition-normal);
}

/* Left Section */
.nav-left {
    display: flex;
    align-items: center;
    gap: 15px;
    flex: 0 0 auto;
}

/* Burger Menu */
.dash-sidebar-toggler {
    cursor: pointer;
    padding: 8px;
    background: transparent;
    border: none;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    transition: all var(--transition-normal);
}

.dash-sidebar-toggler:hover {
    background: var(--primary-soft);
}

.burger-lines {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 24px;
    height: 18px;
}

.burger-lines .line {
    height: 2px;
    width: 100%;
    background-color: var(--primary);
    border-radius: var(--radius-full);
    transition: all var(--transition-normal);
}

/* Back Button */
.back-button {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 8px;
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-normal);
    border-radius: var(--radius-md);
}

.back-button:hover {
    background: var(--primary-soft);
    transform: scale(1.1);
}

/* Center Section */
.nav-center {
    flex: 1;
    text-align: center;
    padding: 0 15px;
}

.welcome-text {
    text-decoration: none;
    font-weight: 600;
    font-size: 16px;
    color: var(--primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 300px;
    display: inline-block;
    padding: 8px 16px;
    border-radius: var(--radius-full);
    background: var(--primary-soft);
    transition: all var(--transition-normal);
    display: inline-flex;  /* inline-block ki jagah inline-flex */
    align-items: center;    /* vertical center ke liye */
    justify-content: center; /* horizontal center ke liye */
}


.welcome-text:hover {
    background: var(--bg-primary);
    border: 1px solid var(--primary);
    transform: translateY(-2px);
}

/* Right Section */
.nav-right {
    display: flex;
    align-items: center;
    gap: 15px;
    flex: 0 0 auto;
}

/* Rank Badge */
.rank-badge {
    width: 40px;
    height: 40px;
    background: var(--primary-soft);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-normal);
}

.rank-badge:hover {
    background: var(--primary-light);
    transform: scale(1.1);
}

.rank-badge img {
    width: 22px;
    height: 22px;
    object-fit: contain;
}

/* Theme Toggle Button */
.theme-toggle {
    width: 42px;
    height: 42px;
    border: none;
    background: var(--primary-soft);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.theme-toggle:hover {
    background: var(--primary);
    transform: scale(1.05);
}

.theme-toggle .sun-icon,
.theme-toggle .moon-icon {
    width: 22px;
    height: 22px;
    transition: all 0.3s ease;
}

.theme-toggle .sun-icon {
    display: block;
}

.theme-toggle .moon-icon {
    display: none;
}

.dark-theme .theme-toggle .sun-icon {
    display: none;
}

.dark-theme .theme-toggle .moon-icon {
    display: block;
}

/* Profile Dropdown */
.profile-dropdown-container {
    position: relative;
}

.profile-trigger {
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    padding: 0;
    cursor: pointer;
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: all var(--transition-normal);
}

.profile-trigger:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-sm);
}

.profile-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--radius-sm);
}

.profile-dropdown-menu {
    position: absolute;
    top: 50px;
    right: -10px;
    width: 260px;
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-15px) scale(0.95);
    transition: all var(--transition-normal);
    z-index: 1010;
    border: 1px solid var(--border-color);
    transform-origin: top right;
}

.profile-dropdown-menu.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.dropdown-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-secondary);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.profile-name {
    margin: 0 0 4px 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.profile-username {
    margin: 0;
    font-size: 13px;
    color: var(--text-secondary);
}

.dropdown-links {
    list-style: none;
    padding: 8px 0;
    margin: 0;
}

.dropdown-links li a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all var(--transition-fast);
}

.dropdown-links li a:hover {
    background: var(--primary-soft);
    color: var(--primary);
    padding-left: 25px;
}

.dropdown-links li a i {
    width: 20px;
    font-size: 16px;
    color: var(--text-secondary);
}

.dropdown-links li a:hover i {
    color: var(--primary);
}

.logout-link {
    color: var(--danger) !important;
}

.logout-link i {
    color: var(--danger) !important;
}

.divider {
    height: 1px;
    background: var(--border-color);
    margin: 8px 0;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .fixed-topbar {
        padding: 0 12px;
        height: 60px;
    }
    
    .welcome-text {
        font-size: 14px;
        max-width: 200px;
        padding: 6px 12px;
    }
    
    .nav-right {
        gap: 10px;
    }
    
    .theme-toggle,
    .rank-badge,
    .profile-trigger {
        width: 36px;
        height: 36px;
    }
    
    .profile-dropdown-menu {
        width: 240px;
        right: -5px;
    }
}

@media (max-width: 480px) {
    .fixed-topbar {
        padding: 0 10px;
        height: 55px;
    }
    
    .nav-left {
        gap: 8px;
    }
    
    .burger-lines {
        width: 20px;
        height: 16px;
    }
    
    .welcome-text {
        font-size: 12px;
        max-width: 150px;
        padding: 4px 8px;
    }
    
    .theme-toggle,
    .rank-badge,
    .profile-trigger {
        width: 32px;
        height: 32px;
    }
    
    .profile-dropdown-menu {
        width: 220px;
        right: 0;
    }
    
    .dropdown-header {
        padding: 12px;
    }
    
    .profile-name {
        font-size: 14px;
    }
    
    .profile-username {
        font-size: 11px;
    }
    
    .dropdown-links li a {
        padding: 8px 15px;
        font-size: 12px;
    }
}