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

body {
    background-color: rgb(0, 0, 33);
    color: white;
    font-family: 'Poppins', sans-serif;
}

/* Updated header styles to allow hiding */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: rgb(18, 18, 62);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    transition: transform 0.3s ease-in-out; /* Smooth transition */
}

header .left{
    font-size: 25px;
    font-weight: 50px;
}

/* Navigation Bar */
nav {
    display: flex;
    justify-content: space-around;
    align-items: center;
    height: 60px;
    position: relative; /* Needed for absolute positioning of mobile menu */
}

nav ul {
    display: flex;
    justify-content: center;
}

nav ul li {
    list-style-type: none;
    margin: 0 23px;
}

nav ul li a {
    text-decoration: none;
    color: white;
}

nav ul li a:hover {
    color: rgb(193, 193, 253);
    font-size: 1.01rem;
}

/* Hamburger button (Desktop: hidden) */
.hamburger {
    display: none; 
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    z-index: 1001;
}

/* Hide Header on Scroll */
.hidden {
    transform: translateY(-100%);
}

/* Hero Section */
.home {
    display: flex;
    justify-content: space-around;
    align-items: center;
    margin: 80px 0;
    height: 580px;
    padding-top: 60px; /* Account for fixed header on desktop */
}

.home > div {
    width: 30%;
}

.leftsection {
    font-size: 3rem;
}

.rightsection {
    width: 30%;
}

.rightsection img {
    width: 500px;
    height: 500px;
    object-fit: cover;
}

/* Typography */
.purple {
    color: rgb(165, 110, 216);
}

.textgray {
    color: gray;
}

#element {
    color: rgb(165, 110, 216);
}

/* Work Experience Section */
.about {
    max-width: 80vw;
    margin: auto;
    height: 80vh;
    padding-top: 60px;
}

.about h1 {
    font-size: 1.9rem;
}

.about .box {
    background-color: white;
    width: 165vh;
    height: 2px;
    margin: 56px 0;
}

/* Divider */
main hr {
    border: 0;
    background-color: rgb(165, 110, 216);
    height: 1.2px;
    margin: 20px 80px;
}

/* Footer (Base) */
/* --- Footer Styling --- */
footer {
    background-color: #0e0e1a;
    min-height: 120px; /* Increased min-height for padding */
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 50px; /* Added margin for separation */
    padding: 20px 10px;
    text-align: center;
}

.footer-content {
    max-width: 900px;
    width: 100%;
}

.footer-content p {
    margin: 10px 0; /* Vertical spacing between lines */
    color: rgb(170, 170, 170); /* Subtle gray for text */
    font-size: 14px;
}

.footer-interests {
    font-weight: 500;
    /* Use the accent color for the bold text (Interests) */
    color: rgb(165, 110, 216); 
    padding-bottom: 5px;
}

.footer-credits a {
    color: crimson; /* Retained link color */
    text-decoration: none;
    font-weight: bold;
}


/* Buttons */
.leftsection .btn {
    display: inline-block;
    background: #1e2167;
    color: #fff;
    font-size: 15px;
    padding: 12px 36px;
    margin-top: 20px;
    font-weight: 400;
    border-radius: 6px;
    border: 2px solid rgb(124, 124, 225);
    transition: all 0.3sease;
    text-decoration: none;
}

.home .home-content a {
    display: inline-block;
    background: crimson;
    color: #fff;
    font-size: 25px;
    padding: 12px 36px;
    margin-top: 20px;
    font-weight: 400;
    border-radius: 6px;
    border: 2px solid crimson;
    transition: all 0.3sease;
}

html {
    scroll-behavior: smooth;
}


section .title {
    position: relative;
    text-align: center;
    font-size: 40px;
    font-weight: 500;
    margin-bottom: 60px;
    padding-bottom: 20px;
}

section .title::before {
    content: "";
    position: absolute;
    bottom: 0px;
    left: 50%;
    width: 190px;
    height: 2px;
    background: white;
    transform: translateX(-50%);
}

.about .title::after {
    content: "who I am";
}

section .title::after {
    position: absolute;
    bottom: -12px;
    left: 50%;
    font-size: 20px;
    color: crimson;
    padding: 0 5px;
    background: rgb(0, 0, 33);
    transform: translateX(-50%);
}

.about-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 40px;
    flex-wrap: wrap;
    max-width: 80vw;
    height: 80vh;
}

.aboutleft img {
    width: 100%;
    max-width: 350px;
    height: auto;
    border-radius: 10px;
}

.aboutright {
    max-width: 627px;
    text-align: justify;
}

.aboutright p {
    font-size: 18px;
    line-height: 1.6;
    color: white;
}


#element1{
    font-size: 24px;
    color: rgb(165, 110, 216);
}

.aboutright .text b{
    font-size: 24px;
    font-weight: 400;
}

.about hr {
    border: 0;
    background-color: rgb(165, 110, 216);
    height: 1.2px;
    margin: 20px 0px;
}

