@charset "UTF-8";

/* ==========================================================================
   PORTFOLIO - VERSION OPTIMISÉE (décembre 2025)
   Changements : 
   - Regroupement des media queries similaires
   - Utilisation de variables CSS pour les valeurs répétées
   - Suppression des redondances
   ========================================================================== */

/* Note : Les variables CSS globales sont définies dans global.css */

/* ============================================= */
/*              PAGE HEADER                      */
/* ============================================= */

.page-header {
    background: url('../images/development/Los-Santos.png') center/cover no-repeat;
    color: white;
    padding: 80px 0 60px;
    position: relative;
    z-index: 0;
    text-align: center;
}

.page-header::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(2px);
    z-index: -1;
}

.page-header h1,
.page-header p {
    position: relative;
    z-index: 1;
}

.page-header h1 {
    font-size: clamp(28px, 5vw, 48px);
    font-weight: 700;
    margin-bottom: 16px;
}

.page-header p {
    font-size: clamp(16px, 3vw, 20px);
    opacity: 0.9;
}

/* ============================================= */
/*              PORTFOLIO SECTION                */
/* ============================================= */

.portfolio {
    padding: 40px 0;
}

/* ============================================= */
/*              FILTERS                          */
/* ============================================= */

.filters {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 48px;
    flex-wrap: wrap;
    padding: 10px;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 16px;
    border: 1px solid rgba(0,0,0,0.06);
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    max-width: fit-content;
    margin-left: auto;
    margin-right: auto;
}

.filter-button {
    padding: 14px 28px;
    background: white;
    border: 2px solid;
    border-radius: 12px;
    font-size: 0.98rem;
    font-weight: 600;
    color: var(--color-text);
    cursor: pointer;
    transition: all 0.25s ease;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
}

.filter-button:hover {
    transform: translateY(-1.5px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.filter-button.active {
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.12);
}

.filter-icon {
    width: 28px;
    height: 28px;
    object-fit: contain;
    flex-shrink: 0;
}

/* Couleurs par catégorie - Regroupement */
.filter-button[data-filter="all"] {
    border-color: #e0e0e0;
    color: #616161;
}
.filter-button[data-filter="all"].active {
    background: #e0e0e0;
    border-color: #e0e0e0;
    color: #212121;
}

.filter-button[data-filter="fivem"] {
    border-color: #ffdab9;
    color: #c35400;
}
.filter-button[data-filter="fivem"].active {
    background: #ffdab9;
    border-color: #ffdab9;
    color: #212121;
    box-shadow: 0 6px 18px rgba(255, 193, 7, 0.28);
}

.filter-button[data-filter="discord"] {
    border-color: #d7bde2;
    color: #6f42c1;
}
.filter-button[data-filter="discord"].active {
    background: #d7bde2;
    border-color: #d7bde2;
    color: #311b92;
    box-shadow: 0 6px 18px rgba(156, 39, 176, 0.22);
}

.filter-button[data-filter="web"] {
    border-color: #a5d8ff;
    color: #0c8599;
}
.filter-button[data-filter="web"].active {
    background: #a5d8ff;
    border-color: #a5d8ff;
    color: #01579b;
    box-shadow: 0 6px 18px rgba(3, 169, 244, 0.25);
}

.filter-button[data-filter="minecraft"] {
    border-color: #b2f2bb;
    color: #2e7d32;
}
.filter-button[data-filter="minecraft"].active {
    background: #b2f2bb;
    border-color: #b2f2bb;
    color: #1b5e20;
    box-shadow: 0 6px 18px rgba(76, 175, 80, 0.25);
}

.filter-button[data-filter="autre"] {
    border-color: #e0e0e0;
    color: #616161;
}
.filter-button[data-filter="autre"].active {
    background: #e0e0e0;
    border-color: #e0e0e0;
    color: #212121;
}

/* ============================================= */
/*              PORTFOLIO GRID & CARDS           */
/* ============================================= */

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

.portfolio-card {
    background: white;
    border: 2px solid var(--color-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    cursor: pointer;
    transition: all 0.35s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.06);
    display: flex;
    flex-direction: column;
}

.portfolio-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 32px rgba(0,0,0,0.12);
    border-color: var(--color-primary);
}

.portfolio-card.hidden {
    display: none;
}

.card-image {
    width: 100%;
    height: 220px;
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #f5f5f5 0%, #e0e0e0 100%);
    flex-shrink: 0;
}

