:root {
    /* Light Theme Colors */
    --background-color: #ffffff;
    --text-color: #000000;
    --primary-color: #1b6099;
    --secondary-color: #7be5ec;
    --card-background: #f9f9f9;
    --card-shadow: rgba(0, 0, 0, 0.1);
    --footer-background: rgb(154, 127, 127);
    --footer-text: #ffff;
    --contact-background: black;
    --contact-text: white;
    --input-background: rgb(75, 73, 73);
}

[data-theme="dark"] {
    /* Dark Theme Colors */
    --background-color: #121212;
    --text-color: #ffffff;
    --primary-color: #7be5ec;
    --secondary-color: #1b6099;
    --card-background: #1e1e1e;
    --card-shadow: rgba(255, 255, 255, 0.1);
    --footer-background: #333333;
    --footer-text: #ffffff;
    --contact-background: #1e1e1e;
    --contact-text: #ffffff;
    --input-background: #333333;
}

/* General Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: sans-serif;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--background-color);
    color: var(--text-color);
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Fix scrolling offset issue */
section,
div[id] {
    scroll-margin-top: 80px;
}

/* Header Section */
.header {
    width: 100%;
    min-height: 550px;
    background: linear-gradient(120deg, var(--primary-color), var(--secondary-color));
    padding-top: 80px;
    padding-bottom: 50px;
}

/* Navigation Bar */
nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 50px;
    background: linear-gradient(120deg, var(--primary-color), var(--secondary-color));
    z-index: 1000;
}

nav h2 {
    color: var(--text-color);
    font-size: 24px;
}

nav ul {
    display: flex;
    align-items: center;
    list-style: none;
    margin-left: auto;
}

nav ul li {
    margin: 0 20px;
}

nav ul li a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 550;
    font-size: 16px;
    position: relative;
}

nav ul li a::after {
    content: "";
    width: 0;
    height: 2px;
    position: absolute;
    background: var(--text-color);
    bottom: -5px;
    left: 0;
    transition: 0.5s;
}

nav ul li a:hover::after {
    width: 100%;
}

/* Theme Toggle Button */
.theme-toggle {
    cursor: pointer;
    margin-left: 20px;
}

.theme-toggle i {
    font-size: 24px;
    color: var(--text-color);
}

/* Navbar Icons (Hidden for Desktop) */
nav .fa-solid {
    display: none;
    color: var(--text-color);
    font-size: 24px;
    cursor: pointer;
}

/* Sidebar Menu Styling */
#sidemenu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    margin-left: 500px;
}

#openmenu,
#closemenu {
    display: none;
    font-size: 24px;
    cursor: pointer;
}

/* Mobile View Styling */
@media (max-width: 768px) {
    nav ul {
        display: none;
        flex-direction: column;
        position: fixed;
        top: 0;
        right: -250px;
        width: 250px;
        height: 100vh;
        background: linear-gradient(120deg, var(--primary-color), var(--secondary-color));
        padding-top: 60px;
        transition: right 0.3s ease;
    }

    nav ul.active {
        right: 0;
    }

    #openmenu,
    #closemenu {
        display: block;
    }

    #closemenu {
        position: absolute;
        top: 20px;
        right: 20px;
    }
}

/* Adjusting padding for other content */
.intro,
#about,
#experience,
.skills,
#portfolio,
#contact {
    padding-top: 80px;
}

/* Intro Section */
.intro {
    width: 90%;
    max-width: 1200px;
    background: var(--card-background);
    padding: 0px;
    margin: 0 auto;
    border-radius: 6px;
    color: var(--text-color);
    font-size: 16px;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    box-shadow: 0 5px 10px var(--card-shadow);
}


/* For colored letters */
.highlight-orange {
    color: orange;
    font-weight: bold;
}

.highlight-blue {
    color: #00bfff;
    font-weight: bold;
}

#typed-text {
    font-weight: 5000;
    border-right: 2px solid orange;
    white-space: nowrap;
    overflow: hidden;
    /* color: white; */
}

.intro .image {
    flex: 1;
    min-width: 300px;
    margin: 20px;
    text-align: center;
}

.intro .image img {
    width: 70%;
    max-width: 400px;
    height: auto;
    border-radius: 160px;
    margin-top: 40px;
    margin-right: 30px;
    /* animation: floating 2.5s ease-in-out infinite; */
}

