/* --- Universal Styles & Variables --- */
:root {
    --primary-color: #4f46e5;
    --secondary-color: #1e293b;
    --background-color: #f8fafc;
    --text-color: #334155;
    --card-bg-color: #ffffff;
    --card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --border-color: #e2e8f0;
    --font-family: 'Poppins', sans-serif;
}

body.dark-theme {
    --primary-color: #818cf8;
    --secondary-color: #e2e8f0;
    --background-color: #0f172a;
    --text-color: #cbd5e1;
    --card-bg-color: #1e293b;
    --card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -2px rgba(0, 0, 0, 0.2);
    --border-color: #334155;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    background-color: var(--background-color);
    color: var(--text-color);
    transition: background-color 0.3s, color 0.3s;
}

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

section {
    min-height: 60vh;
}

h1, h2, h3 {
    color: var(--secondary-color);
    font-weight: 600;
}

h2.section-title {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3rem;
    position: relative;
}

h2.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background-color: var(--primary-color);
    border-radius: 2px;
}

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

/* --- Header & Navbar --- */
#header {
    position: sticky;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    transition: background-color 0.3s, box-shadow 0.3s;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background-color: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid transparent;
}

body.dark-theme .navbar {
    background-color: rgba(15, 23, 42, 0.8);
}

#header.scrolled .navbar {
    box-shadow: var(--card-shadow);
    border-bottom-color: var(--border-color);
}

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

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

.nav-link {
    font-weight: 500;
    color: var(--text-color);
    transition: color 0.3s;
}

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

.nav-toggle-group {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.theme-toggle {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    color: var(--text-color);
}
.theme-toggle .fa-sun { display: none; }
body.dark-theme .theme-toggle .fa-sun { display: inline-block; }
body.dark-theme .theme-toggle .fa-moon { display: none; }

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

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

/* --- Hero Section --- */
#hero {
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    min-height: 100vh;
    padding: 0 1rem;
    position: relative;
    overflow: hidden;
    color: white;
}

.hero-content {
    z-index: 2;
}

.profile-photo-hero {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    border: 5px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
    margin-bottom: 1.5rem;
}

#hero h1 {
    font-size: 4rem;
    color: white;
    font-weight: 700;
}

#hero .subtitle {
    font-size: 1.5rem;
    margin: 0.5rem auto;
    font-weight: 400;
    max-width: 800px; /* Ensures long subtitle wraps nicely */
    line-height: 1.4;
}

#hero .tagline {
    font-size: 1.2rem;
    margin-top: 1rem;
    font-style: italic;
    opacity: 0.9;
}

.cta-buttons {
    margin-top: 2rem;
}

.btn {
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    transition: transform 0.2s, box-shadow 0.2s;
    display: inline-block;
    border: none;
    cursor: pointer;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}
body.dark-theme .btn-primary {
    background-color: #6366f1;
}

.btn-secondary {
    background-color: transparent;
    color: white;
    border: 2px solid white;
    margin-left: 1rem;
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.animated-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    background: linear-gradient(-45deg, #ee7752, #e73c7e, #23a6d5, #23d5ab);
    background-size: 400% 400%;
    animation: gradient 15s ease infinite;
}

@keyframes gradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* --- About Me Section --- */
.about-content {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 3rem;
    align-items: center;
}

.about-image img {
    width: 100%;
    max-width: 300px;
    border-radius: 50%;
    border: 8px solid var(--card-bg-color);
    box-shadow: var(--card-shadow);
}

.about-text p {
    margin-bottom: 1rem;
    line-height: 1.7;
}

.quick-facts {
    margin-top: 2rem;
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.fact-item {
    background-color: var(--card-bg-color);
    padding: 10px 15px;
    border-radius: 8px;
    box-shadow: var(--card-shadow);
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
}
.fact-item i {
    color: var(--primary-color);
}

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

.skill-card {
    background-color: var(--card-bg-color);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: var(--card-shadow);
    text-align: center;
    font-weight: 500;
    transition: transform 0.3s, box-shadow 0.3s;
}

.skill-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
}

body.dark-theme .skill-card:hover {
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.3), 0 4px 6px -2px rgba(0,0,0,0.2);
}

