/* CSS Variables for Light Mode */
:root {
    --bg-color: #f5f5dc;
    /* Beige */
    --primary-color-rgb: 216, 167, 177;
    /* #d8a7b1 in RGB */
    --primary-color: #d8a7b1;
    /* Mauve */
    --accent-color: #a8b5b7;
    /* Slate Gray */
    --text-color: #2a2a2a;
    /* Dark Charcoal */
    --background: linear-gradient(rgba(216, 167, 177, 0.2), rgba(168, 181, 183, 0.4)), url(images/hero.webp);
    --opacity1: 0.1;
    --opacity2: 0.2;
    --opacity3: 0.3;
    --opacity4: 0.4;
    --opacity5: 0.5;
    --opacity6: 0.6;
    --opacity7: 0.7;
    --opacity8: 0.8;
    --opacity9: 0.9;
}

/* Dark Mode Variables */
body.dark {
    --bg-color: #2a2a2a;
    /* Charcoal */
    --primary-color: #b5838d;
    /* Muted Coral */
    --primary-color-rgb: 181, 131, 141;
    --accent-color: #6b7280;
    /* Dark Slate */
    --text-color: #e5e7eb;
    /* Light Gray */
    --background: linear-gradient(rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.6)), url(images/hero.webp);
}

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

h1,
h2,
h3 {
    font-family: 'Inter', sans-serif;
}

body {
    font-family: "Poppins", sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    transition: background-color 0.3s, color 0.3s;
    line-height: 1.7;
    overflow-x: hidden;
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 2rem;
    background: var(--primary-color);
    position: sticky;
    top: 0;
    transition: transform 0.3s ease-in-out, background 0.3s ease;
    transform: translateY(0);
    z-index: 100;
}

header.hidden {
    transform: translateY(-100%);
}

header.scrolled {
    background: rgba(var(--primary-color-rgb), 0.5);
}

header h1 {
    font-size: 1.75rem;
    font-weight: 700;
}

nav {
    display: flex;
    align-items: center;
    transition: transform 0.5s ease-in-out;
}

nav a {
    margin: 0 1.25rem;
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    font-size: 1rem;
    transition: color 0.3s ease, opacity 0.3s ease;
}

nav a:hover {
    color: var(--accent-color);
    opacity: 0.9;
}

.hamburger {
    display: none;
    background: transparent;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-color);
    transition: transform 0.3s ease;
}

.hamburger i {
    transition: transform 0.3s ease;
}

.hamburger.active i {
    transform: rotate(90deg);
}

.hamburger.active i.fa-bars::before {
    content: "\f00d";
}

.dark-mode-toggle {
    cursor: pointer;
    padding: 0.5rem 1rem;
    border: none;
    background: var(--accent-color);
    border-radius: 5px;
    font-weight: 500;
    margin-left: 1rem;
    transition: background 0.3s;
}

.dark-mode-toggle i {
    color: var(--text-color);
}

/* Media Query for 750px and below */
@media (max-width: 750px) {
    .hamburger {
        display: block;
    }

    nav {
        position: fixed;
        top: 0;
        right: 0;
        height: 100vh;
        width: 250px;
        background: rgba(var(--primary-color-rgb), 0.1);
        backdrop-filter: blur(10px);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        transform: translateX(100%);
        /* Hidden by default */
        box-shadow: -5px 0 15px rgba(0, 0, 0, 0.2);
    }

    nav.active {
        transform: translateX(0);
        /* Slide in when active */
    }

    nav a {
        margin: 1rem 0;
        font-size: 1.2rem;
    }

    .dark-mode-toggle {
        margin: 1rem 0;
    }
}

/* Hero Section */
#hero {
    text-align: left;
    padding: 4rem 0;
    background: var(--background);
    animation: fadeIn 2s ease-out;
    height: 90vh;
    background-size: cover;
    background-position: top;
    background-repeat: no-repeat;
    background-attachment: fixed;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

#hero .hero-container {
    margin: 10% 0 40% 40%;
    transform: translateX(100%);
    opacity: 0;
    animation: flyIn 1.5s ease-out forwards;
    overflow: hidden;
}

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

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

#hero h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.8rem;
}

