/* Google Font - Poppins */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800;900&display=swap');

/* --- Variables and Global Styles (Deep Indigo & Electric Blue Theme) --- */
:root {
    /* Background Colors */
    --bg-color: #0F172A; 	 /* Deep Indigo/Navy Background */
    --second-bg-color: #1E293B; /* Slightly Lighter Background for Sections */
    
    /* Text and Accent Colors */
    --text-color: #CBD5E1; 	 /* Light Gray-Blue Text */
    --main-color: #38BDF8; 	 /* Electric/Sky Blue Accent */
    
    /* Shadow (matching the main accent color) */
    --shadow-color: rgba(56, 189, 248, 0.2); 
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    text-decoration: none;
    border: none;
    outline: none;
    scroll-behavior: smooth;
    font-family: 'Poppins', sans-serif;
}

html {
    font-size: 62.5%; /* 1rem = 10px */
    overflow-x: hidden;
}

body {
    background: var(--bg-color);
    color: var(--text-color);
}

section {
    min-height: 100vh;
    padding: 10rem 9% 2rem;
}

/* --- 1. Header and Navigation --- */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 2rem 9%;
    background: var(--bg-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
    /* Header Highlight */
    border-bottom: 0.1rem solid var(--second-bg-color); 
    box-shadow: 0 0 1rem rgba(0, 0, 0, 0.4); 
}

.logo {
    display: flex;
    align-items: center;
    gap: 1rem;
    /* Increased Logo Text Size */
    font-size: 3.5rem; /* Set to 3.5rem for bigger look */
    color: var(--text-color);
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.3s ease-in-out; 
}
.logo:hover {
    transform: scale(1.05); /* Zooms the logo (image + text) by 5% */
}

.logo span {
    color: var(--main-color);
}

.logo-img {
    /* Increased Logo Image Size */
    height: 60px; /* Set to 60px for bigger look */
    width: auto;
    object-fit: contain;
}

.navbar a {
    font-size: 1.7rem;
    color: var(--text-color);
    margin-left: 4rem;
    transition: 0.3s;
}

.navbar a:hover,
.navbar a.active {
    color: var(--main-color);
}

/* --- Reusable Components --- */
.heading {
    font-size: 4.5rem;
    text-align: center;
    margin-bottom: 5rem;
}

.heading span {
    color: var(--main-color);
}

.btn {
    display: inline-block;
    padding: 1rem 2.8rem;
    background: var(--main-color);
    border-radius: 4rem;
    box-shadow: 0 0 1rem var(--shadow-color);
    font-size: 1.6rem;
    color: var(--bg-color);
    letter-spacing: 0.1rem;
    font-weight: 600;
    transition: 0.5s ease;
    /* Removed width: 100% here to allow the Download CV button to be small by default */
}

.btn:hover {
    box-shadow: 0 0 1rem var(--main-color);
    filter: brightness(1.1);
}

/* --- 2. Home Section (Hero) --- */
.home {
    display: flex;
    justify-content: space-between; 
    align-items: center;
    gap: 4rem; 
    flex-wrap: wrap; 
}

.home-content {
    max-width: 60rem;
    margin-right: 2rem; 
}

/* FIX: Makes the Download CV button small again (by overriding the contact form's long button style) */
.home-content .btn {
    width: auto; /* Overrides the contact form's 100% width, making it small */
}

.home-content h1 {
    font-size: 5.6rem;
    font-weight: 700;
    line-height: 1.3;
}

.home-content h3 {
    font-size: 3.2rem;
    font-weight: 700;
}

.home-content h3 .highlight {
    color: var(--main-color);
}

.home-content p {
    font-size: 1.6rem;
    margin: 2rem 0 4rem;
    color: #8892b0;
}

.social-media a {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 4rem;
    height: 4rem;
    background: transparent;
    border: 0.2rem solid var(--main-color);
    border-radius: 50%;
    font-size: 2rem;
    color: var(--main-color);
    margin: 3rem 1.5rem 3rem 0;
    transition: 0.5s ease;
}

