@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
    --primary-color: #4F46E5;
    --accent-color: #7C3AED;
    --text-color: #1F2937;
    --link-color: #3B82F6;
    --background-color: #F9FAFB;
    --light-gray: #E5E7EB;
    --gray: #6B7280;
    --dark-gray: #374151;
    --particle-color: rgba(79, 70, 229, 0.5);
    --border-color: #D1D5DB;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
    text-decoration: none;
}

body {
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
    scroll-behavior: smooth;
    text-align: center;
    position: relative;
    overflow-x: hidden;
}

body.dark-mode {
    --background-color: #1F2937;
    --text-color: #F3F4F6;
    --light-gray: #374151;
    --gray: #9CA3AF;
    --link-color: #60A5FA;
    --particle-color: rgba(96, 165, 250, 0.5);
    --border-color: #4B5563;
}

#particle-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
}

#theme-toggle {
    margin-left: 1rem;
    padding: 0.4rem 0.8rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    background: var(--primary-color);
    color: white;
    font-size: 1rem;
    transition: all 0.3s ease;
}

#theme-toggle:hover {
    transform: scale(1.05);
}

.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: var(--background-color);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    transition: all 0.3s ease;
    border-bottom: 1px solid var(--border-color);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0.8rem 1.6rem;
}

.logo {
    display: flex;
    align-items: center;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-color);
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.nav {
    display: flex;
    gap: 2rem;
    justify-content: center;
    align-items: center;
}

.nav-links {
    color: var(--gray);
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.nav-links:hover {
    color: var(--link-color);
    transform: translateY(-2px);
}

.contact-button {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: var(--primary-color);
    color: white;
    padding: 0.5rem 1.2rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.contact-button:hover {
    transform: translateY(-2px);
}

.hamburger-select {
    display: none;
    background: var(--primary-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1.5rem;
    font-weight: 600;
    padding: 0.5rem;
    cursor: pointer;
    color: white;
    width: 50px;
    text-align: center;
    transition: all 0.3s ease;
}

.hamburger-select:hover {
    background: var(--accent-color);
    transform: scale(1.1);
}

.main-section {
    max-width: 1280px;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    padding: 1.6rem;
    gap: 1.6rem;
}

.content-left {
    text-align: left;
    max-width: 50%;
}

.section-label {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--primary-color);
    letter-spacing: 1px;
}

.section-title {
    font-size: 3rem;
    font-weight: 800;
    color: var(--text-color);
    margin: 1rem 0;
}

.section-description {
    font-size: 1rem;
    color: var(--gray);
    line-height: 1.8;
}

.content-right {
    flex: 1;
}

.image-slider {
    position: relative;
    width: 600px;
    height: 400px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
    border: 2px solid var(--border-color);
}

@media (min-width:767px) and (max-width:1000px) {
    .image-slider {
        width: 400px;
        height: 300px;
    }

    .content-left {
        text-align: left;
        max-width: 30%;
    }
}

.slider-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transform: scale(1.05);
    /* Slight zoom for smoother effect */
    transition: opacity 0.6s ease-in-out, transform 0.6s ease-in-out;
    /* Added transform transition */
    will-change: opacity, transform;
    /* Optimize for performance */
}

.slider-image.active {
    opacity: 1;
    transform: scale(1);
    /* Reset scale when active */
}

.About-container {
    max-width: 1280px;
    margin: 4rem auto;
    padding: 1.6rem;
}

.About-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-color);
    text-align: center;
    margin-bottom: 2rem;
}

.About-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(200px, 1fr));
    gap: 1.6rem;
}

.About-card {
    background: var(--background-color);
    border-radius: 12px;
    padding: 1.6rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
}

.About-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

.education-timeline {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.education-item {
    background: var(--background-color);
    border-left: 4px solid var(--primary-color);
    padding: 1.2rem;
    border-radius: 8px;
    position: relative;
    border: 1px solid var(--border-color);
}

.education-item::before {
    content: '';
    position: absolute;
    left: -8px;
    top: 1.5rem;
    width: 12px;
    height: 12px;
    background: var(--primary-color);
    border-radius: 50%;
    border: 2px solid var(--border-color);
}

.education-title-h {
    font-size: 1.4rem;
}

.education-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 0.2rem;
}

