:root {
    --red: #DC143C;
    --white: #fff;
    --black: #000;
    --poppins: 'Poppins',sans-serif;
    --lobster: "Lobster", serif;
    --exo2: "Exo 2", serif;
}
*{
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    scroll-behavior: smooth;
}

/* for body all */
body{
    background-color: var(--black);
    color: var(--white);
}

/* ------- For Loading Animation ------------ */
.loader-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--black);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.loader {
    border: 5px solid #f3f3f3;
    border-top: 5px solid var(--red);
    border-radius: 50%;
    width: 60px;
    height: 60px;
    animation: spin 2s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

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

.content {
    display: none;
    /* Hide content initially */
}

/* -------------------------- Navbar ----------------------- */
        /* background-image: linear-gradient(#000000, #000000), */
        /* radial-gradient(circle at top left, #05FA3B, #EA00FF); */

header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    font-family: var(--poppins);
    margin: 0.5rem 0;
    padding: 20px 6%;
    background: var(--black);
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 2;
    border-bottom: 1px solid var(--red);
    padding-bottom: 25px;
    box-shadow: 0 2px 30px -7px var(--red);
    margin-top: 0;
}

.name {
    font-size: 2rem;
    font-family: var(--lobster);    
    text-decoration: none;
    font-weight: 600;
    cursor: pointer;
    letter-spacing: 1px;
}

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

nav a {
    font-size: 18px;
    color: var(--white);
    text-decoration: none;
    font-weight: 500;
    margin: 0 30px;
    transition: .3s;
}

nav a:hover,
nav a:focus { 
    color: var(--red);  /* DC143C  DD0004 */
    border: 2.5px solid transparent;
    border-radius: 25px;
    background-image: linear-gradient(#000000, #000000), radial-gradient(circle at top left, #05FA3B, #EA00FF);
    background-origin: border-box;
    background-clip: padding-box, border-box;
    padding: 8.5px 20px;
    font-weight: 600;
}

.hamburger {
    display: none;
    flex-direction: column;
    -webkit-box-pack: justify;
    justify-content: space-between;
    width: 35px;
    height: 20px;
    cursor: pointer;
}

.icon1, .icon2, .icon3 {
    height: 4px;
    width: 100%;
    background-color: var(--white);
    border-radius: 6px;
    transition: 0.5s;
}

.change .icon1 {
    transform: translate(0, 8px) rotate(-45deg);
}

.change .icon2 {
    opacity: 0;
}

.change .icon3 {
    transform: translate(0, -8px) rotate(45deg);
}


/* ---------------------------- Main Section ------------------------------ */

main {
    margin-top: 6rem;
    padding: 0 6%;
    font-family: var(--poppins);
}

h2 {
    text-align: center;
    font-size: 2rem;
    font-family: var(--exo2);
    margin: 2rem 0;
}

/* --------------- Hero Section -------------- */
section#hero-section {
    margin: 6.7rem -3.5%;
    margin-bottom: 3rem;
    min-height: 80vh;
    min-height: 80dvh;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    border-radius: 40px;
    box-shadow: inset 0px 0px 30px 3px var(--red);
    padding: 1rem 3.5%;
}

.hero {
    flex: 1;
}

.left h3 {
    font-size: 28px;
    font-weight: 600;
    margin: 7px 0;
}

.left h3 span {
    font-size: calc(1rem + 1vw);
    color: var(--red);
    white-space: nowrap;
    border-right: 3px solid var(--red);
    overflow: hidden;
    animation: blink-caret 0.6s step-end infinite;
    max-width: 90%;
    word-wrap: break-word;
}

@keyframes blink-caret {
    50% {
        border-color: var(--red);
    }
}

.left h1 {
    font-size: 40px;
    font-weight: 700;
    /* margin: 1rem 0; */
}

.left p {
    font-size: 16px;
    margin-bottom: 0.7rem;
}

.left h3:nth-of-type(2) {
    margin-bottom: 20px;
}

.social-icons img, .footer-icons img {
    height: 40px;
    width: 40px;
}

.social-icons {
    display: flex;
    align-items: center;
    margin: 2rem 0;
    gap: 1rem;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
}

.hero-buttons a {
    padding: 14px 28px;
    background: var(--red);
    font-size: 16px;
    border-radius: 40px;
    color: var(--white);
    letter-spacing: 1px;
    align-content: center;
    text-decoration: none;
    transition: box-shadow 0.3s;
}

