/* yidawang-site/style.css */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&family=Outfit:wght@300;400;600;700&display=swap');

:root {
    /* Colors - Dark Theme */
    --bg-base: #0d1117;
    --bg-card: #161b22;
    --bg-card-hover: #1c2128;
    --border-color: #30363d;
    --text-primary: #c9d1d9;
    --text-secondary: #8b949e;
    --text-heading: #f0f6fc;

    /* Accents */
    --accent-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --accent-color: #667eea;

    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 2rem;
    --spacing-lg: 4rem;
    --spacing-xl: 6rem;

    /* Shadows & Effects */
    --shadow-sm: 0 4px 6px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 10px 15px rgba(0, 0, 0, 0.4);
    --glass-bg: rgba(22, 27, 34, 0.7);
    --glass-blur: blur(10px);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-base);
    background-image: linear-gradient(rgba(13, 17, 23, 0.25), rgba(13, 17, 23, 0.25)), url('images/background_galaxy.png');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    cursor: default;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: 'Outfit', sans-serif;
    color: var(--text-heading);
    margin-bottom: var(--spacing-sm);
}

a {
    color: var(--accent-color);
    text-decoration: none;
    transition: all 0.3s ease;
}

a:hover {
    color: #764ba2;
}

/* Base Layout */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: transparent;
    transition: all 0.3s ease;
    padding: var(--spacing-md) 0;
}

.navbar.scrolled {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    border-bottom: 1px solid var(--border-color);
    padding: var(--spacing-sm) 0;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand {
    font-family: 'Outfit', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-heading);
    text-transform: uppercase;
    letter-spacing: 2px;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    list-style: none;
}

.nav-link {
    color: var(--text-secondary);
    font-weight: 500;
    text-transform: uppercase;
    font-size: 0.875rem;
    letter-spacing: 1px;
}

.nav-link:hover,
.nav-link.active {
    color: var(--accent-color);
    text-shadow: 0 0 12px rgba(102, 126, 234, 0.6);
}

.nav-link.nav-highlight {
    font-size: 1rem; /* Slightly larger */
    font-weight: 600; /* Bolder */
    color: var(--text-heading);
}

.nav-link.nav-highlight:hover,
a.nav-link.nav-highlight:hover {
    color: #764ba2 !important;
    text-shadow: 0 0 12px rgba(118, 75, 162, 0.6) !important;
}

/* Mobile Menu Button */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text-heading);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
}

/* Search Bar */
.search-nav-item {
    position: relative;
}

.search-container {
    position: relative;
    display: flex;
    align-items: center;
}

.search-input {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.4rem 1rem 0.4rem 2rem;
    border-radius: 20px;
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    width: 150px;
    transition: all 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: var(--accent-color);
    width: 200px;
    box-shadow: 0 0 8px rgba(102, 126, 234, 0.4);
}

.search-icon {
    position: absolute;
    left: 10px;
    color: var(--text-secondary);
    font-size: 0.8rem;
    pointer-events: none;
}

.search-results-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    width: 250px;
    margin-top: 0.5rem;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: var(--shadow-md);
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
}

.search-results-dropdown.active {
    display: block;
}

.search-result-item {
    padding: 10px 15px;
    border-bottom: 1px solid var(--border-color);
    display: block;
    color: var(--text-primary);
    text-decoration: none;
    transition: background 0.2s;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover {
    background-color: var(--bg-card-hover);
    color: var(--accent-color);
}

.search-result-title {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.2rem;
}

.search-result-snippet {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* Dropdown */
.dropdown {
    position: relative;
}

.dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background-color: var(--bg-card);
    min-width: 160px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
}

.dropdown:hover .dropdown-content,
.dropdown.active .dropdown-content {
    display: block;
}

.dropdown-content a {
    color: var(--text-secondary);
    padding: 12px 16px;
    display: block;
    font-size: 0.875rem;
}

.dropdown-content a:hover {
    background-color: var(--bg-card-hover);
    color: var(--accent-color);
    text-shadow: 0 0 8px rgba(102, 126, 234, 0.4);
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding-top: var(--spacing-xl);
    position: relative;
    overflow: hidden;
}

.hero-content {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: var(--spacing-xl);
    align-items: center;
}

.hero-image-container {
    position: relative;
    width: 100%;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    isolation: isolate;
}

/* This is the solid shield that blocks stars - perfectly locked to the portrait size */
.hero-image-container::before {
    content: '';
    position: absolute;
    right: 5%; 
    width: 90%;
    max-width: 580px; /* Larger than the image to block all stars in the fade zone */
    height: 90%;
    background: var(--bg-base);
    border-radius: 50%;
    z-index: 1;
    filter: blur(60px); /* Solid enough to block stars, soft enough to blend */
}

.hero-image-wrapper {
    position: relative;
    border-radius: 50%;
    z-index: 2;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 500px;
}

.hero-image {
    width: 100%;
    height: auto;
    display: block;
    position: relative;
    z-index: 2;
    border-radius: 50%;
    -webkit-mask-image: radial-gradient(ellipse at center, rgba(0,0,0,1) 40%, rgba(0,0,0,0.4) 62%, rgba(0,0,0,0) 72%);
    mask-image: radial-gradient(ellipse at center, rgba(0,0,0,1) 40%, rgba(0,0,0,0.4) 62%, rgba(0,0,0,0) 72%);
}

@keyframes pulse {
    0% {
        opacity: 0.5;
        transform: scale(0.95);
    }

    100% {
        opacity: 0.8;
        transform: scale(1.05);
    }
}

.hero-title {
    font-size: 3.5rem;
    line-height: 1.1;
    margin-bottom: var(--spacing-sm);
}

.hero-subtitle {
    font-size: 1.5rem;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-md);
    font-weight: 300;
}