.education-details {
    font-size: 0.9rem;
    color: var(--gray);
    line-height: 1.6;
}

.dashboard {
    background: linear-gradient(135deg, var(--light-gray), var(--background-color));
    border-radius: 12px;
    padding: 1.6rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    text-align: center;
    border: 1px solid var(--border-color);
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.dashboard-item {
    background: var(--background-color);
    border-radius: 8px;
    padding: 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
}

.dashboard-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.dashboard-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.dashboard-label {
    font-size: 0.9rem;
    color: var(--gray);
    margin-top: 0.5rem;
}

.social-links {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: space-evenly;
    gap: 1rem;
    grid-column-start: 1;
    grid-column-end: 3;
    margin-top: 1.5rem;
}



@media (min-width: 576px) and (max-width: 1200px) {
    .certificate {
        grid-row-start: 2;
    }

}

@media screen and (max-width:576px) {
    .dashboard-grid {
        grid-template-columns: repeat(1, 1fr);
        gap: 1rem;

    }

    .contact-image {
        display: none;
    }

    .social-links {
        align-items: center;
        justify-content: space-evenly;
    }

    .links-logo {
        width: 15%;
        height: 10%;
    }

}

@media screen and (max-width:320px) {
    .dashboard-item {
        width: 200px;

    }
}

@media screen and (max-width:290px) {
    .dashboard-item {
        width: 170px;

    }
}

@media screen and (min-width:1112px) {
    .header {
        position: fixed;
    }

    .rank {
        grid-column-start: 1;
        grid-column-end: 3;
    }
}

@media (min-width:980px) and (max-width:1112px) {
    .rank {
        grid-column-start: 2;
        grid-column-end: 4;
    }
}

.description {
    margin-top: 1.5rem;
    padding: 2.3rem;
    text-align: left;
    font-size: 0.9rem;
    color: var(--gray);
    line-height: 1.6;
}

.links-logo {
    color: var(--gray);
    font-size: 1rem;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.links-logo:hover {
    color: var(--link-color);
    background: var(--light-gray);
}

.About-avatar {
    width: 40px;
    height: 40px;
    object-fit: contain;
    /* keeps the logo sharp */
}


.About-name {
    color: var(--primary-color);
    font-size: 1.2rem;
    font-weight: 600;
}

.About-text,
.About-desc {
    color: var(--gray);
    font-size: 1rem;
}

.skills-container {
    max-width: 1280px;
    margin: 4rem auto;
    padding: 1.6rem;
}

.skills-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-color);
    text-align: center;
    margin-bottom: 2rem;
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1.5rem;
    background: var(--light-gray);
    padding: 1.6rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.skills-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
}

.skills-logo:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.svg-img {
    width: 50px;
    height: 50px;
}

.logo-txt {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-color);
    margin-top: 0.5rem;
}

.Project-conatiner {
    max-width: 1280px;
    margin: 4rem auto;
    padding: 2rem;
}

.Project-title-h {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-color);
    text-align: center;
    margin: 0 auto;
    padding-top: 3rem;
    margin-bottom: 2.5rem;
}

.Project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.6rem;
    max-width: 1280px;
    justify-items: center;
    margin: 0 auto;
    padding: 0 1rem;
}