#hero p {
    font-size: 1.3rem;
    font-weight: 400;
}

#hero .btn button {
    font-size: 16px;
    font-weight: 500;
    padding: 12px 24px;
    border-radius: 6px;
    color: var(--text-color);
    border: none;
    outline: none;
    cursor: pointer;
    transition: transform 0.3s ease, opacity 0.3s ease;
    margin: 15px 0px;
}

#hero .btn button:first-child {
    background: var(--primary-color);
    border: 2px solid var(--text-color);
}

#hero .btn button:first-child a {
    color: var(--text-color);
    text-decoration: none;
}

#hero .btn button:first-child:hover {
    background: var(--accent-color);
    color: var(--primary-color);
    transform: translateY(-8px);
    border: 2px solid var(--primary-color);
}

#hero .btn button:last-child {
    background: var(--accent-color);
    /* border: 2px solid var(--text-color); */
}

#hero .btn button:last-child:hover {
    background: var(--primary-color);
    color: var(--text-color);
    transform: translateY(-8px);
    border-color: var(--accent-color);
}

#hero .social {
    margin: 20px 0 0 0;
}

#hero .social .social-links {
    display: flex;
    align-items: center;
    gap: 15px;
}

.social-links a {
    font-size: 20px;
    border-radius: 50%;
    color: var(--text-color);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--primary-color);
    border: 1px solid #3b3b3b;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.social-links a:hover {
    transform: translateY(-8px);
    opacity: 0.9;
}

/* About Section */
#about {
    padding: 3.5rem;
    transform: translateY(40px);
    opacity: 0;
    transition: transform 1.5s ease-out, opacity 1.5s ease-out;
}

#about.visible {
    transform: translateY(0);
    opacity: 1;
}

#about h2 {
    font-size: 2.4rem;
    margin-bottom: 1rem;
    font-weight: 700;
    text-align: center;
}

.about-text {
    max-width: 950px;
    margin: 0 auto;
    font-size: 1.1rem;
}

/* certificates */
.certificates {
    text-align: center;
    padding: 3rem 2rem;
    background: var(--bg-color);
}

.certificates h2 {
    font-size: 2.3rem;
    margin-bottom: 1.5rem;
    font-weight: 700;
}

.certificate-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.35rem;
    /* justify-content: center;
    align-items: center; */
}

.c-item {
    background: var(--bg-color);
    padding: 0.8rem;
    border-radius: 10px;
    border: 1px solid var(--accent-color);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease, opacity 0.3s ease;
    overflow: hidden;
    cursor: pointer;
    min-height: 450px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
}

.c-item img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    object-fit: cover;
}

.c-item h3 {
    color: var(--text-color);
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.c-item p {
    color: var(--text-color);
    font-size: 0.9rem;
    font-weight: 400;
    margin-top: 0.8rem;
}

.c-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
    opacity: 0.95;
}

/* Dark Mode */
body.dark .c-item {
    background: var(--bg-color);
    box-shadow: 0 4px 8px rgba(255, 182, 193, 0.2);
    border-color: var(--primary-color);
}

body.dark .c-item p {
    color: var(--text-color);
}

/* Skills Section */
#skills {
    padding: 5rem 0;
    background: linear-gradient(rgba(var(--primary-color-rgb), 0.05), rgba(var(--primary-color-rgb), 0.05));
}

#skills h2 {
    font-size: 2.25rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 2rem;
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1.5rem;
}

.skill-item {
    background: var(--bg-color);
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid var(--accent-color);
    text-align: center;
    font-weight: 500;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.skill-item:hover {
    transform: scale(1.02);
    opacity: 0.95;
}

body.dark .skill-item {
    background: var(--bg-color);
    border-color: var(--primary-color);
    color: var(--text-color);
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    max-width: 90%;
    max-height: 90vh;
    border-radius: 8px;
    animation: fadeInM 0.3s ease-out;
}

@keyframes fadeInM {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.modal-content video {
    width: 100%;
    border-radius: 10px;
}

body.dark .modal-content {
    background: var(--bg-color);
}

/* Projects Section */
#projects {
    padding: 5rem 0;
    animation: fadeIn 2s ease-out;
    /* margin: 0 30px 20px 30px; */
}

#projects h2 {
    font-size: 2.25rem;
    font-weight: 700;
    margin-bottom: 1rem;
    text-align: center;
}

