/* Certificates Section */
.certificates {
    padding: 60px 20px;
}

.certificates .heading {
    text-align: center;
    margin-bottom: 24px;
}

.certificates-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    /* 4 columns like reference on desktop */
    gap: 28px;
    align-items: stretch;
}

.certificate-card {
    background: var(--bg-color);
    /* Matches dark theme */
    border: 1px solid rgba(0, 217, 255, 0.2);
    border-radius: 20px;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.40);
    display: flex;
    flex-direction: column;
}

.certificate-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 217, 255, 0.3);
    border-color: var(--main-color);
}

.certificate-img {
    background: rgba(10, 14, 26, 0.5);
    /* Dark background for transparent images */
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 180px;
    padding: 10px;
    overflow: hidden;
}

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

.certificate-info {
    padding: 18px 20px 22px;
    background: var(--bg-color);
    display: flex;
    flex-direction: column;
    gap: 10px;
    text-align: center;
}

.certificate-info h3 {
    font-size: 1.28rem;
    line-height: 1.35;
    margin: 0 0 6px 0;
    color: var(--text-color);
    font-weight: 800;
}

.certificate-info .issuer,
.certificate-info .year {
    font-size: 1.02rem;
    color: rgba(255, 255, 255, 0.7);
    margin: 0;
    font-weight: 600;
}

.view-all-container {
    display: flex;
    justify-content: center;
    margin-top: 20px;
}

.view-all-btn {
    background: #1f6feb;
    color: #fff;
    border: none;
    padding: 12px 22px;
    border-radius: 999px;
    cursor: pointer;
    box-shadow: 0 6px 16px rgba(31, 111, 235, 0.35);
    font-weight: 600;
}

.view-all-btn:hover {
    filter: brightness(1.05);
}

/* Visibility control for hidden certificates */
.hidden-cert {
    display: none;
}

.hidden-cert.show-cert {
    display: block;
}

@media (max-width: 600px) {
    .certificates {
        padding: 40px 14px;
    }

    .certificates-container {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .certificate-img {
        height: 160px;
        padding: 8px;
    }

    .certificate-info h3 {
        font-size: 1.12rem;
    }
}

@media (max-width: 1024px) {
    .certificates-container {
        grid-template-columns: repeat(2, 1fr);
        /* 2 columns on tablets */
    }
}

/* Image Modal */
.image-modal {
    position: fixed;
    inset: 0;
    display: none;
    z-index: 1000;
}

.image-modal.show {
    display: block;
}

.image-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    /* Darker backdrop */
}

.image-modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 90vw;
    max-height: 85vh;
    background: #0a0e1a;
    border-radius: 12px;
    border: 1px solid rgba(0, 217, 255, 0.2);
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.8);
}

.image-modal-content img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000;
}

.image-modal-close {
    position: absolute;
    top: 8px;
    right: 10px;
    font-size: 28px;
    line-height: 1;
    background: transparent;
    border: none;
    color: #fff;
    cursor: pointer;
}

/* SECTION STYLES */

/* HOME SECTION */
.home {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8rem;
    background: var(--bg-color);
}

.home-content {
    max-width: 60rem;
}

.home-content h3 {
    font-size: 3.2rem;
    font-weight: 700;
    opacity: 0;
    animation: slideBottom 1s ease forwards;
}

.home-content h3:nth-of-type(2) {
    margin-bottom: 2rem;
    animation-delay: 0.7s;
}