.Project-card {
    background: linear-gradient(135deg, #435186, #3856a3);
    border-radius: 12px;
    padding: 1.5rem;
    color: white;
    transition: all 0.3s ease;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
    border: 1px solid var(--border-color);
}

.Project-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

body.dark-mode .Project-card {
    background: var(--background-color);
}


.Project-card:hover .Project-buttons {
    opacity: 1;
    visibility: visible;
}

.icon-container {
    background: rgba(251, 241, 241, 0.1);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
    border: 1px solid var(--border-color);
}

.Project-svg {
    width: 60px;
    height: 60px;
}

.Project-info {
    text-align: center;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.Project-title {
    font-size: 1.4rem;
    font-weight: 600;
    min-height: 3rem;
}

.Project-description {
    font-size: 0.9rem;
    margin: 0.5rem 0;
    min-height: 5rem;
    padding: 1rem;
}

.Project-buttons {
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    display: flex;
    gap: 1rem;
    justify-content: space-evenly;
    margin-top: 1rem;
}

.theory-button,
.project-link {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid var(--border-color);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

@media screen and(max-width:576px) {

    .theory-button,
    .project-link {
        font-size: 0.5rem;
    }
}

.theory-button:hover,
.project-link:hover {
    transform: translateY(-2px);
}

.experience-container {
    max-width: 1280px;
    margin: 4rem auto;
    padding: 1.6rem;
}

.experience-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-color);
    text-align: center;
    margin-bottom: 2rem;
}

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

.experience-card {
    background: var(--background-color);
    border-radius: 12px;
    padding: 1rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
    position: relative;

}

.experience-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

.experience-card:hover .experience-buttons {
    opacity: 1;
    visibility: visible;
}

.experience-name {
    color: var(--primary-color);
    font-size: 1.3rem;
    font-weight: 600;
    display: flex;
    flex-direction: column;
}

.experience-desc {
    color: var(--gray);
    font-size: 1rem;
}

.experience-buttons {
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    display: flex;
    justify-content: center;
}

.experience-button {
    background: var(--primary-color);
    color: white;
    border: 1px solid var(--border-color);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.experience-button:hover {
    transform: translateY(-2px);
    background: var(--accent-color);
}

.certificates-container {
    max-width: 1280px;
    margin: 4rem auto;
    padding: 1.6rem;
}

.certificates-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-color);
    text-align: center;
    margin-bottom: 2rem;
}

.certificates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.6rem;
}

.certificate-placeholder {
    background: linear-gradient(135deg, var(--light-gray), var(--background-color));
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    color: var(--gray);
    font-size: 1rem;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.certificate-placeholder::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: 0.5s;
}

.certificate-placeholder:hover::before {
    left: 100%;
}

.certificate-placeholder:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

.popup {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.popup-content {
    background: var(--background-color);
    padding: 2rem;
    border-radius: 12px;
    max-width: 600px;
    width: 90%;
    position: relative;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
}

.popup-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--gray);

}

.popup-close:hover {
    color: var(--primary-color);
}

#popup-description {
    color: var(--text-color);
    font-size: 1rem;
    line-height: 1.6;

}

.contact-container {
    margin: 4rem auto;
    padding: 1.6rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;

}

body.dark-mode .input_ {
    background-color: #1F2937;
}

.contact-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 2rem;
}

.contact-content {
    display: flex;
    gap: 1.6rem;
    width: 100%;
    border: 1px solid var(--border-color);
    padding: 2rem;
    background-color: #fff;
    border-radius: 16px;
    max-width: 1000px;
}

.dark-img {
    display: none;
    justify-content: center;
    align-items: center;
}

.light-img {
    justify-content: center;
    align-items: center;
}

body.dark-mode .contact-content {
    background-color: #1F2937;
}

body.dark-mode .contact-image img {
    border-radius: 12px;
}

body.dark-mode .dark-img {
    display: block;
}

body.dark-mode .light-img {
    display: none;
}

.contact-image {
    flex: 1;
    max-width: 300px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.contact-image img {
    width: 100%;
}

.form-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-container input,
.form-container textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    background: white;
    transition: border-color 0.3s ease;
}

.form-container input:focus,
.form-container textarea:focus {
    border-color: var(--primary-color);
    outline: none;
}

.form-container button {
    background: var(--primary-color);
    color: white;
    border: 1px solid var(--border-color);
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    align-self: flex-start;
}


.form-container button:hover {
    background: var(--accent-color);
    transform: translateY(-2px);
}

.footer-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 1.6rem;
    background: var(--background-color);
    text-align: center;
    border-top: 1px solid var(--border-color);
}

