/**
 * Main CSS for Academic Portfolio
 * Author: Yunuo Zhang
 * Description: Core styles for academic portfolio website
 */

/* ==================== CSS VARIABLES ==================== */
:root {
    --primary-color: #2c3e50;    /* Main brand color */
    --accent-color: #3498db;      /* Links and highlights */
    --text-color: #333;           /* Body text */
    --bg-light: #f8f9fa;         /* Light background */
    --border-color: #dee2e6;      /* Borders */
    --card-shadow: 0 2px 4px rgba(0,0,0,0.1); /* Card shadows */
}

/* ==================== GLOBAL STYLES ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box; /* Include padding in width calculations */
}

body {
    font-family: 'MonaspaceRadon', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
}

/* ==================== HEADER NAVIGATION ==================== */
.main-header {
    background: white;
    border-bottom: 1px solid var(--border-color);
    position: sticky; /* Stick to top on scroll */
    top: 0;
    z-index: 100;
}

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

/* Site brand/logo */
.nav-brand a {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
    text-decoration: none;
}

/* Navigation menu */
.nav-menu {
    display: flex;
    gap: 2rem;
}

.nav-menu a {
    color: var(--text-color);
    text-decoration: none;
    transition: color 0.3s;
}

.nav-menu a:hover {
    color: var(--accent-color);
}

/* ==================== HERO SECTION ==================== */
.hero {
    background: var(--bg-light);
    padding: 4rem 2rem;
    border-bottom: 1px solid var(--border-color);
}

.hero-container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 200px 1fr; /* Fixed width photo, flexible content */
    gap: 3rem;
    align-items: center;
}

/* Profile photo styling */
.profile-photo {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    border: 3px solid var(--accent-color);
    object-fit: cover;
    background: #ddd; /* Placeholder background */
}

/* Hero text content */
.hero-right .name {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.title {
    font-size: 1.2rem;
    color: var(--accent-color);
    margin-bottom: 0.25rem;
}

.institution {
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

.research-tagline {
    font-style: italic;
    margin-bottom: 1.5rem;
    padding: 0.5rem;
    background: white;
    border-left: 3px solid var(--accent-color);
}

/* Social/contact links */
.contact-row {
    display: flex;
    gap: 1.5rem;
}

.contact-row a {
    color: var(--text-color);
    text-decoration: none;
    transition: color 0.3s;
}

.contact-row a:hover {
    color: var(--accent-color);
}

/* ==================== MAIN CONTENT SECTION ==================== */
.main-content {
    padding: 4rem 2rem;
}

.content-container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr; /* Three equal columns */
    gap: 2rem;
}

/* Content card styling */
.content-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 2rem;
    box-shadow: var(--card-shadow);
}

