@import './root.css';

/* =========================================
   1. MAIN CONTAINER
   ========================================= */
.projects {
    position: fixed;
    top: 100px;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 15;
    display: none;
    overflow-y: auto;

    background: rgba(0, 0, 0, 0.2);
    padding: 10px 20px 40px 20px;

    scrollbar-width: thin;
    scrollbar-color: var(--color-purple) transparent;
}

.projects.show {
    display: block;
    animation: fadeInPage 0.5s ease-out;
}

/* Layout: Grid with Sidebar by default (Desktop First) */
.projects-layout {
    display: grid;
    grid-template-columns: 1fr 260px;
    /* Content + Sidebar */
    gap: 40px;
    max-width: 1300px;
    margin: 0 auto;
    padding-bottom: 80px;
    min-height: 100%;
}

/* =========================================
   2. SIDEBAR (Desktop Filtering)
   ========================================= */
.projects-sidebar {
    display: block;
    /* Visible by default */
    position: sticky;
    top: 20px;
    height: fit-content;
    max-height: 80vh;
    padding: 0 10px;
    background: transparent;
    overflow-y: auto;
}

/* Sidebar Styles (Shared with Mobile Modal) */
.sidebar-group {
    margin-bottom: 25px;
}

.sidebar-label {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--color-purple);
    margin-bottom: 12px;
    display: block;
    font-weight: 700;
    opacity: 0.9;
}

.search-container {
    margin-bottom: 25px;
}

.project-search-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 12px 15px;
    color: #fff;
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.3s ease;
}

.project-search-input:focus {
    outline: none;
    border-color: #00f7ff;
    box-shadow: 0 0 15px rgba(0, 247, 255, 0.2);
}

.project-search-input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.filter-options {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 10px;
}

.filter-chip {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.7);
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.filter-chip:hover {
    border-color: #fff;
    color: #fff;
}

.filter-chip.active {
    background: var(--color-purple);
    border-color: var(--color-purple);
    color: #fff;
    box-shadow: 0 0 15px rgba(197, 112, 255, 0.4);
}

.reset-btn {
    background: none;
    border: 1px solid rgba(255, 76, 163, 0.3);
    color: #ff4ca3;
    font-size: 0.9rem;
    cursor: pointer;
    padding: 12px;
    border-radius: 10px;
    transition: 0.3s;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
    width: 100%;
    text-align: center;
    margin-top: 15px;
}

.reset-btn:hover {
    background: rgba(255, 76, 163, 0.1);
    color: #fff;
    border-color: #ff4ca3;
}

/* =========================================
   3. HEADERS & GRIDS
   ========================================= */
.projects-section-header {
    margin: 10px 0 20px 0;
    display: flex;
    align-items: center;
    gap: 15px;
    position: relative;
    border-bottom: 1px solid rgba(197, 112, 255, 0.3);
    padding-bottom: 10px;
}

.projects-section-header.first {
    margin-top: 10px;
}

.projects-title-text {
    font-size: 1.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #fff;
    margin: 0;
    background: linear-gradient(90deg, #fff, var(--color-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 15px rgba(197, 112, 255, 0.4);
}

.projects-grid-featured {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 25px;
    margin-bottom: 50px;
}

.projects-grid-archive {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

/* =========================================
   4. CARDS
   ========================================= */
.project-card {
    position: relative;
    display: flex;
    flex-direction: column;
    background: rgba(20, 20, 30, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 16px;
    padding: 20px;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    opacity: 0;
    transform: translateY(20px);
    overflow: hidden;
    cursor: pointer;
}

.project-card:hover {
    transform: translateY(-5px);
    background: rgba(30, 30, 45, 0.8);
    border-color: #d4aaff;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.5), 0 0 15px rgba(197, 112, 255, 0.3);
}

.project-card.is-featured {
    background: linear-gradient(160deg, rgba(30, 20, 50, 0.7), rgba(10, 5, 20, 0.8));
    border: 1px solid rgba(197, 112, 255, 0.4);
}

.card-media {
    width: 100%;
    height: 160px;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 15px;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
    filter: brightness(0.9);
}

.project-card:hover .card-img {
    transform: scale(1.05);
    filter: brightness(1.1);
}

.card-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: #fff;
    margin: 0 0 8px 0;
    transition: color 0.3s;
}

.project-card:hover .card-title {
    background: var(--color-accent);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 5px rgba(197, 112, 255, 0.5));
}

.card-desc {
    font-size: 0.9rem;
    line-height: 1.5;
    color: rgba(220, 220, 255, 0.8);
    margin-bottom: 15px;
    flex-grow: 1;
}

.card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 15px;
}