.footer {
    display: flex;
    justify-content: space-between;
    gap: 1.6rem;
    flex-wrap: wrap;
}

.footer-top,
.footer-grid,
.footer-right {
    flex: 1;
    min-width: 200px;
}

.footer-grid-heading {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 1rem;
}

.footer-links-list {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.footer-link {
    color: var(--gray);
    font-size: 0.9rem;
}

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

.social {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 1rem;
}

.social-icon {
    width: 24px;
    height: 24px;
}

.footer-copyright {
    text-align: center;
    color: var(--gray);
    font-size: 0.9rem;
    margin-top: 1.2rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border-color);
}

/* Scroll Animations */
[data-aos="scroll-up"] {
    opacity: 0;
    transform: translateY(50px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

[data-aos="scroll-up"].aos-animate {
    opacity: 1;
    transform: translateY(0);
}

/* Media Queries for Responsiveness */

/* Extra Small Devices (Mobile Smartphones, <= 576px) */
@media screen and (max-width: 576px) {

    .experience-buttons,
    .Project-buttons {
        opacity: 1;
        visibility: visible;
        margin-top: 1rem;
    }

    .experience-button {
        font-size: 0.8rem;
        padding: 0.4rem 0.8rem;
    }
}

.social-name {
    font-size: 0.9rem;
}

@media screen and (max-width: 576px) {
    .main-section {
        flex-direction: column; /* Stack content vertically on small screens */
        padding: 10px;
    }
    .content-left{
        padding: 3rem;
    }
    .header-content {
        padding: 0.5rem;
    }

    .logo {
        font-size: 1.2rem;
    }

    body.dark-mode .dark-img,
    .light-img {
        display: none;
    }

    .description {
        text-align: center;
        font-size: 0.8rem;
    }

    .contact-image img {
        display: none;
    }

    .logo-text {
        font-size: 1.2rem;
    }

    .social-name {
        display: none;
    }

    .nav,
    .contact-button {
        display: none;
    }

    .hamburger-select {
        display: block;
        font-size: 1.2rem;
        width: 50px;
    }

    .main-section {
        flex-direction: column;
        padding: 0.5rem;
        gap: 0.5rem;
    }

    .content-left {
        max-width: 100%;
        justify-content: center;
        text-align: center;
    }

    /*.content-right {
        display: ;
        /* Hide profile image on mobile */

    .section-label {
        font-size: 0.9rem;
    }

    .section-title {
        font-size: 1.5rem;
    }

    .section-description {
        font-size: 0.8rem;
        line-height: 1.4;
    }

    .About-title,
    .skills-title,
    .Project-title-h,
    .experience-title,
    .certificates-title,
    .contact-title {
        font-size: x-large;
    }


    .About-grid {
        grid-template-columns: 1fr;
        gap: 0.8rem;
        display: flex;
        flex-direction: column;
    }

    .About-card {
        padding: 0.8rem;
        order: 1;
        /* Education first */
    }

    .dashboard {
        order: 2;
        /* Dashboard second */
        padding: 0.8rem;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
        gap: 0.8rem;
    }

    .dashboard-item {
        padding: 0.6rem;
        grid-column-start: 1;
        grid-row-start: auto;
    }

    .dashboard-value {
        font-size: 1.2rem;
    }

    .dashboard-label {
        font-size: 0.8rem;
    }

    .description {
        order: 3;
        /* Description after dashboard */
        padding: 0.8rem;
        margin-top: 0.8rem;
    }

    .social-links {
        order: 4;
        /* Links after description */
        gap: 0.4rem;
    }

    .links-logo {
        font-size: 0.8rem;
        padding: 0.3rem 0.6rem;
    }

    .links-logo img {
        width: 20px;
        /* Smaller link icons */
        height: 20px;
    }

    .education-timeline {
        gap: 0.8rem;
    }

    .education-item {
        padding: 0.8rem;
    }



    .education-details {
        font-size: 0.9rem;
    }

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

    .skills-logo {
        padding: 0.6rem;
    }

    .svg-img {
        width: 30px;
        height: 30px;
    }

    .logo-txt {
        font-size: 0.7rem;
    }

    .Project-grid {
        grid-template-columns: 1fr;
        gap: 0.8rem;
    }

    .Project-card {
        padding: 0.8rem;
    }

    .Project-svg {
        width: 50px;
        height: 50px;
    }



    .Project-description {
        font-size: 0.7rem;
    }

    .experience-grid {
        grid-template-columns: 1fr;
        gap: 0.8rem;
    }

    .experience-card {
        padding: 0.8rem;
    }

    .experience-name {
        font-size: 1.1rem;
    }

    .experience-desc {
        font-size: 0.9rem;
    }

    .certificates-grid {
        grid-template-columns: 1fr;
        gap: 0.8rem;
    }

    .certificate-placeholder {
        padding: 0.8rem;
    }

    .contact-container {
        padding: 0.8rem;
    }

    .contact-content {
        flex-direction: column;
        gap: 0.8rem;
    }

    .contact-image {
        max-width: 120px;
    }



    .form-container {
        gap: 0.4rem;
    }

    .form-container input,
    .form-container textarea {
        padding: 0.5rem;
        font-size: 0.9rem;
    }

    .form-container button {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
        align-self: center;
    }

    .footer {
        flex-direction: column;
        gap: 0.8rem;
    }

    .footer-top,
    .footer-grid,
    .footer-right {
        width: 100%;
    }

    .footer-grid-heading {
        font-size: 1rem;
    }

    .footer-link {
        font-size: 0.8rem;
    }
}

/* Small Devices (Tablets, 577px to 768px) */
@media screen and (min-width: 577px) and (max-width: 768px) {
    .header-content {
        padding: 0.8rem;
    }

    .logo {
        font-size: 1.6rem;
    }

    .logo-text {
        font-size: 1.5rem;
    }

    .nav,
    .contact-button {
        display: none;
    }

    .hamburger-select {
        display: block;
        font-size: 1.3rem;
        width: 55px;
    }

    .main-section {
        flex-direction: column;
        padding: 1.5rem;
        gap: 1.5rem;
    }

    .content-left {
        max-width: 100%;
        text-align: center;
    }

    .section-title {
        font-size: 2.5rem;
    }

    .section-description {
        font-size: 1rem;
    }

    .image-container,
    .content-right {
        display: none;
    }

    .About-grid {
        grid-template-columns: 1fr;
        gap: 0.8rem;
        display: flex;
        flex-direction: column;
    }

    .About-card {
        padding: 1.5rem;
    }

    .dashboard-grid {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        gap: 1.2rem;
    }

    .dashboard-item {
        padding: 0.8rem;
    }

    .social-links {
        gap: 0.8rem;
    }

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

    .skills-logo {
        padding: 0.8rem;
    }

    .svg-img {
        width: 45px;
        height: 45px;
    }

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

    .Project-card {
        padding: 1.2rem;
    }

    .Project-svg {
        width: 70px;
        height: 70px;
    }

    .Project-title {
        font-size: 1.3rem;
    }

    .Project-description {
        font-size: 0.85rem;
    }

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

    .experience-card {
        padding: 1.5rem;
    }

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

    .certificate-placeholder {
        padding: 1.5rem;
    }

    .contact-container {
        padding: 1.5rem;
    }

    .contact-content {
        flex-direction: column;
        gap: 1.5rem;
    }

    .contact-image {
        max-width: 200px;
    }

    .form-container {
        gap: 0.8rem;
    }

    .form-container button {
        align-self: center;
    }

    .footer {
        flex-direction: column;
        gap: 1.5rem;
    }

    .footer-top,
    .footer-grid,
    .footer-right {
        width: 100%;
    }
}

@media screen and (max-width:768px) {
    .image-slider {
        width: 300px;
        height: 300px;
        margin: 0 auto;
    }
}

/* Medium Devices (Small Laptops, 769px to 992px) */
@media screen and (min-width: 769px) and (max-width: 992px) {
    .header-content {
        padding: 0.7rem 1.5rem;
    }

    .logo {
        font-size: 1.7rem;
    }

    .logo-text {
        font-size: 1.2rem;
    }

    .nav {
        gap: 1rem;
    }

    .nav-links {
        font-size: 0.8rem;
    }

    .contact-button {
        padding: 0.2rem 0.5rem;
        font-size: 0.4rem;
    }

    .hamburger-select {
        display: none;
    }

    .main-section {
        flex-direction: row;
        padding: 1.5rem;
        gap: 1.5rem;
    }

    .content-left {
        max-width: 60%;
    }

    .section-title {
        font-size: 3rem;
    }

    .section-description {
        font-size: 1rem;
    }

    .image-container {
        max-width: 350px;
    }

    .About-grid {
        grid-template-columns: repeat(2, minmax(200px, 1fr));
        gap: 1.5rem;
    }

    .About-card {
        padding: 1.4rem;
    }

    .dashboard-grid {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        gap: 1.2rem;
    }

    .dashboard-item {
        padding: 1rem;
    }

    .social-links {
        gap: 1rem;
    }

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

    .skills-logo {
        padding: 1rem;
    }

    .svg-img {
        width: 45px;
        height: 45px;
    }

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

    .Project-card {
        padding: 1.5rem;
    }

    .Project-svg {
        width: 75px;
        height: 75px;
    }

    .Project-title {
        font-size: 1.3rem;
    }

    .Project-description {
        font-size: 0.9rem;
    }

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

    .experience-card {
        padding: 1.5rem;
    }

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

    .certificate-placeholder {
        padding: 1.5rem;
    }

    .contact-container {
        padding: 1.5rem;
    }

    .contact-content {
        flex-direction: row;
        gap: 1.5rem;
    }

    .contact-image {
        max-width: 250px;
    }

    .form-container {
        gap: 1rem;
    }

    .footer {
        flex-direction: row;
        gap: 1.5rem;
    }

    .footer-top,
    .footer-grid,
    .footer-right {
        min-width: 180px;
    }
}

/* Large Devices (Laptops/Desktops, 993px to 1200px) */
@media screen and (min-width: 993px) and (max-width: 1200px) {
    .header-content {
        padding: 0.7rem 1.5rem;
    }

    .logo {
        font-size: 1.8rem;
    }

    .image-slider {
        max-width: 500px;
    }

    .logo-text {
        font-size: 1.5rem;
    }

    .nav {
        gap: 1.8rem;
    }

    .nav-links {
        font-size: 1rem;
    }

    .contact-button {
        padding: 0.5rem 1.2rem;
    }

    .main-section {
        padding: 2rem;
        gap: 2rem;
    }

    .content-left {
        max-width: 55%;
    }

    .section-title {
        font-size: 3rem;
    }

    .section-description {
        font-size: 1rem;
    }

    .image-container {
        max-width: 380px;
    }

    .About-grid {
        grid-template-columns: repeat(2, minmax(200px, 1fr));
        gap: 1.6rem;
    }

    .About-card {
        padding: 1.6rem;
    }

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

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

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

    .Project-card {
        padding: 1.5rem;
    }

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

    .certificates-grid {
        grid-template-columns: repeat(3, minmax(240px, 1fr));
        gap: 1.6rem;
    }

    .contact-container {
        padding: 1.6rem;
    }

    .contact-content {
        gap: 1.6rem;
    }

    .contact-image {
        max-width: 280px;
    }

    .footer {
        gap: 2rem;
    }
}

/* Extra Large Devices (Large Desktops, > 1200px) */
@media screen and (min-width: 1201px) {
    .header-content {
        padding: 0.8rem 1.6rem;
    }

    .image-slider {
        max-width: 500px;
    }

    .logo {
        font-size: 1.8rem;
    }

    .logo-text {
        font-size: 1.5rem;
    }

    .nav {
        gap: 2rem;
    }

    .nav-links {
        font-size: 1rem;
    }

    .contact-button {
        padding: 0.5rem 1.2rem;
    }

    .main-section {
        padding: 2rem;
        gap: 2rem;
    }

    .content-left {
        max-width: 50%;
    }

    .section-title {
        font-size: 3rem;
    }

    .section-description {
        font-size: 1rem;
    }

    .image-container {
        max-width: 360px;
    }

    .About-grid {
        grid-template-columns: repeat(2, minmax(200px, 1fr));
        gap: 1.6rem;
    }

    .About-card {
        padding: 1.6rem;
    }

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

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

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

    .Project-card {
        padding: 1.5rem;
    }

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

    .certificates-grid {
        grid-template-columns: repeat(3, minmax(250px, 1fr));
        gap: 1.6rem;
    }

    .contact-container {
        padding: 1.6rem;
    }

    .contact-content {
        gap: 1.6rem;
    }

    .contact-image {
        max-width: 300px;
    }

    .footer {
        gap: 2rem;
    }
}

/* New Hamburger Button & Mobile Nav */
.hamburger-btn {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 28px;
    height: 20px;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 1500;
}

.hamburger-btn .bar {
    width: 100%;
    height: 3px;
    background-color: var(--text-color);
    transition: 0.3s;
    border-radius: 2px;
}

/* Open state animation */
.hamburger-btn.active .bar:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.hamburger-btn.active .bar:nth-child(2) {
    opacity: 0;
}

.hamburger-btn.active .bar:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* Mobile nav sliding panel */
.mobile-nav {
    display: none;
    flex-direction: column;
    position: fixed;
    top: 60px;
    right: 0;
    width: 200px;
    background-color: var(--background-color);
    border-left: 1px solid var(--border-color);
    box-shadow: -2px 0 5px rgba(0, 0, 0, 0.1);
    padding: 1rem;
    z-index: 1400;
}

.mobile-nav a {
    padding: 0.75rem 0;
    color: var(--text-color);
    text-align: left;
}

/* Show hamburger & hide normal nav only on mobile */
@media screen and (max-width: 768px) {
    .hamburger-btn {
        display: flex;
        justify-self: right;
    }

    .header-content {
        justify-content: space-between;
    }

    .nav,
    .contact-button,
    .hamburger-select {
        display: none !important;
    }
}

/* Ensure theme toggle is always visible */
#theme-toggle {
    display: inline-block !important;
    margin-left: 1rem;
}

@media screen and (max-width: 576px) {
    #theme-toggle {
        margin-left: auto;
        margin-right: 0.5rem;
    }
}

