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

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

:root {
    --bg-color: #081b29;
    --second-bg-color: #112e42;
    --text-color: #ededed;
    --main-color: #00abf0;
}

html {
    font-size: 62.5%;
    overflow-x: hidden;
}

body {
    background: var(--bg-color);
    color: var(--text-color);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 2rem 9%;
    background: transparent;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
    transition: .3s;
}

.header.sticky {
    background: var(--bg-color);
}

.logo {
    position: relative;
    font-size: 2.5rem;
    color: var(--text-color);
    font-weight: 600;
}

.navbar {
    position: relative;
}

.navbar a {
    font-size: 1.7rem;
    color: var(--text-color);
    font-weight: 500;
    margin-left: 3.5rem;
    transition: .3s;
}

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

#menu-icon {
    position: relative;
    font-size: 3.6rem;
    color: var(--text-color);
    cursor: pointer;
    display: none;
}

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

.home {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 4rem;
    position: relative;
    min-height: 100vh;
    padding: 10rem 9% 8rem;
    overflow: hidden;
}

.home-content {
    flex: 1 1 48%;
    max-width: 60rem;
    z-index: 99;
    min-width: 0;
}

.home-content h1 {
    position: relative;
    display: inline-block;
    font-size: 5.12rem; 
    font-weight: 700;
    line-height: 1.3;
}

.home-content h1 span {
    color: var(--text-color);
}

.home-content .text-animate {
    position: relative;
    width: 32.8rem;
}

.home-content .text-animate h3 {
    font-size: 3.05rem;
    font-weight: 700;
    color: var(--main-color);
}

/* Smooth typewriter animation - repeats every 7 seconds */
.home-content .typewriter-text {
    display: inline-block;
    overflow: hidden;
    white-space: nowrap;
    border-right: 2px solid var(--main-color);
    animation: typewriter-repeat 7s ease-in-out infinite;
    width: 0;
}

@keyframes typewriter-repeat {
    0% {
        width: 0;
        border-color: var(--main-color);
    }
    36% {
        width: 16ch;
        border-color: var(--main-color);
    }
    40% { width: 16ch; border-color: transparent; }
    45% { width: 16ch; border-color: var(--main-color); }
    50% { width: 16ch; border-color: transparent; }
    55% { width: 16ch; border-color: var(--main-color); }
    60% { width: 16ch; border-color: transparent; }
    65% { width: 16ch; border-color: var(--main-color); }
    70% { width: 16ch; border-color: transparent; }
    75% { width: 16ch; border-color: var(--main-color); }
    80% { width: 16ch; border-color: transparent; }
    85% { width: 16ch; border-color: var(--main-color); }
    90% { width: 16ch; border-color: transparent; }
    100% {
        width: 16ch;
        border-color: var(--main-color);
    }
}

.home-content p {
    position: relative;
    font-size: 1.6rem;
    margin: 1.4rem 0 2rem;
}

.btn-box {
    position: relative;
    display: flex;
    justify-content: space-between;
    width: 34.5rem;
    height: 5rem;
}

.btn-box .btn {
    position: relative;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 15rem;
    height: 100%;
    background: var(--main-color);
    border: .2rem solid var(--main-color);
    border-radius: .8rem;
    font-size: 1.8rem;
    font-weight: 600;
    letter-spacing: .1rem;
    color: var(--bg-color);
    z-index: 1;
    overflow: hidden;
    transition: .5s;
}

.btn-box .btn:hover {
    color: var(--main-color);
}

.btn-box .btn:nth-child(2) {
    background: transparent;
    color: var(--main-color);
}

.btn-box .btn:nth-child(2):hover {
    color: var(--bg-color);
}

.btn-box .btn:nth-child(2)::before {
    background: var(--main-color);
}

.btn-box .btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 100%;
    background: var(--bg-color);
    z-index: -1;
    transition: .5s;
}

.btn-box .btn:hover::before {
    width: 100%;
}

.home-sci {
    position: absolute;
    bottom: 4rem;
    width: 170px;
    display: flex;
    justify-content: space-between;
}

.home-sci a {
    position: relative;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 40px;
    height: 40px;
    background: transparent;
    border: .2rem solid var(--main-color);
    border-radius: 50%;
    font-size: 20px;
    color: var(--main-color);
    z-index: 1;
    overflow: hidden;
    transition: .5s;
}

.home-sci a:hover {
    color: var(--bg-color);
}

.home-sci a::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 100%;
    background: var(--main-color);
    z-index: -1;
    transition: .5s;
}

.home-sci a:hover::before {
    width: 100%;
}

