/* ===== General & Typography ===== */
html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: #1A0A2B; /* Darker Purple Base */
    color: #EAE0F5; /* Soft lavender-white for text */
}

/* ===== Interactive Particle Background ===== */
#particles-js {
    position: fixed;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: 0; /* Behind all content */
}

/* Let cursor events pass through the main content to the particles canvas */
main, footer {
    pointer-events: none;
}
/* Re-enable pointer events for all interactive elements */
header, .content-card, .contact-button, .resume-button, .social-icon, .project-link, .profile-image-wrapper, .footer-content, .read-more-btn, .filter-btn {
    pointer-events: auto;
}


/* ===== Header & Navigation ===== */
header {
    background-color: rgba(26, 10, 43, 0.5); /* Semi-transparent base */
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid transparent;
}

header.scrolled {
    background-color: rgba(26, 10, 43, 0.85); /* More opaque on scroll */
    border-bottom: 1px solid #3a2055;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.2);
}

.site-logo {
    width: 40px;
    height: 40px;
    transition: transform 0.3s ease, filter 0.3s ease;
}

.site-logo:hover {
    transform: scale(1.1);
    filter: drop-shadow(0 0 8px #E040FB);
}


.nav-link span {
    position: relative;
    padding-bottom: 6px;
    font-weight: 600;
    color: #EAE0F5;
    transition: color 0.3s ease;
}

.nav-link:hover span {
    color: #E040FB; /* Neon Fuchsia Accent */
}

.nav-link span::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: #E040FB;
    transform: scaleX(0);
    transform-origin: bottom right;
    transition: transform 0.3s ease;
}

.nav-link:hover span::after {
    transform: scaleX(1);
    transform-origin: bottom left;
}

.hover-glow:hover {
    text-shadow: 0 0 10px #E040FB, 0 0 20px #E040FB;
}

/* Mobile Navigation */
.mobile-nav-bg {
    background-color: rgba(26, 10, 43, 0.95);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border-top: 1px solid #3a2055;
}

.nav-link-mobile {
    display: block;
    color: #EAE0F5;
    text-align: center;
    padding: 1rem 0;
    font-size: 1.125rem;
    font-weight: 600;
    transition: background-color 0.3s, color 0.3s;
}

.nav-link-mobile:hover {
    background-color: rgba(224, 64, 251, 0.1);
    color: #E040FB;
}

/* ===== General Sections & Content Cards ===== */
.section-padding {
    padding-top: 100px;
    padding-bottom: 100px;
}

.section-title {
    font-size: 2.25rem; /* text-4xl */
    font-weight: 700;
    text-align: center;
    color: #fff;
    margin-bottom: 4rem;
    position: relative;
    padding-bottom: 1.5rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    text-shadow: 0 0 15px rgba(224, 64, 251, 0.3);
}

@media (min-width: 768px) {
    .section-title {
        font-size: 2.5rem; /* text-5xl */
    }
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, #E040FB, #8E24AA);
    border-radius: 2px;
    box-shadow: 0 0 15px #E040FB;
}

.content-card {
    background: rgba(46, 16, 79, 0.4);
    border-radius: 16px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(224, 64, 251, 0.2);
}

/* ===== Hero & Social Icons ===== */
@keyframes pulseGlow {
    0%, 100% {
        box-shadow: 0 0 25px rgba(224, 64, 251, 0.4);
    }
    50% {
        box-shadow: 0 0 40px rgba(224, 64, 251, 0.7);
    }
}