.home-content h1 {
    font-size: 5.6rem;
    font-weight: 700;
    line-height: 1.3;
    background: linear-gradient(135deg, var(--main-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    opacity: 0;
    animation: slideRight 1s ease forwards;
    animation-delay: 0.3s;
}

.home-content p {
    font-size: 1.6rem;
    margin: 2rem 0 4rem;
    opacity: 0;
    animation: slideLeft 1s ease forwards;
    animation-delay: 0.5s;
}

.home-img {
    width: 35vw;
    height: 35vw;
    max-width: 450px;
    max-height: 450px;
    position: relative;
}

.home-img::before {
    content: '';
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    background: linear-gradient(135deg, var(--main-color), var(--accent-color));
    border-radius: 50%;
    z-index: -1;
    opacity: 0.3;
    animation: rotateGlow 8s linear infinite;
}

.home-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    border: 4px solid var(--main-color);
    box-shadow: var(--shadow-glow);
    animation: floatImage 6s ease-in-out infinite, zoomIn 1s ease forwards;
    animation-delay: 0s, 0.9s;
    opacity: 0;
}

/* ABOUT SECTION */
.about {
    background: var(--second-bg-color);
    position: relative;
    overflow: hidden;
}

.about::before {
    content: '';
    position: absolute;
    top: 0;
    left: -50%;
    width: 200%;
    height: 100%;
    background: radial-gradient(circle, rgba(0, 217, 255, 0.05) 1px, transparent 1px);
    background-size: 50px 50px;
    /* Static grid looks more premium than continuous moving grid */
}

.about-content {
    position: relative;
    z-index: 2;
}

.about-content h3 {
    font-size: 2.6rem;
    margin-bottom: 2rem;
    text-align: center;
}

.about-content p {
    font-size: 1.6rem;
    line-height: 1.8;
    margin-bottom: 2rem;
    text-align: center;
}

.about-highlights {
    list-style: none;
    max-width: 80rem;
    margin: 3rem auto;
    display: grid;
    gap: 1.5rem;
}

.about-highlights li {
    position: relative;
    padding: 1.5rem 2rem 1.5rem 5rem;
    background: rgba(0, 217, 255, 0.05);
    border: 1px solid rgba(0, 217, 255, 0.2);
    border-radius: 1rem;
    font-size: 1.6rem;
    transition: all 0.3s ease;
}

.about-highlights li::before {
    content: '✓';
    position: absolute;
    left: 2rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 2rem;
    color: var(--main-color);
    font-weight: bold;
}

.about-highlights li:hover {
    background: rgba(0, 217, 255, 0.1);
    transform: translateX(10px);
    border-color: var(--main-color);
}

.about-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(25rem, 1fr));
    gap: 2.5rem;
    margin-top: 4rem;
    max-width: 90rem;
    margin-inline: auto;
}

/* EDUCATION SECTION */
.education {
    background: var(--bg-color);
    color: var(--text-color);
    position: relative;
    padding-top: 8rem;
    padding-bottom: 8rem;
}

.education::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80%;
    height: 80%;
    background: radial-gradient(circle, rgba(0, 217, 255, 0.03), transparent);
    border-radius: 50%;
}

.education .heading {
    color: var(--text-color);
    will-change: transform, opacity, filter;
    overflow: hidden;
}

.education .heading span {
    background: linear-gradient(135deg, var(--main-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.education .heading.reveal-init {
    opacity: 0;
    transform: translateY(18px);
    filter: blur(6px);
}

.education .heading.reveal-in {
    animation: headingFadeUp .9s cubic-bezier(.25, .6, .3, 1) forwards;
    animation-duration: .9s !important;
}

.education .heading.reveal-in::after {
    animation: headingShimmer 1.1s .2s ease forwards;
    animation-duration: 1.1s !important;
    animation-delay: .2s !important;
}

.education-scroll {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    overflow: visible;
    padding: 0;
    scroll-snap-type: none;
}

.education-scroll::-webkit-scrollbar {
    height: 10px;
}

.education-scroll::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 10px;
}

.edu-card {
    scroll-snap-align: start;
    background: linear-gradient(135deg, rgba(0, 217, 255, 0.05), rgba(102, 126, 234, 0.05));
    border: 1px solid rgba(0, 217, 255, 0.2);
    border-radius: 1.6rem;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.2);
    padding: 2.2rem;
    transition: transform .28s ease, box-shadow .25s ease, border-color .25s ease;
    position: relative;
}

.edu-card::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 1.6rem;
    pointer-events: none;
    box-shadow: 0 0 0 0 rgba(0, 217, 255, 0.35);
    transition: box-shadow .25s ease;
}

.edu-card:hover {
    transform: scale(1.02);
    border-color: var(--main-color);
    box-shadow: 0 15px 40px rgba(0, 217, 255, 0.2);
}

.edu-card:hover::after {
    box-shadow: 0 0 0 .16rem rgba(0, 217, 255, 0.38);
}

.edu-header h3 {
    font-size: 2rem;
    margin: 0 0 .6rem;
    color: var(--text-color);
    font-weight: 600;
}

.edu-header h4 {
    font-size: 1.6rem;
    margin: 0 0 1rem;
    color: var(--main-color);
}

.edu-meta {
    display: flex;
    flex-wrap: wrap;
    gap: .8rem 1.2rem;
    margin-bottom: 1.2rem;
}

.edu-year,
.edu-grade {
    display: inline-block;
    font-size: 1.35rem;
    padding: .4rem .9rem;
    border-radius: 1rem;
    background: rgba(102, 126, 234, 0.1);
    color: var(--text-color);
    border: 1px solid rgba(102, 126, 234, 0.3);
}

.edu-card p {
    font-size: 1.5rem;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.85);
    margin: 0;
}

/* SKILLS SECTION */
.skills {
    background: var(--second-bg-color);
}