/* Filter & Search Section */
.filter-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    margin: 0 10px 20px 0;
}

.filter-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    position: relative;
    width: 100%;
    max-width: 600px;
}

.filter-header i {
    font-size: 25px;
    cursor: pointer;
    transition: color 0.3s ease, transform 0.2s ease;
}

.filter-header #toggleFilter {
    margin-right: 5px;
}

.filter-header #toggleFilter:hover {
    color: var(--primary-color);
    transform: scale(1.1);
}

.search-wrapper {
    position: relative;
    flex: 1;
}

#searchInput {
    width: 100%;
    padding: 12px 40px;
    border: 1px solid var(--accent-color);
    border-radius: 25px;
    outline: none;
    font-size: 1rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

#searchInput:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 6px rgba(var(--primary-color-rgb), 0.2);
}

#search-btn {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--accent-color);
}

#searchInput:focus+#search-btn {
    color: var(--primary-color);
}

.filter-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
    margin: 0.5rem 0;
}

.filter-buttons.hidden {
    display: none;
}

.filter-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    background: var(--accent-color);
    font-weight: 600;
    font-size: 0.9rem;
    transition: background 0.3s ease, color 0.3s ease, transform 0.2s ease;
}

.filter-btn:hover,
.filter-btn.active {
    background: var(--primary-color);
    color: var(--bg-color);
}

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

.filter-btn.active {
    transform: scale(1.1);
}

/* Project Grid */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
    /* padding: 2rem; */
}

.project-item {
    background: var(--bg-color);
    padding: 1.5rem;
    border-radius: 10px;
    border: 1px solid var(--accent-color);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    /* display: block; */
    transition: transform 0.3s ease, box-shadow 0.3s ease, opacity 0.5s ease;

    /* height: auto;
    overflow: hidden; */
}

.project-item.hidden {
    display: none;
    transform: translateY(20px);
}

.project-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
    opacity: 0.95;
}

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

.project-item h3 {
    font-size: 1.3rem;
    font-weight: 500;
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

.project-item p {
    font-size: 1rem;
    color: var(--text-color);
    margin-bottom: 1rem;
}

.project-link {
    display: inline-flex;
    align-items: center;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.project-link i {
    margin-right: 0.5rem;
    font-size: 2rem;
}

.project-link:hover {
    color: var(--accent-color);
}

body.dark .project-item {
    background: var(--bg-color);
    border-color: var(--primary-color);
}

body.dark .project-item h3,
body.dark .project-item p {
    color: var(--text-color);
}

body.dark .project-link {
    color: var(--primary-color);
}

body.dark .project-link:hover {
    color: var(--accent-color);
}

.view-more-btn {
    padding: 10px 25px;
    border: none;
    border-radius: 25px;
    background: var(--primary-color);
    color: var(--bg-color);
    font-weight: 500;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
}

.view-more-btn:hover {
    background: var(--accent-color);
    color: var(--text-color);
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.view-more-btn:active {
    transform: scale(0.95);
}


body.dark .view-more-btn {
    background: var(--primary-color);
    color: var(--bg-color);
}

body.dark .view-more-btn:hover {
    background: var(--accent-color);
    color: var(--text-color);
}

/* pricing plan */
#pricing {
    padding: 60px 20px;
    max-width: 1280px;
    margin: 0 auto;
    background: var(--bg-color);
    font-family: 'Poppins', sans-serif;
}

#pricing h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 40px;
    color: var(--text-color);
    font-family: 'Inter', sans-serif;
    position: relative;
}

#pricing h2::after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background-color: var(--primary-color);
    margin: 10px auto 0;
}

.pricing-tabs {
    max-width: 1200px;
    margin: 0 auto;
}

.tab-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    list-style: none;
    gap: 15px;
    margin-bottom: 30px;
}

.tab-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 25px;
    background: var(--accent-color);
    color: var(--text-color);
    border: none;
    border-radius: 30px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
    font-family: 'Poppins', sans-serif;
    font-size: 1rem;
}

