/* ==========================================================================
   FICHIER : projets-detail.css
   DESCRIPTION : Styles spécifiques aux études de cas (AP1 à AP7)
   ========================================================================== */

/* --- LAYOUT ET ESPACEMENT --- */

.project-detail-container {
    max-width: 1400px;
    margin: 0 auto;
    /* Réduit pour éviter le décalage avec le header global */
    padding: 20px 4% 80px; 
}

/* --- SECTION HERO (TITRE & TAGS) --- */

.project-hero {
    padding: 10px 0 40px; 
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 3rem;
}

.hero-content {
    max-width: 1200px;
}

/* FIL D'ARIANE - Correction alignement vertical */
.breadcrumb {
    font-family: 'Fira Code', monospace;
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 1px;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center; /* Aligne le badge et le texte sur le même axe */
    gap: 12px;
}

.breadcrumb a {
    background: rgba(255, 255, 255, 0.05);
    padding: 4px 12px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    text-decoration: none;
    color: #64748b;
    font-size: 0.75rem;
    line-height: 1;
    transition: all 0.3s ease;
}

.breadcrumb a:hover {
    color: var(--accent-blue);
    border-color: var(--accent-blue);
    background: rgba(59, 130, 246, 0.1);
}

.breadcrumb span {
    color: var(--accent-blue);
    line-height: 1;
}

/* TITRES HERO */
.project-hero h1 {
    font-size: 3.5rem;
    color: var(--text-main);
    margin: 0.5rem 0 1rem 0;
    line-height: 1.1;
    font-weight: 800;
}

.project-subtitle {
    font-size: 1.2rem;
    color: var(--text-dim);
    margin-bottom: 2rem;
    max-width: 850px;
    line-height: 1.6;
}

/* TAGS TECHNIQUES */
.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

/* --- TAGS TECHNIQUES : BASE BLEUE & HOVER GRADIENT --- */

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 10px;
}

.project-tags span {
    font-family: 'Fira Code', monospace;
    font-size: 0.85rem;
    font-weight: 600;
    
    /* Retour à la base bleue que tu aimes */
    color: var(--accent-blue);
    background: rgba(59, 130, 246, 0.1); 
    border: 1px solid rgba(59, 130, 246, 0.2);
    
    padding: 8px 16px;
    border-radius: 10px;
    text-transform: uppercase;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: default;
}

/* L'effet de gradient au survol */
.project-tags span:hover {
    color: #fff; /* Le texte passe en blanc pour bien ressortir sur le gradient */
    border-color: transparent;
    transform: translateY(-5px) scale(1.05); /* Effet d'élévation un peu plus prononcé */
    
    /* Gradient allant du bleu au vert (tes couleurs fétiches) */
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-green));
    
    /* Ombre portée colorée pour l'effet "neon" */
    box-shadow: 0 10px 20px rgba(59, 130, 246, 0.3);
}

/* --- GRILLE PRINCIPALE DE CONTENU --- */

.project-main-grid {
    display: grid;
    grid-template-columns: 1.6fr 1fr; /* Colonne texte plus large que la sidebar */
    gap: 5rem;
    align-items: start;
}

.info-block {
    margin-bottom: 2rem;
}

.info-block h2 {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 1.6rem;
    margin-bottom: 1.5rem;
    color: var(--text-main);
}

.info-block h2 .icon {
    font-size: 1.4rem;
}

.info-block p {
    font-size: 1.05rem;
    line-height: 1.8;
    color: var(--text-dim);
    /* Justification du texte pour un rendu plus pro */
    text-align: justify;
    
    /* Évite que les derniers mots d'un paragraphe soient trop espacés */
    text-justify: inter-word;
    
    /* Optionnel : ajoute une légère marge à droite pour ne pas coller à la sidebar */
    padding-right: 5px;
}

/* LISTES DÉTAILLÉES */
.detail-list {
    list-style: none;
    padding: 0;
}

.detail-list li {
    padding: 1.2rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 15px;
    margin-bottom: 1.2rem;
    border-left: 4px solid var(--accent-green);
    color: var(--text-dim);
    transition: transform 0.3s ease;
}

.detail-list li:hover {
    transform: translateX(10px);
    background: rgba(255, 255, 255, 0.04);
}

.detail-list li strong {
    color: var(--text-main);
    display: block;
    margin-bottom: 5px;
}
.detail-list li p {
    text-align: justify;
    margin-top: 5px;
}

/* --- SIDEBAR (DOCUMENTS & APERÇU) --- */

