/* Projects Section Styles */
.cosmic-section {
    position: relative;
    min-height: 100vh;
    padding: 100px 0;
    background: #0a0a0f;
    overflow: hidden;
}

/* Galaxy Background */
.galaxy-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at center, #1a0b2e 0%, #16213e 25%, #0f0f1e 50%, #0a0a0f 100%);
    z-index: 1;
}

.stars-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: radial-gradient(2px 2px at 20px 30px, #eee, transparent),
    radial-gradient(2px 2px at 40px 70px, rgba(255, 255, 255, 0.8), transparent),
    radial-gradient(1px 1px at 90px 40px, #fff, transparent),
    radial-gradient(1px 1px at 130px 80px, rgba(255, 255, 255, 0.6), transparent),
    radial-gradient(2px 2px at 160px 30px, rgba(255, 255, 255, 0.9), transparent);
    background-repeat: repeat;
    background-size: 200px 100px;
    animation: moveStars 20s linear infinite;
    z-index: 2;
}

.stars-layer:nth-child(2) {
    background-size: 250px 120px;
    animation: moveStars 30s linear infinite reverse;
    opacity: 0.7;
}

.stars-layer:nth-child(3) {
    background-size: 300px 150px;
    animation: moveStars 40s linear infinite;
    opacity: 0.5;
}

@keyframes moveStars {
    0% {
        transform: translateX(0) translateY(0);
    }
    100% {
        transform: translateX(-200px) translateY(-100px);
    }
}

/* Blinking Stars */
.blinking-stars {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 3;
}

.blinking-star {
    position: absolute;
    width: 2px;
    height: 2px;
    background: #fff;
    border-radius: 50%;
    animation: blink 2s ease-in-out infinite;
}

.blinking-star:nth-child(2n) {
    animation-delay: 0.5s;
    background: #a855f7;
}

.blinking-star:nth-child(3n) {
    animation-delay: 1s;
    background: #3b82f6;
}

@keyframes blink {
    0%, 100% {
        opacity: 0.3;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.5);
    }
}

/* Galaxy Nebula Effect */
.nebula-effect {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse 400px 200px at 20% 30%, rgba(168, 85, 247, 0.1) 0%, transparent 50%),
    radial-gradient(ellipse 300px 150px at 80% 70%, rgba(59, 130, 246, 0.1) 0%, transparent 50%),
    radial-gradient(ellipse 500px 250px at 50% 50%, rgba(147, 51, 234, 0.05) 0%, transparent 50%);
    animation: nebulaFloat 15s ease-in-out infinite;
    z-index: 4;
}

@keyframes nebulaFloat {
    0%, 100% {
        transform: rotate(0deg) scale(1);
    }
    50% {
        transform: rotate(1deg) scale(1.1);
    }
}

/* Section Title - FIXED VISIBILITY */
.section-title {
    margin-bottom: 60px;
    position: relative;
    z-index: 50; /* Increased z-index */
}

.cosmic-title {
    font-size: 3.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #fff 0%, #a855f7 50%, #3b82f6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 20px;
    text-align: center;
    position: relative;
    animation: titleGlow 3s ease-in-out infinite;
    text-shadow: 0 0 30px rgba(168, 85, 247, 0.5); /* Added for better visibility */
}

@keyframes titleGlow {
    0%, 100% {
        filter: drop-shadow(0 0 10px rgba(168, 85, 247, 0.3));
    }
    50% {
        filter: drop-shadow(0 0 20px rgba(168, 85, 247, 0.6));
    }
}

.highlight {
    color: #a855f7 !important;
    -webkit-text-fill-color: #a855f7 !important; /* Force visibility */
    text-shadow: 0 0 30px rgba(168, 85, 247, 0.8);
}

.title-line {
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, #a855f7, #3b82f6);
    margin: 0 auto;
    border-radius: 2px;
    position: relative;
    overflow: hidden;
    animation: lineGlow 2s ease-in-out infinite;
}

@keyframes lineGlow {
    0%, 100% {
        box-shadow: 0 0 10px rgba(168, 85, 247, 0.5);
    }
    50% {
        box-shadow: 0 0 20px rgba(168, 85, 247, 0.8);
    }
}

/* Project Filters */
.project-filters {
    display: flex;
    justify-content: center;
    margin-bottom: 50px;
    position: relative;
    z-index: 40;
}

.filter-container {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    padding: 15px 25px;
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(25px);
    border-radius: 50px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.filter-btn {
    padding: 12px 25px;
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 25px;
    font-weight: 500;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

.filter-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.2), rgba(59, 130, 246, 0.2));
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -1;
}

.filter-btn:hover::before,
.filter-btn.active::before {
    opacity: 1;
}

.filter-btn:hover,
.filter-btn.active {
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(168, 85, 247, 0.3);
    border-color: rgba(168, 85, 247, 0.4);
}

/* Projects Grid */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
    gap: 30px;
    padding: 20px 0;
    position: relative;
    z-index: 30;
}

/* Project Card */
.project-card {
    position: relative;
    height: 450px;
    opacity: 0;
    transform: translateY(50px);
    animation: cardFadeIn 0.8s ease forwards;
    cursor: pointer;
}

