p, h1, h2, h3, h4, h5, h6, button {
    font-family: "Roboto", serif;
}

body {
    background-color: #f5f5f9;
    background-size: cover;
    width: auto; 
    overflow-x: hidden;
    font-family: "Roboto", serif;
    margin: 0px;
}

.nav-bar {
    width: 100%;
    display: inline-block;
    background-color: #1C539F;
    font-family: "Roboto", serif;
    font-weight: 700 !important;
    padding-top: 10px;
}

.nav-content .logo-touch-target {
    display: inline-flex;
    height: 60%;
    width: 350px;
}

.nav-content .nav-logo {
    height: 60px;
    margin: auto;
}

.nav-logo {
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-logo img {
    width: 200px;
}

.nav-content nav {
    display: block;
    width: 100%;
    text-align: right;
    padding-top: 0px;
    padding-right: 0px;
}

.profile {
    background-color: #1d539f !important;
    text-align: center;
    height: 320px;
    margin-bottom: 50px;
}

.profile h1 {
        font-size: 50px;
        font-weight: 700;
        color: white;
}

.profile img {
        border-radius: 50%;
        max-width: 100%;
        max-height: 100%;
        margin-left: auto;
        margin-right: auto;
        display: block;        
        padding: 20px;
}

.profile .profile-picture {
    margin-bottom: 30px;
    height: 200px;
}

.banner {
    padding: 20px 0px 50px 0px;
    height: 150px;
    background-color: #1d539f;
}

.banner .logo {
    max-width:180px;
    max-height:60px;
    width: auto;
    height: auto;
}

.banner .title {
    color: white;
    font-size: 50px;
    font-weight: 700;
}

.about, .work-experience, .education, .hobbies, .map {
    padding: 10px 60px;
    max-width: 800px;
}

.about h2, .work-experience h2, .education h2, .hobbies h2, .map h2 {
    color: #1C539F; 
}

.menu-bar {
    padding: 5px 60px;
    display: flex;
    justify-content: center;
    gap: 50px;
}

/* Yanxi-only tab-style menu (does not affect Jane's .menu-bar) */
.yanxi-menu {
    gap: 0;
    padding: 0;
    margin: 0 60px 40px 60px;
    border-bottom: 2px solid #e0e0ea;
}

.yanxi-menu a {
    padding: 14px 26px;
    margin-bottom: -2px;
    color: #5a6172;
    font-weight: 500;
    text-decoration: none;
    border-bottom: 3px solid transparent;
    transition: color 0.15s ease, border-color 0.15s ease;
}

.yanxi-menu a:hover {
    color: #1C539F;
}

.yanxi-menu a.active {
    color: #1C539F;
    font-weight: 700;
    border-bottom-color: #1C539F;
}

.hobby img {
    height: 200px;
}

/* Yanxi hobby row — text on the left, ASCII-art icon on the right. */
.yanxi-hobby {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
    max-width: 680px;
    margin: 0 auto 26px;
    padding: 0 24px;
}

.yanxi-hobby .hobby-text {
    flex: 1;
}

.yanxi-hobby .hobby-text h3 {
    margin-bottom: 6px;
}

/* Fixed-width column so every photo sits in the same horizontal slot and forms a
   tidy vertical column; the photo is centered within the slot. */
.hobby-icon-wrap {
    flex-shrink: 0;
    width: 150px;
    display: flex;
    justify-content: center;
}

/* Uniform square thumbnails so different photo sizes still line up neatly.
   (Higher specificity than the shared ".hobby img" rule so it isn't overridden.) */
.yanxi-hobby .hobby-photo {
    width: 150px;
    height: 150px;
    object-fit: cover;
    border-radius: 10px;
    display: block;
}

/* On narrow screens, stack the photo under the text so nothing overflows. */
@media (max-width: 600px) {
    .yanxi-hobby {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    .hobby-icon-wrap {
        width: auto;
        justify-content: flex-start;
    }
}

.map img {
    height: 300px;
}

/* Leaflet interactive map (Yanxi) — needs an explicit height to render. */
.visited-map {
    height: 420px;
    max-width: 820px;
    margin: 0 auto 40px;
    border-radius: 10px;
}

.education img {
    height: 100px;
}

/* ===== Yanxi chat widget (rule-based "ask me anything" bot) ===== */
#yanxi-chatbot {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 1000;
    font-family: "Roboto", sans-serif;
}

.chatbot-toggle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: none;
    padding: 0;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    background: #1C539F;
    color: #fff;
    font-size: 26px;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(28, 83, 159, 0.35);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.chatbot-toggle:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 6px 22px rgba(28, 83, 159, 0.45);
}

.chatbot-toggle.is-open {
    transform: scale(0.9);
    opacity: 0.85;
}

.chatbot-panel {
    position: absolute;
    right: 0;
    bottom: 74px;
    width: 340px;
    max-width: calc(100vw - 32px);
    height: 460px;
    max-height: calc(100vh - 120px);
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
    display: none;
    flex-direction: column;
    overflow: hidden;
}

.chatbot-panel.is-open {
    display: flex;
    animation: chatbotPop 0.18s ease;
}

@keyframes chatbotPop {
    from { opacity: 0; transform: translateY(12px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.chatbot-header {
    background: #1C539F;
    color: #fff;
    padding: 12px 16px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.chatbot-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    padding: 0 4px;
}

.chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: #f5f5f9;
}

.chatbot-msg {
    max-width: 82%;
    padding: 9px 13px;
    border-radius: 14px;
    font-size: 14px;
    line-height: 1.5;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.chatbot-msg.bot {
    align-self: flex-start;
    background: #fff;
    color: #222;
    border: 1px solid #e3e3ec;
    border-bottom-left-radius: 4px;
}

.chatbot-msg.user {
    align-self: flex-end;
    background: #1C539F;
    color: #fff;
    border-bottom-right-radius: 4px;
}

.chatbot-msg.typing {
    display: flex;
    gap: 4px;
    align-items: center;
}

.chatbot-msg.typing span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #9aa3b5;
    animation: chatbotBlink 1.2s infinite both;
}

.chatbot-msg.typing span:nth-child(2) { animation-delay: 0.2s; }
.chatbot-msg.typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes chatbotBlink {
    0%, 80%, 100% { opacity: 0.3; }
    40% { opacity: 1; }
}

.chatbot-sticker {
    display: block;
    max-width: 120px;
    margin-top: 6px;
}

.chatbot-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 0 14px 6px;
    background: #f5f5f9;
}

.chatbot-chip {
    background: #eef2fb;
    color: #1C539F;
    border: 1px solid #cfdcf3;
    border-radius: 16px;
    padding: 5px 12px;
    font-size: 12.5px;
    cursor: pointer;
    transition: background 0.12s ease;
}

.chatbot-chip:hover {
    background: #dfe8fa;
}

.chatbot-input {
    display: flex;
    border-top: 1px solid #e3e3ec;
    padding: 8px;
    gap: 8px;
    background: #fff;
}

.chatbot-input input {
    flex: 1;
    border: 1px solid #d6d6e0;
    border-radius: 18px;
    padding: 8px 14px;
    font-size: 14px;
    outline: none;
    font-family: inherit;
}

.chatbot-input input:focus {
    border-color: #1C539F;
}

.chatbot-input button {
    background: #1C539F;
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 38px;
    height: 38px;
    font-size: 15px;
    cursor: pointer;
    flex-shrink: 0;
}

@media (max-width: 600px) {
    #yanxi-chatbot { right: 14px; bottom: 14px; }
    .chatbot-panel { width: calc(100vw - 28px); height: 70vh; }
}