.home-imgHover {
    position: relative;
    flex: 0 1 auto;
    width: min(42vw, 520px);
    max-height: calc(100vh - 18rem);
    background: transparent;
    transition: opacity .3s;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.home-imgHover:hover {
    opacity: .9;
}

.home-imgHover img.profile-img {
    display: block;
    width: 100%;
    height: auto;
    max-height: calc(100vh - 18rem);
    object-fit: contain;
    object-position: center top;
    border-radius: 8px;
}

.projects {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    gap: 2rem;
    background: var(--second-bg-color);
    padding-bottom: 6rem;
}

.heading {
    position: relative;
    font-size: 5rem;
    margin-bottom: 3rem;
    text-align: center;
}

.project-section-title {
    font-size: 2.8rem;
    color: var(--main-color);
    margin: 3rem 0 1.5rem;
    text-align: left;
    width: 100%;
    max-width: 1200px;
    padding: 0 9%;
}

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

.projects-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 3rem;
    margin: 2rem 0;
    justify-items: center;
}

.projects-grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

.project-box {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    width: 320px;
    height: 420px;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: transform 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    box-sizing: border-box;
}

.project-box:hover {
    transform: translateY(-8px) scale(1.03);
}

.project-box-text {
    background: var(--bg-color);
    border: .2rem solid var(--main-color);
    justify-content: center;
}

.project-box-placeholder {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100%;
    padding: 1.5rem;
    text-align: center;
}

.project-box-placeholder h4 {
    font-size: 2.2rem;
    color: var(--main-color);
    line-height: 1.3;
    margin-bottom: 1.2rem;
}

.project-box-placeholder p {
    font-size: 1.4rem;
    color: var(--text-color);
}

.project-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.modal {
    display: none;
    position: fixed;
    z-index: 999;
    left: 0;
    top: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.5);
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: var(--second-bg-color);
    font-size: 1.6rem;
    padding: 3rem;
    border-radius: 15px;
    max-width: 700px; /* Increased max-width */
    width: 90%;
    position: relative;
    text-align: left;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    line-height: 1.6;
}

.modal-content h3 {
    font-size: 2.8rem;
    color: var(--main-color);
    margin-bottom: 1.5rem;
    text-align: center;
}

.modal-content p {
    margin-bottom: 1.5rem; /* Increased spacing between paragraphs */
    color: var(--text-color);
}

.modal-content p:last-child {
    margin-bottom: 0; /* No margin after the last paragraph */
}

.modal-content p a {
    color: var(--main-color);
    text-decoration: underline;
}

.close {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    font-size: 3rem;
    color: var(--main-color);
    cursor: pointer;
    transition: .3s ease;
}

.close:hover {
    color: var(--text-color);
}

@media (max-width: 900px) {
    .projects-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 600px) {
    .projects-grid,
    .projects-grid-2 {
        grid-template-columns: 1fr;
    }
}

.btn-box.btns {
    display: inline-block;
    width: 15rem;
}

.btn-box.btns a::before {
    background: var(--second-bg-color);
}

.education {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    min-height: auto;
    padding-bottom: 5rem;
}

.education .education-row {
    display: flex;
    flex-wrap: wrap;
    gap: 5rem;
}

.education-row .education-column {
    flex: 1 1 40rem;
}

.education-column .title {
    position: relative;
    display: inline-block;
    font-size: 2.5rem;
    margin: 0 0 1.5rem 2rem;
}

.education-column .education-box {
    position: relative;
    border-left: .2rem solid var(--main-color);
}

.education-box .education-content {
    position: relative;
    padding-left: 2rem;
}

.education-box .education-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: -1.1rem;
    width: 2rem;
    height: 2rem;
    background: var(--main-color);
    border-radius: 50%;
}

.education-content .content {
    position: relative;
    padding: 1.5rem;
    border: .2rem solid var(--main-color);
    border-radius: .6rem;
    margin-bottom: 2rem;
    overflow: hidden;
}

.education-content .content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 100%;
    background: var(--second-bg-color);
    z-index: -1;
    transition: .5s;
}

.education-content .content:hover::before {
    width: 100%;
}

.education-content .content .year {
    font-size: 1.5rem;
    color: var(--main-color);
    padding-bottom: .5rem;
}

.education-content .content .year i {
    padding-right: .5rem;
}

.education-content .content h3 {
    font-size: 2rem;
}

.education-content .content p {
    font-size: 1.8rem; /* Increased font size */
    padding-top: .5rem;
}

.education-content .content strong {
    color: var(--main-color);
}

.education-content .content ul {
    list-style-type: disc; /* Ensure bullet points are visible */
    margin-left: 1.5rem;
    padding-top: .5rem;
}

.education-content .content ul li {
    font-size: 1.8rem; /* Increased font size for list items */
    margin-bottom: .5rem;
}

.certifications {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    min-height: auto;
    padding-bottom: 5rem;
    background: var(--second-bg-color);
}

