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

/* Light mode (default) */
:root {
    --background-color: #ffffff;
    --text-color: #000000;
    --header-background: rgba(0, 0, 0, 0.8);
    --border-color: #cccccc;
    --button-background: rgb(0, 157, 255);
    --button-text-color: #ffffff;
    --button-hover-background: rgb(255, 0, 255);
}

/* Dark mode */
.dark-mode {
    --background-color: #181818;
    --text-color: #ffffff;
    --header-background: rgba(255, 255, 255, 0.1);
    --border-color: #444444;
    --button-background: rgb(50, 50, 50);
    --button-text-color: #ffffff;
    --button-hover-background: rgb(100, 100, 100);
}

/* Apply the colors */
body {
    background-color: var(--background-color);
    color: var(--text-color);
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Header text always white */
header, .nav-links a {
    color: white !important;
    transition: color 0.3s ease;
}

/* Download CV button - light mode */
#download-cv-btn a {
    background-color: white;
    color: black;
    border: 2px solid black;
    padding: 0.8rem 1.5rem;
    border-radius: 3rem;
    text-decoration: none;
    transition: background-color 0.3s ease, color 0.3s ease;
    display: inline-block; /* Ensure it's a block-level element inside the div */
}

/* Hover effect */
#download-cv-btn a:hover {
    background-color: black;
    color: white;
}

/* Download CV button - dark mode */
.dark-mode #download-cv-btn a {
    background-color: black;
    color: white;
    border-color: white;
}

/* Hover effect in dark mode */
.dark-mode #download-cv-btn a:hover {
    background-color: white;
    color: black;
}

/* GitHub links for projects - light mode */
/* GitHub links for projects - light mode */
.project-card .btn {
    background-color: white;
    color: black;
    border: 2px solid black;
    padding: 0.8rem 1.5rem;
    border-radius: 3rem;
    text-decoration: none;
    transition: background-color 0.3s ease, color 0.3s ease, transform 0.3s ease;
}

/* Ensure the hover effect works properly in light mode */
.project-card .btn:hover {
    background-color: black;
    color: white;
    border: 2px solid white;
    transform: scale(1.03);
}

/* GitHub links for projects - dark mode */
.dark-mode .project-card .btn:hover {
    background-color: white;
    color: black;
    border-color: black;
    transform: scale(1.03);
}

/* Hover effect for both light and dark modes */
.dark-mode .project-card .btn {
    background-color: black;
    color: white;
    border-color: white;
}



/* Certificates and Skills sections in dark mode */
.dark-mode .skills-category, 
.dark-mode .certificate-card {
    background-color: #282828;
    color: white;
    border-color: #444444;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Darker hover effect for Certificates and Skills */
.dark-mode .skills-category:hover, 
.dark-mode .certificate-card:hover {
    background-color: #1c1c1c;
}

/* Experience/Grid cards in dark mode */
.dark-mode .grid-card {
    background-color: #282828;
    color: white;
    border-color: #444444;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.dark-mode .grid-card:hover {
    background-color: #1c1c1c;
}

/* Service cards in dark mode */
.dark-mode .service-card {
    background-color: #282828;
    color: white;
    border-color: #444444;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.dark-mode .service-card:hover {
    background-color: #1c1c1c;
}

/* Contact cards in dark mode */
.dark-mode .contact-card {
    background-color: #282828;
    color: white;
    border-color: #444444;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.dark-mode .contact-card:hover {
    background-color: #1c1c1c;
}

.dark-mode .contact-card p {
    color: white;
}

/* Footer text color for dark mode */
.dark-mode footer {
    color: white;
}

.dark-mode footer a {
    color: white; /* Ensure footer links are white */
}

/* Contact section: Fix email and phone number text for dark mode */
.dark-mode .contact-card a {
    color: white;
}

/* Buttons */
button, .btn {
    background-color: var(--button-background);
    color: var(--button-text-color);
    transition: background-color 0.3s ease-in-out, color 0.3s ease-in-out;
}

button:hover, .btn:hover {
    background-color: var(--button-hover-background);
}

/* Bounce Animation */
@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

/* Sun and Moon Toggle Styling */
.theme-toggle {
    display: flex;
    align-items: center;
    cursor: pointer;
    transition: color 0.3s ease;
}

.sun-icon, .moon-icon {
    font-size: 1.8rem;
    cursor: pointer;
    transition: opacity 0.3s ease;
}

/* Hover Effect with Bounce Animation */
.theme-toggle:hover {
    animation: bounce 0.6s;
}

/* Visibility switch for dark mode */
.dark-mode .sun-icon {
    display: none;
}

.dark-mode .moon-icon {
    display: inline-block;
    color: white;
}

.theme-toggle .sun-icon {
    color: yellow;
}

.theme-toggle .moon-icon {
    color: white;
}


header {
    position: fixed;
    top: 1rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5rem;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    color: white;
    padding: 0.5rem 1.5rem;
    border-radius: 3rem;
    z-index: 1000;
}

.logo {
    color: white;
    font-size: 1.3rem;
    font-weight: 600;
    white-space: nowrap;
    transition: 0.3s ease-in-out;
}

.logo:hover {
    transform: scale(1.1);
}

.nav-links {
    display: flex;
    gap: 2rem;
}

li a {
    position: relative;
    color: white;
    font-weight: 300;
}

li a::before {
    position: absolute;
    content: '';
    width: 0;
    left: 0;
    height: 5px;
    top: 25px;
    border-radius: 1rem;
    transition: 0.3s ease-in-out;
    background: linear-gradient(to right, rgb(0, 157, 255), rgb(255, 0, 255));
}

li a:hover::before {
    width: 100%;
}

.visit-btn {
    padding: 0.8rem 1.5rem;
    border-radius: 3rem;
    border: none;
    font-weight: 500;
    font-size: 1rem;
    color: white;
    cursor: pointer;
    white-space: nowrap;
    transition: 0.3s ease-in-out;
    background: linear-gradient(to right, rgb(0, 157, 255), rgb(255, 0, 255));
}

.visit-btn:hover {
    background: linear-gradient(to right, rgb(255, 0, 255), rgb(0, 157, 255));
    transform: scale(1.03);
}

#menu-icon {
    font-size: 2rem;
    display: none;
}