.project-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    transition: transform 0.55s cubic-bezier(0.34, 1.56, 0.64, 1);
    padding: 0;
}

.portfolio-card:hover .project-image {
    transform: scale(1.05);
}

.card-image::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.3) 0%, transparent 60%);
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.portfolio-card:hover .card-image::after {
    opacity: 1;
}

.card-content {
    padding: 1.4rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.card-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 0.8rem;
    color: var(--color-text);
    line-height: 1.3;
}

.card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.9rem;
}

.card-date {
    font-size: 0.875rem;
    color: var(--color-text-light);
    font-weight: 500;
    margin-top: auto;
}

.tag {
    display: inline-block;
    padding: 0.35rem 0.85rem;
    border-radius: var(--radius-sm);
    font-size: 0.78rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

.portfolio-card[data-category="fivem"]     .tag { background: #ffdab9; color: #c35400; }
.portfolio-card[data-category="discord"]   .tag { background: #d7bde2; color: #6f42c1; }
.portfolio-card[data-category="web"]       .tag { background: #a5d8ff; color: #0c8599; }
.portfolio-card[data-category="minecraft"] .tag { background: #b2f2bb; color: #2e7d32; }
.portfolio-card[data-category="autre"]     .tag { background: #e8ecef; color: #495057; }

.portfolio-card:hover .tag {
    opacity: 0.92;
    transform: scale(1.03);
}

/* ============================================= */
/*              PROJECT ASIDE                    */
/* ============================================= */

.project-aside {
    position: fixed;
    top: 0;
    right: -100%;
    width: 100%;
    max-width: 500px;
    height: 100vh;
    background: white;
    box-shadow: -10px 0 40px rgba(0,0,0,0.25);
    z-index: 2000;
    transition: right 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    overflow-y: auto;
}

.project-aside.open {
    right: 0;
}

.aside-close {
    position: absolute;
    top: 1.2rem;
    right: 1.2rem;
    width: 44px;
    height: 44px;
    background: rgba(0,0,0,0.07);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--color-text);
    transition: all 0.3s ease;
    z-index: 10;
}

.aside-close:hover {
    background: var(--color-primary);
    color: white;
    transform: rotate(90deg);
}

.aside-body {
    padding: 5.5rem 2.5rem 3rem;
    min-height: 100%;
    display: flex;
    flex-direction: column;
}

.project-logo {
    width: 130px;
    height: 130px;
    margin: 0 auto 1.8rem;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: linear-gradient(135deg, #f5f5f5 0%, #e0e0e0 100%);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
}

.project-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.project-title {
    text-align: center;
    font-size: 2.2rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    line-height: 1.1;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-bottom: 1.5rem;
    justify-content: center;
}

.project-date,
.project-languages {
    font-size: 1.05rem;
    color: var(--color-text-light);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    justify-content: center;
}

.project-date:before     { content: "📅 "; }
.project-languages:before { content: "💻 "; }

.project-description {
    text-align: justify;
    line-height: 1.8;
    color: var(--color-text);
    margin-bottom: 2.5rem;
    padding: 1.5rem;
    background: var(--color-bg-light);
    border-radius: var(--radius-lg);
    border-left: 4px solid var(--color-primary);
    flex-grow: 1;
}

#asideBack {
    width: 100%;
    margin-top: auto;
    padding: 0.9rem;
    font-size: 1rem;
}

/* ==========================================================================
   RESPONSIVE - VERSION OPTIMISÉE
   ========================================================================== */

/* Large desktops (1440px+) */
@media (min-width: 1440px) {
    .portfolio-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 28px;
    }
    
    .card-image {
        height: 240px;
    }
}

/* Desktop standard (1200-1439px) */
@media (min-width: 1200px) and (max-width: 1439px) {
    .portfolio-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Tablettes paysage (992-1199px) */
@media (min-width: 992px) and (max-width: 1199px) {
    .portfolio {
        padding: 70px 0;
    }
    
    .portfolio-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
    }
    
    .card-image {
        height: 200px;
    }
    
    .filters {
        max-width: 90%;
    }
}

/* Tablettes portrait (768-991px) */
@media (min-width: 768px) and (max-width: 991px) {
    .portfolio {
        padding: 60px 0;
    }

    .page-header {
        padding: 70px 0 50px;
    }

    .portfolio-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
    
    .card-image {
        height: var(--card-image-height-tablet);
    }

    .filters {
        gap: 10px;
        padding: 12px;
        max-width: 95%;
    }

    .filter-button {
        padding: 12px 20px;
        font-size: 0.94rem;
    }

    .filter-icon {
        width: 26px;
        height: 26px;
    }

    .card-title {
        font-size: 1.15rem;
    }

    .project-aside {
        max-width: 420px;
    }
}

/* Configuration commune mobiles/tablettes petites */
@media (max-width: 767px) {
    .portfolio {
        padding: 50px 0 60px;
    }

    .page-header {
        padding: 60px 0 40px;
    }

    .filters {
        margin-bottom: 40px;
        padding: 10px;
        max-width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
        justify-content: flex-start;
    }

    .filter-button {
        min-width: 110px;
        flex: 0 0 auto;
    }

    .project-aside {
        max-width: none;
        width: 100%;
    }

    /* Scrollbar personnalisée (webkit uniquement) */
    .filters::-webkit-scrollbar {
        height: 6px;
    }
    
    .filters::-webkit-scrollbar-track {
        background: rgba(0,0,0,0.05);
        border-radius: 3px;
    }
    
    .filters::-webkit-scrollbar-thumb {
        background: rgba(0,0,0,0.2);
        border-radius: 3px;
    }
}

/* Mobiles grands (576-767px) */
@media (min-width: 576px) and (max-width: 767px) {
    .filter-button {
        padding: 10px 18px;
        font-size: 0.92rem;
    }

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

    .portfolio-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 18px;
    }
    
    .card-image {
        height: 180px;
    }

    .card-content {
        padding: 1.2rem;
    }

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

    .aside-body {
        padding: 5rem 2rem 3rem;
    }

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

    .project-logo {
        width: 110px;
        height: 110px;
    }
}

/* Mobiles moyens et petits (≤575px) */
@media (max-width: 575px) {
    .portfolio {
        padding: 40px 0 50px;
    }

    .page-header {
        padding: 50px 0 35px;
    }

    .filters {
        padding: 8px;
        gap: 8px;
        margin-bottom: 35px;
        scrollbar-width: none;
    }

    .filters::-webkit-scrollbar {
        display: none;
    }

    .filter-button {
        padding: 10px 16px;
        font-size: 0.88rem;
        min-width: 100px;
    }

    .filter-icon {
        width: 22px;
        height: 22px;
    }

    .portfolio-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .card-content {
        padding: 1.3rem 1.2rem;
    }

    .card-title {
        font-size: 1.2rem;
    }

    .aside-body {
        padding: 4.5rem 1.6rem 3.5rem;
    }

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

    .project-logo {
        width: 100px;
        height: 100px;
        margin-bottom: 1.5rem;
    }

    .project-description {
        font-size: 0.98rem;
        line-height: 1.75;
        padding: 1.3rem;
    }
}

/* Ajustements spécifiques mobiles standards (376-575px) */
@media (min-width: 376px) and (max-width: 575px) {
    .card-image {
        height: 200px;
    }
}

/* Ajustements spécifiques petits mobiles (≤375px) */
@media (max-width: 375px) {
    .portfolio {
        padding: 35px 0 45px;
    }

    .page-header {
        padding: 45px 0 30px;
    }

    .filters {
        margin-bottom: 30px;
    }

    .filter-button {
        padding: 9px 14px;
        font-size: 0.85rem;
        min-width: 95px;
    }

    .filter-icon {
        width: 20px;
        height: 20px;
    }

    .portfolio-grid {
        gap: 18px;
    }
    
    .card-image {
        height: 180px;
    }

    .card-content {
        padding: 1.2rem 1rem;
    }

    .card-title {
        font-size: 1.15rem;
        line-height: 1.25;
    }

    .card-tags {
        gap: 0.4rem;
    }

    .tag {
        padding: 0.3rem 0.7rem;
        font-size: 0.74rem;
    }

    .card-date {
        font-size: 0.85rem;
    }

    .aside-body {
        padding: 4rem 1.4rem 3rem;
    }

    .aside-close {
        width: 40px;
        height: 40px;
        top: 1rem;
        right: 1rem;
    }

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

    .project-logo {
        width: 95px;
        height: 95px;
        margin-bottom: 1.3rem;
    }

    .project-tags .tag {
        font-size: 0.8rem;
        padding: 0.4rem 0.8rem;
    }

    .project-date,
    .project-languages {
        font-size: 0.95rem;
    }

    .project-description {
        font-size: 0.95rem;
        padding: 1.2rem;
        line-height: 1.7;
    }

    #asideBack {
        padding: 0.85rem;
        font-size: 0.95rem;
    }
}