/* --- Global Styles & Variables --- */
:root {
    --primary-color: #000000;
    --secondary-color: #ffffff;
    --accent-blue: #2563eb;
    --text-dark: #111827;
    --text-gray: #4b5563;
    --bg-color: #fafafa;
    --border-color: #e2e8f0;
    --card-bg: #ffffff;
    --font-main: 'Poppins', sans-serif;
}

/* Dark Mode Variable Overrides */
body.dark-mode {
    --primary-color: #ffffff;
    --secondary-color: #0f172a;
    --text-dark: #f8fafc;
    --text-gray: #94a3b8;
    --bg-color: #0f172a;
    --border-color: #334155;
    --card-bg: #1e293b;
}

/* Smooth Scrolling & Offset for Sticky Nav */
html { 
    scroll-behavior: smooth; 
    scroll-padding-top: 100px; 
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: var(--font-main); background-color: var(--bg-color); color: var(--text-dark); line-height: 1.6; transition: background-color 0.3s ease, color 0.3s ease; padding-top: 90px;}
a { text-decoration: none; color: inherit; }

/* --- Sticky Navigation Bar --- */
.navbar { position: fixed; top: 0; left: 0; width: 100%; display: flex; justify-content: space-between; align-items: center; padding: 1.5rem 5%; background-color: var(--bg-color); z-index: 1000; transition: background-color 0.3s ease; box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05); }
.logo { font-size: 1.8rem; font-weight: 700; letter-spacing: -1px; }
.nav-links { display: flex; list-style: none; gap: 2rem; }
.nav-links a { font-size: 0.95rem; font-weight: 500; color: var(--text-gray); transition: color 0.3s ease; cursor: pointer;}
.nav-links a:hover, .nav-links a.active { color: var(--text-dark); font-weight: 600; }
.nav-icons { display: flex; align-items: center; gap: 1.5rem; }
.theme-toggle, .menu-toggle { cursor: pointer; color: var(--text-dark); display: flex; align-items: center; justify-content: center; }
.menu-toggle { display: none; }

/* --- Unified Section Headings --- */
.section-title { font-size: 4rem; font-weight: 800; color: var(--text-dark); letter-spacing: -2px; margin-bottom: 2rem; line-height: 1.1; }

/* --- Hero Section --- */
.hero-section { display: flex; align-items: center; justify-content: space-between; padding: 4rem 5%; max-width: 1200px; margin: 0 auto; min-height: 70vh; }
.hero-content { flex: 1; max-width: 550px; }
.subtitle { color: var(--accent-blue); font-size: 0.85rem; font-weight: 600; letter-spacing: 2px; text-transform: uppercase; display: block; margin-bottom: 1rem; }
.hero-content h1 { font-size: 4.5rem; font-weight: 700; line-height: 1.1; margin-bottom: 1.5rem; letter-spacing: -2px; }
.hero-content p { font-size: 1.1rem; color: var(--text-gray); margin-bottom: 2.5rem; max-width: 90%; }
.hero-image-container { flex: 1; display: flex; justify-content: flex-end; }
.profile-img { width: 450px; height: 450px; border-radius: 50%; object-fit: cover; box-shadow: 0 20px 50px rgba(0, 0, 0, 0.08); border: 10px solid var(--secondary-color); }