section {
    min-height: 100vh;
    padding: 8rem 12%;
    width: 100%;
    position: relative;
}

.about {
    display: flex;
    align-items: center;
    justify-content: center;
}

.about .about-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10rem;
}

.about img {
    width: 30vw;
    border-radius: 50%;
}

#dynamic-role {
    background: linear-gradient(to right, rgb(255, 0, 255), rgb(0, 157, 255));
    background-clip: text;
    color: transparent;
    font-size: 2rem;
    border-right: 2px solid black;
    white-space: nowrap;
    overflow: hidden;
    display: inline-block;
    animation: blink-cursor 0.8s steps(2) infinite;
}

.info-box {
    display: flex;
    flex-direction: column;
    text-align: center;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
}


.btn-group a {
    color: inherit;
    text-decoration: none;
}

.btn-group a:hover {
    color: inherit;
}


.socials a {
    color: inherit;
}

.socials a:hover {
    color: #000;
}

.info-box h3 {
    font-size: 1.8rem;
    font-weight: 500;
    opacity: 0.8;
}

.info-box h1 {
    font-size: 4rem;
    font-weight: 600;
}

.info-box span {
    background: linear-gradient(to right, rgb(255, 0, 255), rgb(0, 157, 255));
    background-clip: text;
    color: transparent;
    font-size: 2rem;
}

.btn-group {
    display: flex;
    gap: 1rem;
}

.btn {
    border-radius: 3rem;
    padding: 0.5rem 1.5rem;
    border: 2px solid black;
    cursor: pointer;
    font-weight: 500;
    white-space: nowrap;
    transition: 0.2s ease-in-out;
}

.btn:hover {
    background-color: black;
    color: white;
}

.socials {
    display: flex;
    gap: 2rem;
}

.socials i {
    font-size: 2.5rem;
    cursor: pointer;
    transition: 0.2s ease-in-out;
}

.socials i:hover {
    transform: scale(1.1);
}

.section-title {
    text-align: center;
    font-size: 4rem;
    font-weight: 600;
    margin-bottom: 3rem;
}

.experience-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5rem;
    width: 100%;
}

.experience {
    padding: 8rem 12%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3rem;
}

.experience img {
    width: 24vw;
    border-radius: 3rem;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    width: 100%;
}

.grid-card {
    border: 2px solid black;
    border-radius: 3rem;
    padding: 3rem;
    display: flex;
    flex-direction: column;
    align-items: baseline;
    justify-content: left;
    cursor: pointer;
    transition: 0.2s ease-in-out;
}

.grid-card:hover {
    background-color: black;
    color: white;
}

