/* --- Google Fonts & Theme Variables --- */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600;700&display=swap');

:root {
    --primary-color: #2563eb;
    --primary-light: #3b82f6;
    --bg-color: #0f172a;
    --bg-alt: #1e293b;
    --text-color: #f8fafc;
    --text-muted: #94a3b8;
    --border-color: #334155;
    --card-bg: #1e293b;
    --transition: all 0.3s ease;
}

[data-theme="light"] {
    --bg-color: #f8fafc;
    --bg-alt: #f1f5f9;
    --text-color: #0f172a;
    --text-muted: #64748b;
    --border-color: #cbd5e1;
    --card-bg: #ffffff;
}

/* --- Base Reset & Core Styles --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    scroll-behavior: smooth;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    transition: var(--transition);
    overflow-x: hidden;
}

ul { list-style: none; }
a { text-decoration: none; color: inherit; }

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 2rem;
}

.section {
    padding: 6rem 0;
}

.back-alt {
    background-color: var(--bg-alt);
}

.section-title {
    font-size: 2.2rem;
    text-align: center;
    margin-bottom: 3rem;
    position: relative;
    font-weight: 700;
}

.section-title::after {
    content: '';
    display: block;
    width: 50px;
    height: 4px;
    background: var(--primary-color);
    margin: 10px auto 0;
    border-radius: 2px;
}

/* --- Fixed Top Navigation --- */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
    transition: var(--transition);
}

[data-theme="light"] .navbar {
    background-color: rgba(248, 250, 252, 0.9);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 2rem;
}

.logo {
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: 1px;
}

.logo span { color: var(--primary-color); }

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-links a {
    font-weight: 500;
    transition: var(--transition);
    font-size: 0.95rem;
}

.nav-links a:hover { color: var(--primary-color); }

.nav-actions {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

#theme-toggle {
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 1.2rem;
    cursor: pointer;
    transition: var(--transition);
}

/* --- Welcome Hero Section --- */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding-top: 80px;
}