.content-card h2 {
    margin-bottom: 1.5rem;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.content-card h3 {
    margin: 1.5rem 0 1rem;
    font-size: 1.1rem;
    color: var(--primary-color);
}

/* ==================== NEWS SECTION STYLES ==================== */
.news-item {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.news-date {
    font-size: 0.85rem;
    color: #666;
    margin-right: 1rem;
}

.news-badge {
    background: var(--accent-color);
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    text-transform: uppercase;
}

/* ==================== RESEARCH SECTION STYLES ==================== */
.research-areas {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.area-tag {
    background: var(--bg-light);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    border: 1px solid var(--border-color);
}

/* ==================== PUBLICATIONS STYLES ==================== */
.pub-highlight {
    margin-bottom: 1rem;
    padding: 1rem;
    background: var(--bg-light);
    border-radius: 4px;
}

.pub-title {
    font-weight: bold;
    margin-bottom: 0.25rem;
}

.pub-venue {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.pub-links a {
    color: var(--accent-color);
    margin-right: 1rem;
}

/* ==================== STATISTICS STYLES ==================== */
.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-top: 1rem;
}

.stat {
    text-align: center;
    padding: 1rem;
    background: var(--bg-light);
    border-radius: 4px;
}

.stat-number {
    font-size: 2rem;
    font-weight: bold;
    color: var(--accent-color);
}

.stat-label {
    font-size: 0.9rem;
    color: #666;
}

/* ==================== EDUCATION SECTION STYLES ==================== */
.education-timeline {
    position: relative;
    padding-left: 20px;
}

/* Education timeline line */
.education-timeline::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 2px;
    background: var(--accent-color);
}

/* Individual education item */
.edu-item {
    position: relative;
    margin-bottom: 2rem;
}

/* Timeline dot */
.edu-item::before {
    content: '';
    position: absolute;
    left: -24px;
    top: 5px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--accent-color);
    border: 2px solid white;
}

.edu-date {
    font-size: 0.85rem;
    color: var(--accent-color);
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.edu-degree {
    font-weight: bold;
    font-size: 1.05rem;
    margin-bottom: 0.25rem;
}

.edu-institution {
    color: #666;
    margin-bottom: 0.5rem;
}

.edu-details {
    font-size: 0.85rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.edu-advisor,
.edu-focus,
.edu-gpa,
.edu-honors {
    color: #777;
    font-style: italic;
}

/* Achievements section */
.achievements-list {
    margin-top: 1rem;
}

.achievement-item {
    padding: 0.5rem 0;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.achievement-item i {
    color: var(--accent-color);
}

/* "See more" links */
.see-more {
    display: inline-block;
    margin-top: 1rem;
    color: var(--accent-color);
    text-decoration: none;
}

/* ==================== NAVIGATION GRID SECTION ==================== */
.navigation-grid {
    background: var(--bg-light);
    padding: 4rem 2rem;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
}

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

/* Navigation cards grid */
.nav-cards-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* 3 columns */
    gap: 2rem;
}

/* Individual navigation card */
.nav-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    text-decoration: none;
    color: var(--text-color);
    transition: all 0.3s;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Hover effect for nav cards */
.nav-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* Navigation card icon */
.nav-icon {
    font-size: 3rem;
    color: var(--accent-color);
    margin-bottom: 1rem;
}

.nav-card h3 {
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

.nav-card p {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 1rem;
}

/* Navigation count badges */
.nav-count {
    background: var(--bg-light);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    color: var(--accent-color);
    font-weight: bold;
}

/* Download button style for CV */
.nav-download {
    background: var(--accent-color);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: bold;
}

/* ==================== FOOTER ==================== */
footer {
    background: var(--primary-color);
    color: white;
    padding: 2rem;
    text-align: center;
}

.footer-container p {
    margin: 0.25rem;
}

/* ==================== RESPONSIVE DESIGN ==================== */
/* Tablet view */
@media (max-width: 1024px) {
    /* Stack content cards vertically */
    .content-container {
        grid-template-columns: 1fr;
    }
    
    /* 2 columns for navigation cards */
    .nav-cards-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Mobile view */
@media (max-width: 768px) {
    /* Stack hero content vertically */
    .hero-container {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    /* Center contact links */
    .contact-row {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    /* Single column for navigation cards */
    .nav-cards-grid {
        grid-template-columns: 1fr;
    }
    
    /* Hide desktop menu - mobile menu would be implemented */
    .nav-menu {
        display: none; /* TODO: Implement mobile hamburger menu */
    }
}

/* Mobile menu button (hidden by default) */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}

/* Mobile menu button lines */
.mobile-menu-btn span {
    display: block;
    width: 25px;
    height: 3px;
    background: var(--primary-color);
    margin: 4px 0;
    transition: 0.3s;
}

/* Show mobile menu button on small screens */
@media (max-width: 768px) {
    .mobile-menu-btn {
        display: block;
    }
    
    /* Mobile menu active state */
    .nav-menu.active {
        display: flex;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        flex-direction: column;
        background: white;
        border-bottom: 1px solid var(--border-color);
        box-shadow: 0 2px 5px rgba(0,0,0,0.1);
        padding: 1rem 0;
    }
    
    .nav-menu.active a {
        padding: 0.5rem 2rem;
    }
}

/* Projects Page */
.projects-section {
    padding: 2rem 0;
}

.project-filters {
    display: flex;
    gap: 1rem;
    margin-bottom: 3rem;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 0.5rem 1.5rem;
    border: 2px solid #ddd;
    background: white;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-btn:hover,
.filter-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
}

.project-card {
    background: white;
    border-radius: 8px;
    padding: 2rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.12);
}

.project-card.featured {
    border: 2px solid var(--primary-color);
}

.featured-badge {
    position: absolute;
    top: -12px;
    right: 20px;
    background: var(--primary-color);
    color: white;
    padding: 0.25rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.project-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.project-header h3 {
    margin: 0;
    color: #333;
}

.project-status {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

.project-status.active {
    background: #e7f5ff;
    color: #1971c2;
}

.project-status.completed {
    background: #f3f0ff;
    color: #6741d9;
}

.project-description {
    color: #666;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.project-highlights {
    margin-bottom: 1.5rem;
}

.project-highlights h4 {
    color: #444;
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
}

.project-highlights ul {
    list-style: none;
    padding: 0;
}

.project-highlights li {
    padding: 0.25rem 0;
    padding-left: 1.5rem;
    position: relative;
    color: #666;
    font-size: 0.95rem;
}

.project-highlights li:before {
    content: "▸";
    position: absolute;
    left: 0;
    color: var(--primary-color);
}

.project-links {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.btn-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    color: #333;
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.btn-link:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.btn-link.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}


/* Teaching Page */
.teaching-statement {
    background: #f8f9fa;
    padding: 2rem;
    border-radius: 8px;
    margin-bottom: 3rem;
    border-left: 4px solid var(--primary-color);
}

.teaching-category {
    margin-bottom: 4rem;
}

.teaching-category h2 {
    color: #333;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Course Cards */
.course-card {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.course-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.course-title h3 {
    margin: 0 0 0.5rem 0;
    color: #2c3e50;
}

.course-role {
    display: inline-block;
    background: #007bff;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
}

.course-meta {
    text-align: right;
}

.course-meta span {
    display: block;
    color: #666;
    font-size: 0.95rem;
}

.semester {
    font-weight: 600;
    color: #444 !important;
}

.course-stats {
    display: flex;
    gap: 2rem;
    margin-top: 1rem;
}

.course-stats span {
    color: #666;
    font-size: 0.9rem;
}

/* TA Grid */
.ta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.ta-card {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    border-top: 3px solid var(--primary-color);
}

.ta-card h4 {
    margin: 0 0 0.5rem 0;
    color: #333;
}

.ta-semester {
    color: #666;
    font-size: 0.9rem;
    font-style: italic;
}

/* Mentoring Section */
.mentoring-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.stat-card {
    text-align: center;
    padding: 2rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

.stat-number {
    font-size: 3rem;
    font-weight: 700;
    color: var(--primary-color);
}

.stat-label {
    color: #666;
    margin-top: 0.5rem;
}

/* Materials Grid */
.materials-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.material-card {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.3s ease;
}

.material-card:hover {
    transform: translateY(-5px);
}

.material-card i {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.download-link {
    display: inline-block;
    margin-top: 1rem;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.download-link:hover {
    text-decoration: underline;
}