.tab-btn:hover {
    background: var(--primary-color);
    color: var(--bg-color);
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.tab-btn.active {
    background: var(--primary-color);
    color: var(--bg-color);
    transform: scale(1.05);
}

.tab-content {
    background: var(--bg-color);
    border-radius: 15px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    padding: 30px;
    border: 1px solid var(--accent-color);
}

.tab-pane {
    display: none;
    opacity: 0;
}

.tab-pane.active {
    display: block;
    animation: flyIn 0.5s ease-out forwards;
}

@keyframes flyIn {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.price {
    font-size: 2rem;
    color: var(--primary-color);
    text-align: center;
    margin-bottom: 20px;
    font-family: 'Inter', sans-serif;
}

.price span {
    font-size: 1rem;
    color: var(--accent-color);
}

.features {
    list-style: none;
    margin-bottom: 20px;
    padding: 0 20px;
}

.features li {
    padding: 10px 0;
    border-bottom: 1px solid rgba(var(--accent-color), var(--opacity8));
    text-align: center;
    color: var(--text-color);
    transition: color 0.3s ease;
}

.features li:hover {
    color: var(--primary-color);
}

.contact-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 25px;
    border-radius: 30px;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.3s ease, transform 0.3s ease;
    font-family: 'Poppins', sans-serif;
}

.btn-email {
    background: var(--accent-color);
    color: var(--text-color);
    border: 1px solid var(--primary-color);
}

.btn-email:hover {
    background: var(--primary-color);
    color: var(--bg-color);
    transform: scale(1.05);
}

.btn-whatsapp {
    background: #25D366;
    color: #fff;
    border: none;
}

.btn-whatsapp:hover {
    background: #1EBE57;
    transform: scale(1.05);
}

body.dark .btn-email {
    color: var(--text-color);
}

body.dark .btn-email:hover {
    color: var(--bg-color);
}

/* Mobile Responsiveness */
@media (max-width: 750px) {
    #pricing {
        padding: 40px 15px;
    }

    #pricing h2 {
        font-size: 2rem;
    }

    .tab-list {
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }

    .tab-btn {
        width: 100%;
        max-width: 300px;
        justify-content: center;
        font-size: 0.95rem;
        padding: 10px 20px;
    }

    .tab-content {
        padding: 20px;
    }

    .price {
        font-size: 1.8rem;
    }

    .features li {
        font-size: 0.9rem;
    }

    .contact-buttons {
        flex-direction: column;
        align-items: center;
    }

    .btn {
        width: 100%;
        max-width: 300px;
        justify-content: center;
    }
}

@media (max-width: 320px) {
    #pricing h2 {
        font-size: 1.75rem;
    }

    .price {
        font-size: 1.5rem;
    }

    .tab-btn {
        font-size: 0.85rem;
        padding: 8px 15px;
    }

    .features li {
        font-size: 0.85rem;
    }
}




/* Testimonials Section */
#testimonials {
    padding: 5rem 0;
    background: var(--bg-color);
}

#testimonials h2 {
    font-size: 2.25rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 2rem;
}

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

.testimonial-item {
    background: var(--bg-color);
    padding: 1.5rem;
    border-radius: 10px;
    border: 1px solid var(--accent-color);
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.testimonial-item:hover {
    transform: scale(1.02);
    opacity: 0.95;
}

body.dark .testimonial-item {
    background: var(--bg-color);
    border-color: var(--primary-color);
    color: var(--text-color);
}

/* Contact Section */
#contact {
    background: var(--bg-color);
    padding-top: 3rem;
    animation: slideIn 1.5s ease-out;

}

/* #contact .container {
    margin: 0 auto;
} */

.row {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    justify-content: space-between;
}

.contact-left {
    flex-basis: 40%;
    min-width: 300px;
    margin-left: 3rem;
}

#contact .sub-title {
    font-size: 3rem;
    color: var(--text-color);
    margin-bottom: 2rem;
    font-weight: 700;
    text-align: center;
}

.contact-right {
    flex-basis: 55%;
    min-width: 300px;
}

.contact-left p {
    margin-top: 30px;
    font-size: 1.1rem;
    color: var(--text-color);
}

.contact-left p a {
    text-decoration: none;
    color: var(--text-color);
    transition: color 0.3s ease;
}