@keyframes cardFadeIn {
    0% {
        opacity: 0;
        transform: translateY(50px) scale(0.9);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.project-card.filtered-out {
    opacity: 0 !important;
    transform: translateY(30px) scale(0.8) !important;
    pointer-events: none;
    transition: all 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.projects-grid {
    transition: all 0.3s ease-out;
}

.project-card:not(.filtered-out) {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
    transition: all 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Glassmorphism Card */
.project-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.project-card:hover .project-card-inner {
    background: rgba(255, 255, 255, 0.02);
    border-color: rgba(168, 85, 247, 0.2);
    box-shadow: 0 20px 60px rgba(168, 85, 247, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

/* Mouse Tracking Effect */
.mouse-light {
    position: absolute;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(168, 85, 247, 0.1) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    transition: opacity 0.3s ease;
    opacity: 0;
    z-index: 5;
}

.project-card:hover .mouse-light {
    opacity: 1;
}

/* Project Content */
.project-card-front {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.project-card:hover .project-card-front {
    opacity: 0.2;
    filter: blur(3px);
    transform: scale(0.95);
}

.project-image-container {
    position: relative;
    height: 250px;
    overflow: hidden;
    border-radius: 15px 15px 0 0;
}

.project-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: all 0.6s ease;
    filter: brightness(0.7) saturate(0.8);
}

.project-card:hover .project-image {
    transform: scale(1.1);
    filter: brightness(0.4) saturate(0.6);
}

.featured-tag {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(168, 85, 247, 0.8);
    backdrop-filter: blur(10px);
    color: white;
    padding: 6px 14px;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 600;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 15px rgba(168, 85, 247, 0.3);
}

.project-meta {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.project-category {
    display: inline-block;
    background: rgba(168, 85, 247, 0.15);
    color: #a855f7;
    padding: 6px 14px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 12px;
    border: 1px solid rgba(168, 85, 247, 0.2);
    align-self: flex-start;
    backdrop-filter: blur(10px);
}

.project-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 15px;
    line-height: 1.3;
}

.tech-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: auto;
}

.tech-badge {
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.9);
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 500;
    border: 1px solid rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

/* Clean Glass Overlay - Coming down from TOP */
.project-details-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Clean glass effect - no gradients */
    background: rgba(15, 15, 25, 0.85);
    backdrop-filter: blur(30px) saturate(1.2);
    border-radius: 20px;
    padding: 35px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    /* Starting position - above the card */
    transform: translateY(-100%);
    opacity: 0;
    visibility: hidden;
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 25;
    box-shadow: 0 25px 70px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.15),
    inset 0 -1px 0 rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Smooth slide down animation */
.project-card:hover .project-details-overlay {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
    transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Ultra smooth content animations */
.project-details-overlay h3 {
    font-size: 1.6rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 18px;
    text-shadow: 0 2px 10px rgba(168, 85, 247, 0.3);
    /* Smooth content entrance */
    transform: translateY(30px);
    opacity: 0;
    transition: all 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.2s;
}

.project-card:hover .project-details-overlay h3 {
    transform: translateY(0);
    opacity: 1;
}

.project-details-overlay p {
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.7;
    margin-bottom: 28px;
    font-size: 0.95rem;
    font-weight: 400;
    /* Smooth content entrance */
    transform: translateY(30px);
    opacity: 0;
    transition: all 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.3s;
}

.project-card:hover .project-details-overlay p {
    transform: translateY(0);
    opacity: 1;
}

.project-links {
    display: flex;
    gap: 16px;
    justify-content: center;
    /* Smooth content entrance */
    transform: translateY(30px);
    opacity: 0;
    transition: all 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.4s;
}

.project-card:hover .project-links {
    transform: translateY(0);
    opacity: 1;
}

.project-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 22px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    text-decoration: none;
    border-radius: 25px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    border: 1px solid rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(15px);
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.project-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.15);
    transition: left 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    z-index: -1;
}

.project-link:hover::before {
    left: 0;
}

.project-link:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
}

.project-link.github:hover {
    background: rgba(88, 166, 255, 0.25);
    border-color: rgba(88, 166, 255, 0.4);
    box-shadow: 0 8px 30px rgba(88, 166, 255, 0.15);
}

/* GitHub Activity Indicator */
.github-activity {
    position: absolute;
    top: 12px;
    left: 12px;
    background: rgba(34, 197, 94, 0.9);
    color: white;
    padding: 5px 10px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    animation: pulse 2s ease-in-out infinite;
    z-index: 10;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 0.9;
    }
    50% {
        transform: scale(1.05);
        opacity: 1;
    }
}

/* View More Button */
.cosmic-download-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 15px 30px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    color: #fff;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
    z-index: 20;
}

.cosmic-download-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #a855f7, #3b82f6);
    transition: left 0.3s ease;
    z-index: -1;
}

.cosmic-download-btn:hover::before {
    left: 0;
}

.cosmic-download-btn:hover {
    color: #fff;
    transform: translateY(-3px);
    box-shadow: 0 15px 35px rgba(168, 85, 247, 0.4);
    border-color: transparent;
}

/* Responsive Design */
@media (max-width: 768px) {
    .cosmic-title {
        font-size: 2.5rem;
    }

    .projects-grid {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 10px;
    }

    .project-card {
        height: 400px;
    }

    .filter-container {
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }

    .project-links {
        flex-direction: column;
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .cosmic-title {
        font-size: 2rem;
    }

    .project-card {
        height: 350px;
    }

    .project-image-container {
        height: 200px;
    }

    .project-meta {
        padding: 15px;
    }

    .project-details-overlay {
        padding: 25px;
    }
}