/* Animated theme toggle switch */
#theme-toggle {
    width: 50px;
    height: 26px;
    background: var(--primary-color);
    border-radius: 50px;
    position: relative;
    border: 1px solid var(--border-color);
    cursor: pointer;
    overflow: hidden;
    padding: 0;
    display: inline-block;
    transition: background 0.3s ease;
}

#theme-toggle .toggle-circle {
    content: "";
    position: absolute;
    top: 50%;
    /* center vertically */
    left: 3px;
    /* small gap from left edge */
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.3s ease;
}

@media (min-width:577px) and (max-width:770px) {
    #theme-toggle {
        position: absolute;
        right: 50px;
        /* Adjust this value to position it left of the hamburger menu */
        top: 19px;
        /* Adjust this value to align vertically */
        /* z-index: 10; */
        /* Ensure it stays above other elements */
    }
}


/* When in dark mode (body.dark-mode) slide the circle */
body.dark-mode #theme-toggle {
    background: var(--gray);
}

body.dark-mode #theme-toggle .toggle-circle {
    transform: translateX(24px);
    background: #ffe066;
    /* sun color */
}

/* Optional: small sun/moon icon effect using box-shadow */
#theme-toggle .toggle-circle::before {
    content: "";
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 70%;
    box-shadow: -4px -4px 0 0 #f0c420 inset;
    /* subtle crescent */
    opacity: 0;
    transition: opacity 0.3s ease;
}