.sidebar-card {
    background: var(--tile-bg);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 24px;
    padding: 2.5rem;
    margin-bottom: 2.5rem;
    backdrop-filter: blur(12px);
}

.sidebar-card h3 {
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
    color: var(--text-main);
    border-left: 3px solid var(--accent-blue);
    padding-left: 15px;
}

/* LIENS DOCUMENTS */
.doc-links {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.doc-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 1.2rem;
    background: rgba(15, 23, 42, 0.4);
    border-radius: 16px;
    text-decoration: none;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.doc-item:hover {
    border-color: var(--accent-blue);
    background: rgba(59, 130, 246, 0.1);
    transform: translateY(-3px);
}

.doc-icon {
    font-size: 1.8rem;
}

.doc-info strong {
    display: block;
    color: var(--text-main);
    font-size: 0.95rem;
}

.doc-info span {
    font-size: 0.8rem;
    color: var(--text-dim);
}

/* APERÇU IMAGE */
.project-preview img {
    width: 100%;
    border-radius: 16px;
    margin: 1rem 0 1.5rem 0;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.btn-live {
    display: block;
    text-align: center;
    padding: 1.1rem;
    background: var(--accent-blue);
    color: white;
    text-decoration: none;
    border-radius: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
}

.btn-live:hover {
    filter: brightness(1.2);
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.4);
}

/* --- NAVIGATION BAS DE PAGE --- */

.project-footer-nav {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: flex-start; /* Aligné à gauche */
}

.btn-back {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 24px;
    color: var(--text-dim);
    text-decoration: none;
    font-weight: 600;
    font-family: 'Fira Code', monospace;
    font-size: 0.9rem;
    border-radius: 12px;
    border: 1px solid transparent; /* Prépare la bordure pour le hover */
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* EFFET HOVER (La petite box qui apparaît) */
.btn-back:hover {
    color: var(--accent-blue);
    background: rgba(59, 130, 246, 0.08); /* Fond bleu très léger */
    border-color: rgba(59, 130, 246, 0.3); /* Bordure subtile */
    transform: translateX(-10px); /* Petit décalage vers la gauche pour accentuer le retour */
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2); /* Ombre pour l'effet de profondeur */
}

/* --- RESPONSIVE --- */

@media (max-width: 1100px) {
    .project-main-grid {
        grid-template-columns: 1fr;
        gap: 3rem;
    }
    .project-hero h1 {
        font-size: 2.5rem;
    }
}

@media (max-width: 768px) {
    .project-detail-container {
        padding-top: 20px;
    }
    .project-hero h1 {
        font-size: 2rem;
    }
    .sidebar-card {
        padding: 1.5rem;
    }
}
/* --- GRILLE TECHNOLOGIQUE DÉTAILLÉE --- */
.tech-grid-detail {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}

.tech-item-detail {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 1.2rem;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    transition: all 0.3s ease;
}

.tech-item-detail:hover {
    border-color: var(--accent-blue);
    background: rgba(59, 130, 246, 0.05);
    transform: translateY(-3px);
}

.tech-item-detail strong {
    color: var(--accent-blue);
    font-size: 1rem;
}

.tech-item-detail span {
    color: var(--text-dim);
    font-size: 0.8rem;
    font-style: italic;
}

/* Indicateur de statut dans la sidebar */
.status-indicator {
    display: flex;
    align-items: center;
    gap: 15px;
    background: rgba(15, 23, 42, 0.4);
    padding: 1rem;
    border-radius: 12px;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.status-dot.green {
    background: var(--accent-green);
    box-shadow: 0 0 10px var(--accent-green);
}

.status-indicator p {
    font-size: 0.85rem;
    color: var(--text-dim);
    margin: 0;
}

/* --- STYLE DES COMPÉTENCES DANS LA SIDEBAR --- */
.tech-stack-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 15px;
}

.tech-pill {
    font-family: 'Fira Code', monospace;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.05);
    padding: 6px 14px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.tech-pill:hover {
    color: #fff;
    border-color: transparent;
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-green));
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(59, 130, 246, 0.2);
}

/* Ajustement sidebar pour plus de densité */
.sidebar-card {
    padding: 2rem 1.8rem;
}

.status-waiting {
    opacity: 0.6;
    cursor: not-allowed !important;
    border-style: dashed !important;
}

/* --- GRILLE DE MÉTADONNÉES SIDEBAR --- */
.project-meta-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 20px;
}

