:root {
    /* Color Palette based on image */
    --bg-color: #ffffff;
    --text-primary: #1a1a1a;
    --text-secondary: #666666;
    --accent-color: #007bff; /* A standard blue for links */
    --tag-bg: #eef2ff; /* Light purple/blue for tags */
    --tag-text: #4f46e5;
    --border-color: #eaeaea;
    --card-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: #f9fafb; /* Very light gray background for page */
    color: var(--text-primary);
    line-height: 1.6;
}

/* Layout Structure */
.main-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 60px;
}

/* Responsive breakpoint for desktop view */
@media (min-width: 900px) {
    .main-container {
        grid-template-columns: 300px 1fr; /* Fixed sidebar, flexible content */
        align-items: start; /* Keep sidebar at top */
    }
}

/* General Typography */
h1 { font-size: 2rem; font-weight: 700; margin-bottom: 0.5rem; }
h2 { font-size: 1.25rem; font-weight: 600; margin-bottom: 0.5rem; color: var(--text-primary); }
h3 { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 1px; color: var(--text-secondary); margin-bottom: 1rem; font-weight: 600; }
p { color: var(--text-secondary); font-size: 0.95rem; margin-bottom: 1rem; }
.meta-text { font-size: 0.9rem; color: var(--text-secondary); }
.section-title { font-size: 1.5rem; margin-bottom: 25px; border-bottom: none; }
.loading { color: var(--text-secondary); font-style: italic; }

/* ---- SIDEBAR STYLES ---- */
.profile-header {
    margin-bottom: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

#profile-image {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 20px;
    border: 3px solid white;
    box-shadow: var(--card-shadow);
}

.social-icons {
    margin-top: 20px;
    display: flex;
    gap: 15px;
}

.social-icons a {
    color: var(--text-secondary);
    font-size: 1.4rem;
    text-decoration: none;
    transition: color 0.2s;
}

.social-icons a:hover { color: var(--text-primary); }

.sidebar-section { margin-bottom: 40px; }

/* Skill Tags */
.tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag {
    background-color: var(--tag-bg);
    color: var(--tag-text);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

/* ---- MAIN CONTENT AREA STYLES ---- */

/* Project Grid */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 30px;
    margin-bottom: 60px;
}

.project-card {
    background: var(--bg-color);
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    transition: transform 0.2s, box-shadow 0.2s;
}

.project-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--card-shadow);
}

.project-thumb {
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.project-content { padding: 24px; }
.project-content h3 { margin-bottom: 15px; color: var(--text-primary); text-transform: none; font-size: 1.1rem;}
.project-tags { margin-bottom: 15px; }
.read-more { color: var(--accent-color); text-decoration: none; font-weight: 500; font-size: 0.95rem;}
.read-more:hover { text-decoration: underline; }
.read-more i { font-size: 0.8rem; margin-left: 4px;}


/* CV Section Styles */
.main-page-subsequent-container {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid var(--border-color);
}

.cv-block {
    background: var(--bg-color);
    padding: 30px;
    border-radius: 16px;
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background-color: var(--text-primary);
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: background-color 0.2s;
}

.btn-primary:hover { background-color: #333; }

/* ---- RESOURCE CARD STYLES ---- */
.resource-card {
    background: var(--bg-color);
    border-radius: 16px;
    border: 1px solid var(--border-color);
    padding: 30px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.2s, box-shadow 0.2s;
    height: 100%;
}

.resource-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--card-shadow);
}

.resource-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.resource-icon-box {
    width: 50px;
    height: 50px;
    background-color: var(--tag-bg);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--tag-text);
    font-size: 1.4rem;
}

.resource-card h3 {
    margin-bottom: 0;
    color: var(--text-primary);
    font-size: 1.1rem;
}

.resource-card p {
    flex-grow: 1; /* Pushes the button to the bottom */
    margin-bottom: 20px;
}

.resource-link {
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: color 0.2s;
}

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

/* ---- PROJECT PAPERS STYLES ---- */
.project-papers {
    margin-top: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.paper-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background-color: #f3f4f6; /* Light gray background */
    color: var(--text-secondary);
    padding: 6px 12px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.paper-link:hover {
    background-color: white;
    border-color: var(--accent-color);
    color: var(--accent-color);
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.paper-link i {
    font-size: 0.9rem;
}

/* ---- LIGHTBOX (IMAGE ZOOM) STYLES ---- */
.lightbox {
    display: none; /* Hidden by default */
    position: fixed;
    z-index: 1000;
    padding-top: 50px;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.9); /* Black w/ opacity */
}

/* Replace your existing .lightbox-content rule with this: */
.lightbox-content {
    margin: auto;
    display: block;
    width: 80%;
    max-width: 1000px;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.1);

    /* Updated for Zoom Support */
    cursor: grab;
    transition: transform 0.1s ease-out; /* Smooths the zoom slightly */
    transform-origin: center center;
}

.lightbox-content:active {
    cursor: grabbing;
}


/* Close Button */
.close-lightbox {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
}

.close-lightbox:hover,
.close-lightbox:focus {
    color: #bbb;
    text-decoration: none;
    cursor: pointer;
}

/* Caption Text */
#caption {
    margin: auto;
    display: block;
    width: 80%;
    max-width: 700px;
    text-align: center;
    color: #ccc;
    padding: 10px 0;
    height: 150px;
}

/* Make the project card images look clickable */
.project-thumb {
    cursor: pointer;
    transition: transform 0.2s, opacity 0.2s;
}

.project-thumb:hover {
    opacity: 0.9;
}

/* Responsive Lightbox */
@media only screen and (max-width: 700px) {
    .lightbox-content {
        width: 100%;
    }
}