body.dark-mode #theme-toggle .toggle-circle::before {
    opacity: 1;
}

/* Reduce vertical gaps between sections */
.About-container,
.skills-container,
.Project-conatiner,
.experience-container,
.certificates-container,
.contact-container {
    margin: 2rem auto;
    /* was 4rem auto */
    padding: 1.6rem;
    /* reduce internal padding */
}

/* On mobile reduce even more */
@media screen and (max-width: 576px) {

    .About-container,
    .skills-container,
    .Project-conatiner,
    .experience-container,
    .certificates-container,
    .contact-container {
        margin: 1.5rem auto;
        padding: 1rem;
    }
}

/* New stylish Contact button */
.contact-button {
    position: relative;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: #fff;
    border: none;
    border-radius: 50px;
    /* pill shape */
    padding: 0.5rem 1.2rem;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
    overflow: hidden;
}

.contact-button::after {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: 0.5s;
}

.contact-button:hover::after {
    left: 100%;
}

.contact-button:hover {
    transform: translateY(-3px) scale(1.03);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2);
}

/* On mobile reduce padding a bit */
@media screen and (max-width: 576px) {
    .contact-button {
        padding: 0.6rem 1.5rem;
        font-size: 0.9rem;
    }
}

.contact-image {
    flex: 1;
    max-width: 300px;
    width: 300px;
    /* Set explicit width */
    height: 300px;
    /* Set explicit height */
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    /* Ensure images don't overflow */
}