.cert-content {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2.5rem;
    width: 100%;
    max-width: 1000px;
    padding: 0 9%;
    margin: 0 auto;
}

.cert-project {
    position: relative;
}

.cert-inner {
    position: relative;
    background: var(--bg-color);
    border: .2rem solid var(--main-color);
    border-radius: .8rem;
    padding: 1rem;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}

.cert-inner:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 171, 240, 0.15);
}

.cert-inner img.cert-img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 0.4rem;
    cursor: pointer;
    min-height: 280px;
    object-fit: cover;
}

.cert-inner p {
    margin: 1rem 0 0;
    font-size: 1.4rem;
    color: var(--text-color);
    text-align: center;
}

.cert-project-bottom-spacer {
    grid-column: 1 / -1;
    height: 1rem;
}

/* Cert image modal */
.cert-modal .cert-modal-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    background: transparent;
    padding: 0;
    box-shadow: none;
}

.cert-modal .cert-modal-content img {
    max-width: 90vw;
    max-height: 90vh;
    width: auto;
    height: auto;
    display: block;
    border-radius: 0.8rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.cert-modal .cert-modal-close {
    position: absolute;
    top: -4rem;
    right: 0;
    color: #fff;
    font-size: 3.5rem;
    cursor: pointer;
    z-index: 10;
}

.cert-modal .cert-modal-close:hover {
    color: var(--main-color);
}

@media (max-width: 768px) {
    .cert-content {
        grid-template-columns: 1fr;
    }
}


.skills {
    min-height: auto;
    padding-bottom: 7rem;
    background: var(--second-bg-color);
}

.skills h2 {
    display: inline-block;
    left: 50%;
    transform: translateX(-50%);
}

.skills-content-wrapper {
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 9%;
}

.skills-div {
    display: grid;
    grid-template-columns: 1fr;
    gap: 3rem;
}

.skills-category {
    border: .2rem solid var(--main-color);
    border-radius: .6rem;
    padding: 2rem 2.5rem;
    background: var(--bg-color);
    transition: box-shadow 0.2s;
}

.skills-category:hover {
    box-shadow: 0 4px 16px rgba(0, 171, 240, 0.2);
}

.skills-category strong {
    display: block;
    font-size: 1.875rem;
    color: var(--main-color);
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(0, 171, 240, 0.3);
    letter-spacing: 0.05em;
}

.skills-category p {
    font-size: 1.875rem;
    color: var(--text-color);
    line-height: 1.7;
    margin: 0;
}

.contact {
    min-height: auto;
    padding-bottom: 7rem;
}

.contact h2 {
    display: inline-block;
    left: 50%;
    transform: translateX(-50%);
}

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

.contact form .input-box {
    position: relative;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 2%; /* Add a gap between input fields */
}

.contact form .input-box .input-field {
    position: relative;
    width: 49%;
    margin: .8rem 0;
}

.contact form .input-box .input-field input,
.contact form .textarea-field textarea {
    width: 100%;
    height: 100%;
    padding: 1.5rem;
    font-size: 1.6rem;
    color: var(--text-color);
    background: transparent;
    border-radius: .6rem;
    border: .2rem solid var(--main-color);
}

.contact form .input-box .input-field input::placeholder,
.contact form .textarea-field textarea::placeholder {
    color: var(--text-color);
}

.contact form .focus {
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 100%;
    background: var(--second-bg-color);
    border-radius: .6rem;
    z-index: -1;
    transition: .5s;
}

.contact form .input-box .input-field input:focus~.focus,
.contact form .input-box .input-field input:valid~.focus,
.contact form .textarea-field textarea:focus~.focus,
.contact form .textarea-field textarea:valid~.focus {
    width: 100%;
}

/* No specific justify-content for nth-child(1) - rely on general .contact form .input-box styles */
.contact form .input-box:nth-child(1) .input-field {
    width: 49%; /* Ensure it's 49% as per original side-by-side layout */
}

.contact form .input-box:nth-child(2) {
    justify-content: center; /* Keep Email Subject centered */
}

.contact form .input-box:nth-child(2) .input-field {
    width: 100%; /* Keep Email Subject full width */
}

.contact form .textarea-field {
    position: relative;
    margin: .8rem 0 2.7rem;
    display: flex;
}

.contact form .textarea-field textarea {
    resize: none;
}

.contact form .btn-box.btns .btn {
    cursor: pointer;
}

.footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    padding: 2rem 9%;
    background: var(--second-bg-color);
    margin-top: auto;
}

.footer-text,
.footer-iconTop {
    position: relative;
}

.footer-text p {
    font-size: 1.6rem;
}

.footer-iconTop a {
    position: relative;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    padding: .8rem;
    background: var(--main-color);
    border: .2rem solid var(--main-color);
    border-radius: .6rem;
    z-index: 1;
    overflow: hidden;
}

