/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    font-family: "Darker Grotesque", sans-serif;
    font-weight: 500;
    font-style: normal;
    font-size: clamp(16px, 2vw, 25px);
}

html {
    min-height: 100vh;
}

body {
    margin: 0;
    font-family: 'Darker Grotesque', monospace;
    color: #ffffff;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: #121212;
    position: relative;
    scrollbar-width: thin;
    scrollbar-color: #888 #f1f1f1;
}

/* Scrollbar Styles */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Layout */
.body {
    padding: 40px;
    flex: 1;
    display: flex;
    gap: 30px;
    max-width: 1400px;
    padding-bottom: 0px;
}

.navbar {
    position: sticky;
    top: 0;
    display: flex;
    padding: 5px 80px;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(2.5px);
    z-index: 1000;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.footer {
    padding: 20px;
    text-align: center;
}

.main-footer {
    margin-top: 1rem;
}

.footer-container {
    max-width: 1000px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: start;
}

.copyright-section {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 234, 0, 0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.copyright-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.copyright-right {
    display: flex;
    gap: 1rem;
}

/* Typography */
h1 {
    font-size: clamp(1.5rem, 4vw, 3.5rem);
    color: #FFEA00;
    margin-bottom: 1rem;
    text-align: center;
}

.intro {
    font-size: clamp(30px, 4vw, 50px);
    letter-spacing: 1px;
}

.name a {
    color: #FFEA00;
    font-weight: 700;
    text-decoration: underline;
    font-size: clamp(35px, 5vw, 50px);
}

.copyright {
    text-align: center;
    font-size: 14px;
    color: #d3d3d3;
}

.subtitle {
    font-size: 1.5rem;
    opacity: 0.8;
}

.footer-left h2 {
    font-size: 2rem;
    color: #FFEA00;
    margin-bottom: 1rem;
}

.footer-left p {
    margin-bottom: 0.6rem;
    line-height: 1.6;
}

.skill-name {
    font-size: 1rem;
    padding-bottom: 0.25rem;
}

.research h1 {
    font-size: 2rem;
    color: #FFEA00;
    margin-bottom: 2.5rem;
    text-align: center;
}

.research-title a {
    font-size: 1rem;
    color: aqua;
    text-decoration: none;
    transition: all 0.3s ease;
}

.research-description {
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

/* Links and Buttons */
.footer-left .contact-email {
    color: #00d4ff;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-left .contact-email:hover {
    color: #FFEA00;
}

.card-buttons button {
    background-color: rgba(255, 234, 0, 0.8);
    padding: 6px 20px;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    font-weight: 500;
}

.card-buttons button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 234, 0, 0.5);
}

.card-buttons button a {
    color: #000000;
    text-decoration: none;
}

.submit-btn {
    background-color: rgba(255, 234, 0, 0.8);
    color: #000000;
    padding: 0.4rem 1rem;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-family: 'Darker Grotesque', monospace;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    width: 100%;
}

.submit-btn:hover {
    box-shadow: 0 4px 12px rgba(255, 234, 0, 0.5);
}

.info-card a {
    color: #ffffff;
    text-decoration: none;
    transition: color 0.3s ease;
}

.info-card a:hover {
    color: #FFEA00;
}

.social-link {
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    transition: all 0.3s ease;
}

.social-link:hover {
    background: rgba(255, 234, 0, 0.2);
    transform: translateY(-2px);
}

.support-btn {
    display: inline-block;
    background-color: rgba(255, 234, 0, 0.8);
    color: #000000;
    padding: 0.2rem 1.5rem;
    margin-left: 10px;
    border-radius: 12px;
    text-align: center;
    text-decoration: none;
}

.copyright-right a {
    color: #FFEA00;
    text-decoration: none;
    transition: color 0.3s ease;
}

.copyright-right a:hover {
    color: #00d4ff;
}

.research-title a:hover {
    color: #FFEA00;
    text-decoration: underline;
}

/* Section Styles */


.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    /* margin-bottom: 25px; */
}

.section-header h1 {
    margin: 0 40px;
}

.section-header a {
    margin: 0 40px;
    text-align: left;
}

.view-more {
    color: #ffff00;
}


.section-divider {
    height: 1px;
    background: linear-gradient(to right, transparent, rgba(255, 234, 0, 0.4), transparent);
    margin: 1rem 0;
}

.research {
    margin: 0 auto;
    padding: 2rem;
    max-width: 1400px;
}

.research-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
}

.research-text {
    flex: 1;
    padding-right: 2rem;
}

.research-title {
    margin-bottom: 1.5rem;
}

/* Card Components */
.card-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 400px));
    gap: 40px;
    justify-content: center;
    padding: 20px;
}

.cards {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    overflow: hidden;
    height: auto;
    min-height: 450px;
    backdrop-filter: blur(5px);
    position: relative;
    display: flex;
    flex-direction: column;
    /* opacity: 0.95; */
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0);
    border: 2px solid rgba(255, 234, 0, 0.4);
}

.card-image {
    /* width: 100%; */
    height: 250px;
    overflow: hidden;
    position: relative;
    flex: 0 0 auto;
    padding: 25px;
    padding-bottom: 14px;
}