/* --- About Section --- */
.about-section { padding: 5rem 5%; max-width: 1200px; margin: 0 auto; }
.about-container { display: flex; justify-content: center; }
.about-content { text-align: center; max-width: 800px; display: flex; flex-direction: column; align-items: center; }
.about-heading-new { font-size: 2.5rem; font-weight: 700; color: var(--text-dark); margin-bottom: 1.5rem; line-height: 1.3; letter-spacing: -0.5px; }
.about-content p { color: var(--text-gray); font-size: 1.05rem; margin-bottom: 1.5rem; line-height: 1.7; }
.btn-download-cv { display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.8rem 1.8rem; margin-top: 1rem; border: 2px solid #9b51e0; color: #9b51e0; border-radius: 6px; font-weight: 600; font-size: 0.95rem; transition: all 0.3s ease; }
.btn-download-cv:hover { background-color: #9b51e0; color: #ffffff; }

/* --- Experience Section --- */
.experience-section { padding: 5rem 5%; max-width: 1000px; margin: 0 auto; }
.experience-section .section-title { margin-bottom: 4rem; }
.experience-list-container { display: flex; flex-direction: column; gap: 2.5rem; }
.exp-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 2rem; border-bottom: 1px solid var(--border-color); padding-bottom: 2rem; }
.exp-row:last-child { border-bottom: none; }
.exp-left { flex: 1; }
.exp-title { position: relative; padding-left: 18px; font-size: 1.15rem; font-weight: 700; color: var(--text-dark); margin-bottom: 0.8rem; line-height: 1.4; }
.exp-title::before { content: ''; position: absolute; left: 0; top: 6px; width: 6px; height: 6px; background-color: var(--text-gray); }
.exp-desc { padding-left: 35px; }
.exp-desc li { color: var(--text-gray); font-size: 1rem; line-height: 1.6; }
.exp-right { display: flex; flex-direction: column; align-items: flex-end; gap: 0.5rem; min-width: 180px; text-align: right; }
.exp-date { font-size: 1rem; color: var(--text-gray); font-weight: 500; }
.btn-details { background: transparent; display: inline-block; padding: 0.2rem 0.8rem; font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; color: #9b51e0; border: 1px solid #9b51e0; border-radius: 4px; transition: all 0.3s ease; cursor: pointer; font-family: var(--font-main); }
.btn-details:hover { background-color: #9b51e0; color: #ffffff; }

/* --- Projects Section --- */
.projects-section { padding: 5rem 5%; max-width: 1200px; margin: 0 auto; }
.projects-header { text-align: center; margin-bottom: 4rem; }
.projects-header p { color: var(--text-gray); max-width: 600px; margin: 0 auto; font-size: 1rem; }
.projects-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; }
.project-card { background: var(--card-bg); border-radius: 8px; overflow: hidden; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06); transition: transform 0.3s ease, box-shadow 0.3s ease; display: flex; flex-direction: column; }
.project-card:hover { transform: translateY(-5px); box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1); }
.project-img { width: 100%; height: 220px; object-fit: cover; display: block; }
.project-content { padding: 1.8rem; display: flex; flex-direction: column; flex: 1; }
.project-title { font-size: 1.2rem; font-weight: 600; color: var(--text-dark); margin-bottom: 0.8rem; line-height: 1.3; }
.project-desc { font-size: 0.9rem; color: var(--text-gray); margin-bottom: 1.5rem; line-height: 1.6; flex: 1; }
.btn-case-study { background: transparent; display: inline-flex; align-items: center; justify-content: center; padding: 0.5rem 1rem; border: 1px solid #9b51e0; color: #9b51e0; border-radius: 4px; font-weight: 600; font-size: 0.85rem; transition: all 0.3s ease; width: max-content; cursor: pointer; font-family: var(--font-main); }
.btn-case-study:hover { background-color: #9b51e0; color: #ffffff; }

/* --- Extracurriculum Section --- */
.extracurriculum-section { padding: 0 5% 5rem 5%; max-width: 1200px; margin: 0 auto; }
.extracurriculum-section .section-title { text-align: center; margin-bottom: 5rem; }
.extra-container { display: flex; justify-content: center; gap: 4rem; margin-top: 0; flex-wrap: wrap; }
.extra-card { border: none; font-family: var(--font-main); background: var(--card-bg); border-radius: 20px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06); transition: transform 0.3s ease, box-shadow 0.3s ease; width: 300px; height: 200px; display: flex; align-items: center; justify-content: center; color: var(--text-dark); cursor: pointer; }
.extra-card:hover { transform: translateY(-5px); box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1); }
.extra-card h3 { font-size: 1.8rem; font-weight: 500; }

/* --- Contact Section --- */
.contact-section { padding: 5rem 5%; max-width: 1000px; margin: 0 auto 5rem auto; }
.contact-container { display: flex; align-items: center; gap: 5rem; }
.contact-image-wrapper { flex: 1; display: flex; justify-content: center; }
.contact-image { width: 100%; max-width: 500px; height: auto; object-fit: contain; }
.contact-content { flex: 1; }
.contact-heading { font-size: 3.5rem; font-weight: 700; color: var(--text-dark); margin-bottom: 0.5rem; letter-spacing: -1.5px; }
.contact-subtext { font-size: 1.1rem; color: var(--text-gray); margin-bottom: 2.5rem; line-height: 1.6; }
.social-links { list-style: none; display: flex; flex-direction: column; gap: 1.2rem; }
.social-links li { display: flex; align-items: center; gap: 1rem; }
.social-icon { width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }

