/* --- Global Reset & Variables --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --secondary: #06b6d4;
    --dark: #0f172a;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --nav-bg: #ffffff;
    --border-color: #e2e8f0;
    --radius-sm: 8px;
    --radius-md: 12px;
    --bg-gradient: linear-gradient(135deg, #4f46e5 0%, #06b6d4 100%);
    --nav-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: #f8fafc;
    color: var(--text-main);
    padding-top: 80px; /* Added so fixed header doesn't hide your main content */
}

/* --- Fixed Header & Navbar Container --- */
.site-header {
    background: var(--nav-bg);
    position: fixed; /* Cleaned up conflicting sticky/fixed rule */
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--nav-shadow);
}

.navbar {
    max-width: 1280px;
    margin: 0 auto;
    padding: 12px 24px;
    display: flex;
    align-items: center;
    gap: 20px;
    /* justify-content: space-between removed to allow auto-alignment */
}

/* --- Brand Section --- */
.nav-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    text-decoration: none;
    z-index: 1002;
    flex-shrink: 0; /* Prevents the logo section from squishing */
    margin-right: auto; /* This forces the logo left, and all menu buttons to the right */
    
    /* 
      TIP: If you literally meant you want the Logo on the FAR RIGHT of the screen 
      and the menu on the left, delete 'margin-right: auto;' above and use:
      margin-left: auto;
      order: 3;
    */
}

.logo {
    width: 48px;
    height: 48px;
    min-width: 48px;
    background: var(--bg-gradient);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(79, 70, 229, 0.25);
}

.logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.brand-text h1 {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: -0.2px;
    line-height: 1.3;
    white-space: nowrap; /* Prevents text from breaking into multiple lines */
}

.brand-text p {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 500;
    line-height: 1.2;
    margin-top: 2px;
    white-space: nowrap; /* Prevents text from breaking into multiple lines */
}

/* --- Desktop Navigation Menu --- */
.nav-menu {
    display: flex;
    align-items: center;
    flex-shrink: 0; /* Prevents menu from shrinking */
}

.nav-list {
    display: flex;
    align-items: center;
    list-style: none;
    gap: 8px;
}

.nav-link {
    text-decoration: none;
    color: var(--text-muted);
    font-size: 0.92rem;
    font-weight: 500;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
    white-space: nowrap; /* Ensures button text stays in one line */
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary);
    background-color: rgba(79, 70, 229, 0.08);
}

.mobile-login-wrapper {
    display: none;
}

/* --- Right Action Button --- */
.nav-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.login-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: #ffffff;
    border: 2px solid var(--primary);
    color: var(--primary);
    padding: 8px 20px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.88rem;
    transition: all 0.25s ease;
    box-shadow: 0 2px 6px rgba(79, 70, 229, 0.08);
    cursor: pointer;
    white-space: nowrap;
}

.login-btn:hover {
    background: var(--primary);
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(79, 70, 229, 0.25);
}

/* --- Hamburger Toggle Button --- */
.hamburger-btn {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 32px;
    height: 24px;
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 1002;
    padding: 2px 0;
    touch-action: manipulation;
}

.hamburger-btn .bar {
    width: 100%;
    height: 3px;
    background-color: var(--dark);
    border-radius: 3px;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.hamburger-btn.active .bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.hamburger-btn.active .bar:nth-child(2) {
    opacity: 0;
}

.hamburger-btn.active .bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* --- Mobile Overlay Backdrop --- */
.menu-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(3px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 998;
}

.menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* --- Responsive Breakpoints --- */
/* Increased breakpoint to 1150px so if you add lots of buttons, it collapses before breaking */
@media (max-width: 1150px) {
    .hamburger-btn {
        display: flex;
    }

    .desktop-login {
        display: none;
    }

    .nav-menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: 280px;
        height: 100vh;
        background-color: var(--nav-bg);
        flex-direction: column;
        justify-content: flex-start;
        align-items: stretch;
        padding: 90px 24px 30px;
        box-shadow: -8px 0 24px rgba(0, 0, 0, 0.12);
        transition: right 0.35s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 1001;
    }

    .nav-menu.active {
        right: 0 !important;
    }

    .nav-list {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .nav-link {
        padding: 12px 16px;
        font-size: 1rem;
        display: block;
    }

    .mobile-login-wrapper {
        display: block;
        margin-top: 24px;
        padding-top: 20px;
        border-top: 1px solid var(--border-color);
    }

    .mobile-login-wrapper .login-btn {
        width: 100%;
        padding: 10px 16px;
    }
}

@media (max-width: 768px) {
    .navbar {
        padding: 10px 16px;
    }
    
    /* Let text wrap naturally on very small phones so it doesn't overflow off-screen */
    .brand-text h1, .brand-text p {
        white-space: normal; 
    }

    .brand-text h1 {
        font-size: 0.9rem;
    }

    .brand-text p {
        font-size: 0.68rem;
    }

    .logo {
        width: 40px;
        height: 40px;
        min-width: 40px;
    }
}

@media (max-width: 480px) {
    .brand-text {
        max-width: 185px;
    }
}