.tag-pill {
    font-size: 0.7rem;
    padding: 4px 10px;
    border-radius: 50px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.8);
    transition: all 0.2s ease;
    cursor: pointer;
}

.project-card:hover .tag-pill {
    border-color: var(--color-purple);
    color: #fff;
    background: rgba(197, 112, 255, 0.1);
}

.tag-pill:hover {
    background: var(--color-purple);
    color: #fff;
    box-shadow: 0 0 10px var(--color-accent-glow);
}

.card-links {
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    gap: 15px;
}

.link-item {
    text-decoration: none;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
    display: flex;
    align-items: center;
    gap: 6px;
    transition: 0.2s;
    font-weight: 500;
    cursor: pointer;
}

.link-item:hover {
    color: #fff;
    text-shadow: 0 0 5px #fff;
}

/* =========================================
   5. FLOATING FILTER (Hidden on Desktop)
   ========================================= */
.filter-floating-btn {
    display: none;
    /* Hidden by default */
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 100;
    background: rgba(20, 0, 30, 0.85);
    backdrop-filter: blur(15px);
    border: 2px solid rgba(197, 112, 255, 0.4);
    color: #ffffff;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    cursor: pointer;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    transition: all 0.5s;
    opacity: 0;
    pointer-events: none;
    transform: translateY(100px) rotate(90deg);
}

.filter-floating-btn.visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0) rotate(0deg);
}

.filter-floating-btn .filter-icon {
    width: 24px;
    height: 24px;
}

/* Filter Modal */
.filter-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.filter-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.filter-modal {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 85vh;
    background: rgba(10, 5, 20, 0.95);
    backdrop-filter: blur(25px);
    border-top: 2px solid rgba(197, 112, 255, 0.3);
    border-radius: 25px 25px 0 0;
    z-index: 2001;
    padding: 25px;
    transform: translateY(100%);
    transition: transform 0.4s ease;
    overflow-y: auto;
}

.filter-modal.active {
    transform: translateY(0);
}

.filter-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(197, 112, 255, 0.3);
}

.filter-modal-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    margin: 0;
}

.close-filter-modal {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #fff;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    cursor: pointer;
}

/* Animations */
@keyframes fadeInPage {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes cardEntry {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.project-card.visible {
    animation: cardEntry 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

/* =========================================
   RESPONSIVE (Mobile First overrides)
   ========================================= */

/* Tablet & Mobile (Below 1024px) */
@media (max-width: 1024px) {

    /* Switch Grid to Single Column */
    .projects-layout {
        display: flex;
        flex-direction: column;
        gap: 30px;
        max-width: 95%;
    }

    /* HIDE Sidebar */
    .projects-sidebar {
        display: none;
    }

    /* SHOW Floating Button */
    .filter-floating-btn {
        display: flex;
    }

    .projects-grid-featured {
        grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    }
}

/* Mobile (Below 768px) */
@media (max-width: 768px) {
    .projects {
        top: 80px;
        padding: 10px 15px 30px 15px;
    }

    .projects-grid-featured {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }

    .projects-grid-archive {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
}

/* Small Mobile */
@media (max-width: 480px) {

    .projects-grid-featured,
    .projects-grid-archive {
        grid-template-columns: 1fr;
    }
}

/* =========================================
   6. STATUS BADGE (New)
   ========================================= */
.status-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    z-index: 10; /* Ensures it sits above images */
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(10, 10, 15, 0.85); /* Dark background for readability */
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    pointer-events: none; /* Allows clicks to pass through to the card */
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

/* Glowing Dot */
.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: currentColor;
    box-shadow: 0 0 8px currentColor;
}

/* Green Theme: Finished */
.status-badge.finished {
    color: #2effa6; /* Neon Green */
    border-color: rgba(46, 255, 166, 0.25);
}

/* Red Theme: In Progress */
.status-badge.in-progress {
    color: #ff5555; /* Neon Red */
    border-color: rgba(255, 85, 85, 0.25);
}