.hero-buttons a:nth-child(2) {
    background: transparent;
    border: 2px solid var(--red);
    border-color: var(--red);
}

.hero-buttons a:hover {
    box-shadow: 0 0 10px var(--red);
}

/* Hero right */
lottie-player {
    object-fit: cover;
    object-position: center;
    height: 500px;
}

/* ------------ About Section -------------  */

/* #about-section h2 {
    text-align:  center;
    font-size: 2rem;
    font-family: var(--exo2);
} */

#about-section h2:nth-of-type(2) {
    margin: 2rem 0rem;
}

.about-content {
    display: flex;
    gap: 2rem;
}

.profile-img {
    width: 150px;
    padding: 1rem;
    background-color: var(--white);
    border-radius: 1.2rem;
}

.about-content p {
    letter-spacing: 1px;
    padding: 0.3rem;
    padding-top: 0;
}

.about-content span {
    font-size: 1.2rem;
    font-weight: 700;
    font-style: italic;
    letter-spacing: 2px;
}

/* Skills Section */

.tools-icons {
    margin: 3rem 0;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.tools-icons i {
    font-size: 60px;
    position: relative;
    margin-bottom: 1.5rem;
}

.tools-icons i:hover::after {
    content: attr(title);
    position: absolute;
    top: -35px;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--white);
    color: var(--black);
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 14px;
    font-family: var(--poppins);
    white-space: nowrap;
/* Add the triangle (pointer) effect */
    border-width: 5px;
    border-style: solid;
    border-color: transparent transparent var(--white) transparent;
    /* Pointing downwards */
    margin-top: -5px;
    /* Adjust position of the tooltip for the triangle */
}

/* --------- Experience & Education Section --------- */

/* Timeline */
.timeline-container {
    text-align: center;
}

.buttons {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 20px;
}

.filter-btn {
    padding: 10px 20px;
    font-size: 16px;
    border: 2px solid var(--red);
    background-color: transparent;
    color: var(--white);
    cursor: pointer;
    border-radius: 5px;
    transition: all 0.3s;
}

.filter-btn.active {
    background-color: var(--red);
    color: var(--white);
}

.filter-btn:hover {
    box-shadow: 0 0 10px var(--red);
}

.timeline {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px 0;
}

.timeline::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 5px;
    border-radius: 10px;
    background: var(--white);
    transform: translateX(-50%);
}

.timeline-item {
    position: relative;
    margin: 20px 0;
    display: none;
    /* Hidden by default */
}

.timeline-content {
    position: relative;
    text-align: left;
    border: 2px solid var(--red);
    border-radius: 5px;
    padding: 20px;
    /* box-shadow: 0 2px 8px var(--red); */
    transition: all 0.3s ease;
    background-color: var(--red);
    max-width: 300px;
}

.timeline-content h4, h5, p {
    margin-bottom: 10px;
}

.timeline-content h4 {
    font-size: 1.1rem;
}

.timeline-item.left .timeline-content {
    right: 165px;
}

.timeline-item.right .timeline-content {
    left: 175px;
}

.timeline-item::before {
    content: "";
    position: absolute;
    top: 10px;
    left: 50%;
    width: 20px;
    height: 20px;
    background: var(--red);
    border: 4px solid var(--white);
    border-radius: 50%;
    z-index: 1;
    transform: translateX(-50%);
}

/* -------- Projects Section --------- */

