@import url('https://fonts.googleapis.com/css2?family=Nata+Sans:wght@100..900&display=swap ');

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

:root {
    --background: rgb(24, 24, 24);
    --second-background: rgb(21, 21, 21);
    --form-bg: rgba(30, 30, 30, 0.6);
    --input-border: rgba(255, 255, 255, 0.2);
    --input-focus: #07aeea;
    --text-gradient: linear-gradient(to right, #07aeea, #2bf598);
}

/* Keyframe animations */
@keyframes slideInFromLeft {
    0% {
        transform: translateX(-100%);
        opacity: 0;
    }

    100% {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideInFromRight {
    0% {
        transform: translateX(100%);
        opacity: 0;
    }

    100% {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ADD: Global fix for any potential overflow */
html,
body {
    max-width: 100vw;
    overflow-x: hidden;
    /* Prevent horizontal scrolling */
}

/* Base styles */
body {
    min-height: 100vh;
    background-color: var(--background);
    overflow-x: hidden;
    font-family: "Nata Sans", sans-serif;
}

/* Navigation */
nav {
    position: fixed;
    top: 0;
    width: 100%;
    max-width: 100vw;
    /* ADD: Prevent overflow */
    height: 60px;
    padding: 2em 10%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: rgba(15, 15, 15, 0.8);
    backdrop-filter: blur(10px);
    z-index: 1000;
}

.logo {
    color: white;
    text-decoration: none;
    font-size: 2rem;
    font-weight: 800;
    background-image: var(--text-gradient);
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Hamburger Menu Icon */
.menu-icon {
    display: none;
    flex-direction: column;
    cursor: pointer;
    padding: 8px;
    z-index: 1001;
    margin-left: auto;
    /* ADD: Force icon to stay within container */
}

.menu-icon span {
    width: 25px;
    height: 3px;
    background: white;
    margin: 3px 0;
    transition: 0.3s ease;
    border-radius: 2px;
}

/* Navigation Menu */
nav ul {
    display: flex;
    align-items: center;
    gap: 2em;
    flex-wrap: wrap;
    list-style: none;
    padding: 0;
}

nav ul li {
    display: inline-block;
}

nav ul a {
    color: white;
    opacity: 0.7;
    transition: 0.2s ease-in-out;
    text-decoration: none;
    font-size: 1.5rem;
}

nav ul a:hover {
    opacity: 1;
    border: 1px solid white;
    padding: 10px;
    border-radius: 5px;
    background: whitesmoke;
    color: black;
}

section {
    padding: 2em 10%;
}

#home {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 2em;
    color: white;
}

#home img {
    width: 25vw;
    border-radius: 50%;
    margin-top: 5.5em;
    filter: drop-shadow(0 0 1rem rgba(250, 255, 255, 1));
    transition: filter 0.3s ease-in-out;
}

.slide-in-left {
    animation: slideInFromLeft 3s ease-out forwards;
}


.info-box {
    display: flex;
    flex-direction: column;
    text-align: center;
    gap: 0.5em;
    max-width: 600px;
    animation: slideInFromRight 2s ease-out forwards;
}

.info-box h1 {
    font-size: 3rem;
    font-weight: 500;
}

.info-box h1 span {
    background-image: linear-gradient(to right, #07aeea, #2bf598);
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.info-box h3 {
    font-size: 1.5rem;
    font-weight: 500;
    margin-top: 15px;
}

.info-box p {
    font-size: 20px;
    margin-top: 15px;
    word-spacing: 2px;
}

.btn-box {
    margin-top: 15px;
    animation: slideInFromLeft 3s ease-out forwards;
}

.btn-box a {
    text-decoration: none;
    border: 1px solid white;
    padding: 10px 30px;
    border-radius: 5px;
    background: whitesmoke;
    color: black;
    animation: slideInFromLeft 3s ease-out forwards;
    animation-delay: 0.5s;
    opacity: 0;
    animation-fill-mode: forwards;
}

.btn-box a:hover {
    border: 1px solid white;
    background: transparent;
    color: white;
}

.abt-box h2 span {
    font-weight: bold;
    font-size: 30px;
    margin-bottom: 20px;
    color: white;
    text-align: center;
    background-image: linear-gradient(to right, #07aeea, #2bf598);
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.first-flex {
    width: 100%;
    display: flex;
    gap: 150px;
    margin-top: 50px;
    justify-content: center;
    flex-wrap: wrap;
}

.skillsdiv {
    min-width: 250px;
    min-height: 250px;
    padding-bottom: 20px 20px;
    margin-bottom: 10px;
}

.skillsdiv h2 {
    font-weight: bold;
    font-size: 50px;
    margin-bottom: 20px;
    color: white;
    text-align: center;
    background-image: linear-gradient(to right, #07aeea, #2bf598);
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.skills {
    display: flex;
    text-align: left;
    gap: 15em;
}

.skills ul {
    font-size: 1.3em;
    font-weight: 500;
    display: flex;
    flex-direction: column;
    color: white;
    opacity: 0.8;
    align-items: baseline;
    list-style: none;
}

.skills ul li {
    margin-bottom: 20px;
}

.skills ul li span {
    display: flex;
    align-items: center;
    gap: 0.5em;
    font-size: 1.1em;
    transition: 0.3s ease-in-out;

}

.skills ul li span:hover {
    transform: translateX(10px);
}

.skills ul li i {
    font-size: 1.2em;
}

#projects {
    background-color: var(--second-background);
    color: white;
    text-align: center;
    padding-bottom: 70px;
}

#projects h2 {
    font-weight: bold;
    font-size: 50px;
    margin-bottom: 50px;
    color: white;
    text-align: center;
    background-image: linear-gradient(to right, #07aeea, #2bf598);
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.project-container {
    display: flex;
    flex-wrap: wrap;
    gap: 50px;
    justify-content: center;
}

.project-card-link {
    text-decoration: none;
    color: white;
}

.project-card {
    background-color: var(--second-background);
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
    width: 450px;
    max-width: 100%;
    /* ADD: Ensure cards don't overflow */
    height: 400px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.project-card-link:hover .project-card {
    transform: translateY(-10px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.4);
}

.card-image-box {
    flex-basis: 70%;
    overflow: hidden;
}

.project-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
}

.card-info-box {
    flex-basis: 30%;
    /* Info box takes up 30% of the card height */
    padding: 1.5em;
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: center;
}

.card-info-box h3 {
    font-size: 1.5rem;
    margin-bottom: 0.2em;
    background-image: linear-gradient(#2bf598);
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.card-info-box p {
    font-size: 1rem;
    opacity: 0.8;
}

#main-footer {
    background-color: var(--background);
    color: white;
    text-align: center;
    padding: 2em 10%;
}

#main-footer h2 {
    font-weight: bold;
    font-size: 50px;
    margin-bottom: 30px;
    color: white;
    text-align: center;
    background-image: linear-gradient(to right, #07aeea, #2bf598);
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

#contact {
    padding-bottom: 2em;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 1em;
    margin-top: 1em;
}

.contact-info p {
    text-decoration: none;
    color: white;
    font-size: 1.5rem;
}

.contact-info i {
    font-size: 1.5rem;
    background-image: linear-gradient(#2bf598);
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.contact-info p a {
    text-decoration: none;
    color: #f2f2f2;
}

/* Contact Form Styles */
.contact-form {
    max-width: 600px;
    margin: 2em auto;
    padding: 2em;
    background: var(--form-bg);
    border-radius: 10px;
    backdrop-filter: blur(10px);
}

.form-group {
    margin-bottom: 1.5em;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    background: var(--second-background);
    border: 1px solid var(--input-border);
    border-radius: 5px;
    color: white;
    font-family: inherit;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--input-focus);
    box-shadow: 0 0 0 2px rgba(7, 174, 234, 0.2);
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

.submit-btn {
    width: 100%;
    padding: 12px;
    background: #2bf597c0;
    border: none;
    border-radius: 5px;
    color: white;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    font-family: "Nata Sans", sans-serif;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(43, 245, 152, 0.3);
}


.social-icons-container {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 1.5em;
}

.social-link {
    text-decoration: none;
    color: white;
    transition: transform 0.3s ease, color 0.3s ease;
}

.social-link i {
    font-size: 2.5rem;
    color: white;
    background-image: linear-gradient(#2bf598);
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.social-link:hover {
    transform: translateY(-5px);
}

::-webkit-scrollbar {
    width: 10px;
    background-color: var(--background);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(to bottom, #6cff52, #3ec5ff);
}


/* Overlay when menu is open */
body.menu-open::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 998;
    backdrop-filter: blur(5px);
}

/* Popup Modal Styles */
.popup-modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
}

.popup-modal.show {
    display: flex;
    justify-content: center;
    align-items: center;
}

.popup-content {
    background: var(--second-background);
    padding: 2em;
    border-radius: 10px;
    text-align: center;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    position: relative;
}

.popup-close {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 2rem;
    cursor: pointer;
    color: white;
    opacity: 0.7;
    transition: opacity 0.3s;
}

.popup-close:hover {
    opacity: 1;
}

.popup-icon {
    font-size: 3rem;
    margin-bottom: 0.5em;
}

.popup-icon.success {
    background-image: var(--text-gradient);
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.popup-icon.error {
    color: #ff4444;
}

.popup-title {
    font-size: 1.5rem;
    margin-bottom: 0.5em;
    background-image: var(--text-gradient);
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.popup-message {
    font-size: 1rem;
    opacity: 0.8;
    color: white;
}

/* MEDIA QUERIES */
@media (max-width: 768px) {

    /* Show hamburger */
    .menu-icon {
        display: flex;
    }

    /* Hide and position mobile menu */
    nav ul {
        position: fixed;
        top: 0;
        right: -100%;
        width: 75%;
        height: 100vh;
        background: var(--background);
        flex-direction: column;
        justify-content: flex-start;
        padding-top: 100px;
        gap: 3em;
        transition: right 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.1);
        z-index: 999;
        margin: 0;
        backdrop-filter: blur(10px);
    }

    nav ul.show-menu {
        right: 0;
    }

    /* 1. Hamburger animation to X */
    .menu-icon.active span:nth-child(1) {
        transform: rotate(45deg) translate(8px, 8px);
    }

    .menu-icon.active span:nth-child(2) {
        opacity: 0;
    }

    .menu-icon.active span:nth-child(3) {
        transform: rotate(-45deg) translate(8px, -8px);
    }

    /* 2. Show menu when active */
    nav ul.show-menu {
        right: 0;
    }

    /* Prevent body scroll when menu open */
    body.menu-open {
        overflow: hidden;
    }

    /* Make nav links stack vertically */
    nav ul li {
        display: block;
        width: 100%;
        text-align: center;
    }

    /* Mobile nav links */
    nav ul li {
        display: block;
        width: 100%;
        text-align: center;
    }

    nav ul a {
        display: block;
        padding: 1em 0;
        font-size: 1.8rem;
    }

    /* Mobile content spacing */
    section {
        padding: 1.5em 5%;
    }

    #home {
        min-height: auto;
        padding-top: 80px;
        padding-bottom: 60px;
    }

    #home img {
        width: 50vw;
        margin-top: 0;
    }

    .info-box h1 {
        font-size: 2rem;
    }

    .info-box h3 {
        font-size: 1.2rem;
    }

    .info-box p {
        font-size: 16px;
    }

    /* Skills section mobile */
    #skills {
        padding: 3em 5%;
    }

    .first-flex {
        flex-direction: column;
        gap: 20px;
        margin-top: 20px;
    }

    .skillsdiv h2 {
        font-size: 40px;
    }

    .skills {
        flex-direction: column;
        gap: 1em;
        align-items: center;
    }

    .skills ul {
        font-size: 1.1em;
    }

    /* Projects mobile */
    #projects {
        padding: 3em 5%;
    }

    #projects h2 {
        font-size: 40px;
        margin-bottom: 30px;
    }

    .project-container {
        gap: 30px;
    }

    .project-card {
        width: 100%;
        height: auto;
        max-width: 350px;
    }

    /* Contact mobile */
    #contact {
        padding: 3em 5%;
    }

    #contact h2 {
        font-size: 40px;
    }

    .contact-form {
        padding: 1.5em;
        margin: 1.5em auto;
    }

    .contact-info p {
        font-size: 1.2rem;
    }

    .social-link i {
        font-size: 2rem;
    }

    /* Footer mobile */
    #main-footer {
        padding: 2em 5%;
    }

    #main-footer h2 {
        font-size: 40px;
    }
}

@media (max-width: 480px) {

    nav {
        padding: 1em 3%;
    }

    /* ADD: Ensure icon stays properly positioned */
    .menu-icon {
        padding: 4px;
        margin-right: 0;
    }

    /* Extra small screen adjustments */
    .logo {
        font-size: 1.3rem;
    }

    #home img {
        width: 60vw;
    }

    .info-box h1 {
        font-size: 1.5rem;
    }

    .info-box h3 {
        font-size: 1rem;
    }

    .btn-box a {
        padding: 8px 20px;
        font-size: 0.9rem;
    }

    .skillsdiv h2 {
        font-size: 32px;
    }

    #projects h2 {
        font-size: 32px;
    }

    .project-card {
        max-width: 100%;
    }

    #contact h2 {
        font-size: 32px;
    }

    .submit-btn {
        font-size: 1rem;
        padding: 10px;
    }

    .contact-info p {
        font-size: 1rem;
    }

    .social-link i {
        font-size: 1.8rem;
    }
}

/* --- FORM SUBMIT BUTTON LOADING STYLES --- */

.btn-text {
    display: inline-block;
    transition: opacity 0.3s ease;
}

.btn-loader {
    display: none;
    font-size: 1.2rem;
}

.btn-loader i {
    animation: spin 1s linear infinite;
}

/* Hidden state for loading elements */
.btn-text.hidden {
    display: none !important;
}

.btn-loader.hidden {
    display: none !important;
}

/* Loading state for button */
.submit-btn.loading .btn-text {
    display: none;
}

.submit-btn.loading .btn-loader {
    display: inline-block;
}

/* Add spinner animation */
@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Ensure button text is white during loading */
.submit-btn.loading {
    color: white;
}