.contact-left p a:hover {
    color: var(--primary-color);
}

.contact-left p i {
    color: var(--primary-color);
    margin-right: 15px;
    font-size: 25px;
}

.contact-left .social-icons {
    margin: 30px 0 20px;
}

.social-icons a {
    text-decoration: none;
    font-size: 30px;
    margin-right: 15px;
    color: var(--accent-color);
    /* display: inline-block; */
    transition: color 0.3s ease, transform 0.5s ease;
}

.social-icons a:hover {
    color: var(--primary-color);
    transform: translateY(-5px);
}

.btn.btn2 {
    display: inline-block;
    background: var(--primary-color);
    padding: 0.75rem 2rem;
    font-size: 16px;
    color: var(--bg-color);
    border: none;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 500;
    cursor: pointer;
    transition: transform 0.3s ease, opacity 0.3s ease;
    margin-right: 1rem;
}

.btn.btn2:hover {
    opacity: 0.9;
    transform: scale(1.05);
}

.btn.btn2:hover {
    transform: scale(1.05);
    opacity: 0.9;
}

body.dark .btn.btn2 {
    color: var(--text-color);
}

.contact-right form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-width: 600px;
    margin: 0 auto;
}

form input,
form textarea {
    width: 90%;
    border: none;
    outline: none;
    background: var(--bg-color);
    padding: 1rem;
    margin: 10px 0;
    color: var(--text-color);
    font-size: 18px;
    border-radius: 6px;
    border: 1px solid var(--accent-color);
    transition: border 0.3s ease, background 0.3s ease;
}

form input:focus,
form textarea:focus {
    border: 2px solid var(--primary-color);
}

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

form .btn2 {
    padding: 14px 60px;
    margin: 20px 0 0;
    align-self: flex-start;
    width: 90%;
}

#msg {
    margin-top: 1rem;
    color: var(--text-color);
    font-size: 1rem;
    text-align: center;
}

.copyright {
    width: 100%;
    text-align: center;
    padding: 20px 0;
    background: rgba(0, 0, 0, var(--opacity4));
    font-weight: 400;
    margin-top: 20px;
    color: var(--text-color);
    position: relative;
    bottom: 0;
}

.copyright i {
    color: var(--primary-color);
}

#designer {
    font-size: 11px;
    opacity: 0.8;
}

@keyframes slideIn {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Back to Top Button */
#backToTop {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--primary-color);
    color: var(--bg-color);
    border: none;
    border-radius: 50%;
    width: 3rem;
    height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
}

#backToTop.visible {
    opacity: 1;
    visibility: visible;
}

#backToTop:hover {
    transform: scale(1.1);
}

body.dark #backToTop {
    color: var(--text-color);
}

/* Responsive Design */

/* Media Query for 750px and below */
@media (max-width: 750px) {
    header {
        padding: 1rem;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    header h1 {
        font-size: 1.5rem;
    }

    .hamburger {
        display: block;
    }

    nav {
        position: fixed;
        top: 0;
        right: 0;
        height: 100vh;
        width: 250px;
        background: rgba(var(--primary-color-rgb), 0.1);
        backdrop-filter: blur(10px);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        transform: translateX(100%);
        box-shadow: -5px 0 15px rgba(0, 0, 0, 0.2);
    }

    nav.active {
        transform: translateX(0);
    }

    nav a {
        margin: 1.2rem 0;
        font-size: 1.2rem;
    }

    .dark-mode-toggle {
        margin: 1.2rem 0;
    }

    #hero {
        padding: 3rem 1rem;
        height: auto;
        background-attachment: scroll;
    }

    #hero .hero-container {
        margin: 8% 5%;
        text-align: center;
    }

    #hero h2 {
        font-size: 2rem;
    }

    #hero p {
        font-size: 1.1rem;
    }

    #hero .btn {
        flex-direction: column;
        gap: 0.75rem;
    }

    #hero .btn button {
        width: 100%;
    }

    .social-links {
        justify-content: center;
    }

    #about {
        padding: 2.5rem 1rem;
    }

    #about h2 {
        font-size: 2rem;
    }

    .certificates {
        padding: 2rem 1rem;
    }

    .certificates h2 {
        font-size: 2rem;
    }

    .certificate-container {
        grid-template-columns: 1fr;
    }

    .c-item {
        min-height: 400px;
    }

    #skills {
        padding: 3rem 1rem;
    }

    #skills h2 {
        font-size: 2rem;
    }

    .skills-grid {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    }

    #projects {
        padding: 3rem 1rem;
    }

    #projects h2 {
        font-size: 2rem;
    }

    .projects-grid {
        grid-template-columns: 1fr;
    }

    .filter-header {
        flex-direction: column;
        gap: 0.5rem;
    }

    #testimonials {
        padding: 3rem 1rem;
    }

    #testimonials h2 {
        font-size: 2rem;
    }

    .testimonials-grid {
        grid-template-columns: 1fr;
    }

    #contact {
        padding: 2.5rem 1rem;
    }

    #contact .sub-title {
        font-size: 2.5rem;
    }

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

    .contact-left .social-icons {
        justify-content: center;
    }

    form .btn2 {
        align-self: center;
    }
}