.skill-card i {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
    display: block;
}

/* --- Projects & Highlights Section --- */
.projects-grid,
.highlights-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
}

.project-card {
    background-color: var(--card-bg-color);
    border-radius: 12px;
    box-shadow: var(--card-shadow);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s, box-shadow 0.3s;
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
}

.project-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background-color: var(--border-color); /* Placeholder bg */
}

.project-info {
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.project-info h3 {
    margin-bottom: 0.5rem;
}

.project-info p {
    margin-bottom: 1.5rem;
    flex-grow: 1;
}
.project-card .btn {
    align-self: flex-start;
    background-color: var(--card-bg-color);
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
}
.project-card .btn:hover {
    background-color: var(--primary-color);
    color: white;
}
.project-card .btn i {
    margin-left: 5px;
    font-size: 0.8em;
}

.full-width-card {
    grid-column: 1 / -1;
    text-align: center;
    padding: 2rem;
}
.full-width-card h3 { font-size: 1.5rem; }


/* --- Contact Section --- */
.contact-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 3rem;
}
.contact-form .form-group {
    margin-bottom: 1.5rem;
}
.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background-color: var(--background-color);
    color: var(--text-color);
    font-family: var(--font-family);
    font-size: 1rem;
}
.contact-form input:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.3);
}
.contact-info h3 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
}
.contact-info p {
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 10px;
}
.social-links {
    margin-top: 2rem;
    display: flex;
    gap: 1.5rem;
}
.social-links a {
    font-size: 1.8rem;
    color: var(--text-color);
    transition: color 0.3s;
}
.social-links a:hover {
    color: var(--primary-color);
}


/* --- Footer --- */
footer {
    text-align: center;
    padding: 2rem;
    background-color: var(--card-bg-color);
    border-top: 1px solid var(--border-color);
    margin-top: 2rem;
}

/* --- Scroll to Top Button --- */
#scrollToTopBtn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: var(--card-shadow);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s, transform 0.3s;
}

#scrollToTopBtn.show {
    opacity: 1;
    visibility: visible;
}
#scrollToTopBtn:hover {
    transform: scale(1.1);
}

/* --- Animations on Scroll --- */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.animate-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

/* --- Responsive Design --- */
@media (max-width: 992px) {
    .container {
        padding: 3rem 1.5rem;
    }
    .about-content, .contact-content {
        grid-template-columns: 1fr;
    }
    .about-image {
        text-align: center;
    }
}

@media (max-width: 768px) {
    .nav-menu {
        position: fixed;
        left: -100%;
        top: 68px; /* Height of navbar */
        flex-direction: column;
        background-color: var(--background-color);
        width: 100%;
        text-align: center;
        transition: 0.3s;
        box-shadow: var(--card-shadow);
        gap: 0;
    }
    .nav-menu.active {
        left: 0;
    }
    .nav-item {
        width: 100%;
    }
    .nav-link {
        display: block;
        padding: 1.5rem 0;
        border-bottom: 1px solid var(--border-color);
    }
    .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);
    }

    #hero h1 {
        font-size: 2.8rem;
    }
    #hero .subtitle {
        font-size: 1.2rem;
    }
    h2.section-title {
        font-size: 2rem;
    }
}

@media (max-width: 480px) {
    .cta-buttons {
        display: flex;
        flex-direction: column;
        gap: 1rem;
    }
    .btn-secondary {
        margin-left: 0;
    }
    .projects-grid, .highlights-grid {
        grid-template-columns: 1fr;
    }
    .quick-facts {
        flex-direction: column;
        align-items: flex-start;
    }
}