.about .aboutright a{
    display: inline-block;
    background: #1e2167;
    color: #fff;
    font-size: 15px;
    padding: 12px 36px;
    margin-top: 20px;
    margin-left: 200px;
    font-weight: 400;
    border-radius: 6px;
    border: 2px solid rgb(124, 124, 225);
    transition: all 0.3sease;
    text-decoration: none;
}

.skill{
    margin-top: 250px;
    padding-top: 60px;
}

section .title1 {
    position: relative;
    text-align: center;
    font-size: 40px;
    font-weight: 500;
    margin-bottom: 60px;
    padding-bottom: 20px;
}

section .title1::before {
    content: "";
    position: absolute;
    bottom: 24px;
    left: 50%;
    width: 190px;
    height: 2px;
    background: white;
    transform: translateX(-50%);
}

.skill-category {
    margin: 10px -10px;
}

.skill-category h2 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 15px;
    margin-left: 300px;
}

.skill-box {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
    max-width: 1000px;
    margin: 0 auto;
}

.skill-item {
    width: 120px;
    height: 140px;
    background: #22234c;
    border-radius: 10px;
    box-shadow: 0px 4px 10px rgba(162, 155, 155, 0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10px;
    transition: transform 0.3s ease-in-out;
}

.skill-item:hover {
    transform: translateY(-5px);
}

.skill-item img {
    width: 100px;
    height: 107px;
    margin-bottom: 6px;
    object-fit: contain;
}

.skill-item p {
    font-size: 14px;
    font-weight: 500;
}


/* Project Section */
.projects {
    text-align: center;
    padding: 50px 0;
    padding-top: 60px;
}

.project-container {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 30px;
    max-width: 900px;
    margin: 0 auto;
}

/* Project Card Styling */
.project-card {
    width: 280px;
    background: #22234c;
    border-radius: 10px;
    box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: transform 0.3s ease;
    color: white;
}

.project-card:hover {
    transform: scale(1.05);
}

.project-card img {
    width: 100%;
    height: 160px;
    object-fit: cover;
}

.project-info {
    padding: 15px;
}

.project-info h2 {
    font-size: 20px;
    margin-bottom: 10px;
}

.project-info p {
    font-size: 14px;
    color: #f4ecec;
}

.project-info a {
    display: inline-block;
    margin-top: 10px;
    text-decoration: none;
    color: white;
    background-color: #6567b5;
    padding: 8px 12px;
    border-radius: 5px;
    font-size: 14px;
    transition: background 0.3s ease;
}

.project-info a:hover {
    background-color: #bdbeef;
}

/* Education Section */
.education {
    text-align: center;
    padding: 50px 0;
    padding-top: 60px;
}

.education-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 40px;
    max-width: 990px;
    margin: 0 auto;
}

/* Education Item */
.education-item {
    display: flex;
    align-items: center;
    gap: 20px;
    position: relative;
    text-align: left; /* Ensure text is left-aligned */
}

/* Year Badge */
.education-year {
    font-size: 18px;
    font-weight: bold;
    color: #f0e9e9;
    background: #42437d;
    padding: 10px 20px;
    border-radius: 20px;
}

/* Education Details */
.education-details h2 {
    font-size: 18px; /* Increased for readability */
    font-weight: bold;
    margin: 5px 0;
    color: white;
}

.education-details p {
    font-size: 16px; /* Increased for readability */
    color: rgb(170, 170, 170); /* Adjusted for better contrast */
}

.contact {
    text-align: center;
    padding: 50px 0;
    padding-top: 60px;
}

.subtitle {
    color: crimson; /* Retaining the original accent color for the subtitle */
    font-size: 18px;
    margin-bottom: 30px;
}

/* Contact Container */
.contact-container {
    display: flex;
    justify-content: space-between;
    max-width: 1000px;
    margin: auto;
    gap: 50px;
    padding: 0 20px;
}

/* Left Side: Contact Info */
.contact-info {
    text-align: left;
    flex: 1;
}

.contact-info h2 {
    font-size: 24px;
    color: white;
}

.contact-info p {
    font-size: 16px;
    color: rgb(170, 170, 170); /* Adjusted for better contrast */
}

/* Info Items */
.info-item {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-top: 15px;
}

.info-item i {
    color: crimson;
    font-size: 22px;
}

.info-item span {
    font-weight: bold;
    color: white;
}

/* Right Side: Contact Form */
.contact-form {
    flex: 1;
    text-align: left;
}

.contact-form h2 {
    font-size: 24px;
}

.input-group {
    display: flex;
    gap: 10px;
}

input,
textarea {
    width: 100%;
    padding: 10px;
    margin-top: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
    background-color: #1e2167; /* Dark input background */
    color: white;
}

.contact-form .btn {
    background-color: crimson;
    color: #fff;
    border: none;
    padding: 12px;
    cursor: pointer;
    border-radius: 5px;
    font-size: 16px;
    margin-top: 10px;
    text-decoration: none; /* Override a tag style */
}

.contact-form .btn:hover {
    background-color: #b71c1c;
}

