/* ===== Navbar Reorganization & Profile Dropdown ===== */

/* Navbar Layout - Fixed Grid with proper alignment */
.navbar {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    position: relative;
    z-index: 1001;
    padding: 0.75rem 0;
    width: 100%;
    gap: 3rem;
}

/* Logo on far left */
.logo {
    justify-self: start;
    flex-shrink: 0;
    padding-left: 0;
    padding-right: 0;
    margin-right: auto;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Navigation links perfectly centered */
.nav-links {
    display: flex;
    gap: 2rem;
    align-items: center;
    justify-self: center;
    white-space: nowrap;
    height: 100%;
}

/* Navigation link styles - EXM simplified */
.nav-links a {
    position: relative;
    padding: 0.5rem 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: rgba(255, 255, 255, 0.7);
    font-weight: 500;
    font-size: 0.95rem;
    text-decoration: none;
    display: flex;
    align-items: center;
    height: 100%;
}

.nav-links a:hover {
    color: white;
}

.nav-links a.active {
    color: white !important;
    font-weight: 600;
}

/* Simple underline for active page - EXM style */
.nav-links a.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: white;
    border-radius: 2px;
}

/* Remove normal links from nav-links for right-side positioning */
.nav-links > .nav-link-auth,
.nav-links > .nav-cta {
    display: none;
}

/* Auth actions container (far right side) */
.nav-auth-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    justify-self: end;
    padding-right: 0;
    padding-left: 0;
    margin-left: auto;
}

/* Discord icon button - EXM style */
.nav-discord {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 40px !important;
    height: 40px !important;
    border-radius: 50% !important;
    background: rgba(255, 255, 255, 0.1) !important;
    color: white !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    cursor: pointer !important;
    font-size: 1.1rem !important;
    margin: 0 !important;
    border: none !important;
}

.nav-discord:hover {
    background: #5865F2 !important;
    transform: translateY(-2px) scale(1.05) !important;
}

/* Login button - EXM style (icon only) */
.nav-link-auth {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    color: white !important;
    padding: 0.6rem !important;
    background: rgba(255, 255, 255, 0.1) !important;
    border-radius: 50% !important;
    width: 40px !important;
    height: 40px !important;
    font-size: 1.1rem !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    border: none !important;
    cursor: pointer !important;
    position: relative !important;
    margin: 0 !important;
}

.nav-link-auth:hover {
    background: rgba(255, 255, 255, 0.2) !important;
    transform: translateY(-2px) scale(1.05) !important;
}

.nav-link-auth:active {
    transform: translateY(0) scale(1.02) !important;
    background: rgba(255, 255, 255, 0.25) !important;
}

.nav-link-auth.active {
    background: var(--gradient);
    border-color: transparent;
}

/* Purchase button styles are in button-enhancements.css */

/* Profile Dropdown (shown when logged in) - replaces login button */
.profile-dropdown {
    position: relative;
    order: 3;
    margin-left: auto !important;
    margin-right: 0 !important;
    flex-shrink: 0;
}

.profile-trigger {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1rem;
    background: rgba(139, 92, 246, 0.1);
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: white;
}

.profile-trigger:hover {
    background: rgba(139, 92, 246, 0.2);
    border-color: rgba(139, 92, 246, 0.5);
    transform: translateY(-2px);
}

.profile-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
    color: white;
}

.profile-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.profile-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: white;
    line-height: 1.2;
}

.profile-email {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
    line-height: 1.2;
}

.profile-arrow {
    margin-left: 0.5rem;
    transition: transform 0.3s ease;
    color: rgba(255, 255, 255, 0.7);
}

.profile-dropdown.active .profile-arrow {
    transform: rotate(180deg);
}

/* Dropdown Menu */
.profile-menu {
    position: absolute;
    top: calc(100% + 1rem);
    right: 0;
    min-width: 260px;
    background: rgba(15, 23, 42, 0.98);
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 16px;
    padding: 0.75rem 0;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(12px);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 2000;
}

.profile-dropdown.active .profile-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Menu Header */
.profile-menu-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 0.5rem;
}

.profile-menu-header strong {
    display: block;
    color: white;
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.profile-menu-header span {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.85rem;
}

/* Menu Items */
.profile-menu-item {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 0.875rem 1.25rem;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    font-size: 0.95rem;
}

.profile-menu-item:hover {
    background: rgba(139, 92, 246, 0.1);
    color: white;
}

.profile-menu-item i {
    width: 18px;
    text-align: center;
    color: var(--primary);
    font-size: 1rem;
}

.profile-menu hr {
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin: 0.5rem 0;
}

/* Sign out button with red accent */
.profile-menu-item[data-action="signout"] {
    color: #ef4444;
}

.profile-menu-item[data-action="signout"]:hover {
    background: rgba(239, 68, 68, 0.1);
}

.profile-menu-item[data-action="signout"] i {
    color: #ef4444;
}

/* Badge for premium users */
.profile-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.75rem;
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #000;
    margin-left: 0.5rem;
}

.profile-badge i {
    font-size: 0.65rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .navbar {
        flex-wrap: wrap;
        padding: 0.5rem 0.75rem; /* Smaller padding on mobile */
        gap: 1rem; /* Smaller gap on mobile */
    }
    
    .logo {
        order: 1;
        margin-left: 0;
        margin-right: 0; /* Remove extra margin on mobile */
    }
    
    .nav-links {
        margin: 0; /* Remove large margins on mobile */
        gap: 1.5rem; /* Smaller gap between nav items on mobile */
    }
    
    .nav-auth-actions {
        margin-left: 0; /* Remove margin on mobile */
    }
    
    .mobile-menu-toggle {
        order: 2;
        margin-left: auto;
        margin-right: 0;
    }
    
    .nav-links {
        order: 3;
        width: 100%;
        flex-direction: column;
        gap: 0;
        margin-top: 1rem;
    }
    
    .nav-auth-actions {
        order: 4;
        width: 100%;
        flex-direction: column;
        gap: 0.75rem;
        margin-top: 1rem;
        margin-left: 0 !important;
    }
    
    .nav-link-auth,
    .nav-cta {
        width: 100%;
        justify-content: center;
    }
    
    .profile-dropdown {
        width: 100%;
        margin-left: 0 !important;
    }
    
    .profile-trigger {
        width: 100%;
        justify-content: space-between;
    }
    
    .profile-menu {
        position: static;
        width: 100%;
        margin-top: 0.5rem;
        transform: none;
    }
    
    .profile-dropdown.active .profile-menu {
        transform: none;
    }
    
    .nav-link-auth {
        width: 100%;
        justify-content: center;
        margin: 1rem 0 0 0 !important;
    }
}

/* Hide profile dropdown by default (shown via JS when logged in) */
.profile-dropdown {
    display: none;
}

.profile-dropdown.visible {
    display: flex;
}

/* Hide login button when profile is shown */
body.logged-in .nav-link-auth {
    display: none;
}

body.logged-in .profile-dropdown {
    display: flex;
}