.skills-categories {
    max-width: 110rem;
    margin: 0 auto 5rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(30rem, 1fr));
    gap: 3rem;
}

.category {
    background: linear-gradient(135deg, rgba(0, 217, 255, 0.05), rgba(102, 126, 234, 0.05));
    padding: 3rem 2.5rem;
    border-radius: 1.5rem;
    border: 1px solid rgba(0, 217, 255, 0.2);
    transition: all 0.3s ease;
}

.category:hover {
    transform: translateY(-10px);
    border-color: var(--main-color);
    box-shadow: 0 10px 30px rgba(0, 217, 255, 0.3);
}

.category h3 {
    font-size: 2.2rem;
    margin-bottom: 2rem;
    color: var(--main-color);
}

.skills-list {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.skills-container {
    max-width: 110rem;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(35rem, 1fr));
    gap: 3rem;
}

.skills-box {
    background: linear-gradient(135deg, rgba(0, 217, 255, 0.05), rgba(102, 126, 234, 0.05));
    padding: 4rem 3rem;
    border-radius: 2rem;
    border: 1px solid rgba(0, 217, 255, 0.2);
    text-align: center;
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
}

.skills-box::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(from 0deg, transparent, rgba(0, 217, 255, 0.1), transparent 30%);
    transition: all 0.6s ease;
    opacity: 0;
}

.skills-box:hover::before {
    opacity: 1;
    /* Remove aggressive rotation on hover, keep subtle glow */
}

.skills-box:hover {
    transform: translateY(-5px);
    /* Reduced float height */
    border-color: var(--main-color);
    box-shadow: 0 15px 40px rgba(0, 217, 255, 0.15);
    /* Softer shadow */
}

.skills-box i {
    font-size: 5rem;
    color: var(--main-color);
    margin-bottom: 2rem;
    position: relative;
    z-index: 2;
    transition: all 0.3s ease;
}

.skills-box:hover i {
    transform: scale(1.2) rotateY(360deg);
}

.skills-box h3 {
    font-size: 2.4rem;
    margin-bottom: 1.5rem;
    position: relative;
    z-index: 2;
}

.skills-box p {
    font-size: 1.6rem;
    line-height: 1.8;
    position: relative;
    z-index: 2;
}

/* PROJECTS SECTION */
.projects {
    background: var(--bg-color);
    position: relative;
    padding: 10rem 9% 5rem;
}

.projects .heading {
    position: relative;
    z-index: 10;
    margin-bottom: 6rem;
}

.projects-container {
    max-width: 120rem;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(55rem, 1fr));
    gap: 4rem;
    position: relative;
    z-index: 1;
}