.hero-content h1 {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.hero-content .highlight { color: var(--primary-color); }

.hero-content h2 {
    font-size: 1.8rem;
    color: var(--text-muted);
    font-weight: 400;
    margin-bottom: 1.5rem;
}

.hero-content p {
    max-width: 600px;
    margin: 0 auto 2rem;
    color: var(--text-muted);
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.social-links a {
    font-size: 1.5rem;
    transition: var(--transition);
}

.social-links a:hover {
    color: var(--primary-color);
    transform: translateY(-3px);
}

.btn {
    display: inline-block;
    background-color: var(--primary-color);
    color: #fff;
    padding: 0.8rem 2rem;
    border-radius: 30px;
    font-weight: 600;
    transition: var(--transition);
    border: 2px solid transparent;
}

.btn:hover {
    background-color: transparent;
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* --- Skills & Education Grid Layout --- */
.skills-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2.5rem;
}

.education-card, .skills-card {
    background-color: var(--card-bg);
    padding: 2.5rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.education-card h3, .skills-card h3 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary-color);
}

.edu-item h4 { font-size: 1.2rem; margin-bottom: 0.2rem;}
.edu-item .institution { color: var(--text-muted); font-weight: 500;}
.edu-item .meta { font-size: 0.9rem; color: var(--primary-light); margin-top: 0.5rem;}

.skills-list {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.skill-category strong { color: var(--text-color); display: block; margin-bottom: 0.3rem;}
.skill-category { color: var(--text-muted); font-size: 0.95rem;}

/* --- Interactive Experience Timeline --- */
.timeline {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
}

.timeline::after {
    content: '';
    position: absolute;
    width: 2px;
    background-color: var(--border-color);
    top: 0;
    bottom: 0;
    left: 20px;
}

.timeline-item {
    position: relative;
    padding-left: 50px;
    margin-bottom: 3rem;
}

.timeline-dot {
    position: absolute;
    width: 16px;
    height: 16px;
    background-color: var(--primary-color);
    border-radius: 50%;
    left: 13px;
    top: 6px;
    z-index: 2;
}

.timeline-date {
    font-weight: 600;
    color: var(--primary-light);
    margin-bottom: 0.5rem;
}

.timeline-content {
    background-color: var(--card-bg);
    padding: 2rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.timeline-content h3 { font-size: 1.4rem; }
.timeline-content .company { color: var(--text-muted); font-size: 1rem; margin-bottom: 1rem; font-weight: 500; }
.timeline-content ul { padding-left: 1.2rem; list-style-type: square; }
.timeline-content li { margin-bottom: 0.5rem; color: var(--text-muted); font-size: 0.95rem;}

/* --- Project Management & Filters --- */
.project-filters {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 3rem;
}

.filter-btn {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    padding: 0.5rem 1.5rem;
    border-radius: 20px;
    cursor: pointer;
    font-family: inherit;
    transition: var(--transition);
}

.filter-btn.active, .filter-btn:hover {
    background: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
}

.project-card {
    background-color: var(--card-bg);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    overflow: hidden;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
}

.project-info {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.project-info h3 { font-size: 1.3rem; margin-bottom: 1rem; }
.project-info p { color: var(--text-muted); font-size: 0.95rem; margin-bottom: 1.5rem; flex-grow: 1; }

.tech-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.tech-tags span {
    background-color: var(--bg-color);
    font-size: 0.8rem;
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    border: 1px solid var(--border-color);
    color: var(--primary-light);
}

.project-link {
    font-weight: 600;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* --- Research Papers Section --- */
.research-card {
    background-color: var(--card-bg);
    padding: 2.5rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    max-width: 900px;
    margin: 0 auto;
}

.research-card h3 { font-size: 1.5rem; margin-bottom: 0.3rem; color: var(--primary-color); }
.research-card .meta { color: var(--text-muted); font-style: italic; margin-bottom: 1.5rem; font-size: 0.95rem; }
.research-card ul { padding-left: 1.2rem; list-style-type: circle; }
.research-card li { margin-bottom: 0.8rem; color: var(--text-muted); }

/* --- Achievements Flex Grid --- */
.achievements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.achieve-card {
    background-color: var(--card-bg);
    padding: 2.5rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    text-align: center;
    transition: var(--transition);
}

.achieve-card:hover { transform: translateY(-5px); }
.achieve-icon { font-size: 2.5rem; color: var(--primary-color); margin-bottom: 1rem; }
.achieve-card h3 { font-size: 1.3rem; margin-bottom: 1rem; }
.achieve-card p { color: var(--text-muted); font-size: 0.95rem; }

/* --- Footer --- */
.footer {
    text-align: center;
    padding: 2rem 0;
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* --- Navigation Mobile View (Hamburger Menu) --- */
.hamburger { display: none; cursor: pointer; }
.bar { display: block; width: 25px; height: 3px; margin: 5px auto; background-color: var(--text-color); transition: var(--transition); }

/* --- Animation Setups --- */
.fade-in { opacity: 0; transform: translateY(20px); animation: fadeInUp 0.8s forwards; }
.delay-1 { animation-delay: 0.2s; }
.delay-2 { animation-delay: 0.4s; }
.delay-3 { animation-delay: 0.6s; }

@keyframes fadeInUp {
    to { opacity: 1; transform: translateY(0); }
}

/* --- FIXED: Card Reveal Visibility Fix --- */
/* Elements ko direct visible kiya gaya hai taaki JS file miss hone par bhi data show ho. 
   Agar aap transitions lagana chahein toh opacity badha sakte hain. */
.card-reveal { 
    opacity: 1 !important; 
    transform: translateY(0) !important; 
    transition: opacity 0.6s ease-out, transform 0.6s ease-out; 
}

/* --- Responsive Layout Breakpoints --- */
@media(max-width: 768px) {
    .hamburger { display: block; }
    .hamburger.active .bar:nth-child(2) { opacity: 0; }
    .hamburger.active .bar:nth-child(1) { transform: translateY(8px) rotate(45deg); }
    .hamburger.active .bar:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }
    
    .nav-links {
        position: fixed;
        left: -100%;
        top: 70px;
        flex-direction: column;
        background-color: var(--bg-color);
        width: 100%;
        text-align: center;
        padding: 2rem 0;
        transition: 0.3s;
        border-bottom: 1px solid var(--border-color);
    }
    .nav-links.active { left: 0; }
    .skills-grid { grid-template-columns: 1fr; }
    .hero-content h1 { font-size: 2.5rem; }
    .timeline::after { left: 10px; }
    .timeline-item { padding-left: 35px; }
    .timeline-dot { left: 3px; }
}