/* Floating animation */
@keyframes floating {
    0% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }

    100% {
        transform: translateY(0);
    }
}


.header-text {
    flex: 2;
    min-width: 300px;
    margin: 20px;
}

.header-text h1 {
    font-size: 40px;
    margin-top: 15px;
    padding: 10px 0px;
}

.header-text span {
    color: orange;
}

.personal-info {
    margin: 40px 0;
}

.personal-info li {
    list-style: none;
    font-size: 16px;
    margin: 12px 0;
}

.personal-info li i {
    color: orange;
    margin-right: 10px;
}

/* Button Styles - UPDATED */
/* Download CV Button */
.header-text .btn {
    margin: 20px 0;
    display: inline-block;
    animation: floating 2.5s ease-in-out infinite;
}

/* See More Button */
#portfolio .btn {
    margin: 40px auto 20px;
    display: flex;
    justify-content: center;
}

/* Hire Me Button */
.contact-left .btn {
    margin: 25px 0;
    display: inline-block;
    animation: floating 2.5s ease-in-out infinite;
}

/* Common Button Style */
.btn a {
    display: inline-block;
    position: relative;
    padding: 15px 40px;
    color: white;
    font-size: 18px;
    font-weight: bold;
    text-decoration: none;
    border-radius: 32px;
    border: 2px solid skyblue;
    background: linear-gradient(120deg, #ff00cc, #3333ff);
    box-shadow: 0 0 15px #ff00cc, 0 0 30px #3333ff;
    z-index: 1;
    transition: transform 0.3s ease;
}

/* Glowing outer effect */
.btn a::before {
    content: "";
    position: absolute;
    top: -3px;
    left: -3px;
    right: -3px;
    bottom: -3px;
    background: linear-gradient(45deg, #FF0000, #FF7300, #FFFB00, #48FF00, #00FFD5, #002BFF, #FF00C8, #FF0000);
    background-size: 600%;
    filter: blur(8px);
    z-index: -1;
    border-radius: 14px;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
    animation: glowing 20s linear infinite;
}

.btn a:hover::before {
    opacity: 1;
}

.btn a:hover {
    transform: scale(1.05);
}

/* Click active effect */
.btn a:active {
    color: #000;
    font-weight: bold;
}

/* Keyframes for glowing effect */
@keyframes glowing {
    0% {
        background-position: 0 0;
    }

    50% {
        background-position: 400% 0;
    }

    100% {
        background-position: 0 0;
    }
}

/* About Section */
#about {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: var(--card-background);
    padding: 50px 20px;
}

.row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    max-width: 1100px;
    width: 100%;
}

.about-col-1 {
    flex: 1;
    min-width: 300px;
    padding: 20px;
}

.about-col-1 h1 {
    font-size: 32px;
    font-weight: bold;
    color: var(--text-color);
    margin-bottom: 15px;
}

.about-col-1 p {
    font-size: 18px;
    color: var(--text-color);
    line-height: 1.6;
}

.about-col-2 {
    flex: 1;
    min-width: 300px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.image-container {
    width: 100%;
    max-width: 400px;
    overflow: hidden;
}

.animated-image {
    width: 100%;
    border-radius: 10px;
    box-shadow: 0 4px 10px var(--card-shadow);
    transition: transform 0.5s ease-in-out;
}

.animated-image:hover {
    transform: scale(1.1);
}

/* Experience Section */
#experience {
    padding: 40px 20px;
    width: 100%;
    text-align: center;
    background: linear-gradient(120deg, var(--primary-color), var(--secondary-color));
}

#experience .tab-title button {
    background: var(--card-background);
    color: var(--text-color);
    padding: 10px 20px;
    border-radius: 10px;
    border: 0;
    outline: none;
    cursor: pointer;
    font-weight: 550;
    font-size: 15px;
    margin-left: 12px;
}

#experience .tab-content ul li {
    list-style: none;
    margin: 30px 0;
}

#experience .tab-content ul li span {
    color: var(--text-color);
    font-weight: 700;
    font-size: 18px;
    margin-bottom: 20px;
}



/* Skills Section */
.skills {
    padding: 80px 20px;
    background: var(--card-background);
    text-align: center;
    overflow: hidden;
    position: relative;
}

