/* Google Fonts Import */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Playfair+Display:wght@400;700&display=swap');

/* Variables */
:root {
    /* Light Mode (Default) */
    --bg-color: #f8f9fa;
    --card-bg: #ffffff;
    --text-primary: #1f2937;
    --text-secondary: #4b5563;
    --accent-color: #2563eb;
    --accent-hover: #1d4ed8;
    --border-color: #e5e7eb;
    --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);
    --transition-speed: 0.3s;
    --header-bg: rgba(255, 255, 255, 0.8);
}

[data-theme="dark"] {
    /* Dark Mode */
    --bg-color: #111827;
    --card-bg: #1f2937;
    --text-primary: #f9fafb;
    --text-secondary: #d1d5db;
    --accent-color: #60a5fa;
    --accent-hover: #3b82f6;
    --border-color: #374151;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.3);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.5), 0 2px 4px -2px rgb(0 0 0 / 0.3);
    --header-bg: rgba(31, 41, 55, 0.8);
}

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


html {
    scroll-behavior: smooth;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-color);
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
    transition: background-color var(--transition-speed), color var(--transition-speed);
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: 'Playfair Display', serif;
}


.container {
    max-width: 1024px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Header */
header {
    background-color: var(--header-bg);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 0;
    transition: background-color var(--transition-speed), border-color var(--transition-speed);
}

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

.logo h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.title-tag {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

.theme-toggle {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-primary);
    padding: 0.5rem;
    border-radius: 50%;
    transition: background-color 0.2s, color var(--transition-speed);
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-toggle:hover {
    background-color: var(--border-color);
}

.theme-toggle svg {
    width: 24px;
    height: 24px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Sections Common */
section {
    padding: 4rem 0;
    border-bottom: 1px solid var(--border-color);
}

section:last-child {
    border-bottom: none;
}

.section-title {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 2rem;
    color: var(--text-primary);
    position: relative;
    display: inline-block;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 60px;
    height: 4px;
    background-color: var(--accent-color);
    border-radius: 2px;
}

/* Hero / About */
.about-content {
    font-size: 1.125rem;
    color: var(--text-secondary);
    max-width: 800px;
}

.contact-links {
    margin-top: 2rem;
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.contact-link {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
}

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

/* Experience & Education (Timeline) */
.timeline {
    position: relative;
    padding-left: 2rem;
    border-left: 2px solid var(--border-color);
}

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

.timeline-item::before {
    content: '';
    position: absolute;
    left: -2.6rem;
    top: 0.25rem;
    width: 1rem;
    height: 1rem;
    background-color: var(--bg-color);
    border: 2px solid var(--accent-color);
    border-radius: 50%;
    transition: background-color var(--transition-speed), border-color 0.2s;
}

.timeline-year {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--accent-color);
    margin-bottom: 0.5rem;
    display: block;
}

.timeline-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.timeline-subtitle {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
}

.timeline-desc {
    color: var(--text-secondary);
}

/* Publications */
.publication-list {
    display: grid;
    gap: 1.5rem;
}

.pub-card {
    background-color: var(--card-bg);
    padding: 1.5rem;
    border-radius: 0.75rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    transition: transform 0.2s, box-shadow 0.2s, background-color var(--transition-speed), border-color var(--transition-speed);
}

.pub-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.pub-year {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    background-color: var(--bg-color);
    /* Slight contrast */
    color: var(--text-secondary);
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    border: 1px solid var(--border-color);
}

.pub-title {
    font-size: 1.125rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.pub-title a {
    color: var(--text-primary);
    text-decoration: none;
    background: linear-gradient(to right, var(--accent-color), var(--accent-color)) 0 100% / 0 2px no-repeat;
    transition: background-size 0.2s;
}

.pub-title a:hover {
    background-size: 100% 2px;
}

.pub-journal {
    font-style: italic;
    color: var(--text-secondary);
}

/* Gallery */
/* GSAP Gallery Styles */
.gallery-wrapper {
    overflow: hidden;
    width: 100%;
    position: relative;
    padding: 2rem 0;
}

.gallery-track {
    display: flex;
    flex-wrap: nowrap;
    width: fit-content;
    /* Allow it to hold all items */
    will-change: transform;
    /* Optimize for animation */
}

.gallery-item {
    width: 300px;
    /* Fixed width */
    height: 200px;
    margin-right: 1.5rem;
    /* Gap between items */
    flex-shrink: 0;

    background-color: var(--card-bg);
    border-radius: 0.75rem;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    position: relative;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    cursor: pointer;
    filter: saturate(0.8);
    transition: filter 0.3s;
}

.gallery-item:hover img {
    filter: saturate(1.2);
}

.gallery-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    padding: 0.5rem;
    font-size: 0.8rem;
    opacity: 0;
    transition: opacity 0.3s;
}

.gallery-item:hover .gallery-caption {
    opacity: 1;
}

/* Footer */
footer {
    padding: 2rem 0;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.875rem;
    border-top: 1px solid var(--border-color);
    margin-top: 2rem;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-in {
    animation: fadeIn 0.6s ease-out forwards;
}

/* Responsive */
@media (max-width: 640px) {
    .section-title {
        font-size: 1.75rem;
    }

    .timeline {
        padding-left: 1.5rem;
    }
}

/* Certificate Link */
.timeline-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.timeline-title {
    margin-bottom: 0 !important;
    /* Override default margin */
}

.certificate-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.75rem;
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 9999px;
    /* Pill shape */
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--accent-color);
    text-decoration: none;
    transition: all 0.2s;
}

.certificate-link:hover {
    background-color: var(--accent-color);
    color: #ffffff;
    border-color: var(--accent-color);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.cert-icon {
    width: 14px;
    height: 14px;
}

/* Trip/Gallery Section Styles */
.trip-section {
    margin-bottom: 3.5rem;
    border-bottom: 1px dashed var(--border-color);
    padding-bottom: 2rem;
}

.trip-section:last-child {
    margin-bottom: 0;
    border-bottom: none;
    padding-bottom: 0;
}

.trip-header {
    margin-bottom: 1.5rem;
}

.trip-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    padding-left: 1rem;
    border-left: 4px solid var(--accent-color);
}

.trip-description {
    color: var(--text-secondary);
    font-size: 1rem;
    max-width: 800px;
}

/* Re-ensure gallery grid is active if previously removed or scoped */
/* .gallery-grid { ... } removed to avoid conflict with horizontal scroll */

.gallery-item img {
    cursor: pointer;
}

/* Report Button */
.report-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background-color: var(--accent-color);
    color: #ffffff;
    border: none;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    transition: background-color 0.2s, transform 0.2s, box-shadow 0.2s;
    margin-top: 0.75rem;
}

.report-button:hover {
    background-color: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    color: #ffffff;
}