/* Carousel Item */
.carousel-main {
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

/* Carousel Container */
.carousel-container {
    position: relative;
    width: 80%;
    overflow: hidden;
    display: flex;
    justify-content: center;
}

/* Carousel Track */
.carousel-track {
    display: flex;
    width: 100%;
    transition: transform 0.5s ease-in-out;
    will-change: transform;
    touch-action: pan-y;
    /* Enable swipe gestures */
    gap: 1rem;
}

/* Carousel Item */
.carousel-item {
    min-width: 30%;
    /* Show 3 cards at a time */
    padding: 20px;
    box-sizing: border-box;
    text-align: center;
    border-radius: 5px;
    /*   margin: 0 10px; */
    user-select: none;
    transition: transform 0.3s;
}

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

/* Carousel Buttons */
.carousel-buttons {
    position: absolute;
    width: 80%;
    display: flex;
    justify-content: space-between;
    z-index: 1;
}

.carousel-button {
    color: var(--white);
    background-color: var(--black);
    border: none;
    font-size: 2rem;
    font-weight: bold;
    padding: 15px;
    cursor: pointer;
    border-radius: 50%;
    transition: background-color 0.3s, transform 0.3s;
}

.carousel-button:hover {
    background-color: var(--red);
}

/* ----- Carousel Card ------ */
.project-card-gpt {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.project-card-gpt:hover {
    transform: scale(1.05);
    box-shadow: 0px 0px 12px var(--red);
}

/* Card Image */
.card-image img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
}

/* Card Content */
.card-content {
    padding: 15px;
    text-align: left;
    border-bottom: 2px solid var(--red);
    border-left: 2px solid var(--red);
    border-right: 2px solid var(--red);
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
}

.card-title {
    color: var(--red);
    font-weight: bold;
    font-size: 1.2rem;
    margin-bottom: 10px;
}

.card-description {
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.card-tools {
    font-size: 0.8rem;
}

/* Hover Overlay */
.card-hover {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    opacity: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5rem;
    transition: opacity 0.3s ease;
}

.project-card-gpt:hover .card-hover {
    opacity: 1;
}

/* Links Inside Hover */
.card-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--white);
    font-size: 1rem;
    text-decoration: none;
    border: 2px solid var(--white);
    padding: 8px 16px;
    border-radius: 5px;
    transform: translateY(100%);
    transition: transform 0.3s ease, background 0.3s ease;
}

.card-hover-icon {
    width: 25px;
    height: 25px;
}

.card-link:hover {
    background: var(--red);
}

.project-card-gpt:hover .card-link {
    transform: translateY(0);
}


/* -------------- Contact Section ------------- */

.contact-form {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    font-family: var(--poppins);
}

.contact-form h2 {
    margin-bottom: 20px;
    text-align: center;
}

.contact-form form {
    display: grid;
    grid-template-columns: 2fr 2fr;
    gap: 1.5rem;
    width: 55%;
}

.contact-form form input,
.contact-form form textarea {
    padding: 14px;
    border: 2px solid var(--red);
    border-radius: 20px;
    background-color: var(--black);
    color: var(--white);
    box-shadow: 0 0 10px var(--red);
}

.contact-form form input:focus,
.contact-form form textarea:focus {
    border: 1px solid var(--black);
}

.contact-form form textarea {
    grid-column: span 2;
    resize: none;
    height: 100px;
}

.contact-form form .full-width {
    grid-column: span 2;
}

.contact-form form button {
    /* grid-column: span 2; */
    padding: 12px 2.5rem;
    background-color: var(--red);
    color: var(--white);
    border: none;
    border-radius: 18px;
    cursor: pointer;
    font-size: 16px;
    grid-column: 1 / span 2;
    justify-self: center;
}

.contact-form form button:hover {
    box-shadow: 0 0 10px var(--red);
}

/* Form Submission Alert */
.hidden {
    display: none;
}

.custom-alert {
    position: fixed;
    top: 12%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: #35c73a;
    color: var(--white);
    padding: 10px 20px;
    border-radius: 4px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    font-size: 16px;
    z-index: 1000;
    transition: ease-in-out .3s;
}

/* ---------------------------- Main Section - End ------------------------------ */

/* ---------------------------- Footer Section ------------------------------ */

hr {
    margin: 3rem 0;
    border: none;
    border-bottom: 1px solid var(--red);
    box-shadow: 0 -7px 22px 2px var(--red);
}

footer {
    padding: 0 6%;
    font-family: var(--poppins);
    text-align: center;
    margin-bottom: 1rem;
}

