/* CSS Variables for Theme */
:root {
    --bg-primary: #1a1a1a;
    --bg-secondary: #2d2d2d;
    --text-primary: #ffffff;
    --text-secondary: #b0b0b0;
    --text-muted: #888888;
    --accent: #a5be00;
    --accent-hover: #8fa000;
    --border-color: #404040;
    --tag-conference: #e74c3c;
    --tag-arxiv: #17a2b8;
    --tag-award: #f39c12;
    --tag-findings: #95a5a6;
}

.light-mode {
    --bg-primary: #ffffff;
    --bg-secondary: #f5f5f5;
    --text-primary: #1a1a1a;
    --text-secondary: #4a4a4a;
    --text-muted: #666666;
    --accent: #a5be00;
    --accent-hover: #8fa000;
    --border-color: #e0e0e0;
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Improve touch targets on mobile */
@media (max-width: 768px) {
    button,
    .pub-btn,
    .project-btn,
    .theme-toggle,
    .nav-link {
        min-height: 25px;
        min-width: 30px;
    }
}

/* Navigation */
.navbar {
    position: sticky;
    top: 0;
    background-color: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    padding: 0.5rem 0;
    z-index: 1000;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--text-primary);
    text-decoration: none;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 2rem;
}

/* Mobile Menu Toggle (Hamburger) */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 24px;
    height: 20px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1001;
}

.mobile-menu-toggle span {
    width: 100%;
    height: 2px;
    background-color: var(--text-primary);
    border-radius: 2px;
    transition: all 0.3s ease;
    transform-origin: center;
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.3s ease, font-weight 0.3s ease;
    font-size: 0.95rem;
}

.nav-link:hover {
    color: var(--accent-hover) !important;
}

.nav-link.active {
    color: var(--accent) !important;
}

.theme-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    transition: transform 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
}

.theme-toggle:hover {
    transform: scale(1.1);
    color: var(--accent);
}

.theme-icon {
    width: 20px;
    height: 20px;
    transition: color 0.3s ease;
}

/* Main Content */
.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 3rem 2rem;
}

.section {
    display: none;
}

.section.active {
    display: block;
}

.section-title {
    font-size: 3rem;
    font-weight: bold;
    margin-bottom: 2rem;
    color: var(--text-primary);
}

.section-heading {
    font-size: 2rem;
    font-weight: bold;
    margin: 2rem 0 1rem;
    color: var(--text-primary);
}

/* About Section */
.about-container {
    max-width: 900px;
}

.about-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 3rem;
    gap: 2rem;
}

.profile-image {
    flex-shrink: 0;
}

.profile-image img {
    width: 300px;
    height: 400px;
    object-fit: cover;
    border-radius: 8px;
}

.about-content {
    margin-bottom: 3rem;
}

