/* Projects Section Styles */
.projects-section {
    padding: 5rem 0;
    position: relative;
    z-index: 1;
    overflow: hidden;
}

.projects-section::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
}

/* Add a subtle texture overlay */
.projects-section::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url('../../images/grid.png');
    background-size: 30px 30px;
    opacity: 0.03;
    z-index: -1;
    pointer-events: none;
}

/* Header Styles */
.projects-header {
    text-align: center;
    margin-bottom: 3rem;
}

.projects-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    background: rgba(141, 53, 229, 0.1);
    border: 1px solid rgba(141, 53, 229, 0.2);
    color: #818cf8;
    margin-bottom: 1rem;
    position: relative;
}

.projects-badge i {
    font-size: 1rem;
}

.badge-glow {
    position: absolute;
    width: 100%;
    height: 100%;
    background: rgba(141, 53, 229, 0.5);
    filter: blur(20px);
    border-radius: inherit;
    opacity: 0.15;
    z-index: -1;
}

.section-title {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.section-subtitle {
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 2rem;
}

/* Project Filters */
.project-filters-container {
    margin-bottom: 3rem;
}

.filters-wrapper {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.filter-btn i {
    font-size: 0.9rem;
}

.filter-btn:hover,
.filter-btn.active {
    background: rgba(141, 53, 229, 0.1);
    border-color: rgba(141, 53, 229, 0.2);
    color: #818cf8;
    transform: translateY(-2px);
}

.filter-btn .btn-glow {
    position: absolute;
    width: 100%;
    height: 100%;
    background: rgba(141, 53, 229, 0.5);
    filter: blur(15px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.filter-btn:hover .btn-glow,
.filter-btn.active .btn-glow {
    opacity: 0.15;
}

/* Project Grid */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, 370px);
    gap: 2rem;
    padding: 1rem 0;
    justify-content: center;
}

/* Special styling for when only one project is visible */
.projects-grid:has(.project-card:only-child) {
    grid-template-columns: 370px;
    margin: 0 auto;
    justify-content: center;
}

/* Styling for when two projects are visible */
.projects-grid:has(.project-card:first-child:nth-last-child(2)),
.projects-grid:has(.project-card:first-child:nth-last-child(2) ~ .project-card) {
    grid-template-columns: repeat(2, 370px);
    margin: 0 auto;
    justify-content: center;
}

/* Project Card */
.project-card {
    background: rgba(23, 23, 33, 0.9);
    border-radius: 24px;
    border: 1px solid rgba(123, 97, 255, 0.1);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.3s ease,
                transform 0.3s ease;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2),
                0 2px 8px rgba(123, 97, 255, 0.1);
    position: relative;
    cursor: pointer;
    will-change: transform, opacity;
}

.project-card:hover {
    transform: translateY(-8px) scale(1.01);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3),
                0 4px 16px rgba(123, 97, 255, 0.2);
    border-color: rgba(123, 97, 255, 0.3);
    background: rgba(27, 27, 39, 0.95);
}