/* UPDATED: Contact Social Colors (Gmail, Phone, Location, LinkedIn) */
.gm { background-color: #ea4335; } .ph { background-color: #34a853; } .loc { background-color: #fbbc05; } .li { background-color: #0a66c2; }
.text-gm { color: #ea4335; } .text-ph { color: #34a853; } .text-loc { color: #fbbc05; } .text-li { color: #0a66c2; }

/* UPDATED: Applied the identical styling logic to both anchor and span tags */
.social-links a, .social-links span { font-size: 0.95rem; font-weight: 500; color: var(--text-dark); transition: opacity 0.3s ease; }
.social-links a:hover { opacity: 0.7; }

/* ==================================================== */
/* --- DETAILS PAGES VIEWS --- */
/* ==================================================== */

.detail-page-wrapper { padding: 2rem 5% 5rem 5%; max-width: 1100px; margin: 0 auto; min-height: 100vh; animation: fadeIn 0.4s ease forwards; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

.btn-back { background: none; border: none; font-size: 1.05rem; font-weight: 600; cursor: pointer; color: var(--accent-blue); margin-bottom: 3rem; display: inline-flex; align-items: center; gap: 0.5rem; font-family: var(--font-main); }
.btn-back:hover { text-decoration: underline; }

.detail-header { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 2.5rem; padding-bottom: 1rem; gap: 2rem; }
.detail-title { font-size: 2.2rem; font-weight: 700; color: var(--text-dark); line-height: 1.3; }
.detail-date { font-size: 1.1rem; font-weight: 500; color: var(--text-gray); white-space: nowrap; }

.detail-content p { color: var(--text-gray); font-size: 1.1rem; line-height: 1.7; margin-bottom: 2.5rem; }

/* Experience Specific */
.detail-roles-section h4 { font-size: 1.1rem; color: var(--text-dark); margin-bottom: 1rem; font-weight: 600; }
.detail-roles { padding-left: 1.5rem; margin-bottom: 0; }
.detail-roles li { color: var(--text-gray); font-size: 1.05rem; margin-bottom: 0.5rem; line-height: 1.6; }

.detail-images { display: grid; grid-template-columns: repeat(2, 1fr); gap: 3rem; margin-top: 4rem; margin-bottom: 4rem; max-width: 850px; margin-left: auto; margin-right: auto; }
.detail-images img { width: 100%; height: 260px; object-fit: cover; border-radius: 8px; }

/* Project Specific Media Grid (Default 3 columns) */
.project-media-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4rem 3rem; margin-bottom: 4rem; }
.media-item-container { display: flex; flex-direction: column; align-items: center; gap: 1rem; }
.media-item-container img, .media-item-container video { width: 100%; height: 250px; object-fit: cover; border-radius: 8px; background-color: var(--card-bg); }
.media-caption { font-size: 1.05rem; color: var(--text-dark); font-weight: 500; text-align: center; }

/* 2-Column Modifier for Specific Project Grids (Like Vensim) */
.project-media-grid.grid-2x2 {
    grid-template-columns: repeat(2, 1fr);
    max-width: 1000px;
    margin-left: auto;
    margin-right: auto;
}
.project-media-grid.grid-2x2 .media-item-container img, 
.project-media-grid.grid-2x2 .media-item-container video {
    height: 350px;
}

/* Extracurriculum 3-Column Grid */
.extra-media-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3rem; margin-top: 2rem; margin-bottom: 4rem; max-width: 950px; margin-left: auto; margin-right: auto;}
.extra-media-item { display: flex; flex-direction: column; align-items: center; gap: 1.5rem; background: transparent; border: none; cursor: pointer; transition: transform 0.3s ease; font-family: var(--font-main); }
.extra-media-item:hover { transform: translateY(-5px); }
.extra-media-item img { width: 100%; height: 180px; object-fit: cover; border-radius: 8px; background-color: var(--card-bg); box-shadow: 0 5px 15px rgba(0,0,0,0.05); }
.extra-media-caption { font-size: 1.2rem; color: var(--text-dark); text-align: center; font-weight: 500; }

/* Extracurriculum 2-Column Grid (Centered for menus with only 2 items) */
.extra-media-grid.grid-2-col {
    grid-template-columns: repeat(2, 1fr);
    max-width: 650px;
}

/* Default 2-Column Layout for Deep Leaf Menus */
#sub-extra-media-grid { max-width: 750px; margin-left: auto; margin-right: auto; gap: 2.5rem; grid-template-columns: repeat(2, 1fr); }
#sub-extra-media-grid .media-item-container img, #sub-extra-media-grid .media-item-container video { height: 220px; }

/* 3-Column Layout Modifier */
#sub-extra-media-grid.grid-3-col {
    grid-template-columns: repeat(3, 1fr);
    max-width: 950px;
    gap: 2rem;
}
#sub-extra-media-grid.grid-3-col .media-item-container img {
    height: 180px; 
}