.meta-item-box {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px 18px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    transition: all 0.3s ease;
}

.meta-item-box:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.15);
}

.meta-icon {
    font-size: 1.4rem;
}

.meta-text {
    display: flex;
    flex-direction: column;
}

.meta-text label {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: #64748b;
    letter-spacing: 1px;
    font-weight: 700;
}

.meta-text strong {
    font-size: 0.95rem;
    color: var(--text-main);
}

/* Mise en avant du résultat (Médaille d'argent) */
.meta-item-box.highlight {
    border-left: 4px solid #94a3b8; /* Couleur argentée */
    background: rgba(148, 163, 184, 0.05);
}

.meta-item-box.highlight strong {
    color: var(--accent-blue);
}
/* --- HOVER SPÉCIFIQUE POUR LE RÉSULTAT --- */

.meta-item-box.highlight {
    border-left: 4px solid #94a3b8; /* Couleur Argent */
    background: rgba(148, 163, 184, 0.08);
    position: relative;
    overflow: hidden;
}

.meta-item-box.highlight:hover {
    background: rgba(148, 163, 184, 0.15);
    border-color: #cbd5e1; /* Argent plus clair */
    transform: translateY(-5px) scale(1.02);
    /* Lueur argentée pour symboliser la médaille */
    box-shadow: 0 10px 25px rgba(148, 163, 184, 0.25);
}

/* On change la couleur du texte au survol pour qu'il "brille" */
.meta-item-box.highlight:hover strong {
    color: #f8fafc;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

/* Petit effet de reflet qui passe sur la box au survol */
.meta-item-box.highlight::after {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.05),
        transparent
    );
    transition: 0.5s;
}

.meta-item-box.highlight:hover::after {
    left: 100%;
}

/* --- GRILLE DE SOLUTIONS ET AVENIR --- */
.solutions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.solution-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 15px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    transition: transform 0.3s ease;
}

.solution-card:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.05);
}

.solution-card h3 {
    font-size: 1.1rem;
    color: var(--text-main);
    margin-bottom: 5px;
}

.solution-card p {
    font-size: 0.95rem !important;
    line-height: 1.5 !important;
    margin: 0 !important;
}

/* Badges Contrainte / Solution */
.badge {
    font-size: 0.65rem;
    text-transform: uppercase;
    font-weight: 800;
    padding: 4px 10px;
    border-radius: 20px;
    width: fit-content;
}

.badge.warning { background: rgba(234, 179, 8, 0.15); color: #eab308; }
.badge.success { background: rgba(34, 197, 94, 0.15); color: #22c55e; }

.card-footer {
    margin-top: auto;
    padding-top: 15px;
    border-top: 1px dashed rgba(255, 255, 255, 0.1);
}

/* Style spécifique pour les cartes "Avenir" */
.solution-card.future {
    border-left: 4px solid var(--accent-blue);
    justify-content: center;
}

/* --- LAYOUT PLEINE LARGEUR POUR OSI --- */
.full-width-section {
    width: 100vw;
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
    padding: 60px 0;
    background: rgba(255, 255, 255, 0.01);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.section-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 4%;
}

/* Grille de Solutions (3 colonnes sur PC, 1 sur mobile) */
.solutions-grid-large {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 25px;
    margin-top: 30px;
}

.solution-card-tech {
    background: var(--tile-bg);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    padding: 30px;
    transition: all 0.3s ease;
}

.solution-card-tech:hover {
    border-color: var(--accent-blue);
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.3);
}

.tech-badge {
    font-family: 'Fira Code', sans-serif;
    font-size: 0.7rem;
    color: var(--accent-blue);
    background: rgba(59, 130, 246, 0.1);
    padding: 4px 10px;
    border-radius: 6px;
    text-transform: uppercase;
}

/* Grille Avenir */
.future-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    margin-top: 30px;
}

.future-card {
    text-align: center;
    padding: 40px;
    background: linear-gradient(145deg, rgba(255,255,255,0.03), rgba(255,255,255,0.01));
    border-radius: 24px;
    border: 1px solid rgba(255,255,255,0.05);
}

.future-icon { font-size: 3rem; margin-bottom: 20px; }

/* --- SECTIONS TECHNIQUES OSI (AFFICHAGE 3x2) --- */