.about-text {
    margin-bottom: 1rem;
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* News Section */
.news-section {
    margin: 3rem 0;
}

.news-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.news-item {
    display: flex;
    gap: 2rem;
    padding: 0.5rem 0;
}

.news-date {
    min-width: 120px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.news-content {
    color: var(--text-secondary);
    flex: 1;
}

/* Publications */
.publications-preview,
.publications-list {
    margin-top: 2rem;
}

.publication-item {
    display: flex;
    gap: 2rem;
    margin-bottom: 2.5rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
}

.pub-cover-image {
    flex-shrink: 0;
}

.pub-cover-image img {
    width: 200px;
    height: 280px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.pub-content {
    flex: 1;
    min-width: 0;
}

.pub-tags {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}

.tag {
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 500;
}

.tag-conference {
    background-color: var(--tag-conference);
    color: white;
}

.tag-arxiv {
    background-color: var(--tag-arxiv);
    color: white;
}

.tag-award {
    background-color: var(--tag-award);
    color: white;
}

.tag-findings {
    background-color: var(--tag-findings);
    color: white;
}

.pub-title {
    font-size: 1.3rem;
    font-weight: 600;
    margin: 0.5rem 0;
    color: var(--text-primary);
}

.pub-authors {
    color: var(--text-secondary);
    margin: 0.5rem 0;
}

.pub-venue {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin: 0.5rem 0;
}

.pub-buttons {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.pub-btn {
    padding: 0.4rem 0.8rem;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: background-color 0.3s ease;
}

.pub-btn:hover {
    background-color: var(--accent);
    border-color: var(--accent);
}

/* Inline Abstract Display */
.publication-abstract {
    display: none;
    margin-top: 1rem;
    padding: 1.5rem;
    border: 1px dashed var(--border-color);
    border-radius: 4px;
    background-color: transparent;
    animation: fadeIn 0.3s ease;
}

.publication-abstract.active {
    display: block;
}

.publication-abstract p {
    color: var(--text-secondary);
    line-height: 1.8;
    font-size: 1rem;
    margin: 0;
    text-align: justify;
    white-space: pre-wrap;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Filter Bar */
.filter-bar {
    margin-bottom: 2rem;
}

.filter-input {
    width: 100%;
    max-width: 500px;
    padding: 0.75rem 1rem;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-primary);
    font-size: 1rem;
}

.filter-input:focus {
    outline: none;
    border-color: var(--accent);
}

/* Year Groups */
.year-group {
    position: relative;
    margin-bottom: 3rem;
}

.year-label {
    position: absolute;
    right: 0;
    top: 0;
    font-size: 1.5rem;
    color: var(--text-muted);
    font-weight: 300;
}

/* Projects */
.projects-list {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.project-card {
    display: flex;
    gap: 2rem;
    padding: 2rem;
    background-color: var(--bg-secondary);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.project-image {
    flex-shrink: 0;
}

.project-image img {
    width: 400px;
    height: 250px;
    object-fit: cover;
    border-radius: 8px;
}

.project-content {
    flex: 1;
}

.project-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.project-meta {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    align-items: center;
}

.project-type {
    padding: 0.25rem 0.75rem;
    background-color: var(--accent);
    color: white;
    border-radius: 4px;
    font-size: 0.85rem;
}

.project-date {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.project-tech {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

.project-features {
    list-style: none;
    margin: 1rem 0;
    padding-left: 0;
}

.project-features li {
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    padding-left: 1.5rem;
    position: relative;
}

.project-features li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: var(--accent);
}

.project-btn {
    margin-top: 1rem;
    padding: 0.6rem 1.5rem;
    background-color: var(--accent);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.95rem;
    transition: background-color 0.3s ease;
}

.project-btn:hover {
    background-color: var(--accent-hover);
}

/* Extra Curricular */
.extracurricular-category {
    margin: 3rem 0;
}

.category-title {
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--accent);
    margin: 2rem 0 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--accent);
}

.subcategory-title {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 2rem 0 1rem;
    padding-left: 1rem;
    border-left: 4px solid var(--accent);
}

.extracurricular-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.activity-item {
    display: flex;
    gap: 2rem;
    padding: 1.5rem;
    background-color: var(--bg-secondary);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.activity-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.activity-date {
    min-width: 140px;
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
    flex-shrink: 0;
}

.activity-content {
    flex: 1;
}

.activity-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.activity-description {
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Publications Page Specific Styles */
.publications-section {
    margin: 3rem 0;
}

.publications-section-title {
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--accent);
    margin: 2.5rem 0 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--accent);
}

.pub-doi {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin: 0.5rem 0;
}

.doi-link {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.3s ease;
}

.doi-link:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}

.pub-status {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-style: italic;
    margin: 0.5rem 0;
    padding: 0.5rem;
    background-color: var(--bg-secondary);
    border-left: 3px solid var(--accent);
    border-radius: 4px;
}

/* Footer */
.footer {
    text-align: center;
    padding: 3rem 2rem;
    border-top: 1px solid var(--border-color);
    margin-top: 4rem;
}

.social-icons {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 1rem;
}

.social-icons a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: transform 0.3s ease, color 0.3s ease;
    border-radius: 50%;
}

.social-icons a:hover {
    transform: scale(1.1);
    color: var(--accent);
}

.social-icons a svg {
    width: 20px;
    height: 20px;
}

.footer-text {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Responsive Design */

/* Tablet and below (1024px) */
@media (max-width: 1024px) {
    .main-content {
        padding: 2rem 1.5rem;
    }

    .nav-container {
        padding: 0 1.5rem;
    }

    .about-header {
        gap: 1.5rem;
    }
}

/* Mobile and Tablet (768px) */
@media (max-width: 768px) {
    .nav-container {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        padding: 0 1rem;
        position: relative;
    }

    .nav-left {
        flex: 1;
    }

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

    .nav-right {
        position: fixed;
        top: 60px;
        left: 0;
        width: 100%;
        background-color: var(--bg-secondary);
        border-bottom: 1px solid var(--border-color);
        flex-direction: column;
        align-items: stretch;
        padding: 1rem;
        gap: 0;
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
        transition: transform 0.3s ease, opacity 0.3s ease, visibility 0.3s ease;
        z-index: 1000;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    }

    .nav-right.active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }

    .nav-right .nav-link {
        display: block;
        padding: 1rem;
        text-align: center;
        border-bottom: 1px solid var(--border-color);
        width: 100%;
    }

    .nav-right .nav-link:last-child {
        border-bottom: none;
    }

    .nav-right .theme-toggle {
        margin: 0.5rem auto;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .nav-link {
        font-size: 0.85rem;
        padding: 0.25rem 0.5rem;
    }

    .main-content {
        padding: 2rem 1rem;
    }

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

    .section-heading {
        font-size: 1.5rem;
        margin: 1.5rem 0 1rem;
    }

    /* About Section */
    .about-header {
        flex-direction: column;
        align-items: flex-start;
        text-align: left;
    }

    .profile-image {
        width: 100%;
        order: -1;
    }

    .profile-image img {
        width: 100%;
        max-width: 100%;
        height: auto;
        aspect-ratio: 3 / 4;
        object-fit: cover;
    }

    .about-content {
        text-align: left;
    }

    .about-text {
        font-size: 1rem;
    }

    /* News Section */
    .news-section {
        margin-top: 1.5rem;
        margin-bottom: 2rem;
    }

    .news-item {
        flex-direction: column;
        gap: 0.5rem;
        padding: 0.75rem 0;
    }

    .news-date {
        min-width: auto;
        font-weight: 600;
    }

    /* Publications */
    .publication-item {
        flex-direction: column;
        gap: 1.5rem;
    }

    .pub-cover-image {
        width: 100%;
        text-align: center;
    }

    .pub-cover-image img {
        width: 100%;
        height: auto;
        max-width: 100%;
        aspect-ratio: 200 / 280;
        object-fit: cover;
        margin: 0 auto;
    }

    .pub-title {
        font-size: 1.1rem;
    }

    .pub-buttons {
        gap: 0.4rem;
    }

    .pub-btn {
        padding: 0.35rem 0.7rem;
        font-size: 0.8rem;
    }

    .publications-section-title {
        font-size: 1.5rem;
    }

    .filter-input {
        max-width: 100%;
    }

    .year-label {
        position: static;
        display: block;
        margin-bottom: 1rem;
        font-size: 1.2rem;
    }

    /* Projects */
    .project-card {
        flex-direction: column;
        padding: 1.5rem;
        gap: 1.5rem;
    }

    .project-image {
        width: 100%;
    }

    .project-image img {
        width: 100%;
        height: auto;
        max-height: 250px;
        object-fit: cover;
    }

    .project-title {
        font-size: 1.3rem;
    }

    .project-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .project-features li {
        font-size: 0.9rem;
        margin-bottom: 0.75rem;
    }

    /* Extra Curricular */
    .category-title {
        font-size: 1.5rem;
        margin: 1.5rem 0 1rem;
    }

    .subcategory-title {
        font-size: 1.2rem;
        margin: 1.5rem 0 0.75rem;
    }

    .activity-item {
        flex-direction: column;
        gap: 0.75rem;
        padding: 1rem;
    }

    .activity-date {
        min-width: auto;
        font-weight: 600;
    }

    .activity-title {
        font-size: 1.1rem;
    }

    .activity-description {
        font-size: 0.9rem;
    }

    /* Footer */
    .footer {
        padding: 2rem 1rem;
    }

    .social-icons {
        gap: 1rem;
    }

    .social-icons a {
        font-size: 1.2rem;
    }
}

/* Small Mobile (480px) */
@media (max-width: 480px) {
    .nav-container {
        padding: 0.75rem;
    }

    .logo {
        font-size: 1.2rem;
    }

    .nav-right {
        gap: 0.5rem;
    }

    .nav-link {
        font-size: 0.75rem;
        padding: 0.2rem 0.4rem;
    }

    .theme-toggle {
        font-size: 1rem;
        padding: 0.4rem;
    }

    .main-content {
        padding: 1.5rem 0.75rem;
    }

    .section-title {
        font-size: 1.75rem;
        margin-bottom: 1rem;
    }

    .section-heading {
        font-size: 1.3rem;
        margin: 1rem 0 0.75rem;
    }

    .about-header {
        align-items: flex-start;
        text-align: left;
    }

    .profile-image {
        width: 100%;
        order: -1;
    }

    .profile-image img {
        width: 100%;
        max-width: 100%;
        height: auto;
        aspect-ratio: 3 / 4;
        object-fit: cover;
    }

    .about-content {
        text-align: left;
    }

    .about-text {
        font-size: 0.95rem;
    }

    /* Publications */
    .pub-cover-image img {
        width: 100%;
        height: auto;
        max-width: 100%;
        aspect-ratio: 200 / 280;
        object-fit: cover;
    }

    .pub-title {
        font-size: 1rem;
    }

    .pub-authors,
    .pub-venue {
        font-size: 0.85rem;
    }

    .pub-buttons {
        flex-wrap: wrap;
        gap: 0.3rem;
    }

    .pub-btn {
        padding: 0.3rem 0.6rem;
        font-size: 0.75rem;
    }

    .publication-abstract {
        padding: 1rem;
    }

    .publication-abstract p {
        font-size: 0.9rem;
    }

    /* Projects */
    .project-card {
        padding: 1rem;
    }

    .project-title {
        font-size: 1.2rem;
    }

    .project-tech {
        font-size: 0.85rem;
    }

    .project-features li {
        font-size: 0.85rem;
        padding-left: 1rem;
    }

    .project-btn {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
    }

    /* Extra Curricular */
    .category-title {
        font-size: 1.3rem;
    }

    .subcategory-title {
        font-size: 1.1rem;
        padding-left: 0.75rem;
    }

    .activity-item {
        padding: 0.75rem;
    }

    .activity-title {
        font-size: 1rem;
    }

    .activity-description {
        font-size: 0.85rem;
    }

    /* News */
    .news-date {
        font-size: 0.85rem;
    }

    .news-content {
        font-size: 0.9rem;
    }

    /* Filter */
    .filter-input {
        padding: 0.6rem 0.8rem;
        font-size: 0.9rem;
    }

    /* Footer */
    .footer {
        padding: 1.5rem 0.75rem;
    }

    .footer-text {
        font-size: 0.8rem;
    }
}

/* Very Small Mobile (360px) */
@media (max-width: 360px) {
    .section-title {
        font-size: 1.5rem;
    }

    .section-heading {
        font-size: 1.2rem;
    }

    .nav-link {
        font-size: 0.7rem;
        padding: 0.15rem 0.3rem;
    }

    .pub-cover-image img {
        width: 100%;
        height: auto;
        max-width: 100%;
        aspect-ratio: 200 / 280;
        object-fit: cover;
    }

    .project-image img {
        max-height: 200px;
    }
}