.card-image img {
    backdrop-filter: none;
    /* box-shadow: 0 0 15px 5px rgba(255, 234, 0, 0.6); */
    border-radius: 15px;
    width: 100%;
    height: 100%;
    object-fit: fill;
}

.card-content {
    padding: 25px;
    /* position: relative; */
    z-index: 1;
    flex: 1;
    display: flex;
    padding-top: 0;
    flex-direction: column;
}
.card-content h3 {
    /* color: rgba(255, 234, 0, 0.8); */
    color: #ddd;
    font-size: clamp(24px, 2.5vw, 30px);
    line-height: 1;
}


.card-content p {
    margin-top: 5px;
    font-size: clamp(20px, 2vw, 23px);
    line-height: 1.2;
    flex: 1;
    color: #d0d0d0;
}


.card-tags {
    display: flex;
    flex-wrap: wrap;
    /* gap: 3px; */
    /* margin: 7px 0; */
    justify-content: flex-start;
    gap: 0;
}

.card-tags p {
    /* background-color: rgba(255, 255, 255, 0.1); */
    padding:3px;
    color: rgba(255, 234, 0, 0.8);
    border-radius: 5px;
    font-size: clamp(13px, 1.4vw, 17px);
    border: none;
    transition: all 0.3s ease;
    flex:0;
}

.card-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    position: relative;
    width: 100%;
    z-index: 1;
    margin-top: 10px;
}

/* Image Containers & Flip Animation */
.image-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 15px;
    max-width: 350px;
    width: 100%;
}

.flip-card {
    background-color: transparent;
    width: 300px;
    height: 300px;
    perspective: 1000px;
    transform: rotate(7deg);
    /* Only one instance of this property */
}

.flip-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.8s;
    transform-style: preserve-3d;
}

.flip-card:hover .flip-card-inner {
    transform: rotateY(180deg);
}

.flip-card-front,
.flip-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 10px;
    overflow: hidden;
}

.flip-card-back {
    transform: rotateY(180deg);
}

.image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 10px;
}

.research-image {
    flex: 0 0 40%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.research-image img {
    max-width: 100%;
    border-radius: 10px;
    border: 1px solid rgba(255, 234, 0, 0.3);
    transition: transform 0.5s ease;
}

.research-image img:hover {
    transform: scale(1.05);
}

/* About Section */
.about {
    flex: 1;
    margin: 20px;
    margin-top: 0;
    padding-left: 15px;
}


/* Star Glow Animation */
@keyframes starGlowGreen {

    0%,
    100% {
        text-shadow: none;
    }

    50% {
        text-shadow: 0 0 10px rgba(173, 255, 47, 0.8),
            0 0 20px rgba(173, 255, 47, 0.6),
            0 0 30px rgba(173, 255, 47, 0.4),
            0 0 40px rgba(173, 255, 47, 0.3);
    }
}

@keyframes starGlowYellow {

    0%,
    100% {
        text-shadow: none;
    }

    50% {
        text-shadow: 0 0 10px rgba(255, 255, 0, 0.8),
            0 0 20px rgba(255, 255, 0, 0.6),
            0 0 30px rgba(255, 255, 0, 0.4),
            0 0 40px rgba(255, 255, 0, 0.3);
    }
}

@keyframes starGlowRed {

    0%,
    100% {
        text-shadow: none;
    }

    50% {
        text-shadow: 0 0 10px rgba(255, 0, 0, 0.8),
            0 0 20px rgba(255, 0, 0, 0.6),
            0 0 30px rgba(255, 0, 0, 0.4),
            0 0 40px rgba(255, 0, 0, 0.3);
    }
}

.star-link {
    text-decoration: none;
    position: relative;
    display: inline-block;
    transition: all 0.3s ease;
}

/* Projects and Articles links (green) */
.projects-link.star-link {
    animation: starGlowGreen 3s ease-in-out infinite;
    animation-delay: calc(var(--random-delay) * 1s);
}

.articles-link.star-link {
    animation: starGlowYellow 3s ease-in-out infinite;
    animation-delay: calc(var(--random-delay) * 1s);
}

/* Resume, GitHub, and LeetCode links (red) */
.resume-link.star-link,
.github-link.star-link,
.leetcode-link.star-link {
    animation: starGlowRed 3s ease-in-out infinite;
    animation-delay: calc(var(--random-delay) * 1s);
}

.star-link:hover {
    animation: none;
    transform: scale(1.05);
}

.projects-link:hover {
    text-shadow: 0 0 15px rgba(173, 255, 47, 1),
        0 0 30px rgba(173, 255, 47, 0.8),
        0 0 45px rgba(173, 255, 47, 0.6),
        0 0 60px rgba(173, 255, 47, 0.4);
}

.articles-link:hover {
    text-shadow: 0 0 15px rgba(255, 255, 0, 1),
        0 0 30px rgba(255, 255, 0, 0.8),
        0 0 45px rgba(255, 255, 0, 0.6),
        0 0 60px rgba(255, 255, 0, 0.4);
}

.resume-link:hover,
.github-link:hover,
.leetcode-link:hover {
    text-shadow: 0 0 15px rgba(255, 0, 0, 1),
        0 0 30px rgba(255, 0, 0, 0.8),
        0 0 45px rgba(255, 0, 0, 0.6),
        0 0 60px rgba(255, 0, 0, 0.4);
}

/* Responsive grid adjustments */
@media (max-width: 1200px) {
    .card-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .card-container {
        grid-template-columns: 1fr;
    }
}

/* Contact Section */
.contact-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.contact-header {
    text-align: center;
    margin-bottom: 3rem;
}

.contact-header h1 {
    font-size: 3rem;
    color: #FFEA00;
    margin-bottom: 1rem;
}

.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.contact-form-container {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 234, 0, 0.3);
    border-radius: 15px;
    padding: 2rem;
}