.profile-image-wrapper {
    display: inline-block;
    position: relative;
    padding: 5px;
    border-radius: 50%;
    background: linear-gradient(45deg, #E040FB, #8E24AA);
    animation: pulseGlow 4s infinite ease-in-out;
    width: fit-content; /* FIX: Prevents stretching */
}

.profile-image {
    border: 4px solid #1A0A2B;
}

.social-icon {
    color: #D1C4E9; /* Lighter purple-gray */
    transition: color 0.3s, text-shadow 0.3s, transform 0.3s;
    font-size: 32px;
}

.social-icon:hover {
    color: #fff;
    text-shadow: 0 0 10px #E040FB;
    transform: translateY(-3px);
}

/* ===== Experience Timeline ===== */
.timeline-line {
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 3px;
    background-color: rgba(224, 64, 251, 0.15);
    transform: translateX(-50%);
}
.timeline-item {
    position: relative;
    margin-bottom: 50px;
}
/* FIXED: Added clearfix to contain floated children */
.timeline-item::after {
    content: "";
    display: table;
    clear: both;
}
.timeline-dot {
    position: absolute;
    left: 50%;
    top: 15px;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background-color: #E040FB;
    transform: translateX(-50%);
    border: 3px solid #1A0A2B;
    box-shadow: 0 0 10px #E040FB;
}
.timeline-content {
    width: calc(50% - 40px);
    padding: 1.5rem;
    position: relative;
}
.timeline-item:nth-child(even) .timeline-content {
    float: right;
}
.timeline-item:nth-child(odd) .timeline-content {
    float: left;
}
.text-accent {
    color: #E040FB;
}

/* Responsive timeline for mobile */
@media (max-width: 768px) {
    .timeline-line {
        left: 8px;
    }
    .timeline-dot {
        left: 8px;
    }
    .timeline-content {
        width: 100%;
        float: none;
        padding-left: 45px;
    }
    .timeline-item:nth-child(even) .timeline-content,
    .timeline-item:nth-child(odd) .timeline-content {
        float: none;
    }
}


/* ===== Skills Section ===== */
.skill-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center; /* Aligns content vertically */
    gap: 1.5rem;
    padding: 1.5rem 1rem;
    transition: all 0.3s ease;
    min-height: 180px; /* Ensures cards have a consistent height */
}

.skill-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.skill-card:hover {
    transform: translateY(-8px);
    background: rgba(224, 64, 251, 0.1);
    box-shadow: 0 0 20px rgba(224, 64, 251, 0.2);
}

.skill-card .skill-info i {
    color: #E040FB;
    font-size: 48px;
    transition: transform 0.3s;
}
.skill-card:hover .skill-info i {
    transform: scale(1.1);
}

.skill-card .skill-info span {
    color: #EAE0F5;
    font-weight: 600;
}

/* New styles for proficiency stars */
.skill-proficiency {
    display: flex;
    gap: 0.25rem;
    font-size: 1rem;
}

.star-full, .star-half {
    color: #FFD700;
    text-shadow: 0 0 5px rgba(255, 215, 0, 0.5);
}

.star-empty {
    color: rgba(234, 224, 245, 0.3);
}

/* NEW: Styles for custom SVG icons */
.custom-svg-icon svg {
    width: 48px;
    height: 48px;
    stroke: #E040FB;
    transition: transform 0.3s;
}

.skill-card:hover .custom-svg-icon svg {
    transform: scale(1.1);
}

/* ===== Projects Section ===== */
#projects-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 2rem;
}

.project-card {
    /* Set a minimum height to reduce vertical jump */
    min-height: 500px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: all 0.4s ease; /* Simplified transition for hiding and overall card movement */
    width: 100%;
}

@media (min-width: 768px) {
    .project-card {
        width: calc(50% - 1rem);
    }
}
@media (min-width: 1024px) {
    .project-card {
        width: calc(33.333% - 1.34rem);
    }
}

.project-card.hiding {
    transform: scale(0.95);
    opacity: 0;
}

.project-card.hidden {
    display: none;
}


.project-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.project-image-container {
    overflow: hidden;
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
}
.project-image {
    position: absolute;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}
.project-card:hover .project-image {
    transform: scale(1.05);
}

.project-description {
    /* Use a very large, specific max-height for expansion that should cover any content */
    transition: max-height 0.4s ease-in-out; 
    line-height: 1.6;
}

.project-description.truncated {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2; /* Truncate to 2 lines */
    overflow: hidden;
    text-overflow: ellipsis;
    /* Set max-height for 2 lines */
    max-height: 3.6em; 
}