/* Extra Small Devices (≤320px) */
@media only screen and (max-width: 320px) {
    body {
        font-size: 14px;
        line-height: 1.6;
    }

    header {
        padding: 0.75rem;
        flex-direction: column;
    }

    header h1 {
        font-size: 1.25rem;
    }

    nav a {
        font-size: 1rem;
        margin: 0.8rem 0;
    }

    .dark-mode-toggle {
        padding: 0.5rem 0.75rem;
        font-size: 0.9rem;
    }

    #hero {
        padding: 2rem 0.75rem;
    }

    #hero .hero-container {
        margin: 5% 5%;
        animation: none;
    }

    #hero h2 {
        font-size: 1.5rem;
    }

    #hero p {
        font-size: 0.95rem;
    }

    #hero .btn button {
        font-size: 0.9rem;
        padding: 0.5rem 1rem;
    }

    .social-links a {
        width: 2rem;
        height: 2rem;
        font-size: 1rem;
    }

    #about h2,
    .certificates h2,
    #projects h2,
    #skills h2,
    #testimonials h2,
    #contact .sub-title {
        font-size: 1.75rem;
    }

    .c-item,
    .project-item,
    .skill-item,
    .testimonial-item {
        padding: 1rem;
    }

    .c-item img,
    .project-img {
        height: 160px;
    }

    .filter-btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.85rem;
    }

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

    .social-icons a {
        font-size: 1.5rem;
        margin-right: 0.5rem;
    }

    form input,
    form textarea {
        font-size: 0.95rem;
        padding: 0.75rem;
    }

    form .btn2 {
        padding: 0.5rem 1.5rem;
    }

    .copyright {
        font-size: 0.85rem;
    }

    #designer {
        font-size: 0.75rem;
    }
}

/* Small Devices (321px to 576px) */
@media only screen and (min-width: 321px) and (max-width: 576px) {
    body {
        font-size: 15px;
    }

    header {
        padding: 1rem;
    }

    header h1 {
        font-size: 1.5rem;
    }

    #hero {
        padding: 2.5rem 1rem;
        min-height: 70vh;
    }

    #hero .hero-container {
        margin: 6% 5%;
    }

    #hero h2 {
        font-size: 1.75rem;
    }

    #hero p {
        font-size: 1rem;
    }

    #hero .btn button {
        font-size: 0.95rem;
    }

    #about h2,
    .certificates h2,
    #projects h2,
    #skills h2,
    #testimonials h2,
    #contact .sub-title {
        font-size: 1.9rem;
    }

    .certificate-container,
    .projects-grid,
    .skills-grid,
    .testimonials-grid {
        grid-template-columns: 1fr;
    }

    .c-item {
        min-height: 420px;
    }

    .contact-left,
    .contact-right {
        margin-left: 0;
    }
}