.footer-contents {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.footer-icons {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.scroll-top svg {
    border: 2px solid var(--red);
    border-radius: 50%;
}

.scroll-top svg circle {
    transition: fill 0.3s ease;
}

.scroll-top svg circle:hover {
    fill: var(--red);
}

footer span {
    text-align: center;
}

.footer-link-git {
    text-decoration: none;
    color: var(--white);
}


/* ---------------------------- Footer Section - End ------------------------------ */


/* --------------------- Media Queries ----------------------------- */

@media (max-width:992px) {
    /* Navigation bar */
    nav a {
        margin:  0 14px;
    }
    .name {
        font-size: 20px;
    }
    /* Project Carousel */
    .carousel-track {
        gap: 0;
    }
}

@media (max-width: 768px) {
    nav {
        transform: translateX(100%);
        transition: transform ease .5s;
        display: block;
        background-color: rgba(0, 0, 0, 0.9);
        width: 100%;
        min-height: 100vh;
        min-height: 100dvh;
        position: absolute;
        left: 0;
        right: 0;
        top: 80px;
    }

    .hamburger {
        display: flex;
    }

    .is-active {
        transform: translateX(0%);
    }

    nav a {
        display: block;
        text-align: center;
        padding: 15px 0;
        margin: 2rem;
        box-shadow: 0 10px 10px -9px var(--red);
        letter-spacing: 1px;
        align-items: center;
    }

    .navbar .nav-item:hover,
    .navbar .nav-item:focus {
        border: none;
        background: none;
        padding: 12px 20px;
        border-radius: 25px;
        box-shadow: 0 0px 10px 1px var(--red);
    }

    /* ---- Hero section left and right ---- */
    section#hero-section {
        padding: 2.5rem;
    }
    .right {
        display: none;
    }

    /* ---- Experience section - Timeline ---- */
    .timeline {
        align-items: flex-start;
    }
    .timeline::before {
        left: 0;
        /* Align the timeline line to the left */
        transform: none;
    }
    .timeline-item::before {
        left: 2px;
        /* Align dots to the timeline line on the left */
        /*     transform: none; */
    }
    .timeline-content {
        margin-left: 30px;
        /* Space content to the right of the timeline line */
    }
    .timeline-item.left .timeline-content,
    .timeline-item.right .timeline-content {
        left: auto;
        right: auto;
    }
    
    /* ----------- Projects Carousel ---------- */
    .carousel-buttons {
        display: none;
    }
    .carousel-container {
        width: auto;
        overflow-x: auto;
        overflow-y: hidden;
        justify-content: flex-start;
        -webkit-overflow-scrolling: touch;  /* Smooth scrolling on iOS */
        /* scrollbar-width: none;  Hide scrollbar for Firefox */
    }
    .carousel-track {
        touch-action: pan-x;
        scroll-snap-type: x mandatory;  /* Ensure smooth snapping of items */
    }
    .carousel-item {
        min-width: 90%;
        scroll-snap-align: start;   /* Align items to start of track when scrolled */
    }

    /* Card */
    .card-content {
        border: none;
        border-left: 2px solid var(--red);
        border-right: 2px solid var(--red);
        border-radius: 0;
    }
    .card-hover {
        opacity: 1;
        position: relative;
        justify-content: flex-start;
        padding-bottom: 1rem;
        gap: 1rem;
        border-bottom: 2px solid var(--red);
        border-left: 2px solid var(--red);
        border-right: 2px solid var(--red);
        border-bottom-left-radius: 8px;
        border-bottom-right-radius: 8px;
    }

    .card-link {
        transform: translateY(0);
        width: 90%;
        border: 1px solid var(--red);
        box-shadow: 0 0 10px var(--red);
        border-radius: 1rem;
    }

    /* ---- Contact Section --- */
    .contact-form form {
        grid-template-columns: 1fr;
    }
    .contact-form form input,
    .contact-form form textarea,
    .contact-form form button {
        grid-column: span 2;
    }
    .contact-form form button {
        justify-self: auto;
    }
}

@media (max-width: 600px) {
    h2 {
        font-size: 1.8rem;
    }

    /* Hero responsive */
    section#hero-section {
        justify-content: center;
        margin-top: 4.5rem;
        border-radius: 1.9rem;
    }
    .left h3 {
        font-size: 1.5rem;
    }
    .left h1 {
        font-size: 2rem;
    }
    .left h3 span {
        overflow: -moz-hidden-unscrollable;
    }
    .social-icons {
        margin: 1.5rem;
    }
    .social-icons img {
        width: 35px;
        height: 35px;
    }
    .hero-buttons {
        gap: 0.5rem;
    }
    .hero-buttons a {
        padding: 12px 17px;
        letter-spacing: normal;
    }

    /* About responsive */
    .about-content {
        flex-wrap: wrap;
        gap: 1.5rem;
        justify-content: center;
    }

    /* Carousel */
    .carousel-main {
        padding: 0;
    }
    
    /* Contact Section */
    .contact-form form {
        width: 75%;
    }
    .custom-alert {
        width: 70%;
        text-align: center;
    }

    /* --- Footer --- */
    .footer-contents {
        flex-direction: column;
    }
}