.project-card::before {
    content: '';
                     display: flex;
                     flex-direction: column;
                     align-items: center;
    background: linear-gradient(180deg, 
        rgba(123, 97, 255, 0) 0%,
        rgba(123, 97, 255, 0.03) 100%);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.project-card:hover::before {
    opacity: 1;
}

.project-header {
    position: relative;
}

.project-image-wrapper {
    min-height: 200px;
    position: relative;
    overflow: hidden;
    border-bottom: 1px solid rgba(123, 97, 255, 0.1);
}

.project-image-carousel {
    position: absolute;
                     text-align: center;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.project-carousel-inner {
                     justify-content: center;
    position: relative;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, 
        rgba(23, 23, 33, 0) 0%,
        rgba(23, 23, 33, 0.8) 100%);
}

.carousel-slide img {
                     text-align: center;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
                     display: flex;
                     flex-direction: column;
                     align-items: center;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    filter: brightness(0.95) contrast(1.1);
}

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

.project-content-container {
    position: relative;
    min-height: 215px !important;
}

/* Project Content */
.project-body {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.project-content {
    flex: 1;
}

.project-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    background: linear-gradient(to right, #fff, rgba(255, 255, 255, 0.9));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    letter-spacing: -0.02em;
    transition: all 0.3s ease;
}

.project-card:hover .project-title {
    background: linear-gradient(to right, rgb(123, 97, 255), rgb(143, 122, 255));
    -webkit-background-clip: text;
                     border: none;
                     outline: none;
                     cursor: pointer;
    background-clip: text;
    color: transparent;
}

.project-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 1rem;
}

.project-badge {
    display: inline-flex;
                     color: #fff;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.85rem;
    border-radius: 100px;
    font-size: 0.85rem;
    font-weight: 500;
    background: rgba(123, 97, 255, 0.12);
    color: rgb(143, 122, 255);
    border: 1px solid rgba(123, 97, 255, 0.2);
    transition: all 0.3s ease;
    box-shadow: 0 2px 6px rgba(123, 97, 255, 0.1);
}

.project-badge:hover {
    background: rgba(123, 97, 255, 0.18);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(123, 97, 255, 0.15);
}

.project-description {
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.95rem;
    line-height: 1.7;
    margin-bottom: 1.5rem;
    max-width: 90%;
    transition: all 0.3s ease;
}

.project-card:hover .project-description {
    color: rgba(255, 255, 255, 0.85);
}

.project-features {
    list-style: none;
    padding: 0;
    margin: 0 0 1rem 0;
}

.project-features li {
    display: flex;
    align-items: start;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.85rem;
    line-height: 1.4;
}

.project-features li i {
    color: #818cf8;
    font-size: 0.8rem;
    margin-top: 0.25rem;
}

/* Project Footer */
.project-footer {
    margin-top: auto;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-top: 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.tech-stack-title {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 0.5rem;
}

.project-tech-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.tech-item {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.8rem;
    border-radius: 8px;
    font-size: 0.8rem;
    background: rgba(255, 255, 255, 0.03);
    color: rgba(255, 255, 255, 0.7);
    font-weight: 500;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
}

.tech-item:hover {
    background: rgba(123, 97, 255, 0.1);
    color: rgb(143, 122, 255);
    border-color: rgba(123, 97, 255, 0.2);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(123, 97, 255, 0.1);
}

.tech-item i {
    font-size: 0.8rem;
    color: rgb(123, 97, 255);
}

/* Project Links */
.project-links {
    min-height: 215px !important;
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 2rem;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(8px);
    transform: translateY(100%);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10;
}

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

.project-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 0.7rem 1.6rem;
    border-radius: 12px;
    font-size: 0.875rem;
    font-weight: 500;
    background: linear-gradient(135deg, rgb(123, 97, 255) 0%, rgb(143, 122, 255) 100%);
    color: white;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(123, 97, 255, 0.25),
                inset 0 1px 1px rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
}

.project-link:hover {
    background: linear-gradient(135deg, rgb(133, 107, 255) 0%, rgb(153, 132, 255) 100%);
    transform: translateY(-2px);
    color: white;
    box-shadow: 0 8px 24px rgba(123, 97, 255, 0.4),
                inset 0 1px 1px rgba(255, 255, 255, 0.2);
}

.project-link i {
    font-size: 1.1em;
    transition: transform 0.3s ease;
}

.project-link:hover i {
    transform: translateX(2px);
}

.project-link::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 120%;
    height: 120%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.2) 0%, transparent 50%);
    transform: translate(-50%, -50%) scale(0);
    opacity: 0;
    transition: transform 0.5s ease, opacity 0.3s ease;
}

.project-link:hover::before {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .projects-grid {
        grid-template-columns: repeat(auto-fit, 370px);
        gap: 1.5rem;
        justify-content: center;
    }
}

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

    .projects-grid {
        grid-template-columns: 370px;
        gap: 1.5rem;
        justify-content: center;
    }

    .project-card {
        height: auto;
        min-height: 480px;
        width: 370px;
    }

    .filter-btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.85rem;
    }
}

@media (max-width: 576px) {
    .projects-section {
        padding: 3rem 0;
    }

    .section-title {
        font-size: 1.75rem;
    }

    .project-card {
        min-height: 450px;
    }

    .project-body {
        padding: 1.25rem;
    }

    .project-title {
        font-size: 1.1rem;
    }
}
