/* --- General Setup & Variables --- */
:root {
    --primary-color: #00aaff; /* A vibrant blue */
    --secondary-color: #0077b3;
    --dark-bg: #1a1a1a;
    --light-bg: #2c2c2c;
    --text-color: #f0f0f0;
    --light-gray: #cccccc;
    --card-bg: #333333;
    --font-family: 'Poppins', sans-serif;
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: 70px; /* Offset for fixed navbar */
}

body {
    font-family: var(--font-family);
    background-color: var(--dark-bg);
    color: var(--text-color);
    line-height: 1.6;
}

.container {
    max-width: 1100px;
    margin: auto;
    padding: 0 2rem;
}

h1, h2, h3 {
    line-height: 1.2;
    margin-bottom: 1rem;
    font-weight: 600;
}

h1 { font-size: 3.5rem; }
h2 { font-size: 2.5rem; color: var(--primary-color); }
h3 { font-size: 1.5rem; }

p {
    margin-bottom: 1rem;
    color: var(--light-gray);
}

a {
    text-decoration: none;
    color: var(--primary-color);
}

/* --- Utility & Reusable Classes --- */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border-radius: 5px;
    font-weight: 600;
    transition: all 0.3s ease;
    text-align: center;
}

.btn-primary {
    background: var(--primary-color);
    color: #fff;
    border: 2px solid var(--primary-color);
}

.btn-primary:hover {
    background: var(--secondary-color);
    border-color: var(--secondary-color);
}

.btn-secondary {
    background: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-secondary:hover {
    background: var(--primary-color);
    color: #fff;
}

.content-section {
    padding: 80px 0;
}

.bg-light { background-color: var(--light-bg); }
.bg-dark { background-color: var(--dark-bg); }

/* --- Header & Navbar --- */
.navbar {
    position: fixed;
    width: 100%;
    top: 0;
    left: 0;
    z-index: 100;
    background-color: rgba(26, 26, 26, 0.9);
    backdrop-filter: blur(10px);
    transition: background-color 0.3s ease;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.nav-logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 1.5rem;
}

.nav-link {
    color: var(--light-gray);
    transition: color 0.3s ease;
}

.nav-link:hover {
    color: var(--primary-color);
}

.hamburger {
    display: none;
    cursor: pointer;
}

.bar {
    display: block;
    width: 25px;
    height: 3px;
    margin: 5px auto;
    transition: all 0.3s ease-in-out;
    background-color: white;
}

/* --- Hero Section --- */
.hero-section {
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    background: linear-gradient(rgba(26, 26, 26, 0.7), rgba(26, 26, 26, 0.9)), url('https://www.toptal.com/designers/subtlepatterns/uploads/double-bubble-outline.png');
}

.hero-content p {
    font-size: 1.5rem;
    color: #fff;
    margin-bottom: 2rem;
}

#typing-effect {
    color: var(--primary-color);
    font-weight: 600;
}

.hero-links .btn {
    margin: 0 0.5rem;
}

/* --- About Section --- */
.about-container {
    display: flex;
    align-items: center;
    gap: 3rem;
}

.about-text {
    flex: 2;
}

.about-image {
    flex: 1;
    text-align: center;
}

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

/* --- Projects Section --- */
.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.project-card {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 10px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.project-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.5);
}

.project-card h3 {
    color: #fff;
}

.learn-more {
    margin-top: 1rem;
    padding: 8px 16px;
    background: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

.project-tag {
    position: absolute;
    top: 15px;
    right: 15px;
    padding: 5px 10px;
    font-size: 0.8rem;
    font-weight: 600;
    border-radius: 20px;
    color: #fff;
}

.project-tag.patent { background-color: #c0392b; }
.project-tag.publication { background-color: #27ae60; }
.project-tag.research { background-color: #f39c12; }

/* --- Modal --- */
.modal {
    display: none;
    position: fixed;
    z-index: 101;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.7);
    animation: fadeIn 0.3s;
}

.modal-content {
    background-color: var(--light-bg);
    margin: 15% auto;
    padding: 30px;
    border: 1px solid #888;
    width: 80%;
    max-width: 600px;
    border-radius: 10px;
    position: relative;
    animation: slideIn 0.3s;
}

.modal-content .btn {
    margin-top: 1rem;
}

.close-button {
    color: #aaa;
    position: absolute;
    top: 15px;
    right: 25px;
    font-size: 28px;
    font-weight: bold;
}

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

.link-disabled {
    color: var(--light-gray);
    cursor: not-allowed;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideIn { from { transform: translateY(-50px); } to { transform: translateY(0); } }

/* --- Experience (Timeline) --- */
.timeline {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
}
.timeline::after {
    content: '';
    position: absolute;
    width: 4px;
    background-color: var(--primary-color);
    top: 0;
    bottom: 0;
    left: 50%;
    margin-left: -2px;
}
.timeline-item {
    padding: 10px 40px;
    position: relative;
    width: 50%;
}
.timeline-item:nth-child(odd) { left: 0; }
.timeline-item:nth-child(even) { left: 50%; }

.timeline-content {
    padding: 20px;
    background: var(--card-bg);
    border-radius: 8px;
    position: relative;
}
.timeline-date {
    position: absolute;
    top: 22px;
    width: 100px;
    text-align: center;
    font-weight: 600;
    color: var(--primary-color);
    z-index: 1;
}
.timeline-item:nth-child(odd) .timeline-date {
    right: -140px;
}
.timeline-item:nth-child(even) .timeline-date {
    left: -140px;
}

/* --- Skills Section --- */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.skill-category h3 {
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
    color: #fff;
}

.skill-category ul {
    list-style: none;
}

.skill-category ul li {
    background: var(--card-bg);
    margin-bottom: 0.5rem;
    padding: 10px;
    border-radius: 5px;
    border-left: 3px solid var(--primary-color);
}

/* --- Education & Contact --- */
.education-container, .contact-container {
    text-align: center;
    max-width: 700px;
    margin: auto;
}

.contact-info {
    font-size: 1.1rem;
    margin: 1rem 0;
}

/* --- Footer --- */
footer {
    text-align: center;
    padding: 2rem 0;
    background-color: #111;
    color: var(--light-gray);
}

/* --- Responsive Design --- */
@media(max-width: 768px) {
    h1 { font-size: 2.5rem; }
    h2 { font-size: 2rem; }

    .nav-menu {
        position: fixed;
        left: -100%;
        top: 70px;
        flex-direction: column;
        background-color: var(--dark-bg);
        width: 100%;
        text-align: center;
        transition: 0.3s;
        gap: 0;
    }

    .nav-menu.active {
        left: 0;
    }

    .nav-item {
        margin: 16px 0;
    }

    .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); }

    .about-container {
        flex-direction: column;
    }

    .timeline::after { left: 31px; }
    .timeline-item { width: 100%; padding-left: 70px; padding-right: 25px; }
    .timeline-item:nth-child(even) { left: 0; }
    .timeline-date { 
        position: relative;
        top: 0; left: 0; 
        width: auto;
        margin-bottom: 10px;
        text-align: left;
    }

    .modal-content {
        width: 90%;
        margin: 20% auto;
    }
}