.marquee-container {
    width: 100%;
    overflow: hidden;
    position: relative;
    padding: 40px 0;
}

.marquee {
    display: flex;
    width: max-content;
    animation: marquee linear infinite;
    will-change: transform;
    gap: 10px;
    /* Reduced gap between cards */
}

.skill-card {
    min-width: 150px;
    height: 180px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(5px);
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    transition: all 0.4s ease;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.3);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin: 0 5px;
    /* Reduced margin */
}

.skill-icon {
    font-size: 50px;
    margin-bottom: 15px;
    color: var(--primary-color);
    transition: transform 0.3s ease;
}

.skill-card h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-color);
    margin: 0;
}

.skill-card:hover {
    transform: translateY(-10px) scale(1.05);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2);
    background: rgba(255, 255, 255, 0.15);
}

.skill-card:hover .skill-icon {
    transform: scale(1.2);
    color: var(--secondary-color);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .skill-card {
        min-width: 120px;
        height: 150px;
        padding: 15px;
        margin: 0 5px;
    }

    .skill-icon {
        font-size: 40px;
    }

    .skill-card h3 {
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .skills {
        padding: 40px 10px;
        overflow: hidden;
    }
    
    .marquee-container {
        padding: 20px 0;
        width: 100vw;
        margin-left: -10px;
    }
    
    .marquee {
        gap: 5px;
    }
    
    .skill-card {
        min-width: 100px;
        height: 130px;
        padding: 15px;
        margin: 0;
    }
    
    .skill-icon {
        font-size: 30px;
        margin-bottom: 10px;
    }
    
    .skill-card h3 {
        font-size: 14px;
    }
    
    @keyframes marquee {
        0% {
            transform: translateX(100%);
        }
        100% {
            transform: translateX(calc(-100% - 5px));
        }
    }
}



/* Portfolio Section */
#portfolio {
    width: 90%;
    max-width: 1200px;
    padding: 50px 0;
    text-align: center;
    margin: 0 auto;
}

.subtitle {
    font-size: 2em;
    font-weight: bold;
    margin-bottom: 20px;
    color: var(--text-color);
}

.work-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-top: 50px;
}

.work {
    position: relative;
    border-radius: 5px;
    overflow: hidden;
    box-shadow: 0px 4px 10px var(--card-shadow);
    transition: transform 0.3s ease-in-out;
}

.work:hover {
    transform: scale(1.05);
}

.work img {
    width: 100%;
    height: auto;
    display: block;
    height: 190px;
}

.layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(120deg, rgba(27, 96, 153, 0.9), rgba(123, 229, 236, 0.9));
    border-radius: 5px;
    opacity: 0;
    visibility: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    padding: 20px;
    text-align: center;
    color: #ffffff;
    transition: opacity 0.5s ease-in-out, visibility 0.5s ease-in-out;
}

.work:hover .layer {
    opacity: 1;
    visibility: visible;
}

.layer h2 {
    margin-bottom: 10px;
    font-size: 18px;
}

.layer p {
    margin-bottom: 15px;
    font-size: 14px;
    line-height: 1.5;
}

.layer a {
    background: #ffffff;
    height: 40px;
    width: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: background 0.3s ease-in-out;
}

.layer a i {
    color: #d37e0f;
    font-size: 16px;
}

.layer a:hover {
    background: #d37e0f;
}

.layer a:hover i {
    color: #ffffff;
}

.btn2 {
    margin-top: 30px;
    display: flex;
    justify-content: center;
}

.btn a {
    text-decoration: none;
    background: linear-gradient(120deg, #ff00cc, #3333ff);
    color: white;
    padding: 12px 25px;
    border-radius: 32px;
    font-weight: bold;
    transition: background 0.3s ease-in-out;
}

.btn a:hover {
    background: linear-gradient(120deg, #ff00cc, #3333ff);
}

/* Certificate Section */
#certificates {
    padding: 50px 0;
    background: var(--card-background);
    text-align: center;
}

.certificate-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.certificate {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0px 4px 10px var(--card-shadow);
    transition: transform 0.3s ease-in-out;
    height: 100%;
}

.certificate:hover {
    transform: scale(1.05);
    z-index: 1;
}

.certificate img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    display: block;
}