.footer-iconTop a::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 100%;
    background: var(--second-bg-color);
    z-index: -1;
    transition: .5s;
}

.footer-iconTop a:hover::before {
    width: 100%;
}

.footer-iconTop a i {
    font-size: 2.4rem;
    color: var(--bg-color);
    transition: .5s;
}

.footer-iconTop a:hover i {
    color: var(--main-color);
}

::-moz-selection { /* Code for Firefox */
    color: var(--second-bg-color);
    background: var(--main-color);
  }
  
::selection {
    color: var(--second-bg-color);
    background: var(--main-color);
  }


@media (max-width: 1100px) and (min-width: 769px) {
    .home-content h1 {
        font-size: 4.2rem;
    }

    .home-imgHover {
        width: min(38vw, 400px);
    }
}

@media (max-height: 740px) and (min-width: 769px) {
    .home {
        padding-top: 8rem;
        padding-bottom: 6rem;
        gap: 2rem;
    }

    .home-imgHover {
        width: min(36vw, 400px);
        max-height: calc(100vh - 14rem);
    }

    .home-imgHover img.profile-img {
        max-height: calc(100vh - 14rem);
    }

    .home-content p {
        margin: 1.2rem 0 2rem;
    }
}

@media (max-width: 1200px) {
    html {
        font-size: 55%;
    }
}

@media (max-width: 991px) {
    .header {
        padding: 2rem 4%;
    }

    section {
        padding: 10rem 4% 2rem;
    }

    .home {
        padding: 10rem 4% 8rem;
        gap: 2.5rem;
    }

    .footer {
        padding: 2rem 4%;
    }
}

@media (max-width: 768px) {
    .header {
        background: var(--bg-color);
    }

    #menu-icon {
        display: block;
    }

    .navbar {
        position: absolute;
        top: 100%;
        left: -100%;
        width: 100%;
        padding: 1rem 4%;
        background: var(--main-color);
        box-shadow: 0 .5rem 1rem rgba(0, 0, 0, .2);
        z-index: 1;
        transition: .25s ease;
        transition-delay: .25s;
    }

    .navbar.active {
        left: 0;
        transition-delay: 0s;
    }

    .navbar .active-nav {
        position: absolute;
        top: 0;
        left: -100%;
        width: 100%;
        height: 100%;
        background: var(--bg-color);
        border-top: .1rem solid rgba(0, 0, 0, .2);
        z-index: -1;
        transition: .25s ease;
        transition-delay: 0s;
    }

    .navbar.active .active-nav {
        left: 0;
        transition-delay: .25s;
    }

    .navbar a {
        display: block;
        font-size: 2rem;
        margin: 3rem 0;
        transform: translateX(-20rem);
        transition: .25s ease;
        transition-delay: 0s;
    }

    .navbar.active a {
        transform: translateX(0);
        transition-delay: .25s;
    }

    /* Stack image above copy on tablets and phones */
    .home {
        flex-direction: column;
        justify-content: flex-start;
        align-items: center;
        padding-top: 12rem;
        padding-bottom: 4rem;
        gap: 2rem;
        overflow: visible;
    }

    .home-content {
        text-align: center;
        max-width: 100%;
    }

    .home-imgHover {
        width: min(72vw, 340px);
        max-height: 42vh;
        margin: 0 auto;
        pointer-events: auto;
        opacity: 1;
        background: transparent;
        order: -1;
    }

    .home-imgHover img.profile-img {
        max-height: 42vh;
        object-position: center top;
    }

    .home-sci {
        position: relative; /* Change to relative positioning */
        width: 100%; /* Make it take full width */
        max-width: 170px; /* Keep the max-width for larger small screens */
        margin: 2rem auto; /* Center the element */
        bottom: auto; /* Remove fixed bottom positioning */
    }
}

@media (max-width: 520px) {
    html {
        font-size: 50%;
    }

    .home-content h1 {
        display: flex;
        flex-direction: column;
    }

    .home-sci {
        width: 160px;
    }

    .home-sci a {
        width: 38px;
        height: 38px;
    }

    .home-imgHover {
        width: min(80vw, 280px);
        max-height: 36vh;
    }

    .home-imgHover img.profile-img {
        max-height: 36vh;
    }
}

@media (max-width: 462px) {
    .home-content h1 {
        font-size: 5.2rem;
    }

    .education {
        padding: 10rem 4% 5rem 5%;
    }

    .contact form .input-box .input-field {
        width: 100%;
    }

    .footer {
        flex-direction: column-reverse;
    }

    .footer p {
        margin-top: 2rem;
        text-align: center;
    }
}

@media (max-width: 371px) {
    .home {
        justify-content: center;
    }

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

    .home-content h1 {
        font-size: 5rem;
    }
}


.home strong {
    color: var(--main-color);
}