/* Medium Devices (577px to 768px) */
@media only screen and (min-width: 577px) and (max-width: 768px) {
    header {
        padding: 1rem 1.5rem;
    }

    header h1 {
        font-size: 1.75rem;
    }

    nav a {
        margin: 0 0.75rem;
        font-size: 1rem;
    }

    #hero {
        padding: 3.5rem 1.5rem;
        min-height: 80vh;
    }

    #hero .hero-container {
        margin: 8% auto;
    }

    #hero h2 {
        font-size: 2.25rem;
    }

    #hero p {
        font-size: 1.15rem;
    }

    #about {
        padding: 3rem 1.5rem;
    }

    .certificates {
        padding: 2.5rem 1.5rem;
    }

    .certificate-container {
        grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    }

    .skills-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }

    .projects-grid,
    .testimonials-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }

    #projects {
        padding: 3.5rem 1.5rem;
    }

    #testimonials {
        padding: 3.5rem 1.5rem;
    }

    #contact {
        padding: 3rem 1.5rem;
    }

    #contact .sub-title {
        font-size: 2.75rem;
    }

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

/* Large Devices (769px to 1200px) */
@media only screen and (min-width: 769px) and (max-width: 1200px) {
    header {
        padding: 1.25rem 1.75rem;
    }

    header h1 {
        font-size: 2rem;
    }

    nav a {
        margin: 0 1rem;
        font-size: 1.05rem;
    }

    #hero {
        padding: 4rem 2rem;
    }

    #hero .hero-container {
        margin: 10% auto;
    }

    #hero h2 {
        font-size: 2.5rem;
    }

    #hero p {
        font-size: 1.2rem;
    }

    #about {
        padding: 3.5rem 2rem;
    }

    .certificates {
        padding: 3rem 2rem;
    }

    .certificate-container,
    .skills-grid {
        grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    }

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

    #projects {
        padding: 4rem 2rem;
    }

    #testimonials {
        padding: 4rem 2rem;
    }

    #contact {
        padding: 3.5rem 2rem;
    }

    #contact .sub-title {
        font-size: 3rem;
    }

    .contact-left {
        flex-basis: 45%;
    }

    .contact-right {
        flex-basis: 50%;
    }
}

/* Extra Large Devices (1201px to 1920px) */
@media only screen and (min-width: 1201px) and (max-width: 1920px) {
    header {
        padding: 1.5rem 2rem;
    }

    header h1 {
        font-size: 2.25rem;
    }

    nav a {
        margin: 0 1.25rem;
        font-size: 1.1rem;
    }

    #hero {
        padding: 4.5rem 2.5rem;
    }

    #hero h2 {
        font-size: 2.75rem;
    }

    #hero p {
        font-size: 1.25rem;
    }

    #about {
        padding: 4rem 2.5rem;
    }

    .certificates {
        padding: 3.5rem 2.5rem;
    }

    .certificate-container,
    .skills-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }

    .projects-grid,
    .testimonials-grid {
        grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    }

    #projects {
        padding: 4.5rem 2.5rem;
    }

    #testimonials {
        padding: 4.5rem 2.5rem;
    }

    #contact {
        padding: 4rem 2.5rem;
    }

    #contact .sub-title {
        font-size: 3.25rem;
    }

    .contact-left {
        flex-basis: 40%;
    }

    .contact-right {
        flex-basis: 55%;
    }
}

/* Ultra Large Devices (> 1920px) */
@media only screen and (min-width: 1921px) {
    body {
        font-size: 18px;
    }

    header {
        padding: 2rem 3rem;
    }

    header h1 {
        font-size: 2.5rem;
    }

    nav a {
        margin: 0 1.5rem;
        font-size: 1.25rem;
    }

    #hero {
        padding: 5rem 3rem;
    }

    #hero h2 {
        font-size: 3rem;
    }

    #hero p {
        font-size: 1.4rem;
    }

    #about {
        padding: 5rem 3rem;
    }

    .certificates {
        padding: 4rem 3rem;
    }

    .certificate-container,
    .skills-grid {
        grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    }

    .projects-grid,
    .testimonials-grid {
        grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
    }

    .project-img {
        height: 300px;
    }

    #projects {
        padding: 5rem 3rem;
    }

    #testimonials {
        padding: 5rem 3rem;
    }

    #contact {
        padding: 5rem 3rem;
    }

    #contact .sub-title {
        font-size: 3.5rem;
    }

    .contact-left {
        flex-basis: 35%;
    }

    .contact-right {
        flex-basis: 60%;
    }
}