/* Glassmorphic Header & Navigation Styles */
#nav {
    height: 80px;
    width: 100%;
    background: rgba(10, 10, 10, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 40px;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    transition: all 0.3s ease;
}

#nav a.logo-link {
    display: flex;
    align-items: center;
    z-index: 1001;
}

#nav img {
    height: 50px;
    width: auto;
    object-fit: contain;
    transition: transform 0.3s ease;
}

#nav img:hover {
    transform: scale(1.05);
}

/* Right Actions (Chatbot + Hamburger) */
.nav-right-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    z-index: 1001;
}

.chatboticon {
    width: 40px;
    height: 40px;
    cursor: pointer;
    padding: 7px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    transition: all 0.3s ease;
    display: block;
}

.chatboticon:hover {
    background-color: #f1c40f !important;
    border-color: #000000 !important;
    box-shadow: 0 0 16px rgba(241, 196, 15, 0.7);
    transform: scale(1.1);
}

.navb {
    display: flex;
    align-items: center;
    gap: 32px;
}

.navb h4 {
    margin: 0;
}

.navbar a {
    position: relative;
    font-family: var(--font-heading, 'Outfit', sans-serif);
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.85);
    font-weight: 600;
    text-decoration: none;
    letter-spacing: 0.5px;
    padding: 6px 0;
    transition: color 0.3s ease;
    display: inline-block;
}

.navbar a:hover,
.navbar a.active {
    color: #f1c40f !important;
    font-weight: 700;
    text-shadow: 0 0 12px rgba(241, 196, 15, 0.8), 0 0 20px rgba(241, 196, 15, 0.4);
}

.navbar a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 3px;
    background: #f1c40f;
    border-radius: 2px;
    box-shadow: 0 0 10px #f1c40f, 0 0 18px #f1c40f;
    transition: width 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.navbar a:hover::after,
.navbar a.active::after {
    width: 100% !important;
}

/* Mobile Hamburger Button */
.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 28px;
    height: 20px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1001;
}

.menu-toggle span {
    display: block;
    width: 100%;
    height: 3px;
    background: #ffffff;
    border-radius: 3px;
    transition: all 0.3s ease-in-out;
}

.menu-toggle.open span:nth-child(1) {
    transform: translateY(8.5px) rotate(45deg);
    background: #f1c40f;
}

.menu-toggle.open span:nth-child(2) {
    opacity: 0;
    transform: translateX(-10px);
}

.menu-toggle.open span:nth-child(3) {
    transform: translateY(-8.5px) rotate(-45deg);
    background: #f1c40f;
}

/* Desktop layout order */
@media (min-width: 821px) {
    .nav-right-actions {
        order: 2;
    }

    .navb {
        order: 1;
        margin-left: auto;
        margin-right: 28px;
    }
}

/* Mobile Responsive Dropdown (From Top) */
@media (max-width: 820px) {
    #nav {
        padding: 0 20px;
        height: 70px;
    }

    #nav img {
        height: 42px;
        width: auto;
    }

    .menu-toggle {
        display: flex;
    }

    .chatboticon {
        width: 36px;
        height: 36px;
        padding: 6px;
    }

    .navb {
        position: fixed;
        top: 70px;
        left: 0;
        width: 100%;
        background: rgba(12, 12, 12, 0.97);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        flex-direction: column;
        justify-content: flex-start;
        align-items: center;
        gap: 16px;
        padding: 24px 20px;
        box-shadow: 0 15px 30px rgba(0, 0, 0, 0.7);
        transform: translateY(-120%);
        opacity: 0;
        visibility: hidden;
        transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease, visibility 0.35s;
        z-index: 999;
    }

    .navb.show {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }

    .navbar {
        width: 100%;
        text-align: center;
    }

    .navbar a {
        font-size: 1.1rem;
        padding: 8px 0;
        display: inline-block;
        width: auto;
    }
}

/* Chatbox Popup Styles */
#hamburger-toggle.active .bar:nth-child(3) {
    transform: translateY(-9.5px) rotate(-45deg);
    background-color: #f1c40f;
}

@media (max-width: 768px) {
    #nav {
        padding: 0 20px;
        height: 70px !important;
        flex-direction: row !important;
        justify-content: space-between;
        align-items: center;
    }

    #hamburger-toggle {
        display: flex;
    }

    .navb {
        position: fixed;
        top: 70px;
        left: 0;
        width: 100%;
        background: rgba(10, 10, 10, 0.96);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        flex-direction: column;
        align-items: center;
        gap: 20px;
        padding: 30px 20px;
        transform: translateY(-150%);
        opacity: 0;
        pointer-events: none;
        transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
        box-shadow: 0 15px 30px rgba(0, 0, 0, 0.8);
    }

    .navb.active {
        transform: translateY(0);
        opacity: 1;
        pointer-events: auto;
    }

    .navbar a {
        font-size: 1.05rem;
        padding: 8px 0;
        display: inline-block;
    }

    #nav img {
        height: 44px !important;
        width: auto !important;
    }
}

/* ==========================================================================
   Global AI Chatbot Popup Styling
   ========================================================================== */
.chatbox {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 380px;
    max-width: calc(100vw - 40px);
    max-height: 520px;
    background: rgba(14, 14, 14, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.8);
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 10000;
}

.chatbox.active {
    opacity: 1 !important;
    transform: translateY(0) scale(1) !important;
    pointer-events: auto !important;
    display: flex !important;
    visibility: visible !important;
}

.chat-container {
    width: 100%;
    max-height: 320px;
    min-height: 200px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-right: 6px;
    margin: 10px 0;
}

.h1,
.chat-container .h1 {
    font-family: var(--font-heading, 'Outfit', sans-serif);
    font-size: 1rem;
    font-weight: 500;
    text-align: center;
    color: rgba(255, 255, 255, 0.7);
    margin: 10px 0;
}

.input-area {
    display: flex;
    align-items: center;
    padding: 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    gap: 10px;
    margin-top: 10px;
}

.arrow {
    width: 40px;
    height: 40px;
    margin: 0px;
    background: var(--primary, #f1c40f);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #000000;
    font-weight: bold;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(241, 196, 15, 0.3);
}

.arrow img {
    width: 18px;
    height: 18px;
    filter: brightness(0);
}

.arrow:hover {
    background: #ffd700;
    transform: scale(1.05);
}

.prompt {
    flex: 1;
    border: none;
    padding: 10px 14px;
    border-radius: 10px;
    outline: none;
    font-size: 14px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.prompt::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.user-chat-box {
    align-self: flex-end;
    background: #f1c40f;
    color: #0a0a0a;
    font-weight: 600;
    padding: 10px 16px;
    border-radius: 16px 16px 2px 16px;
    max-width: 80%;
    font-size: 0.9rem;
    line-height: 1.4;
    box-shadow: 0 4px 12px rgba(241, 196, 15, 0.3);
    margin-left: auto;
}

.ai-chat-box {
    align-self: flex-start;
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.12);
    padding: 10px 16px;
    border-radius: 16px 16px 16px 2px;
    max-width: 82%;
    font-size: 0.9rem;
    line-height: 1.4;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    margin-right: auto;
}

@media (max-width: 480px) {
    .chatbox {
        width: 92%;
        right: 4%;
        bottom: 20px;
        max-height: 480px;
        padding: 16px;
    }
}