/**
 * MACHINA Navbar CSS
 * Responsive navigation bar styling
 */

/* Navbar Container */
.navbar {
    position: sticky;
    top: 0;
    background: linear-gradient(180deg, var(--color-onyx) 0%, rgba(10, 10, 11, 0.95) 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(10px);
    z-index: 100;
    height: 70px;
    display: flex;
    align-items: center;
}

.navbar-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Logo */
.navbar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    font-weight: 800;
    font-size: 20px;
    color: white;
    flex-shrink: 0;
    transition: all 0.2s;
}

.navbar-brand:hover {
    transform: scale(1.02);
}

.navbar-logo {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--color-blue) 0%, #6ae6b0 100%);
    border-radius: 8px;
    font-size: 20px;
    color: white;
}

/* Search Bar */
.navbar-search {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    max-width: 400px;
    margin: 0 40px;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    transition: all 0.2s;
}

.navbar-search:focus-within {
    border-color: var(--color-blue);
    box-shadow: 0 0 0 3px rgba(0, 87, 255, 0.1);
}

.navbar-search input {
    flex: 1;
    background: none;
    border: none;
    color: white;
    font-size: 13px;
    outline: none;
}

.navbar-search input::placeholder {
    color: rgba(228, 226, 228, 0.4);
}

.navbar-search i {
    color: rgba(228, 226, 228, 0.5);
    font-size: 14px;
}

/* Navigation Menu */
.navbar-menu {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    list-style: none;
    padding: 0;
}

.nav-item {
    position: relative;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    color: rgba(228, 226, 228, 0.8);
    text-decoration: none;
    font-weight: 600;
    font-size: 13px;
    transition: all 0.2s;
    border-radius: 6px;
    white-space: nowrap;
}

.nav-link:hover {
    color: var(--color-blue);
    background: rgba(0, 87, 255, 0.1);
}

.nav-link.active {
    color: var(--color-blue);
    background: rgba(0, 87, 255, 0.15);
}

/* Dropdown Menu */
.nav-dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: linear-gradient(135deg, rgba(45, 45, 48, 0.95) 0%, rgba(45, 45, 48, 0.85) 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 8px 0;
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: all 0.2s;
    transform: translateY(-10px);
    margin-top: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
}

.nav-dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    color: rgba(228, 226, 228, 0.7);
    text-decoration: none;
    font-size: 13px;
    transition: all 0.2s;
}

.dropdown-item:hover {
    background: rgba(0, 87, 255, 0.1);
    color: var(--color-blue);
    padding-left: 20px;
}

.dropdown-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.05);
    margin: 8px 0;
}

/* User Actions */
.navbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: auto;
}

.icon-button {
    position: relative;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: rgba(228, 226, 228, 0.7);
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.icon-button:hover {
    border-color: var(--color-blue);
    color: var(--color-blue);
    background: rgba(0, 87, 255, 0.1);
}

/* Notification Badge */
.badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #ff5858;
    color: white;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 800;
    border: 2px solid var(--color-onyx);
}

/* User Avatar Dropdown */
.user-menu {
    position: relative;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--color-blue);
    cursor: pointer;
    transition: all 0.2s;
}

.user-avatar:hover {
    border-color: #0047cc;
    box-shadow: 0 0 0 3px rgba(0, 87, 255, 0.2);
}

.user-menu .dropdown-menu {
    right: 0;
    left: auto;
}