.social-media a:hover {
    background: var(--main-color);
    color: var(--bg-color);
    box-shadow: 0 0 1rem var(--main-color);
}

/* Image styling (Profile Photo) */
.home-img {
    position: relative;
    width: 38rem; 
    height: 38rem;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-left: 0; 
}

.circular-frame {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    border: 0.3rem solid var(--main-color); 
    box-shadow: 0 0 2rem var(--shadow-color);
    overflow: hidden; 
}

.circular-frame img {
    width: 100%;
    height: 100%;
    object-fit: cover; 
    border-radius: 50%;
    filter: grayscale(10%) contrast(1.1); 
}

/* --- 3. About Section --- */
.about {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: var(--second-bg-color);
}

.about-content {
    max-width: 90rem;
    text-align: left;
    padding: 0 2rem;
}

.about-content p {
    font-size: 1.8rem;
    line-height: 1.6;
    margin-bottom: 3rem;
    color: #8892b0;
}

.about-content h3 {
    font-size: 2.5rem;
    color: var(--main-color);
    margin-bottom: 1.5rem;
}

.education-details ul {
    list-style: none;
    padding-left: 2rem;
    font-size: 1.6rem;
    line-height: 2.2;
}

.education-details ul li {
    position: relative;
    margin-bottom: 1rem;
}

.education-details ul li::before {
    content: '\2022'; 
    color: var(--main-color);
    font-weight: bold;
    display: inline-block;
    width: 1em;
    margin-left: -1em;
}

/* --- 4. Skills Section --- */
.skills {
    background: var(--bg-color);
}

.skills-container {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 4rem;
}

.skill-box {
    flex: 1 1 30rem;
    background: var(--second-bg-color);
    padding: 3rem 2rem 4rem;
    border-radius: 2rem;
    text-align: center;
    border: 0.2rem solid var(--second-bg-color);
    transition: 0.5s ease;
    min-height: 35rem;
}

.skill-box:hover {
    border-color: var(--main-color);
    transform: scale(1.02);
    box-shadow: 0 0 3rem var(--shadow-color);
}

.skill-box i {
    font-size: 5rem;
    color: var(--main-color);
}

/* --- COMPLETE MISSING CSS --- */
.skill-box h3 {
    font-size: 2.6rem;
    margin: 1.5rem 0 1rem; 
}

.skill-box p {
    font-size: 1.6rem;
    color: #a0aec0;
    margin-bottom: 1rem;
    line-height: 1.5;
    text-align: left; /* Aligns text neatly inside the box */
}

/* --- 5. Projects Section --- */
.projects {
    background: var(--second-bg-color); /* Alternate background color */
}

.projects-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 3.5rem;
}

.project-card {
    position: relative;
    border-radius: 2rem;
    overflow: hidden;
    display: flex;
    box-shadow: 0 0 1rem var(--shadow-color);
    min-height: 350px; 
}

.project-layer {
    padding: 3rem;
    background: var(--second-bg-color);
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    transition: 0.5s ease;
    width: 100%;
    height: 100%;
    border: 0.2rem solid var(--second-bg-color);
    border-radius: 2rem;
}

.project-card:hover .project-layer {
    background: var(--bg-color); 
    border-color: var(--main-color);
}

.project-layer h4 {
    font-size: 3rem;
    color: var(--main-color);
    margin-bottom: 1.5rem;
}

.project-layer p {
    font-size: 1.6rem;
    margin-bottom: 2rem;
}

.project-layer .tech-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: auto; /* Pushes the tech stack to the bottom */
    margin-bottom: 2rem;
}

.project-layer .tech-stack span {
    padding: 0.5rem 1rem;
    background: var(--main-color);
    color: var(--bg-color);
    font-size: 1.2rem;
    font-weight: 500;
    border-radius: 0.5rem;
}

.project-layer a {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 5rem;
    height: 5rem;
    background: var(--main-color);
    border-radius: 50%;
    color: var(--bg-color);
    font-size: 2rem;
    transition: 0.3s ease;
}