.project-card {
    display: flex;
    flex-direction: column;
    padding: 0;
    background: linear-gradient(135deg, rgba(0, 217, 255, 0.05), rgba(102, 126, 234, 0.05));
    border: 1px solid rgba(0, 217, 255, 0.2);
    border-radius: 2rem;
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.project-card:hover {
    transform: translateY(-10px);
    border-color: var(--main-color);
    box-shadow: 0 15px 40px rgba(0, 217, 255, 0.3);
    z-index: 2;
}

.project-img {
    height: 40rem;
    width: 100%;
    opacity: 1;
    overflow: hidden;
    border-radius: 2rem 2rem 0 0;
    margin-bottom: 0;
    background: rgba(10, 14, 26, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.project-img img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    opacity: 1;
    transition: transform 0.5s ease;
}

.project-card:hover .project-img img {
    transform: scale(1.05);
}

.project-info {
    padding: 3rem;
}

.project-info h3 {
    font-size: 2.6rem;
    margin-bottom: 1.5rem;
    color: var(--text-color);
}

.project-info p {
    font-size: 1.7rem;
    line-height: 1.9;
    margin-bottom: 2rem;
    opacity: 0.9;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 2.5rem;
}

.project-tags span {
    padding: 0.7rem 1.8rem;
    background: rgba(102, 126, 234, 0.2);
    border: 1px solid rgba(102, 126, 234, 0.3);
    border-radius: 2rem;
    font-size: 1.4rem;
    color: var(--accent-color);
}

.project-links {
    display: flex;
    gap: 1.5rem;
}

/* CONTACT SECTION */
.contact {
    background: var(--second-bg-color);
}

.contact-description {
    text-align: center;
    font-size: 1.8rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

.contact-header-accent {
    width: 100px;
    height: 4px;
    background: linear-gradient(90deg, var(--main-color), var(--accent-color));
    margin: 0 auto 5rem;
    border-radius: 2px;
}

.contact form {
    max-width: 70rem;
    margin: 0 auto;
    text-align: center;
}

.contact form .input-box {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 2rem;
    margin-bottom: 2rem;
}

.contact form .input-box input {
    width: calc(50% - 1rem);
    padding: 1.5rem;
    font-size: 1.6rem;
    color: var(--text-color);
    background: rgba(0, 217, 255, 0.05);
    border: 1px solid rgba(0, 217, 255, 0.2);
    border-radius: 1rem;
    transition: all 0.3s ease;
}

.contact form .input-box input[type="text"],
.contact form .input-box input[type="email"],
.contact form .input-box input[type="tel"],
.contact form textarea {
    background: rgba(0, 217, 255, 0.05);
    border: 1px solid rgba(0, 217, 255, 0.2);
    color: var(--text-color);
    transition: background .3s ease, border-color .3s ease, box-shadow .3s ease;
}

.contact form .input-box input[type="text"]::placeholder,
.contact form .input-box input[type="email"]::placeholder,
.contact form .input-box input[type="tel"]::placeholder,
.contact form textarea::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.contact form .input-box input[type="text"]:focus,
.contact form .input-box input[type="email"]:focus,
.contact form .input-box input[type="tel"]:focus,
.contact form textarea:focus {
    background: rgba(0, 217, 255, 0.1);
    border-color: var(--main-color);
    box-shadow: 0 0 15px rgba(0, 217, 255, 0.3);
    outline: none;
}

.contact form input[type="text"]:-webkit-autofill,
.contact form input[type="email"]:-webkit-autofill,
.contact form input[type="tel"]:-webkit-autofill {
    -webkit-box-shadow: 0 0 0 1000px rgba(0, 217, 255, 0.05) inset;
    -webkit-text-fill-color: var(--text-color);
    transition: background-color 9999s ease-out 0s;
}

.contact form .input-box input[type="text"]:invalid:not(:placeholder-shown),
.contact form .input-box input[type="email"]:invalid:not(:placeholder-shown),
.contact form .input-box input[type="tel"]:invalid:not(:placeholder-shown),
.contact form textarea:invalid:not(:placeholder-shown) {
    border-color: #f87171;
    box-shadow: 0 0 0 1px #f87171;
}

.contact form textarea {
    width: 100%;
    padding: 1.5rem;
    font-size: 1.6rem;
    color: var(--text-color);
    background: rgba(0, 217, 255, 0.05);
    border: 1px solid rgba(0, 217, 255, 0.2);
    border-radius: 1rem;
    resize: none;
    margin-bottom: 2rem;
    transition: all 0.3s ease;
}

.contact form textarea:focus {
    background: rgba(0, 217, 255, 0.1);
    border-color: var(--main-color);
    box-shadow: 0 0 15px rgba(0, 217, 255, 0.3);
}

.contact form .btn {
    margin-top: 2rem;
    cursor: pointer;
}

.contact form input:valid,
.contact form textarea:valid {
    border-color: #4ade80;
}

.contact form input:invalid:not(:placeholder-shown),
.contact form textarea:invalid:not(:placeholder-shown) {
    border-color: #f87171;
}

/* FOOTER */
.footer {
    background: var(--bg-color);
    padding: 5rem 9%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3rem;
    border-top: 1px solid rgba(0, 217, 255, 0.1);
}

.footer::before {
    content: '';
    width: 100px;
    height: 4px;
    background: linear-gradient(90deg, var(--main-color), var(--accent-color));
    margin: 0 auto 5rem;
    border-radius: 2px;
}

.footer-name {
    font-size: 2.8rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--main-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.footer-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2rem;
}

.footer-nav a {
    font-size: 1.6rem;
    color: var(--text-color);
    transition: all 0.3s ease;
    position: relative;
    padding: 0.5rem 1rem;
}

.footer-nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--main-color);
    transition: width 0.3s ease;
}

.footer-nav a:hover::after,
.footer-nav a.active::after {
    width: 100%;
}

.footer-nav a:hover,
.footer-nav a.active {
    color: var(--main-color);
}

.footer-social {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

.footer-social a {
    width: 4.5rem;
    height: 4.5rem;
    display: flex;
    justify-content: center;
    align-items: center;
    background: transparent;
    border: 2px solid var(--main-color);
    border-radius: 50%;
    font-size: 2.2rem;
    color: var(--main-color);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.footer-social a::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 100%;
    background: var(--main-color);
    transition: width 0.3s ease;
    z-index: -1;
}

.footer-social a:hover::before {
    width: 100%;
}

.footer-social a:hover {
    color: var(--bg-color);
    transform: translateY(-5px) rotate(360deg);
    box-shadow: var(--shadow-glow);
}

.footer-text {
    text-align: center;
    margin-top: 2rem;
}

.footer-text p {
    font-size: 1.5rem;
    opacity: 0.7;
}