.contact-image img {
    width: 100%;
    /* Ensure image fills container */
    height: 100%;
    /* Ensure image fills container */
    object-fit: cover;
    /* Maintain aspect ratio, crop if needed */
    border-radius: 12px;
    /* Consistent with dark mode styling */
}

body.dark-mode .contact-image img {
    width: 100%;
    /* Ensure same width in dark mode */
    height: 100%;
    /* Ensure same height in dark mode */
    object-fit: cover;
    /* Consistent behavior */
}

#project-popup {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 2000;
    justify-content: center;
    align-items: center;
    padding: 1rem;
}

.popup-content {
    background: var(--background-color);
    border-radius: 12px;
    max-width: 600px;
    width: 100%;
    height: 700px;
    max-height: 100%;
    padding: 2rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    position: relative;
    animation: slideIn 0.3s ease;
    overflow-y: auto;
    /* Only vertical scrollbar */
    overflow-x: hidden;
    /* Prevent horizontal overflow */
    box-sizing: border-box;
    display: block;
}

/* Hide scrollbar for Chrome, Safari and Opera */
.popup-content::-webkit-scrollbar {
    display: none;
}

/* Hide scrollbar for IE, Edge and Firefox */
.popup-content {
    -ms-overflow-style: none;
    /* IE and Edge */
    scrollbar-width: none;
    /* Firefox */
}



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

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

