/* Modern Personal Website Styles */
:root {
    --primary-color: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary-color: #64748b;
    --accent-color: #f59e0b;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --bg-light: #f8fafc;
    --bg-white: #ffffff;
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --transition: all 0.3s ease;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-white);
    overflow-x: hidden;
}

/* Language Switcher */
.language-switcher {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1040;
    background: var(--bg-white);
    border-radius: 50px;
    padding: 4px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
}

.lang-btn {
    background: none;
    border: none;
    padding: 8px 16px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    color: var(--text-secondary);
}

.lang-btn.active {
    background: var(--primary-color);
    color: white;
}

.lang-btn:hover:not(.active) {
    background: var(--bg-light);
    color: var(--text-primary);
}

/* Navigation */
.navbar {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition);
    padding: 1rem 0;
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--primary-color) !important;
}

.navbar-nav .nav-link {
    color: var(--text-primary) !important;
    font-weight: 500;
    margin: 0 0.5rem;
    transition: var(--transition);
    position: relative;
}

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

.navbar-nav .nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: var(--transition);
    transform: translateX(-50%);
}

.navbar-nav .nav-link:hover::after {
    width: 100%;
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('../img/hero-bg.jpg') center/cover;
    opacity: 0.1;
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    background: linear-gradient(45deg, #fff, #f0f9ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    opacity: 0.9;
    font-weight: 400;
}

.hero-quote {
    font-size: 1.1rem;
    font-style: italic;
    margin-bottom: 2rem;
    opacity: 0.8;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.btn {
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition);
    border: none;
    cursor: pointer;
    display: inline-block;
}

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

.btn-primary:hover {
    background: var(--primary-dark);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-outline-primary {
    background: transparent;
    color: white;
    border: 2px solid white;
}

.btn-outline-primary:hover {
    background: white;
    color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.scroll-indicator {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
}

.scroll-indicator a {
    color: white;
    font-size: 1.5rem;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

/* Section Styles */
.section-padding {
    padding: 80px 0;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 3rem;
    text-align: center;
    color: var(--text-primary);
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: var(--primary-color);
    border-radius: 2px;
}

.section-subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 3rem;
    text-align: center;
}

.bg-light {
    background-color: var(--bg-light) !important;
}

/* About Section */
.about-content {
    margin-top: 3rem;
}

.about-card {
    background: var(--bg-white);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    transition: var(--transition);
    height: 100%;
}

.about-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.about-card h3 {
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: 1rem;
    font-size: 1.25rem;
}

.about-card p {
    color: var(--text-secondary);
    line-height: 1.7;
}

/* Skills Section */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.skill-card {
    background: var(--bg-white);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    transition: var(--transition);
    text-align: center;
}

.skill-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.skill-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    color: white;
    font-size: 2rem;
}

.skill-card h3 {
    color: var(--text-primary);
    font-weight: 600;
    margin-bottom: 1rem;
}

.skill-card ul {
    list-style: none;
    padding: 0;
}

.skill-card li {
    padding: 0.5rem 0;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
}

.skill-card li:last-child {
    border-bottom: none;
}

/* Timeline */
.timeline {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--primary-color);
    transform: translateX(-50%);
}

.timeline-item {
    margin-bottom: 3rem;
    position: relative;
}

.timeline-content {
    background: var(--bg-white);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    position: relative;
    width: calc(50% - 30px);
    transition: var(--transition);
}

.timeline-item:nth-child(odd) .timeline-content {
    margin-left: 0;
    margin-right: auto;
}

.timeline-item:nth-child(even) .timeline-content {
    margin-left: auto;
    margin-right: 0;
}

.timeline-content::before {
    content: '';
    position: absolute;
    top: 50%;
    width: 20px;
    height: 20px;
    background: var(--primary-color);
    border-radius: 50%;
    transform: translateY(-50%);
}

.timeline-item:nth-child(odd) .timeline-content::before {
    right: -40px;
}

.timeline-item:nth-child(even) .timeline-content::before {
    left: -40px;
}

.timeline-content:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.timeline-content h3 {
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: 1rem;
}

.timeline-content p {
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 1rem;
}

.experience-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 8px 0 12px 0;
    flex-wrap: wrap;
    gap: 10px;
}

.company-name {
    color: var(--primary-color);
    font-weight: 600;
    font-size: 1.1rem;
}

.work-period {
    color: var(--accent-color);
    font-weight: 500;
    font-size: 0.9rem;
    background: rgba(245, 158, 11, 0.1);
    padding: 4px 12px;
    border-radius: 20px;
}

/* Portfolio Section */
.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 3rem;
}

.portfolio-item {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.portfolio-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.portfolio-img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    transition: var(--transition);
}

.portfolio-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    color: white;
    padding: 1.5rem;
    transform: translateY(100%);
    transition: var(--transition);
}

.portfolio-item:hover .portfolio-overlay {
    transform: translateY(0);
}