.contact-form-container h2 {
    color: #FFEA00;
    margin-bottom: 1.5rem;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.form-group {
    margin-bottom: 0.5rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.1rem;
    background: transparent;
    border: none;
    /* border-radius: 10px; */
    border-bottom: 2px solid rgba(255, 234, 0, 0.3);
    color: #ffffff;
    font-family: 'Darker Grotesque', monospace;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.form-group textarea {
    height: 50px;
    resize: vertical;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-bottom-color: #FFEA00;
}

.form-group select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.form-group select option {
    background-color: rgba(255, 234, 0);
    color: #000000;
    padding: 10px;
}

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

.info-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 234, 0, 0.5);
    border-radius: 15px;
    padding: 1.5rem;
}

.info-card h2 {
    color: #FFEA00;
    margin-bottom: 1rem;
}

.social-links {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Utility Classes */
.tech-stack-title {
    color: #adff2f;
}

.projects-link {
    color: #adff2f;
}

.articles-link {
    color: #ffff00;
}

.resume-link,
.github-link,
.leetcode-link {
    color: #ff0000;
}

.copyright-left .heart {
    color: #00d4ff;
    font-size: 1.2rem;
}

.skill-logo {
    width: 20px;
    height: 20px;
}

.marquee-container {
    display: flex;
    animation: scroll 60s linear infinite;
    width: max-content;
}

@keyframes scroll {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }
}

.card-tags-tech {
    display: inline-flex;
    gap: 1rem;
    padding-right: 1rem;
}

.tag {
    display: flex;
    align-items: center;
    gap: 5px;
    border-radius: 5px;
    white-space: nowrap;
}

.research-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 0.5rem;
}

.research-tags .tag {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    padding: 0.4rem 0.8rem;
    border-radius: 12px;
    font-size: 0.7rem;
    transition: all 0.3s ease;
}

.research-tags .tag:hover {
    background: rgba(255, 234, 0, 0.2);
    transform: translateY(-2px);
}

/* Media Queries */
@media (max-width: 968px) {
    .research-item {
        flex-direction: column;
    }

    .research-text {
        padding-right: 0;
        margin-bottom: 1.5rem;
    }

    .research h1 {
        font-size: 2.4rem;
    }

    .research-title a {
        font-size: 1.6rem;
    }

    .research-description {
        font-size: 1.3rem;
    }

    .research-tags .tag {
        font-size: 1rem;
    }
}

@media (max-width: 768px) {
    .body {
        flex-direction: column;
        align-items: center;
    }

    .card-container {
        grid-template-columns: minmax(300px, 1fr);
        padding: 10px;
        margin: 10px;
    }

    .cards {
        margin: 0 auto;
        width: 100%;
        max-width: 400px;
    }

    .card-image {
        height: 225px;
    }

    .image-container {
        order: -1;
        max-width: 100%;
        padding: 15px;
    }

    .flip-card {
        width: 300px;
        height: 300px;
    }

    .about {
        width: 100%;
        text-align: left;
    }

    .section {
        text-align: left;
        gap: 10px;
        padding-top: 10px;
    }

    .card-tags {
        justify-content: left;
    }
    
    .card-buttons {
        flex-direction: row;
        gap: 15px;
    }
    
    .contact-grid {
        grid-template-columns: 1fr;
    }
    
    .contact-container {
        padding: 1rem;
    }
    
    .contact-header h1 {
        font-size: 2.5rem;
    }
    
    .subtitle {
        font-size: 1.2rem;
    }
    
    .main-footer {
        padding: 30px 20px 25px;
    }
    
    .footer-container {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .footer-left h2 {
        font-size: 1.8rem;
    }
    
    .copyright-section {
        flex-direction: column;
        text-align: center;
    }
    
    .copyright-right {
        justify-content: center;
    }
}

@media (max-width: 480px) {

    .image-container {
        padding: 10px;
    }
    
    .flip-card {
        width: 250px;
        height: 250px;
    }
    
    .card-tags {
        justify-content: left;
    }

    .card-tags p {
        font-size: clamp(12px, 1.2vw, 16px);
        padding: 3px;
    }

    .card-buttons {
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }

    .card-buttons button {
        width: 80%;
    }

    .copyright-right {
        flex-direction: column;
        gap: 1rem;
    }
}

#topo-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    opacity: 0.4; /* Adjust opacity as needed */
}