/* Footer (link styling) */
footer a{
    color: crimson;
    text-decoration: none;
}

.info-item div #add{
    font-size: 16px;
    color: rgb(170, 170, 170);
    margin-left: 34px;
}

/* =======================================
   RESPONSIVE STYLES (Mobile First) 
   ======================================= */
@media (max-width: 768px) {
    
    /* 1. GLOBAL & HEADER */
    main hr {
        margin: 20px 20px;
    }

    /* Show hamburger, hide desktop menu */
    nav {
        justify-content: space-between;
        padding: 0 20px;
        /* Ensure vertical alignment */
        align-items: center; 
    }
    
    .hamburger {
        display: block;
    }

    .right {
        /* Mobile menu setup: hidden by default */
        display: none;
        position: absolute;
        top: 60px; /* Below the header */
        left: 0;
        width: 100%;
        background-color: rgb(18, 18, 62);
        box-shadow: 0 8px 16px rgba(0, 0, 0, 0.5);
        padding: 10px 0;
        z-index: 999;
    }

    .right.active {
        display: block; /* Use block to contain the vertical list */
    }

    /* --- FIX START: Corrected Mobile Menu Stacking --- */
    nav ul {
        flex-direction: column; /* Force the list of links to stack vertically */
        width: 100%;
        padding: 0;
        align-items: stretch; /* Stretch links to full width */
    }
    
    nav ul li {
        margin: 0; /* Remove horizontal margin */
        padding: 10px 0; /* Add vertical padding for spacing */
        text-align: center;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1); /* Optional separator */
    }
    
    nav ul li:last-child {
        border-bottom: none;
    }
    /* --- FIX END --- */


    /* 2. HOME SECTION */
    .home {
        flex-direction: column; /* Stack sections */
        height: auto;
        padding-top: 100px;
        margin: 0;
    }

    .home > div {
        width: 90%; 
        text-align: center;
        margin-bottom: 30px;
    }

    .leftsection {
        font-size: 2rem; 
    }

    .rightsection {
        width: 80%;
        text-align: center;
    }

    .rightsection img {
        width: 100%;
        max-width: 300px; 
        height: auto;
    }
    
    .leftsection .btn {
        margin-left: 0;
    }

    /* 3. ABOUT SECTION */
    .about {
        max-width: 90vw;
        height: auto;
        padding-top: 50px;
        margin-bottom: 50px;
    }
    
    .about-container {
        flex-direction: column; /* Stack image and text */
        height: auto;
        max-width: 100%;
    }

    .aboutleft img {
        max-width: 100%;
        width: 300px;
    }

    .aboutright {
        width: 90%;
        text-align: center; /* Center content on mobile */
    }
    
    .aboutright p {
        text-align: justify;
    }
    
    .about .aboutright a {
        margin-left: 0; /* Center button */
    }
    
    /* 4. SKILLS SECTION */
    .skill {
        margin-top: 50px;
        padding: 0 10px;
    }
    
    .skill-category h2 {
        margin-left: 0;
        text-align: center;
        font-size: 22px;
    }
    
    .skill-box {
        gap: 10px;
    }
    
    .skill-item {
        width: 90px; 
        height: 110px;
    }

    .skill-item img {
        width: 70px;
        height: 70px;
    }
    
    /* 5. PROJECTS SECTION */
    .project-container {
        flex-direction: column;
        align-items: center;
        gap: 20px;
    }
    
    .project-card {
        width: 90%;
        max-width: 350px;
    }

    /* 6. EDUCATION SECTION */
    .education-container {
        grid-template-columns: 1fr; /* Single column */
        gap: 20px;
        max-width: 90%;
    }
    
    .education-item {
        /* Keep as flex but remove alignment for better flow */
        align-items: flex-start;
    }
    
    .education-details h2 {
        font-size: 16px; 
    }

    .education-details p {
        font-size: 14px; 
    }

    /* 7. CONTACT SECTION */
    .contact-container {
        flex-direction: column;
        gap: 30px;
    }
    
    .contact-info,
    .contact-form {
        width: 100%;
        text-align: center;
    }
    
    .contact-info p {
        color: rgb(170, 170, 170); /* Adjusted for contrast */
    }

    .info-item {
        justify-content: flex-start; /* Re-align info items */
        margin-left: 10px;
    }
    
    .info-item div #add {
        margin-left: 0;
    }
    
    .input-group {
        flex-direction: column;
        gap: 0;
    }
    
    /* 8. FOOTER */
    footer {
        height: auto;
        padding: 20px 10px;
    }
    
    footer p {
        font-size: 12px;
    }
    
    /* Responsive Footer Adjustments (Included again for completeness) */
    .footer-content p {
        font-size: 12px;
    }
}

/* Further decrease font size for very small screens */
@media (max-width: 480px) {
    .leftsection {
        font-size: 1.8rem;
    }
    
    #element {
        font-size: 24px !important;
    }
    
    .aboutright .text b, #element1 {
        font-size: 20px;
    }
    
    .aboutright p {
        font-size: 16px;
    }
}