.certificate .layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(120deg, rgba(27, 96, 153, 0.9), rgba(123, 229, 236, 0.9));
    border-radius: 10px;
    opacity: 0;
    visibility: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    text-align: center;
    color: #ffffff;
    transition: opacity 0.5s ease-in-out, visibility 0.5s ease-in-out;
}

.certificate:hover .layer {
    opacity: 1;
    visibility: visible;
}

.certificate .layer h3 {
    font-size: 20px;
    margin-bottom: 10px;
}

.certificate .layer a {
    background: #ffcc00;
    color: #000000;
    padding: 10px 24px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: bold;
    transition: opacity 0.5s ease-in-out, visibility 0.5s ease-in-out;
    display: inline-block;
    margin-top: 10px;
    border: 2px solid #ffcc00;
    font-size: 16px;
    text-align: center;
    width: 180px;
}

.certificate .layer a:hover {
    background: #000000;
    color: #ffcc00;
    border-color: #000000;
}

/* Responsive Design for Certificates */
@media (max-width: 768px) {
    .certificate-list {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .certificate-list {
        grid-template-columns: 1fr;
    }
}

/* Contact Section */
#contact {
    background: var(--contact-background);
    color: var(--contact-text);
    padding: 50px 20px;
    text-align: center;
    margin: 0 auto;
}

#contact .container {
    max-width: 1100px;
    margin: auto;
}

#contact .row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    width: 100%;
}

.contact-left {
    flex: 1;
    min-width: 300px;
    padding: 20px;
    text-align: left;
}

.contact-left .btn {
    margin: auto 0;
    display: inline-block;
    align-items: center;
    animation: floating 2.5s ease-in-out infinite;
}

.contact-left p {
    margin: 10px 0;
}

.contact-left p i {
    font-size: 20px;
    color: rgb(214, 114, 21);
    margin-right: 12px;
}

.social-icons {
    margin-top: 10px;
    margin: 30px 10px;
}

.social-icons i {
    font-size: 30px;
    color: skyblue;
    margin: 0 5px;
    margin-bottom: 30px;
}

.contact-right {
    flex: 1;
    min-width: 300px;
    padding: 20px;
}

.contact-right form {
    width: 100%;
}

form input,
form textarea,
form button {
    width: 100%;
    margin: 12px 0;
    padding: 14px 6px;
    background: var(--input-background);
    border: 0;
    outline: none;
    border-radius: 5px;
    color: var(--text-color);
    font-size: 16px;
}

form .btn2 {
    background: linear-gradient(120deg, var(--primary-color), var(--secondary-color));
    font-weight: 800;
    cursor: pointer;
}

/* Back-to-Top Button - UPDATED */
/* Back-to-Top Button - FINAL FIXED VERSION */
.back-to-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    color: white;
    padding: 0;
    margin: 0;
    border-radius: 50%;
    text-decoration: none;
    opacity: 0;
    visibility: hidden;
    border: 2px solid skyblue;
    background: linear-gradient(120deg, #ff00cc, #3333ff);
    box-shadow: 0 0 15px #ff00cc, 0 0 30px #3333ff;
    z-index: 1000;
    /* Increased z-index */
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    font-size: 26px;
    /* Slightly larger */
    font-weight: bold;
    line-height: 50px;
    /* Matches height */
    text-align: center;
}