.portfolio-item:hover .portfolio-img {
    transform: scale(1.1);
}

.portfolio-overlay h4 {
    font-weight: 600;
    margin: 0;
}

/* Contact Section */
.contact-info {
    margin-bottom: 3rem;
}

.contact-card {
    background: var(--bg-white);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    text-align: center;
    transition: var(--transition);
    height: 100%;
}

.contact-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

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

.contact-card h4 {
    color: var(--text-primary);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.contact-card p {
    color: var(--text-secondary);
    margin: 0;
}

/* Social Links */
.social-links {
    margin-top: 3rem;
}

.social-links h3 {
    color: var(--text-primary);
    font-weight: 600;
    margin-bottom: 2rem;
    text-align: center;
}

.social-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    max-width: 800px;
    margin: 0 auto;
    justify-items: center;
}

/* Center the last item (YouTube) across all 3 columns */
.social-grid .social-link:nth-child(7) {
    grid-column: 2 / 3;
    margin-top: 0.5rem;
}

.social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1.25rem 1rem;
    background: var(--bg-white);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 16px;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
    white-space: nowrap;
    width: 240px;
    height: 60px;
}

.social-link i {
    font-size: 24px;
}

.social-link:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    color: var(--primary-color);
}

.social-link.linkedin:hover {
    background: #0077b5;
    color: white;
    border-color: #0077b5;
}

.social-link.bilibili:hover {
    background: #00a1d6;
    color: white;
    border-color: #00a1d6;
}

.social-link.qidian:hover {
    background: #ff6b35;
    color: white;
    border-color: #ff6b35;
}

.social-link.youtube:hover {
    background: #ff0000;
    color: white;
    border-color: #ff0000;
}

.social-link.goodreads:hover {
    background: #372213;
    color: white;
    border-color: #372213;
}

.social-link.douban:hover {
    background: #007722;
    color: white;
    border-color: #007722;
}

.social-link.ai-product {
    justify-content: center;
    align-items: center;
    text-align: center;
    display: flex;
    flex-wrap: nowrap;
}

.social-link.ai-product:hover {
    background: #6366f1;
    color: white;
    border-color: #6366f1;
}

.product-name {
    font-weight: 800;
    color: #f59e0b;
    font-family: 'Georgia', 'Times New Roman', serif;
    font-size: 1.1em;
    font-style: italic;
    text-shadow: 0 2px 4px rgba(245, 158, 11, 0.3);
    background: linear-gradient(135deg, #f59e0b, #d97706);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 0.2px;
    transition: all 0.3s ease;
    display: inline;
    white-space: nowrap;
}

.social-link.ai-product:hover .product-name {
    color: #fbbf24;
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 2px 6px rgba(255, 255, 255, 0.4);
    transform: scale(1.05);
    transition: all 0.3s ease;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(5px);
}

.modal-content {
    position: relative;
    margin: 5% auto;
    padding: 20px;
    width: 90%;
    max-width: 800px;
    text-align: center;
    background: var(--bg-white);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
}

.close {
    position: absolute;
    top: 15px;
    right: 25px;
    color: var(--text-primary);
    font-size: 35px;
    font-weight: bold;
    cursor: pointer;
    z-index: 2001;
}

.close:hover,
.close:focus {
    color: var(--primary-color);
}

#modalImage {
    width: 100%;
    max-height: 70vh;
    object-fit: contain;
    border-radius: 8px;
    margin-bottom: 15px;
}

#modalTitle {
    color: var(--text-primary);
    font-weight: 600;
    margin: 0;
}

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

.footer p {
    margin: 0;
    opacity: 0.8;
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2.5rem;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .timeline::before {
        left: 20px;
    }
    
    .timeline-content {
        width: calc(100% - 50px);
        margin-left: 50px !important;
    }
    
    .timeline-content::before {
        left: -35px !important;
    }
    
    .hero-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .social-grid {
        grid-template-columns: 1fr;
        max-width: 350px;
        gap: 1rem;
    }
    
    .social-grid .social-link:nth-child(7) {
        grid-column: 1;
        margin-top: 0;
    }
    
    .social-link {
        width: 100%;
        max-width: 350px;
    }
    
    .social-link.ai-product {
        width: 100%;
        max-width: 350px;
        justify-content: center;
    }
    
    .language-switcher {
        top: 10px;
        right: 10px;
    }
}

@media (max-width: 576px) {
    .section-padding {
        padding: 60px 0;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .about-card,
    .skill-card,
    .contact-card {
        padding: 1.5rem;
    }
    
    .portfolio-grid {
        grid-template-columns: 1fr;
    }
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Animation classes */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease;
}

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

/* Loading animation */
.loading {
    opacity: 0;
    animation: fadeIn 0.5s ease-in forwards;
}

@keyframes fadeIn {
    to {
        opacity: 1;
    }
}
