/* ═══════ CompanyBrain Landing — Global Reset ═══════ */
*, *::before, *::after {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: #0a0a0f;
    color: rgba(255, 255, 255, 0.92);
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: inherit;
    text-decoration: none;
}

/* Selection */
::selection {
    background: rgba(102, 126, 234, 0.3);
    color: white;
}

/* Blazor error boundary */
.blazor-error-boundary {
    background: #b32121;
    padding: 1rem;
    color: white;
}

.blazor-error-boundary::after {
    content: "An error has occurred.";
}

/* ═══════════════════════════════════════════════════════════════════
   Auth-aware Navigation Visibility
   ═══════════════════════════════════════════════════════════════════ */

/* By default: show guest items, hide authenticated items */
.nav-auth-only {
    display: none !important;
}

/* When user is authenticated: hide guest items, show authenticated items */
body.user-authenticated .nav-guest-only {
    display: none !important;
}

body.user-authenticated .nav-auth-only {
    display: flex !important;
}

body.user-authenticated hr.nav-auth-only {
    display: block !important;
}

body.user-authenticated a.nav-auth-only {
    display: flex !important;
}

/* ═══════════════════════════════════════════════════════════════════
   Mobile Responsive Navigation
   ═══════════════════════════════════════════════════════════════════ */

/* Hide mobile menu button by default (desktop) */
.mobile-menu-btn {
    display: none !important;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.5rem;
    line-height: 1;
    transition: background 0.2s ease;
}

.mobile-menu-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Hide mobile drawer on desktop */
.mobile-nav-overlay,
.mobile-nav-drawer {
    display: none !important;
}

/* Desktop navigation visible by default */
.desktop-nav {
    display: flex !important;
}

/* Mobile overlay - full screen dark backdrop */
.mobile-nav-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background: rgba(0, 0, 0, 0.6) !important;
    z-index: 9998 !important;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

body.mobile-nav-open .mobile-nav-overlay {
    opacity: 1;
    visibility: visible;
}

/* Mobile drawer - slides in from right */
.mobile-nav-drawer {
    position: fixed !important;
    top: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: min(320px, 85vw) !important;
    height: 100vh !important;
    z-index: 9999 !important;
    background: rgba(18, 18, 26, 0.98) !important;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-left: 1px solid rgba(255, 255, 255, 0.08);
    display: flex !important;
    flex-direction: column !important;
    box-shadow: -10px 0 40px rgba(0, 0, 0, 0.4);
    transform: translateX(100%);
    transition: transform 0.25s ease;
}

body.mobile-nav-open .mobile-nav-drawer {
    transform: translateX(0);
}

/* Drawer header */
.mobile-nav-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 64px;
}

/* Drawer nav menu */
.mobile-nav-menu {
    padding: 1rem;
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

/* Nav links in drawer */
.mobile-nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: rgba(255, 255, 255, 0.85);
    border-radius: 10px;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.2s ease, transform 0.15s ease;
}

.mobile-nav-link:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateX(4px);
}

.mobile-nav-link .mud-icon-root {
    color: rgba(255, 255, 255, 0.6);
    font-size: 1.25rem;
}

/* Register button in drawer */
.mobile-nav-register {
    display: block;
    text-align: center;
    color: #001f24;
    border-radius: 10px;
    text-transform: none;
    font-weight: 700;
    font-family: 'Inter', sans-serif;
    padding: 0.75rem 1rem;
    margin-top: 0.5rem;
    text-decoration: none;
    transition: opacity 0.2s ease;
}

.mobile-nav-register:hover {
    opacity: 0.9;
}

/* Close button in drawer */
.mobile-nav-close {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    line-height: 1;
    transition: background 0.2s ease;
}

.mobile-nav-close:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Divider in drawer */
.mobile-nav-divider {
    margin: 1rem 0 !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
}

/* Animations */
@keyframes fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slide-in-right {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Tablet breakpoint (960px and below) */
@media (max-width: 960px) {
    /* Hide desktop navigation */
    .desktop-nav {
        display: none !important;
    }
    
    /* Show hamburger menu button in AppBar */
    .mobile-menu-btn {
        display: flex !important;
        align-items: center;
        justify-content: center;
        width: 44px;
        height: 44px;
        margin-left: 8px;
    }
    
    /* Show mobile overlay and drawer */
    .mobile-nav-overlay {
        display: block !important;
    }
    
    .mobile-nav-drawer {
        display: flex !important;
    }

    /* Prevent scrolling when drawer is open */
    body.mobile-nav-open {
        overflow: hidden;
    }
}

/* Mobile breakpoint (600px and below) */
@media (max-width: 600px) {
    /* Reduce logo text size on mobile */
    .brand-name {
        font-size: 1rem !important;
    }
    
    /* Footer stacks vertically on mobile */
    .mobile-footer-stack {
        flex-direction: column !important;
        gap: 1.5rem;
        text-align: center;
    }
    
    .mobile-footer-stack > .mud-stack {
        align-items: center;
    }
}