.back-to-top::before {
    content: "";
    position: absolute;
    top: -3px;
    left: -3px;
    right: -3px;
    bottom: -3px;
    background: linear-gradient(45deg, #FF0000, #FF7300, #FFFB00, #48FF00, #00FFD5, #002BFF, #FF00C8, #FF0000);
    background-size: 600%;
    filter: blur(8px);
    z-index: -1;
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.3s ease;
    animation: glowing 20s linear infinite;
}

.back-to-top:hover {
    transform: scale(1.1);
}

.back-to-top:hover::before {
    opacity: 1;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

/* Keyframes for glowing effect (already in your CSS) */
@keyframes glowing {
    0% {
        background-position: 0 0;
    }

    50% {
        background-position: 400% 0;
    }

    100% {
        background-position: 0 0;
    }
}

/* Footer Section */
.footer {
    background: var(--footer-background);
    color: var(--footer-text);
    padding: 14px 0;
    text-align: center;
    margin: 0 auto;
}

/* Responsive Design */
@media (max-width: 768px) {
    nav {
        padding: 12px 20px;
    }

    nav ul {
        display: none;
        flex-direction: column;
        width: 250px;
        height: 100vh;
        background: linear-gradient(120deg, var(--primary-color), var(--secondary-color));
        position: fixed;
        top: 0;
        right: -250px;
        padding-top: 60px;
        transition: right 0.3s ease;
        z-index: 1000;
    }

    nav ul.active {
        right: 0;
    }

    nav ul li {
        margin: 15px 0;
    }

    nav ul li a {
        font-size: 18px;
        color: var(--text-color);
    }

    nav .fa-solid {
        display: block;
    }

    #closemenu {
        position: absolute;
        top: 20px;
        right: 20px;
        cursor: pointer;
    }

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

    .header-text {
        margin-left: 0;
    }

    .row {
        flex-direction: column;
    }

    .about-col-1,
    .about-col-2 {
        max-width: 100%;
    }

    .contact-left,
    .contact-right {
        flex-basis: 100%;
        text-align: center;
    }
}

/* Media Queries for Responsiveness */
@media (max-width: 768px) {
    nav {
        padding: 12px 20px;
    }

    nav ul {
        display: none;
        flex-direction: column;
        width: 250px;
        height: 100vh;
        background: linear-gradient(120deg, var(--primary-color), var(--secondary-color));
        position: fixed;
        top: 0;
        right: -250px;
        padding-top: 60px;
        transition: right 0.3s ease;
        z-index: 1000;
    }

    nav ul.active {
        right: 0;
    }

    nav ul li {
        margin: 15px 0;
    }

    nav ul li a {
        font-size: 18px;
        color: var(--text-color);
    }

    nav .fa-solid {
        display: block;
    }

    #closemenu {
        position: absolute;
        top: 20px;
        right: 20px;
        cursor: pointer;
    }

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

    .header-text {
        margin-left: 0;
    }

    .row {
        flex-direction: column;
    }

    .about-col-1,
    .about-col-2 {
        max-width: 100%;
    }

    .contact-left,
    .contact-right {
        flex-basis: 100%;
        text-align: center;
    }

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

@media (max-width: 480px) {
    .certificate-list {
        grid-template-columns: 1fr;
    }

    .header-text h1 {
        font-size: 27px;
        margin-top: -5px;
        margin-left: 20px;
        padding: 10px 0px;
    }

    .intro .image img {
        width: 50%;
        max-width: 400px;
        height: auto;
        border-radius: 160px;
        margin-top: 40px;
        margin-right: 25px;
        margin-left: 22px;
        /* animation: floating 2.5s ease-in-out infinite; */
    }

    h3 {
        margin-left: 20px;
        margin-top: -30px;
        font-size: 17px;
    }

    p {
        margin-left: 20px;
        font-size: 10px;
    }

    .personal-info {
        margin: 0 23px;
        text-align: left;
    }

    #about {
        padding: 30px 0;
    }

    .about-col-1 h1 {
        font-size: 24px;
        margin-top: 0px;
        margin-bottom: 0px;
        text-align: center;
    }

    .about-col-1 p {
        font-size: 14px;
        line-height: 1.6;
        text-align: center;
        margin-top: 20px;
        /* Space after image */
    }

    .about-col-2 {
        order: -1;
        /* Moves image above text */
        margin-bottom: 20px;
    }

    .animated-image {
        width: 60%;
        max-width: 200px;
        margin: 0 auto;
        display: block;
        border-radius: 10px;
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    }

    /* Certificate Section */
    .subtitle {
        font-size: 2em;
        font-weight: bold;
        margin-bottom: 20px;
        color: var(--text-color);
    }

    h1.subtitle {
        margin-bottom: 20px;
    }

    /* Get in touch */
    .subtitle {
        font-size: 2em;
        font-weight: bold;
        margin-bottom: auto;
        margin-top: 0px;
        color: var(--text-color);
    }

    .contact-left p {
        margin: 5px auto;
        align-items: center;
        font-size: 1.0em;
    }

    .contact-left .btn {
        margin: auto 0;
        display: inline-block;
        align-items: center;
        animation: floating 2.5s ease-in-out infinite;
    }


}