/* Import Sweet Toffee font */
@import url('https://fonts.googleapis.com/css2?family=Sweet+Toffee&display=swap');

/* Local Sweet Toffee font fallback */
@font-face {
    font-family: 'Sweet Toffee Local';
    src: url('../fonts/SweetToffee-Regular.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

/* Modern Top Navigation Styles */
.top-navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 80px;
    background: rgba(0, 0, 0, 0.5); /* Semi-transparent background */
    backdrop-filter: blur(15px); /* Stronger blur for readability */
    border-bottom: 1px solid rgba(255, 255, 255, 0.1); /* Subtle border */
    z-index: 1000;
    display: flex;
    align-items: center;
    transition: transform 0.3s ease; /* Only transition the transform property */
}

.navbar-container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: nowrap;
    overflow: visible;
}

.navbar-left {
    display: flex !important;
    align-items: center !important;
    flex-direction: row !important;
}

.navbar-brand-container {
    display: flex !important;
    align-items: center !important;
    flex-direction: row !important;
    gap: 16px;
}

.navbar-logo {
    position: relative;
    flex-shrink: 0;
}

.navbar-brand {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    height: 48px;
    flex-direction: row !important;
}

.bot-avatar, .bot-avatar-placeholder {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    border: 2px solid var(--border-color, #333);
}

.bot-avatar-placeholder {
    background: var(--bg-tertiary, #2a2a2a);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted, #71717a);
}

.navbar-brand .bot-title {
    font-size: 1.5rem;
    font-weight: 800;
    margin: 0;
    padding: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif !important;
    letter-spacing: 1px;
    text-transform: lowercase;
    line-height: 1;
    display: inline-block !important;
    
    /* Brighter dashboard purple metallic effect */
    background: linear-gradient(135deg, #8b9cf7 0%, #a688d8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

/* Enhanced visibility for home page */
.home-page .navbar-brand .bot-title {
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
    color: #c4b5fd; /* Fallback color for better visibility */
    
    /* Softer purple metallic shadows for better visibility */
    text-shadow: 
        0 1px 2px rgba(0, 0, 0, 0.5),
        0 0 15px rgba(139, 156, 247, 0.7),
        0 0 30px rgba(166, 136, 216, 0.5);
    
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
    
    /* Position and transitions */
    position: relative;
    transition: all 0.3s ease;
    cursor: default;
}

.navbar-brand .bot-title:hover {
    transform: translateY(-1px);
    text-shadow: 
        0 1px 2px rgba(0, 0, 0, 0.6),
        0 0 20px rgba(139, 156, 247, 0.9),
        0 0 40px rgba(166, 136, 216, 0.7);
    filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.4));
}

.navbar-brand .bot-title::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #5865f2, #7289da);
    opacity: 0.1;
    border-radius: 4px;
    z-index: -1;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.navbar-subtitle {
    font-size: 0.8rem;
    color: var(--text-muted, #71717a);
    font-weight: 500;
}

.navbar-center {
    flex: 1;
    display: flex;
    justify-content: center;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-secondary, #1a1a1a);
    border: 1px solid var(--border-color, #333);
    border-radius: 12px;
    padding: 6px 8px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 24px;
    border-radius: 8px;
    color: var(--text-secondary, #a1a1aa);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    position: relative;
    white-space: nowrap;
    min-width: fit-content;
}

/* Enhance contrast on transparent navbar for all pages */
.nav-link {
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

.nav-link:hover {
    background: var(--bg-tertiary, #2a2a2a);
    color: var(--text-primary, #fff);
}

.nav-link.active {
    background: var(--primary-color, #4f46e5);
    color: white;
}

/* Special styling for home page */
.home-page .nav-link:hover {
    background: rgba(42, 42, 42, 0.4);
    color: white;
}

.home-page .nav-link.active {
    background: rgba(79, 70, 229, 0.6);
    backdrop-filter: blur(10px);
    color: white;
}

.nav-link i {
    width: 16px;
    height: 16px;
}

/* More menu styles */
.nav-more {
    position: relative;
}

.more-btn {
    background: transparent !important;
    border: none;
    cursor: pointer;
}

.more-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) translateY(-10px);
    background: var(--bg-secondary, #1f1f23);
    border: 1px solid var(--border-color, #404040);
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
    min-width: 180px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    z-index: 9999;
    pointer-events: none;
}

.more-menu.show {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateX(-50%) translateY(0) !important;
    pointer-events: all !important;
    display: block !important;
}

.more-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text-secondary, #a1a1aa);
    text-decoration: none;
    transition: all 0.2s ease;
    border-radius: 8px;
    margin: 4px 8px;
    font-size: 0.85rem;
}

.more-item:hover {
    background: var(--bg-tertiary, #2a2a2a);
    color: var(--text-primary, #fff);
}

.more-item.active {
    background: var(--primary-color, #4f46e5);
    color: white;
}

.more-item i {
    width: 14px;
    height: 14px;
}

.mobile-menu-toggle {
    display: none; /* Hidden by default on desktop */
}

#mobileMenuBtn {
    background: transparent;
    border: none;
    color: white;
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#mobileMenuBtn i {
    width: 24px;
    height: 24px;
}

.navbar-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.user-menu {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: transparent;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 48px;
    box-sizing: border-box;
}

.user-menu:hover {
    border-color: var(--primary-color, #4f46e5);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    object-fit: cover;
}

.user-avatar-placeholder {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--bg-tertiary, #2a2a2a);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted, #71717a);
}

.user-details {
    display: flex;
    flex-direction: column;
}

.user-dropdown {
    position: relative;
}

.user-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary, #fff);
    line-height: 1.2;
}

.user-username {
    font-size: 0.75rem;
    color: var(--text-muted, #71717a);
    line-height: 1;
}

.dropdown-btn {
    background: transparent;
    border: none;
    color: var(--text-muted, #71717a);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.dropdown-btn:hover {
    color: var(--text-primary, #fff);
    background: var(--bg-tertiary, #2a2a2a);
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: var(--bg-secondary, #1f1f23);
    border: 1px solid var(--border-color, #404040);
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    z-index: 9999;
    pointer-events: none;
}

.dropdown-menu.show {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(0) !important;
    pointer-events: all !important;
    display: block !important;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text-secondary, #a1a1aa);
    text-decoration: none;
    transition: all 0.2s ease;
    border-radius: 8px;
    margin: 4px 8px;
}

.dropdown-item:hover {
    background: var(--bg-tertiary, #2a2a2a);
    color: var(--text-primary, #fff);
}

.dropdown-item i {
    width: 16px;
    height: 16px;
}

.dropdown-divider {
    height: 1px;
    background: var(--border-color, #333);
    margin: 8px 12px;
}

.login-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: var(--primary-color, #4f46e5);
    color: white;
    text-decoration: none;
    border-radius: 12px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.login-btn:hover {
    background: #3730a3;
    transform: translateY(-1px);
}

.login-btn i {
    width: 16px;
    height: 16px;
}

/* Main container adjustments for top navbar */
.main-container {
    margin-top: 80px;
    min-height: calc(100vh - 80px);
}

/* Responsive design for navbar */
@media (max-width: 1200px) {
    .nav-links {
        gap: 8px;
        padding: 4px 6px;
    }
    
    .nav-link {
        padding: 12px 18px;
        font-size: 0.85rem;
    }
}

@media (max-width: 1024px) {
    .navbar-brand .bot-title {
        font-size: 1.5rem;
    }
    
    .navbar-brand-container {
        gap: 12px;
    }
}
    
    .navbar-subtitle {
        display: none;
    }
    
    .nav-link span {
        display: none;
    }
    
    .nav-links {
        gap: 2px;
    }
    
    .nav-link {
        padding: 12px 10px;
    }
    
    /* Hide less important nav items on medium screens */
    .nav-link:nth-child(n+5) {
        display: none;
    }
    
    .nav-more {
        display: block;
    }
}

@media (max-width: 768px) {
    .navbar-container {
        padding: 0 16px;
    }
    
    .navbar-brand .bot-title {
        font-size: 1.25rem;
    }
    
    .navbar-brand-container {
        gap: 10px;
    }
    
    .navbar-center {
        flex: 0;
        margin-left: auto;
        margin-right: 16px;
    }
    
    .nav-links {
        background: transparent;
        border: none;
        padding: 0;
        gap: 8px;
    }
    
    .nav-link {
        background: var(--bg-secondary, #1a1a1a);
        border: 1px solid var(--border-color, #333);
        border-radius: 8px;
        padding: 8px;
    }
    
    /* Show only most important items on mobile */
    .nav-link:nth-child(n+3) {
        display: none;
    }
    
    .user-details {
        display: none;
    }
    
    .top-navbar {
        height: 60px;
    }
    
    .main-container {
        margin-top: 60px;
    }
}

@media (max-width: 480px) {
    .navbar-left {
        gap: 8px;
    }
    
    .bot-avatar, .bot-avatar-placeholder {
        width: 36px;
        height: 36px;
    }
    
    .mobile-menu-toggle {
        display: block; /* Show on mobile */
    }
    
    /* Home page specific mobile styling */
    .home-page .top-navbar {
        background: transparent;
        border-bottom: none;
    }
    
    /* Show navbar center on mobile but with different styling */
    .navbar-center {
        display: none; /* Hidden by default on mobile */
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: rgba(10, 10, 10, 0.8);
        backdrop-filter: blur(10px);
        height: 60px;
        border-top: 1px solid rgba(80, 80, 80, 0.2);
        z-index: 1000;
    }
    
    /* Show when active */
    .navbar-center.mobile-active {
        display: flex;
    }
    
    /* Adjust nav links for bottom navbar on mobile */
    .nav-links {
        width: 100%;
        justify-content: space-around;
        padding: 0 10px;
    }
    
    .nav-link {
        flex-direction: column;
        padding: 8px 5px;
        gap: 5px;
    }
    
    .nav-link span {
        font-size: 10px;
    }
    
    .nav-link i {
        width: 18px;
        height: 18px;
    }
    
    /* Show all nav links on mobile */
    .nav-link:nth-child(n+3) {
        display: flex;
    }
    
    .login-btn span {
        display: none;
    }
    
    .login-btn {
        padding: 10px 12px;
    }
    
    /* Add padding to the bottom of the page content to account for bottom navbar */
    body {
        padding-bottom: 60px;
    }
}