* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    line-height: 1.6;
    background: linear-gradient(135deg, #e0f7ff, #fff3e6);
    color: #333;
    overflow-x: hidden;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 200 200"%3E%3Cpath fill="%23ffdd57" opacity="0.1" d="M50 50 L150 50 L100 150 Z"/%3E%3Ccircle fill="%234a00e0" opacity="0.1" cx="150" cy="150" r="20"/%3E%3C/svg%3E') repeat;
    z-index: -1;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: auto;
    padding: 1.5rem;
}

header {
    background: linear-gradient(135deg, #1e3c72, #2a5298);
    color: #fff;
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
    border-bottom: 4px solid #ff6f61;
}

.header-content {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.profile-img img {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: 6px solid #fff;
    object-fit: cover;
    transition: all 0.5s ease;
    box-shadow: 0 0 15px rgba(255, 111, 97, 0.3);
}

.profile-img img:hover {
    transform: rotate(360deg) scale(1.05);
    box-shadow: 0 0 25px rgba(255, 111, 97, 0.6);
}

.header-name-nav {
    display: flex;
    align-items: center;
    flex-grow: 1;
    gap: 2rem;
}

.header-title {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.header-name-nav h1 {
    margin: 0;
    font-family: 'Playfair Display', serif;
    font-size: 2rem;
    font-weight: 700;
    background: linear-gradient(45deg, #fff, #ffdd57);
    -webkit-background-clip: text;
    color: transparent;
    text-shadow: 2px 2px 5px rgba(0, 0, 0, 0.2);
    white-space: nowrap;
}

.header-name-nav p {
    font-size: 1rem;
    color: #fff;
    font-weight: 300;
    margin: 0;
}

nav {
    margin-left: auto;
}

nav ul {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0;
}

nav ul li a {
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.15);
    transition: all 0.4s ease;
}

nav ul li a:hover {
    background: #00C4B4;
    color: #fff;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 196, 180, 0.4);
}

h2 {
    color: #1e3c72;
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: 2.8rem;
    text-align: center;
    margin: 3rem 0 2rem;
    position: relative;
    animation: fadeInDown 1s ease;
}

h2::before {
    content: '';
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 2px;
    background: #ffdd57;
}

h2::after {
    content: '';
    width: 60px;
    height: 5px;
    background: linear-gradient(to right, #00C4B4, #ffdd57);
    position: absolute;
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 5px;
}

/* Welcome Section (Specific to index.html) */
.welcome-section {
    padding: 3rem 0;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
    margin: 2rem auto;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 50vh; /* Ensures it takes up some vertical space */
}

.welcome-content {
    text-align: center;
    max-width: 800px; /* Limits content width for readability */
}

.welcome-content h2 {
    margin-top: 0; /* Overrides global h2 margin */
}

.intro-text {
    font-size: 1.2rem;
    font-weight: 300;
    color: #555;
    margin-bottom: 1.5rem;
    animation: fadeInUp 1s ease;
}

.learn-more-btn {
    display: inline-block;
    padding: 0.8rem 2rem;
    background: #00C4B4;
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1rem;
    border-radius: 25px;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 196, 180, 0.3);
}

.learn-more-btn:hover {
    background: #008F7A;
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 196, 180, 0.5);
    color: #fff; /* Changed from #ffdd57 to #fff */
}

/* Skills, Projects, Certifications, Contact Intro */
.skills-intro, .projects-intro, .certifications-intro, .contact-intro, .about-intro {
    text-align: center;
    margin-bottom: 2rem;
    font-size: 1.2rem;
    font-weight: 300;
    color: #555;
    animation: fadeInUp 1s ease;
}

.skills-content, .projects-content, .certifications-content, .contact-content, .about-content {
    padding: 2rem 0;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

.skills-category, .projects-category, .certifications-category {
    margin-bottom: 3rem;
    position: relative;
}

.category-toggle {
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    color: #1e3c72;
    font-weight: 600;
    font-size: 1.6rem;
    border-radius: 15px;
    background: linear-gradient(135deg, #fff, #e0f7ff);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.4s ease;
}

.category-toggle:hover {
    color: #00C4B4;
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.category-toggle i {
    margin-right: 0.75rem;
    font-size: 1.8rem;
}

.toggle-icon {
    transition: transform 0.4s ease;
}

.toggle-icon.active {
    transform: rotate(180deg);
}

.skills-grid, .projects-grid, .certifications-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 1rem;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.6s ease-in-out;
}

.skills-grid.active {
    max-height: 1500px;
}

.projects-grid.active {
    max-height: 1000px;
}

.certifications-grid.active {
    max-height: 2000px;
}

.skill-card, .project-card, .certification-card {
    background: #fff;
    padding: 2rem;
    border-radius: 20px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.1);
    transition: all 0.5s ease;
    position: relative;
    overflow: hidden;
    animation: fadeInUp 0.5s ease backwards;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.skill-card:nth-child(2), .project-card:nth-child(2), .certification-card:nth-child(2) { animation-delay: 0.1s; }
.skill-card:nth-child(3), .certification-card:nth-child(3) { animation-delay: 0.2s; }
.skill-card:nth-child(4), .certification-card:nth-child(4) { animation-delay: 0.3s; }

.skill-card::before, .project-card::before, .certification-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, rgba(30, 60, 114, 0.1), rgba(0, 196, 180, 0.1));
    opacity: 0;
    transition: opacity 0.5s ease;
    z-index: -1;
}

.skill-card:hover::before, .project-card:hover::before, .certification-card:hover::before {
    opacity: 1;
}

.skill-card.tech-card, .project-card, .certification-card {
    border-bottom: 5px solid #1e3c72;
}

.skill-card.non-tech-card {
    border-bottom: 5px solid #00C4B4;
}

.skill-card:hover, .project-card:hover, .certification-card:hover {
    transform: translateY(-10px) rotate(2deg);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
}

.skill-card h4, .project-card h4, .certification-card h4 {
    color: #1e3c72;
    margin-bottom: 1.2rem;
    font-weight: 600;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    text-align: center;
}

.skill-card.non-tech-card h4 {
    color: #00C4B4;
}

.skill-card ul, .project-card ul {
    list-style: none;
    padding: 0;
}

.skill-card ul会导致 li {
    font-weight: 300;
    color: #555;
    margin-bottom: 0.5rem;
    position: relative;
    padding-left: 1.5rem;
}

.skill-card ul li::before {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    color: #1e3c72;
    position: absolute;
    left: 0;
    font-size: 0.9rem;
}

.skill-card.non-tech-card ul li::before {
    color: #00C4B4;
}

.skill-card p, .project-card p, .certification-card p {
    font-weight: 300;
    color: #555;
    margin-bottom: 1rem;
    text-align: center;
}

/* Project-Specific Styles */
.details-btn {
    background: #00C4B4;
    color: #fff;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    text-decoration: none;
    align-self: flex-start;
}

.details-btn:hover {
    background: #008F7A;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.project-details {
    display: none;
    background: #fff;
    padding: 2rem;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    margin-top: 2rem;
    animation: fadeInUp 0.5s ease;
}

.project-details.active {
    display: block;
}

.project-details h3 {
    color: #1e3c72;
    font-size: 1.8rem;
    margin-bottom: 1rem;
}

.project-details p {
    font-weight: 300;
    color: #555;
    margin-bottom: 1.5rem;
}

.github-btn {
    display: inline-flex;
    align-items: center;
    background: #1e3c72;
    color: #fff;
    padding: 0.7rem 1.5rem;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.github-btn i {
    margin-right: 0.5rem;
}

.github-btn:hover {
    background: #00C4B4;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* Certifications Section */
.certifications-content {
    padding: 2rem 0;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

.certification-card .cert-icon {
    width: 80px;
    height: 80px;
    border-radius: 10px;
    object-fit: cover;
    margin: 0 auto;
    display: block;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.certification-card:hover .cert-icon {
    transform: scale(1.1);
}

.certification-card .screenshot-gallery {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.certification-card .screenshot {
    text-align: center;
}

.certification-card .screenshot p {
    font-weight: 400;
    color: #1e3c72;
    margin-bottom: 0.5rem;
}

.certification-card .screenshot img {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.certification-card .screenshot img:hover {
    transform: scale(1.05);
}

/* Contact Section */
.contact-content {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
}

.contact-form, .contact-info {
    flex: 1;
    min-width: 300px;
    background: #fff;
    padding: 2rem;
    border-radius: 20px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.1);
    transition: all 0.5s ease;
}

.contact-form h3, .contact-info h3 {
    color: #1e3c72;
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.contact-form:hover, .contact-info:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
}

.contact-form .form-group {
    margin-bottom: 1.5rem;
}

.contact-form label {
    display: block;
    font-weight: 600;
    color: #1e3c72;
    margin-bottom: 0.5rem;
}

.contact-form input, .contact-form textarea {
    width: 100%;
    padding: 0.8rem;
    border: 2px solid #e0f7ff;
    border-radius: 10px;
    font-size: 1rem;
    font-family: 'Poppins', sans-serif;
    color: #333;
    background: #f9f9f9;
    transition: border-color 0.3s ease;
}

.contact-form input:focus, .contact-form textarea:focus {
    border-color: #00C4B4;
    outline: none;
    background: #fff;
}

.contact-form textarea {
    resize: vertical;
}

.contact-form .submit-btn {
    background: #00C4B4;
    color: #fff;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.contact-form .submit-btn:hover {
    background: #008F7A;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.contact-info ul {
    list-style: none;
    padding: 0;
}

.contact-info ul li {
    font-weight: 300;
    color: #555;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.contact-info ul li i {
    color: #00C4B4;
    font-size: 1.2rem;
}

.contact-info ul li a {
    color: #1e3c72;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.contact-info ul li a:hover {
    color: #00C4B4;
}

.contact-info .email-link {
    color: #1e3c72;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.contact-info .email-link:hover {
    color: #00C4B4;
}

/* Footer */
footer {
    background: linear-gradient(135deg, #1e3c72, #2a5298);
    color: #fff;
    padding: 2.5rem 0;
    margin-top: 4rem;
    position: relative;
    border-top: 4px solid #00C4B4;
}

footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    opacity: 0.5;
    z-index: -1;
}

footer .container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.social-links {
    display: flex;
    gap: 2rem;
}

.social-links a {
    color: #fff;
    font-size: 2rem;
    transition: all 0.4s ease;
}

.social-links a:hover {
    color: #ffdd57;
    transform: scale(1.3) rotate(15deg);
}

/* Animations */
@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-30px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        text-align: center;
    }
    
    .header-name-nav {
        flex-direction: column;
        gap: 1rem;
    }
    
    .profile-img img {
        width: 80px;
        height: 80px;
    }
    
    .header-name-nav h1 {
        font-size: 1.6rem;
    }
    
    nav ul {
        flex-direction: column;
        gap: 0.8rem;
    }
    
    .skills-grid, .projects-grid, .certifications-grid {
        grid-template-columns: 1fr;
    }
    
    h2 {
        font-size: 2.2rem;
    }
    
    .category-toggle {
        font-size: 1.4rem;
    }
    
    .certification-card .cert-icon {
        width: 60px;
        height: 60px;
    }
    
    .certification-card h4 {
        font-size: 1.2rem;
    }
    
    .contact-content {
        flex-direction: column;
    }
    
    .social-links {
        gap: 1.5rem;
    }
    
    .social-links a {
        font-size: 1.8rem;
    }
    
    .welcome-section {
        padding: 2rem 0;
        min-height: auto; /* Adjusts height for smaller screens */
    }
    
    .intro-text {
        font-size: 1rem;
    }
    
    .learn-more-btn {
        padding: 0.6rem 1.5rem;
        font-size: 1rem;
    }
}

@media (min-width: 769px) {
    .header-content {
        flex-wrap: nowrap;
    }
}

/* Project Detail Page */
.project-detail-page {
    padding: 2rem 0;
}

.project-title {
    text-align: center;
    margin-bottom: 3rem;
}

.project-title h1 {
    font-family: 'Playfair Display', serif;
    font-size: 3rem;
    color: #1e3c72;
    margin-bottom: 0.5rem;
}

.project-title .tagline {
    font-size: 1.3rem;
    font-weight: 300;
    color: #555;
    font-style: italic;
}

.project-layout {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
}

.project-text, .project-visuals {
    flex: 1;
    min-width: 300px;
    background: rgba(255, 255, 255, 0.9);
    padding: 2rem;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

.project-text h3 {
    color: #1e3c72;
    font-size: 1.8rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.project-text ul, .project-visuals ul {
    list-style: none;
    padding: 0;
    margin-bottom: 1.5rem;
}

.project-text ul li, .project-visuals ul li {
    font-weight: 300;
    color: #555;
    margin-bottom: 0.8rem;
    position: relative;
    padding-left: 1.5rem;
}

.project-text ul li::before {
    content: '\f105';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    color: #00C4B4;
    position: absolute;
    left: 0;
    font-size: 1rem;
}

.project-text p, .project-visuals p {
    font-weight: 300;
    color: #555;
    margin-bottom: 1.5rem;
}

.demo-link {
    color: #1e3c72;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.demo-link:hover {
    color: #00C4B4;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .project-layout {
        flex-direction: column;
    }
    
    .project-title h1 {
        font-size: 2.5rem;
    }
    
    .project-title .tagline {
        font-size: 1.1rem;
    }
    
    .project-text h3, .project-visuals h3 {
        font-size: 1.6rem;
    }
}

/* Screenshot Gallery */
.screenshot-gallery {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.screenshot {
    text-align: center;
}

.screenshot p {
    font-weight: 400;
    color: #1e3c72;
    margin-bottom: 0.5rem;
}

.screenshot img {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.screenshot img:hover {
    transform: scale(1.05);
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .screenshot-gallery {
        gap: 1rem;
    }
}

/* About Section */
.about-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    padding: 2rem 0;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

.about-card {
    background: #fff;
    padding: 2rem;
    border-radius: 20px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.1);
    transition: all 0.5s ease;
    position: relative;
    overflow: hidden;
}

.about-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
}

.about-card h3 {
    color: #1e3c72;
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.about-card h4 {
    color: #00C4B4;
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.about-card p {
    font-weight: 300;
    color: #555;
    margin-bottom: 1rem;
}

.about-card ul {
    list-style: none;
    padding: 0;
}

.about-card ul li {
    font-weight: 300;
    color: #555;
    margin-bottom: 0.8rem;
    position: relative;
    padding-left: 1.5rem;
}

.about-card ul li::before {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    color: #00C4B4;
    position: absolute;
    left: 0;
    font-size: 0.9rem;
}

.edu-item, .intern-item {
    margin-bottom: 1.5rem;
}

.edu-item p, .intern-item p {
    font-style: italic;
    color: #777;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .about-content {
        grid-template-columns: 1fr;
    }
    
    .about-card h3 {
        font-size: 1.6rem;
    }
    
    .about-card h4 {
        font-size: 1.2rem;
    }
}