.project-description.expanded {
    -webkit-line-clamp: unset;
    /* Use a huge value for max-height when expanded to allow full content */
    max-height: 1000px; 
}

/* REVAMPED: Styling for the Read More button - Now a minimalist text link */
.read-more-btn {
    display: block; /* Takes up its own line, right after the truncated text */
    text-align: left; /* Aligns the link text to the left */
    font-weight: 600;
    background: none;
    border: none;
    padding: 0; /* Remove padding */
    margin-top: 0.25rem; /* Small margin above it */
    cursor: pointer;
    color: #E040FB; /* Keep the accent color */
    text-decoration: underline; /* Add underline for link appearance */
    transition: color 0.2s ease, text-shadow 0.2s ease;
}

.read-more-btn:hover {
    color: #fff; /* White color on hover for high contrast */
    text-shadow: 0 0 5px #E040FB; /* Subtle glow on hover */
    background: none; /* Ensure no background change */
    box-shadow: none; /* Ensure no box shadow */
    text-decoration: underline;
}


.tech-badge {
    font-size: 0.75rem;
    font-weight: 600;
    background-color: rgba(224, 64, 251, 0.15);
    color: #E040FB;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
}

.project-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #EAE0F5;
    font-weight: 600;
    transition: color 0.3s, text-shadow 0.3s;
}

.project-link:hover {
    color: #fff;
    text-shadow: 0 0 5px #E040FB;
}

/* Project Filter Buttons */
.filter-btn {
    font-size: 0.875rem;
    font-weight: 600;
    background-color: rgba(224, 64, 251, 0.15);
    color: #E040FB;
    padding: 0.5rem 1.25rem;
    border-radius: 9999px;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    cursor: pointer;
}

.filter-btn:hover {
    background-color: rgba(224, 64, 251, 0.3);
    border-color: rgba(224, 64, 251, 0.5);
}

.filter-btn.active {
    background-color: #E040FB;
    color: #1A0A2B;
    box-shadow: 0 0 15px rgba(224, 64, 251, 0.5);
    border-color: #E040FB;
}


/* ===== Buttons ===== */
.contact-button, .resume-button {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 700;
    padding: 0.75rem 2rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-size: 1.125rem;
    border: 2px solid #E040FB;
    color: #E040FB;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.contact-button:hover, .resume-button:hover {
    color: #fff;
    transform: translateY(-3px);
    box-shadow: 0 0 20px rgba(224, 64, 251, 0.5);
}

.contact-button::before, .resume-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 100%;
    background: #E040FB;
    transition: width 0.3s ease;
    z-index: -1;
}

.contact-button:hover::before, .resume-button:hover::before {
    width: 100%;
}

/* ===== Footer ===== */
footer {
    border-top: none;
}
.footer-content {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background: rgba(46, 16, 79, 0.4);
    border-radius: 9999px; /* Pill shape */
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(224, 64, 251, 0.2);
    color: #EAE0F5;
    font-size: 0.875rem;
    transition: all 0.3s ease;
}

.footer-content:hover {
    transform: translateY(-3px);
    box-shadow: 0 0 20px rgba(224, 64, 251, 0.5);
    border-color: rgba(224, 64, 251, 0.5);
}


/* ===== Scroll & Load Animations ===== */

.animate-on-load {
    opacity: 0; /* Start hidden */
    animation: fadeInSlideUp 0.8s ease-out forwards;
}

/* UPDATED: New classes for JS-driven animation */
.initially-hidden {
    opacity: 0;
    transition: opacity 0.8s ease, transform 0.8s ease;
    transform: translateY(20px);
}

.fade-in-visible {
    opacity: 1;
    transform: translateY(0);
}

#hero-headline::after {
    content: '|';
    display: inline-block;
    animation: blink-caret 0.75s infinite;
    font-weight: bold;
    color: #E040FB;
    margin-left: 0.25rem; /* Adjust spacing of the cursor */
}

/* The cursor blinking effect */
@keyframes blink-caret {
    from, to { opacity: 1 }
    50% { opacity: 0; }
}

.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.animate-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

@keyframes fadeInSlideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