.popup-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 1.5rem;
    color: var(--gray);
    cursor: pointer;
    transition: color 0.3s ease;
}

.popup-close:hover {
    color: var(--primary-color);
}

.popup-content h3 {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    text-align: center;
}

.popup-content div {
    margin-bottom: 1.2rem;

}

.popup-content h4 {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 0.5rem;
    text-align: left;
}

.popup-content p {
    font-size: 1rem;
    color: var(--gray);
    line-height: 1.6;
    text-align: left;
}

.popup-tools {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.popup-tools span {
    background: var(--light-gray);
    color: var(--text-color);
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
}

@media screen and (max-width: 576px) {
    .Project-card {
        padding: 1.2rem;
    }

    .Project-title {
        font-size: 1.3rem;
    }

    .Project-description {
        font-size: 0.85rem;
    }

    .theory-button,
    .project-link {
        font-size: 0.8rem;
        padding: 0.4rem 0.8rem;
    }

    .popup-content {
        max-height: 70%;
        max-width: 90%;
        padding: 1.5rem;
        overflow: scroll;
    }

    .popup-content h3 {
        font-size: 1.5rem;
    }

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

    .popup-content p {
        font-size: 0.9rem;
    }

    .popup-tools span {
        font-size: 0.8rem;
        padding: 0.3rem 0.6rem;
    }
}