.grid-card i {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.grid-card span {
    font-size: 1.5rem;
    font-weight: 500;
    background: linear-gradient(to right, rgb(255, 0, 255), rgb(0, 157, 255));
    background-clip: text;
    color: transparent;
}

/* Gallery Section */
.gallery {
    padding: 8rem 12%;
}

.gallery-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 1rem;
    cursor: pointer;
    height: 350px;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.gallery-item:hover img {
    transform: scale(1.1);
}

.gallery-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    padding: 2rem;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.gallery-item:hover .gallery-overlay {
    transform: translateY(0);
}

.gallery-overlay h3 {
    color: white;
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.gallery-overlay p {
    color: white;
    font-size: 1rem;
}

/* Services Section */
.services {
    padding: 8rem 12%;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.service-card {
    border: 2px solid black;
    border-radius: 3rem;
    padding: 3rem 2rem;
    text-align: center;
    transition: 0.3s ease-in-out;
    cursor: pointer;
    background-color: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 320px;
}

.service-card:hover {
    background-color: black;
    color: white;
    transform: translateY(-10px);
}

.service-card i {
    font-size: 3rem;
    margin-bottom: 1.5rem;
    background: linear-gradient(to right, rgb(255, 0, 255), rgb(0, 157, 255));
    background-clip: text;
    color: transparent;
}

.service-card:hover i {
    color: white;
    background: white;
    background-clip: text;
}

.service-card h3 {
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.service-card p {
    font-size: 1.1rem;
    font-weight: 300;
    line-height: 1.6;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.project-card {
    padding: 3rem 2rem;
    display: flex;
    flex-direction: column;
    align-items: stretch; /* allow image and content to take full width */
    justify-content: flex-start; /* keep content stacked from the top */
    text-align: center;
    gap: 1.5rem;
    border: 2px solid black;
    border-radius: 3rem;
    cursor: pointer;
    transition: 0.3s ease-in-out;
    min-height: 420px; /* ensure consistent card height so buttons align */
    box-sizing: border-box;
}

.project-card:hover {
    background-color: black;
    color: white;
    transform: translateY(-10px) scale(1.02);
}

.project-card img {
    width: 100%;
    /* Make all project images the same height responsively
       - `clamp(min, preferred, max)` keeps image height responsive
       - `object-fit: cover` preserves aspect and crops as needed
    */
    height: clamp(140px, 18vw, 260px);
    max-width: 100%;
    border-radius: 1rem;
    object-fit: cover;
    display: block;
}

/* Push the project action buttons to the bottom of the card */
.project-card .btn-group {
    margin-top: auto;
}


.project-card h3 {
    font-size: 2rem;
    font-weight: 500;
}


.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.certificates {
    padding: 8rem 12%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3rem;
}

.certificates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.certificate-card {
    border: 2px solid black;
    border-radius: 3rem;
    padding: 3rem;
    text-align: center;
    transition: 0.3s ease-in-out;
    cursor: pointer;
    background-color: white;
}

/* Make certificate cards a column flex container so actions can sit at bottom */
.certificate-card {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 1.5rem;
    min-height: 360px; /* ensures consistent card height */
    box-sizing: border-box;
}

/* Push the button group to the bottom of the card */
.certificate-card .btn-group {
    margin-top: auto;
}

.certificate-card:hover {
    background-color: black;
    color: white;
}

.certificate-card h3 {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.certificate-card p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    font-weight: 300;
}

.certificate-card .btn-group .btn {
    border-radius: 3rem;
    padding: 0.8rem 1.5rem;
    background: linear-gradient(to right, rgb(0, 157, 255), rgb(255, 0, 255));
    color: white;
    border: none;
    transition: 0.3s ease-in-out;
}

.certificate-card:hover .btn {
    background-color: white;
    color: black;
    border: 2px solid white;
}

.certificate-card:hover .btn:hover {
    background-color: black;
    color: white;
}

.skills { 
    padding: 8rem 12%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3rem;
}

.skills-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); /* Grid layout like the Projects section */
    gap: 2rem;
    width: 100%;
}

.skills-category {
    border: 2px solid black;
    border-radius: 3rem;
    padding: 2.5rem;
    transition: 0.3s ease-in-out;
    text-align: center;
    background-color: white;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: flex-start; /* Align all content at the top */
    min-height: 250px; /* Prevents boxes from collapsing */
    word-wrap: break-word; /* Ensures long words are wrapped inside the box */
}

.skills-category:hover {
    background-color: black;
    color: white;
}

/* Ensure consistent height for h3 titles */
.skills-category h3 {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 1rem;
    min-height: 3rem; /* Set a minimum height to align titles */
    display: flex;
    align-items: center; /* Center the title vertically if needed */
    justify-content: center; /* Center the title horizontally */
}

.skills-category ul {
    list-style-type: none;
    padding: 0;
    margin: 0;
    flex-grow: 1; /* Allow ul to grow and take up remaining space */
}

.skills-category li {
    font-size: 1.2rem;
    font-weight: 300;
    margin: 0.5rem 0;
    word-wrap: break-word; /* Ensures long text wraps correctly */
}


/* Media Query for Small Screens */
@media (max-width: 768px) {
    .skills-container {
        grid-template-columns: 1fr; /* Stack the skill categories on smaller screens */
        gap: 1.5rem; /* Reduce gap between items on small screens */
    }

    .skills-category {
        padding: 2rem;
        min-height: auto; /* Adjust height for smaller screens */
    }

    .skills-category h3 {
        font-size: 1.5rem; /* Adjusted title size for smaller screens */
    }

    .skills-category li {
        font-size: 1rem; /* Adjust skill list font size for readability on small screens */
        word-break: break-word; /* Ensure long words don't overflow */
    }
}

@media (max-width: 480px) {
    .skills-category {
        padding: 1.5rem;
        font-size: 0.9rem;
        min-height: auto; /* Ensures flexibility on smaller screens */
    }

    .skills-category h3 {
        font-size: 1.3rem; /* Smaller title size for very small screens */
    }

    .skills-category li {
        font-size: 0.9rem;
    }
}




/* Media Queries */
@media (max-width: 768px) {
    header {
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding: 1rem;
        width: 100%;
    }

    .logo {
        font-size: 1.2rem;
        margin-bottom: 1rem;
    }

    .nav-links {
        display: none;
        flex-direction: column;
        text-align: center;
        width: 100%;
    }

    .nav-links.active {
        display: flex;
    }

    #menu-icon {
        display: block;
        font-size: 2rem;
        margin-top: 0.5rem;
        cursor: pointer;
    }

    .visit-btn {
        font-size: 0.9rem;
        padding: 0.7rem 1rem;
        margin-top: 0.5rem;
    }
}

@media (max-width: 480px) {
    header {
        padding: 0.5rem;
    }

    .logo {
        font-size: 1rem;
    }

    .visit-btn {
        font-size: 0.8rem;
        padding: 0.5rem 1rem;
    }

    .nav-links {
        width: 100%;
    }
}

.contact-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    border-radius: 3rem;
    text-align: center;
    border: 2px solid black;
    word-wrap: break-word;
    overflow-wrap: break-word;
    box-sizing: border-box;
    max-width: 100%;
}

.contact-card a {
    color: inherit;
    text-decoration: none;
    word-break: break-all;
}

.contact-card i {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.contact-card h3 {
    font-size: 1.8rem;
    font-weight: 500;
}

.contact-card p {
    font-size: 1.5rem;
    color: black;
}

.contact-card:hover {
    background-color: black;
    color: white;
}

.contact-card:hover a {
    color: white;
}

footer {
    bottom: 0;
    left: 0;
    height: 10rem;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
    justify-content: center;
}

footer ul {
    display: flex;
    align-items: center;
    gap: 3rem;
}

footer ul li a {
    color: black;
    font-weight: 600;
}

.copyright {
    font-size: 300;
    margin-top: 2rem;
}

/* Additional Media Queries */
@media (max-width: 1280px) {
    header {
        padding: 1rem 2rem;
        gap: 2rem;
    }
    .about .about-container {
        gap: 3rem;
    }
    .experience-info {
        flex-direction: column;
    }
}

@media (max-width: 768px) {
    header {
        padding: 0.5rem 1rem;
        gap: 1rem;
    }
    .logo {
        font-size: 1rem;
    }
    .about-container {
        flex-direction: column;
    }
    .grid {
        grid-template-columns: repeat(1, 1fr);
    }
    .experience-info img {
        width: 70vw;
    }
}

@media (max-width: 600px) {
    #menu-icon {
        display: block;
        font-size: 2rem;
        cursor: pointer;
    }

    .nav-links {
        display: none;
        flex-direction: column;
        text-align: center;
        padding: 1rem;
        width: 100%;
    }

    .nav-links.active {
        display: flex;
    }

    .nav-links li {
        margin-top: 1.5rem;
        padding: 1rem;
    }

    header {
        flex-direction: column;
        align-items: center;
        justify-content: center;
    }

    .about-container img {
        width: 80vw;
    }
}

/* ============================================
   Floating Hearts Styles
   ============================================ */
.floating-heart {
    position: fixed;
    pointer-events: none;
    user-select: none;
    z-index: 9999;
    opacity: 0.7;
    transition: opacity 0.3s ease;
    animation: gentle-pulse 3s ease-in-out infinite;
}

.floating-heart:hover {
    opacity: 1;
}

@keyframes gentle-pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}
