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

html {
    scroll-behavior: smooth;
    overflow-x: hidden; /* Prevent horizontal scrolling */
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #fff;
    overflow-x: hidden; /* Prevent horizontal scrolling */
}

/* Container and Layout */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%; /* Ensure container doesn't exceed viewport */
}

.section {
    padding: 80px 0;
}

.section-alt {
    background-color: #f8f9fa;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 600;
    text-align: center;
    margin-bottom: 60px;
    color: #2c3e50;
}

/* Header and Navigation */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid #e9ecef;
    z-index: 1000;
}

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

.nav-brand {
    font-size: 1.5rem;
    font-weight: 700;
    text-decoration: none;
    color: #2c3e50;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 30px;
}

.nav-link {
    text-decoration: none;
    color: #333;
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav-link:hover {
    color: #3498db;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
}

.nav-toggle span {
    width: 25px;
    height: 3px;
    background: #333;
    margin: 3px 0;
    transition: 0.3s;
}

/* Hero Section */
.hero {
    padding: 120px 0 80px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-align: center;
}

.hero-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.hero-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
}

.hero-avatar {
    position: relative;
}

.avatar {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    border: 5px solid rgba(255, 255, 255, 0.2);
    object-fit: cover;
}

.hero-title {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.hero-subtitle {
    font-size: 1.5rem;
    font-weight: 400;
    opacity: 0.9;
    margin-bottom: 20px;
}

.hero-description {
    font-size: 1.2rem;
    max-width: 600px;
    opacity: 0.9;
    margin-bottom: 30px;
}

.hero-social {
    display: flex;
    gap: 20px;
    justify-content: center;
}

.social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    color: white;
    text-decoration: none;
    transition: all 0.3s ease;
}

.social-link:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.social-icon {
    font-size: 1.5rem;
}

/* About Section */
.about-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 60px;
    align-items: start;
}

.about-text {
    font-size: 1.1rem;
    line-height: 1.8;
}

.about-text p {
    margin-bottom: 20px;
}

.about-sidebar h3 {
    font-size: 1.3rem;
    color: #2c3e50;
    margin-bottom: 15px;
    border-bottom: 2px solid #3498db;
    padding-bottom: 5px;
}

.interests, .education {
    margin-bottom: 40px;
}

.interests ul, .education ul {
    list-style: none;
}

.interests li, .education li {
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}

.interests li:before {
    content: "▸";
    color: #3498db;
    margin-right: 10px;
}

/* Timeline (Experience) */
.timeline {
    position: relative;
    max-width: 1000px;
    margin: 0 auto;
}

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

.timeline-item {
    position: relative;
    margin-bottom: 50px;
}

.timeline-item:nth-child(odd) .timeline-content {
    margin-right: calc(50% + 20px);
    padding-right: 40px;
}

.timeline-item:nth-child(even) .timeline-content {
    margin-left: calc(50% + 20px);
    padding-left: 40px;
}

.timeline-content {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    position: relative;
}

.job-header {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 15px;
}

.company-logo {
    flex-shrink: 0;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    border-radius: 10px;
    padding: 10px;
}

.company-logo .logo {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.job-info {
    flex: 1;
}

.timeline-item:nth-child(odd) .timeline-content:after {
    content: '';
    position: absolute;
    right: -10px;
    top: 30px;
    width: 0;
    height: 0;
    border-left: 10px solid white;
    border-top: 10px solid transparent;
    border-bottom: 10px solid transparent;
}

.timeline-item:nth-child(even) .timeline-content:after {
    content: '';
    position: absolute;
    left: -10px;
    top: 30px;
    width: 0;
    height: 0;
    border-right: 10px solid white;
    border-top: 10px solid transparent;
    border-bottom: 10px solid transparent;
}

.timeline-item:before {
    content: '';
    position: absolute;
    left: 50%;
    top: 30px;
    width: 15px;
    height: 15px;
    background: #3498db;
    border-radius: 50%;
    transform: translateX(-50%);
    z-index: 2;
}

.job-title {
    font-size: 1.4rem;
    color: #2c3e50;
    margin-bottom: 10px;
}

.company {
    font-size: 1.2rem;
    color: #3498db;
    margin-bottom: 10px;
}

.company a {
    color: inherit;
    text-decoration: none;
}

.job-meta {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
    font-size: 0.9rem;
    color: #666;
}

.job-description {
    list-style: none;
}

.job-description li {
    margin-bottom: 8px;
    padding-left: 15px;
    position: relative;
}

.job-description li:before {
    content: "•";
    color: #3498db;
    position: absolute;
    left: 0;
}

/* Projects Grid */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
}