.btn-group {
    display: flex;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: 30px;
    font-weight: 500;
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-primary);
}

.btn:hover {
    transform: translateY(-2px);
    background: var(--bg-card-hover);
    border-color: var(--text-secondary);
    box-shadow: var(--shadow-sm);
    color: var(--text-heading);
}

.btn-primary {
    background: var(--accent-gradient);
    color: white;
    border: none;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
    color: white;
}

/* Sections */
section {
    padding: var(--spacing-xl) 0;
}

.section-title {
    font-size: 2.5rem;
    margin-bottom: var(--spacing-lg);
    text-align: center;
}

/* Cards */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-md);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.15), 0 0 20px rgba(118, 75, 162, 0.2);
    border-color: var(--accent-color);
}

/* About Section */
.about-text p {
    margin-bottom: var(--spacing-sm);
    font-size: 1.1rem;
}

.about-text p:last-child {
    margin-bottom: 0;
}

/* Grid Layouts */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-lg);
}

/* Lists */
.expertise-list,
.education-list {
    list-style: none;
}

.expertise-list li {
    padding: 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: var(--spacing-sm);
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.3s ease;
}

.expertise-list li:hover {
    border-color: var(--accent-color);
    background: var(--bg-card-hover);
}

.expertise-list li i {
    color: var(--accent-color);
    font-size: 1.2rem;
}

.education-item {
    padding: 1.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: var(--spacing-sm);
    transition: all 0.3s ease;
}

.education-item:hover {
    border-color: var(--accent-color);
    background: var(--bg-card-hover);
}

.education-title {
    font-weight: 600;
    color: var(--text-heading);
    margin-bottom: 0.5rem;
}

.education-meta {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Experience Page Specifics */
.page-header {
    padding-top: calc(100px + var(--spacing-md));
    padding-bottom: var(--spacing-md);
    text-align: center;
    background: radial-gradient(circle at center, rgba(102, 126, 234, 0.1) 0%, rgba(13, 17, 23, 0) 70%);
}

.page-title {
    font-size: 3.5rem;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
}

.experience-layout {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: var(--spacing-lg);
    position: relative;
    align-items: start;
}

.sidebar-toc {
    position: sticky;
    top: 100px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: var(--spacing-md);
    transition: all 0.3s ease;
}

.sidebar-toc:hover {
    border-color: var(--accent-color);
    box-shadow: 0 0 15px rgba(102, 126, 234, 0.15);
}

.toc-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-sm);
    padding-bottom: var(--spacing-xs);
    border-bottom: 1px solid var(--border-color);
}

.toc-title {
    font-size: 1.2rem;
    margin-bottom: 0;
}

.toc-close {
    display: none;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 5px;
    transition: color 0.2s;
}

.toc-close:hover {
    color: var(--text-heading);
}

.mobile-toc-toggle {
    display: none;
    position: fixed;
    bottom: 30px;
    left: 30px;
    z-index: 1000;
    background: var(--accent-gradient);
    color: white;
    padding: 0.8rem 1.2rem;
    border-radius: 30px;
    border: none;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    cursor: pointer;
    font-size: 1rem;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.toc-toggle-text {
    font-weight: 600;
}

.mobile-toc-toggle:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.toc-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 1050;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.toc-overlay.active {
    display: block;
    opacity: 1;
}

.toc-links {
    list-style: none;
}

.toc-links li {
    margin-bottom: 0.5rem;
}

.toc-link {
    color: var(--text-secondary);
    font-size: 0.95rem;
    display: block;
    padding: 0.5rem;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.toc-link:hover,
.toc-link.active {
    background: var(--bg-card-hover);
    color: #764ba2;
    text-shadow: 0 0 10px rgba(118, 75, 162, 0.5);
    padding-left: 1rem;
    border-left: 3px solid #764ba2;
}

.experience-content section {
    margin-bottom: var(--spacing-xl);
    scroll-margin-top: 100px;
    /* For anchor links */
}

.org-header {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-md);
    padding-bottom: var(--spacing-sm);
    border-bottom: 1px solid var(--border-color);
}

.org-header h2 {
    margin-bottom: 0;
    line-height: 1.2;
}

.org-header i {
    font-size: 2rem;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: flex;
    align-items: center;
    transform: translateY(-1px); /* Slight nudge to match visual baseline */
}

.role-section {
    margin-bottom: var(--spacing-lg);
}

.role-title {
    color: var(--text-heading);
    margin-bottom: var(--spacing-sm);
}

.role-desc p {
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.role-desc ul {
    margin-left: var(--spacing-md);
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.role-desc li {
    margin-bottom: 0.5rem;
}

/* Image Gallery */
.img-gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-top: 2rem;
    margin-bottom: 2rem;
}

.img-gallery figure {
    flex: 1 1 280px;
    margin: 0;
    padding: 1.25rem; /* Balanced internal padding */
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background: var(--bg-base);
    display: flex;
    flex-direction: column;
}

.img-gallery figure img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    display: block;
    border-radius: 6px; /* Soften image corners inside card */
    transition: transform 0.4s ease;
}

.img-gallery figure:hover img {
    transform: scale(1.02);
}

.img-gallery figcaption {
    padding: 0;
    margin-top: 1.25rem;
    font-size: 0.82rem;
    color: var(--text-secondary);
    font-style: italic;
    line-height: 1.5;
}

/* Chatbot Widget */
.chatbot-widget {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 1000;
}

.chatbot-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--accent-gradient);
    color: white;
    padding: 0.8rem 1.2rem;
    border-radius: 30px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    font-weight: 600;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.chatbot-btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
    color: white;
}