/* 4-Column Layout Modifier */
#sub-extra-media-grid.grid-4-col {
    grid-template-columns: repeat(4, 1fr);
    max-width: 1100px;
    gap: 1.5rem;
}
#sub-extra-media-grid.grid-4-col .media-item-container img {
    height: 160px; /* Keep it compact so 4 fit nicely across */
}

/* 1-Column Layout Modifier for single large images (like QUBES) */
#sub-extra-media-grid.grid-1-col {
    grid-template-columns: 1fr;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}
#sub-extra-media-grid.grid-1-col .media-item-container img {
    height: auto;
    max-height: 500px;
    object-fit: cover; 
}


/* --- Responsive Adjustments --- */
@media (max-width: 968px) {
    .menu-toggle { display: flex; }
    
    .nav-links { position: absolute; top: 100%; left: 0; width: 100%; background-color: var(--bg-color); flex-direction: column; align-items: center; gap: 1.5rem; padding: 2rem 0; box-shadow: 0 10px 10px rgba(0,0,0,0.05); opacity: 0; visibility: hidden; transform: translateY(-20px); transition: all 0.3s ease; z-index: 999; }
    .nav-links.active { opacity: 1; visibility: visible; transform: translateY(0); }
    .hero-section { flex-direction: column-reverse; text-align: center; gap: 3rem; }
    .hero-content { max-width: 100%; }
    .hero-content p { margin: 0 auto 2.5rem auto; }
    .hero-image-container { justify-content: center; }
    .profile-img { width: 350px; height: 350px; }
    
    .section-title { font-size: 3rem; }
    .about-heading-new { font-size: 2.2rem; }
    .contact-container { flex-direction: column; }
    .contact-heading, .contact-subtext { text-align: center; }
    .social-links { align-items: center; }
    .exp-row { flex-direction: column; gap: 1rem; }
    .exp-right { align-items: flex-start; text-align: left; padding-left: 35px; }
    .detail-header { flex-direction: column; align-items: flex-start; gap: 0.5rem; }
    .detail-title { font-size: 1.8rem; }
    .project-media-grid { grid-template-columns: repeat(2, 1fr); }
    
    #sub-extra-media-grid.grid-3-col,
    #sub-extra-media-grid.grid-4-col { 
        grid-template-columns: repeat(2, 1fr); 
        max-width: 750px; 
    }
}

@media (max-width: 640px) {
    .projects-grid { grid-template-columns: 1fr; }
    .section-title { font-size: 2.5rem; }
    .extra-container { flex-direction: column; align-items: center; gap: 2rem; }
    .extra-card { width: 100%; max-width: 300px; }
    .extracurriculum-section .section-title { margin-bottom: 3rem; }
    .contact-heading { font-size: 2.5rem; }
    
    .detail-images, .project-media-grid, .project-media-grid.grid-2x2, .extra-media-grid, .extra-media-grid.grid-2-col, #sub-extra-media-grid, #sub-extra-media-grid.grid-3-col, #sub-extra-media-grid.grid-4-col, #sub-extra-media-grid.grid-1-col { grid-template-columns: 1fr; }
    .detail-images img, .media-item-container img, .media-item-container video, .extra-media-item img { height: 250px; }
}