.osi-full-block {
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.osi-full-block h2 {
    margin-bottom: 2rem;
    font-size: 1.6rem;
    color: var(--text-main);
}

/* Grille forcée en 3 colonnes pour le 3x2 */
.solutions-grid-forced {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* Force 3 colonnes */
    gap: 20px;
}

.future-grid-forced {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* Force 3 colonnes */
    gap: 20px;
}

.solution-card-tech {
    background: var(--tile-bg);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.card-tech-header {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tech-badge {
    font-family: 'Fira Code', monospace;
    font-size: 0.65rem;
    color: var(--accent-blue);
    background: rgba(59, 130, 246, 0.1);
    padding: 3px 8px;
    border-radius: 4px;
    width: fit-content;
}

.card-tech-body p {
    font-size: 0.9rem !important;
    line-height: 1.6 !important;
    margin-bottom: 8px !important;
    text-align: justify;
}

/* --- EFFET FLIP CARD 3D --- */

.solutions-grid-forced {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
    perspective: 1000px; /* Nécessaire pour l'effet 3D */
}

.flip-card {
    background-color: transparent;
    height: 300px; /* Hauteur fixe pour que le flip soit propre */
    cursor: pointer;
}

.flip-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: left;
    transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    transform-style: preserve-3d;
}

/* Rotation au survol */
.flip-card:hover .flip-card-inner {
    transform: rotateY(180deg);
}

/* --- CORRECTION FLIP CARD : OPACITÉ & MASQUAGE --- */

.flip-card-front, .flip-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden; 
    backface-visibility: hidden;
    border-radius: 20px;
    padding: 30px;
    display: flex;
    flex-direction: column;
    
    /* 1. ON REVIENT À UNE BORDURE PLUS VISIBLE */
    border: 1px solid rgba(255, 255, 255, 0.12);
}

/* Style de la face AVANT (Contrainte) */
.flip-card-front {
    /* 2. UTILISE LA COULEUR DE TES TUILES (Tile-bg) MAIS EN OPAQUE */
    /* Si ton tile-bg est transparent, remplace par cette valeur solide : */
    background-color: #111827; 
    color: var(--text-main);
}

/* Style de la face ARRIÈRE (Solution) */
.flip-card-back {
    /* FORCE UNE COULEUR DE FOND SOLIDE (Pas de transparence) */
    background-color: #0f172a; /* Couleur sombre de base */
    
    /* Tu peux ajouter un léger dégradé bleu, mais sur une base SOLIDE */
    background-image: linear-gradient(145deg, rgba(59, 130, 246, 0.1), rgba(0, 0, 0, 0.2));
    
    color: white;
    transform: rotateY(180deg);
    border-color: var(--accent-blue);
}

.flip-card-front h3 {
    color: var(--text-main);
    font-size: 1.3rem;
}

.flip-card-front p {
    color: #94a3b8; /* Un gris plus clair (slate-400) pour mieux lire sur le sombre */
    line-height: 1.6;
}

.flip-card-front h3, .flip-card-back h3 {
    margin: 15px 0;
    font-size: 1.2rem;
}

.flip-card-front p, .flip-card-back p {
    font-size: 0.9rem;
    line-height: 1.6;
    text-align: justify;
}

.flip-hint {
    margin-top: auto;
    font-size: 0.7rem;
    color: var(--text-dim);
    font-style: italic;
    text-align: center;
}

.tech-badge.warning { background: rgba(234, 179, 8, 0.15); color: #eab308; }
.tech-badge.success { background: rgba(34, 197, 94, 0.15); color: #22c55e; }

/* Responsive : On repasse en 1 colonne sur mobile uniquement */
@media (max-width: 900px) {
    .solutions-grid-forced, .future-grid-forced {
        grid-template-columns: 1fr;
    }
}


/* Responsive */
@media (max-width: 1000px) {
    .future-grid { grid-template-columns: 1fr; }
    .solutions-grid-large { grid-template-columns: 1fr; }
}

/* --- GRILLE DE PETITES RESSOURCES (CÔTE À CÔTE) --- */
.tech-resources-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* 3 colonnes égales */
    gap: 10px;
    margin-top: 15px;
}

.res-square {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 12px 5px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.res-square:hover {
    background: rgba(59, 130, 246, 0.1);
    border-color: var(--accent-blue);
    transform: translateY(-3px);
}

.res-icon {
    font-size: 1.5rem; /* Taille de l'icône */
    margin-bottom: 5px;
}

.res-label {
    font-family: 'Fira Code', monospace;
    font-size: 0.65rem; /* Texte très petit en dessous */
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
}

.res-square:hover .res-label {
    color: var(--accent-blue);
}