/* Chat Window */
.chat-window {
    display: none;
    position: absolute;
    bottom: 60px;
    right: 0;
    width: 320px;
    height: 450px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: var(--shadow-md);
    flex-direction: column;
    overflow: hidden;
    transform-origin: bottom right;
    animation: chatPop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.chat-window.active {
    display: flex;
}

@keyframes chatPop {
    0% {
        transform: scale(0.5);
        opacity: 0;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.chat-header {
    background: var(--accent-gradient);
    color: white;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-title {
    font-weight: 600;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.chat-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.chat-close:hover {
    opacity: 1;
}

.chat-messages {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: var(--bg-base);
}

.message {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 0.9rem;
    line-height: 1.4;
    word-wrap: break-word;
}

.bot-message {
    align-self: flex-start;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-bottom-left-radius: 4px;
}

.user-message {
    align-self: flex-end;
    background: var(--accent-color);
    color: white;
    border-bottom-right-radius: 4px;
}

.chat-input-area {
    padding: 15px;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 10px;
    background: var(--bg-card);
}

#chat-input {
    flex: 1;
    background: var(--bg-base);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 10px 15px;
    border-radius: 20px;
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
}

#chat-input:focus {
    outline: none;
    border-color: var(--accent-color);
}

#chat-send {
    background: var(--accent-gradient);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: transform 0.2s;
}

#chat-send:hover {
    transform: scale(1.1);
}

.typing-indicator {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
}

.typing-dot {
    width: 6px;
    height: 6px;
    background: var(--text-secondary);
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

.typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-4px);
    }
}

/* Footer */
footer {
    border-top: 1px solid var(--border-color);
    padding: var(--spacing-md) 0;
    text-align: center;
    color: var(--text-secondary);
    margin-top: var(--spacing-xl);
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-sm);
}

/* Animations */
.fade-in-up {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.fade-in-up.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Responsive */
@media (max-width: 992px) {
    .hero-content {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .hero-image-container {
        margin-bottom: var(--spacing-md);
    }

    .btn-group {
        justify-content: center;
    }

    .grid-2 {
        grid-template-columns: 1fr;
    }

    .experience-layout {
        grid-template-columns: 1fr;
    }

    .sidebar-toc {
        display: block;
        position: fixed;
        top: 0;
        left: -300px;
        width: 280px;
        height: 100vh;
        z-index: 1100;
        background: var(--bg-card);
        border-right: 1px solid var(--border-color);
        border-radius: 0;
        padding: var(--spacing-md);
        transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        overflow-y: auto;
    }

    .sidebar-toc.active {
        left: 0;
    }

    .toc-close {
        display: block;
    }

    .mobile-toc-toggle {
        display: flex;
    }
}

@media (max-width: 768px) {
    .nav-container {
        padding-top: 0.5rem;
        padding-bottom: 0.5rem;
    }

    .mobile-menu-btn {
        display: block;
    }

    .nav-links {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--bg-card);
        flex-direction: column;
        padding: 1rem;
        gap: 1.5rem;
        border-bottom: 1px solid var(--border-color);
        box-shadow: var(--shadow-md);
        display: none;
        align-items: flex-start;
    }

    .nav-links.active {
        display: flex;
    }

    .dropdown-content {
        position: static;
        display: none;
        box-shadow: none;
        border: none;
        padding-left: 1rem;
        margin-top: 0.5rem;
    }

    .dropdown.active .dropdown-content {
        display: block;
    }

    .search-input {
        width: 100%;
    }

    .search-input:focus {
        width: 100%;
    }

    .search-results-dropdown {
        width: 100%;
        right: auto;
        left: 0;
    }

    .hero-title {
        font-size: 2.5rem;
    }

    .section-title {
        font-size: 2rem;
    }
}