.project-card {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

.project-image {
    height: 200px;
    overflow: hidden;
}

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

.project-content {
    padding: 25px;
}

.project-title {
    font-size: 1.3rem;
    margin-bottom: 15px;
}

.project-title a {
    color: #2c3e50;
    text-decoration: none;
}

.project-summary {
    color: #666;
    margin-bottom: 15px;
    line-height: 1.6;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag {
    background: #e3f2fd;
    color: #1976d2;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
}

/* Publications */
.publications {
    max-width: 800px;
    margin: 0 auto;
}

.publication-item {
    background: white;
    padding: 30px;
    margin-bottom: 30px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
}

.publication-title {
    font-size: 1.3rem;
    margin-bottom: 15px;
}

.publication-title a {
    color: #2c3e50;
    text-decoration: none;
}

.publication-meta {
    color: #666;
    margin-bottom: 15px;
    font-size: 0.9rem;
}

.publication-meta span {
    margin-right: 15px;
}

.publication-summary {
    margin-bottom: 15px;
    line-height: 1.6;
}

.publication-links {
    display: flex;
    gap: 15px;
}

.publication-link {
    color: #3498db;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
}

/* Contact Form */
.contact-content {
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
}

.contact-form {
    background: white;
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    margin-top: 40px;
}

.form-group {
    margin-bottom: 25px;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #2c3e50;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #3498db;
}

.submit-btn {
    background: #3498db;
    color: white;
    padding: 15px 40px;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.3s ease;
}

.submit-btn:hover {
    background: #2980b9;
}

/* Single Page Styles */
.single-page {
    padding: 120px 0 80px;
}

.single-content {
    max-width: 800px;
    margin: 0 auto;
}

.single-header {
    text-align: center;
    margin-bottom: 40px;
}

.single-title {
    font-size: 2.5rem;
    color: #2c3e50;
    margin-bottom: 15px;
}

.single-subtitle {
    font-size: 1.2rem;
    color: #666;
    margin-bottom: 20px;
}

.single-meta {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.single-date {
    color: #666;
    font-size: 0.9rem;
}

.single-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.single-image {
    margin: 40px 0;
    text-align: center;
}

.single-image img {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.single-body {
    font-size: 1.1rem;
    line-height: 1.8;
    margin-bottom: 40px;
}

.single-body h1,
.single-body h2,
.single-body h3,
.single-body h4,
.single-body h5,
.single-body h6 {
    color: #2c3e50;
    margin: 30px 0 15px;
}

.single-body p {
    margin-bottom: 20px;
}

.single-body ul,
.single-body ol {
    margin-bottom: 20px;
    padding-left: 30px;
}

.single-body li {
    margin-bottom: 8px;
}

.single-body blockquote {
    border-left: 4px solid #3498db;
    padding-left: 20px;
    margin: 30px 0;
    font-style: italic;
    color: #666;
}

.single-body code {
    background: #f8f9fa;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
}

.single-body pre {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 20px 0;
}

.single-links {
    background: #f8f9fa;
    padding: 30px;
    border-radius: 10px;
    margin-bottom: 40px;
}

.single-links h3 {
    color: #2c3e50;
    margin-bottom: 20px;
}

.links-grid {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.link-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: #3498db;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    transition: background 0.3s ease;
}

.link-button:hover {
    background: #2980b9;
}

.link-icon {
    font-size: 1rem;
}

.single-nav {
    text-align: center;
    margin-top: 40px;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #3498db;
    text-decoration: none;
    font-weight: 500;
    padding: 12px 20px;
    border: 2px solid #3498db;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.back-link:hover {
    background: #3498db;
    color: white;
}

/* Footer */
.footer {
    background: #2c3e50;
    color: white;
    padding: 40px 0;
    text-align: center;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.footer a {
    color: #3498db;
    text-decoration: none;
}

/* Callout Styles */
.callout {
    padding: 20px;
    margin: 20px 0;
    border-left: 4px solid;
    border-radius: 0 8px 8px 0;
}

.callout-note {
    background: #f8f9fa;
    border-color: #3498db;
    color: #2c3e50;
}

.callout-warning {
    background: #fff3cd;
    border-color: #ffc107;
    color: #856404;
}

.callout-danger {
    background: #f8d7da;
    border-color: #dc3545;
    color: #721c24;
}

.callout-success {
    background: #d4edda;
    border-color: #28a745;
    color: #155724;
}

/* Video Styles */
.video-container {
    margin: 30px 0;
    text-align: center;
}

.video-container video {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Gallery Styles */
.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin: 30px 0;
}

.gallery img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.gallery img:hover {
    transform: scale(1.05);
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(10px);
        border-top: 1px solid #e9ecef;
        flex-direction: column;
        padding: 20px;
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    }
    
    .nav-menu.active {
        display: flex;
    }
    
    .nav-menu li {
        margin: 10px 0;
    }
    
    .nav-toggle {
        display: flex;
    }
    
    .nav-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }
    
    .nav-toggle.active span:nth-child(2) {
        opacity: 0;
    }
    
    .nav-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -6px);
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1.2rem;
    }
    
    .section {
        padding: 60px 0;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .about-content {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    
    .timeline:before {
        left: 20px;
    }
    
    .timeline-item:nth-child(odd) .timeline-content,
    .timeline-item:nth-child(even) .timeline-content {
        margin-left: 50px;
        margin-right: 0;
        padding-left: 20px;
        padding-right: 20px;
    }
    
    .timeline-item:nth-child(odd) .timeline-content:after,
    .timeline-item:nth-child(even) .timeline-content:after {
        left: -10px;
        right: auto;
        border-right: 10px solid white;
        border-left: none;
    }
    
    .timeline-item:before {
        left: 20px;
        transform: translateX(-50%);
    }
    
    .projects-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .job-meta {
        flex-direction: column;
        gap: 5px;
    }
    
    .job-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .company-logo {
        align-self: center;
    }
    
    .avatar {
        width: 150px;
        height: 150px;
    }
    
    /* Fix any potential horizontal scroll issues */
    .hero-social {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .timeline-content {
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    
    .job-description li {
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }
    
    .hero {
        padding: 100px 0 60px;
    }
    
    .hero-description {
        font-size: 1rem;
    }
    
    .timeline-content {
        padding: 20px;
    }
    
    .contact-form {
        padding: 30px 20px;
    }
}