.project-layer a:hover {
    box-shadow: 0 0 1rem var(--main-color);
}

/* --- 6. Achievements Section (Gallery) --- */
.achievements {
    background: var(--bg-color);
}

.achievement-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2.5rem;
    padding: 0 5rem;
}

.achievement-item {
    background: var(--second-bg-color);
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 0 1rem var(--shadow-color);
    transition: 0.3s ease;
    min-height: 450px;
    display: flex;
    flex-direction: column;
}

.achievement-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 0 2.5rem var(--main-color);
}

.achievement-item img {
    width: 100%;
    height: 220px; 
    object-fit: cover;
}

.caption {
    padding: 1.5rem;
    flex-grow: 1; 
}

.caption h4 {
    font-size: 2rem;
    color: var(--main-color);
    margin-bottom: 0.5rem;
}

.caption p {
    font-size: 1.5rem;
    color: var(--text-color);
    line-height: 1.4;
}


/* --- 7. Contact Section --- */
.contact {
    background: var(--second-bg-color);
}

.contact-form {
    max-width: 70rem;
    margin: 0 auto;
    text-align: center;
}

.contact-form form {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
}

.contact-form .input-box {
    display: flex;
    justify-content: space-between;
    gap: 2.5rem;
}

.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: 1.5rem;
    font-size: 1.6rem;
    color: var(--text-color);
    background: var(--bg-color); /* Darker background for input fields */
    border-radius: 0.8rem;
    box-shadow: 0 0 0.5rem var(--shadow-color);
    border: 0.1rem solid transparent;
    transition: border-color 0.3s ease;
}

.contact-form input:focus,
.contact-form textarea:focus {
    border-color: var(--main-color);
}

.contact-form textarea {
    resize: none;
}

.contact-form .btn {
    margin-top: 2rem;
    cursor: pointer;
    /* FIX: Ensures the Send Message button is long/full-width in this context */
    width: 100%; 
    background: var(--main-color); 
}

/* --- 8. Footer --- */
.footer {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem 9%;
    background: var(--bg-color);
    border-top: 0.1rem solid var(--second-bg-color); 
}

.footer p {
    font-size: 1.6rem;
    color: var(--text-color);
    text-align: center;
}

/* --- 9. MEDIA QUERIES (Responsiveness) --- */
@media (max-width: 1200px) {
    html {
        font-size: 55%; 
    }
}

@media (max-width: 991px) {
    .header {
        padding: 2rem 4%; 
    }
    section {
        padding: 10rem 4% 2rem; 
    }
    /* Home section specific adjustments */
    .home {
        flex-direction: column; /* Stacks vertically on tablets */
    }
    .home-content {
        order: 2; /* Content below image */
        margin-right: 0;
    }
    .home-img {
        order: 1; /* Image above content */
        margin: 4rem 0 2rem;
    }
    .achievement-gallery {
        padding: 0;
    }
    .projects-container {
        padding: 0 2rem;
    }
}

@media (max-width: 768px) {
    
    #menu-icon {
        display: block; 
        font-size: 3rem;
        color: var(--main-color);
        cursor: pointer;
    }

    .navbar {
        display: none;
    }

    .home {
        flex-direction: column; 
        text-align: center; 
    }

    .home-content h1 {
        font-size: 4.5rem;
    }
    
    /* CRITICAL FIX for mobile profile photo display */
    .home-img {
        width: 70vw; 
        height: 70vw;
        /* Ensure margins are simple for vertical stacking */
        margin: 4rem auto 2rem; /* Use auto for horizontal centering */
        /* Make sure overflow-x: hidden in HTML is not causing clipping */
        /* The main issue is likely fixed by simplifying margin and ensuring flex-direction is column */
    }
    
    .about-content {
        padding: 0 1rem;
    }

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

    .contact-form .input-box {
        flex-direction: column;
        gap: 1.5rem;
    }
}