/* Mobile Toggle */
.mobile-toggle {
    display: none;
    width: 40px;
    height: 40px;
    flex-direction: column;
    gap: 6px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.mobile-toggle:hover {
    border-color: var(--color-blue);
    background: rgba(0, 87, 255, 0.1);
}

.hamburger-line {
    width: 100%;
    height: 2px;
    background: currentColor;
    border-radius: 1px;
    transition: all 0.3s;
    color: rgba(228, 226, 228, 0.7);
}

.mobile-toggle.active .hamburger-line:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

.mobile-toggle.active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.mobile-toggle.active .hamburger-line:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

/* Mobile Menu */
.mobile-menu {
    position: fixed;
    top: 70px;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, var(--color-onyx) 0%, #0f0f11 100%);
    max-height: calc(100vh - 70px);
    overflow-y: auto;
    padding: 20px;
    display: none;
    flex-direction: column;
    gap: 12px;
    z-index: 90;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.mobile-menu.show {
    display: flex;
}

.mobile-menu-item {
    padding: 14px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    color: rgba(228, 226, 228, 0.8);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mobile-menu-item:hover {
    background: rgba(0, 87, 255, 0.1);
    color: var(--color-blue);
}

.mobile-menu-section {
    padding: 12px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.mobile-menu-section:first-child {
    border-top: none;
}

.mobile-menu-title {
    font-size: 11px;
    text-transform: uppercase;
    color: rgba(228, 226, 228, 0.5);
    font-weight: 700;
    margin-bottom: 8px;
    padding: 0 4px;
}

/* Auth Buttons */
.auth-buttons {
    display: flex;
    gap: 8px;
    align-items: center;
}

.btn-ghost {
    padding: 8px 16px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--color-silver);
    border-radius: 6px;
    text-decoration: none;
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-ghost:hover {
    border-color: var(--color-blue);
    color: var(--color-blue);
    background: rgba(0, 87, 255, 0.05);
}

.btn-primary {
    padding: 8px 20px;
    background: var(--color-blue);
    color: white;
    border: none;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary:hover {
    background: #0047cc;
    transform: translateY(-2px);
}

/* Responsive */
@media (max-width: 1024px) {
    .navbar-search {
        max-width: 300px;
        margin: 0 20px;
    }

    .nav-link {
        padding: 8px 12px;
        font-size: 12px;
    }
}

@media (max-width: 768px) {
    .navbar-container {
        padding: 0 16px;
    }

    .navbar-search {
        display: none;
    }

    .navbar-menu {
        display: none;
    }

    .mobile-toggle {
        display: flex;
        order: 2;
    }

    .navbar-actions {
        gap: 8px;
        margin-left: auto;
        order: 3;
    }

    .navbar-brand {
        order: 1;
    }

    .navbar-logo {
        width: 32px;
        height: 32px;
        font-size: 18px;
    }

    .navbar-brand {
        font-size: 18px;
    }

    .icon-button {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }

    /* Mobile menu takes full height */
    .mobile-menu {
        top: 70px;
        max-height: calc(100vh - 70px);
    }

    .mobile-menu-item {
        padding: 12px;
        font-size: 13px;
    }

    .auth-buttons {
        flex-direction: column;
        width: 100%;
        margin-top: 12px;
        padding-top: 12px;
        border-top: 1px solid rgba(255, 255, 255, 0.05);
    }

    .btn-ghost,
    .btn-primary {
        width: 100%;
        padding: 12px;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .navbar-container {
        padding: 0 12px;
    }

    .navbar-logo {
        width: 28px;
        height: 28px;
        font-size: 16px;
    }

    .navbar-brand {
        font-size: 16px;
        gap: 6px;
    }

    .navbar-brand span {
        display: none;
    }

    .navbar-actions {
        gap: 6px;
    }

    .icon-button {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }

    .user-avatar {
        width: 32px;
        height: 32px;
    }

    .badge {
        width: 18px;
        height: 18px;
        font-size: 9px;
        top: -6px;
        right: -6px;
    }
}

/* Scroll Effect */
.navbar.scrolled {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    border-bottom-color: rgba(0, 87, 255, 0.1);
}

/* Light mode (if needed) */
.navbar.light {
    background: rgba(255, 255, 255, 0.95);
    border-bottom-color: rgba(0, 0, 0, 0.1);
}

.navbar.light .nav-link,
.navbar.light .navbar-brand {
    color: #0a0a0b;
}

.navbar.light .nav-link:hover {
    background: rgba(0, 87, 255, 0.05);
}

.navbar.light .icon-button {
    border-color: rgba(0, 0, 0, 0.1);
    color: rgba(10, 10, 11, 0.6);
}