/* 
 * STYLE MATRICES RASCI POUR ARTICLES BLOG
 * Couleurs officielles du dashboard Qui Fait Quoi
 */

:root {
    --rasci-blue: #3B82F6;      /* R - Responsible */
    --rasci-green: #10B981;     /* A - Accountable */
    --rasci-orange: #F59E0B;    /* S - Support */
    --rasci-purple: #8B5CF6;    /* C - Consulted */
    --rasci-gray: #6B7280;      /* I - Informed */
}

/* Conteneur de la matrice */
.rasci-matrix-container {
    margin: 20px 0;
    overflow-x: auto;
    border-radius: 14px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    border: 1px solid #e5e7eb;
}

/* Table principale */
.rasci-matrix {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: white;
    font-size: 14px;
    min-width: 600px;
    border-radius: 14px;
    overflow: hidden;
    table-layout: fixed; /* Force les colonnes à avoir des largeurs fixes */
}

/* Header (ligne avec les noms de personnes) */
.rasci-matrix thead th {
    background: linear-gradient(to bottom, #1f2937 0%, #111827 100%);
    color: #ffffff;
    padding: 16px 12px;
    font-weight: 700;
    text-align: center;
    border-right: 1px solid #374151;
    border-bottom: 2px solid #4b5563;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    width: 33.33%; /* 1/3 de la largeur pour colonne user */
}

.rasci-matrix thead th:first-child {
    text-align: left;
    background: linear-gradient(to bottom, #374151 0%, #1f2937 100%);
    color: #ffffff;
    font-weight: 700;
    border-right: 2px solid #4b5563;
    width: 66.67%; /* 2/3 de la largeur pour colonne tâches */
}

.rasci-matrix thead th:last-child {
    border-right: none;
}

/* Première colonne (noms des tâches) */
.rasci-matrix tbody th {
    background: transparent;
    padding: 14px 16px;
    text-align: left;
    font-weight: 600;
    color: #111827;
    border-right: 2px solid #e5e7eb;
    font-size: 14px;
    width: 66.67%; /* 2/3 de la largeur pour colonne tâches */
}

.rasci-matrix tbody tr th {
    background: #fafafa;
}

.rasci-matrix tbody tr:nth-child(even) th {
    background: #f3f4f6;
}

/* Lignes alternées (zebra striping) */
.rasci-matrix tbody tr {
    border-bottom: 1px solid #e5e7eb;
    transition: all 0.25s ease;
}

.rasci-matrix tbody tr:nth-child(even) {
    background-color: #fafafa;
}

.rasci-matrix tbody tr:hover {
    background-color: #e0f2fe !important;
    transform: scale(1.01);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.15);
}

.rasci-matrix tbody tr:hover th,
.rasci-matrix tbody tr:hover td {
    background-color: transparent !important;
}

.rasci-matrix tbody tr:last-child {
    border-bottom: none;
}

/* Cellules avec les rôles */
.rasci-matrix tbody td {
    padding: 12px;
    text-align: center;
    border-right: 1px solid #f3f4f6;
    background: transparent;
    position: relative;
    width: 33.33%; /* 1/3 de la largeur pour colonne user */
}

.rasci-matrix tbody td:last-child {
    border-right: none;
}

/* Badges des rôles RASCI */
.rasci-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    font-weight: 800;
    font-size: 15px;
    margin: 3px;
    box-shadow: 0 3px 8px rgba(0,0,0,0.15);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    letter-spacing: 0.5px;
}

.rasci-badge:hover {
    transform: scale(1.15) translateY(-2px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.25);
}

.rasci-badge.r {
    background: var(--rasci-blue);
    color: white;
}

.rasci-badge.a {
    background: var(--rasci-green);
    color: white;
}

.rasci-badge.s {
    background: var(--rasci-orange);
    color: white;
}

.rasci-badge.c {
    background: var(--rasci-purple);
    color: white;
}

.rasci-badge.i {
    background: var(--rasci-gray);
    color: white;
}

/* Cellule vide */
.rasci-matrix tbody td.empty {
    color: #e5e7eb;
    font-size: 18px;
}

/* Légende */
.rasci-legend {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
    margin-top: 24px;
    padding: 24px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 12px;
    border: 2px solid #e2e8f0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.rasci-legend-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 10px;
    padding: 16px 12px;
    background: white;
    border-radius: 10px;
    transition: all 0.25s;
}

.rasci-legend-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

.rasci-legend-badge {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    font-weight: 800;
    font-size: 20px;
    letter-spacing: 0.5px;
    box-shadow: 0 3px 8px rgba(0,0,0,0.15);
}

.rasci-legend-text {
    font-size: 13px;
    color: #1e293b;
    font-weight: 600;
    line-height: 1.4;
}

.rasci-legend-text strong {
    display: block;
    font-size: 14px;
    color: #0f172a;
    margin-bottom: 2px;
}

/* Optimisation pour matrice à 1 user - DÉSACTIVÉ car on utilise 2/3 - 1/3 */

/* Responsive Mobile */
@media (max-width: 768px) {
    .rasci-matrix {
        font-size: 12px;
    }
    
    .rasci-matrix thead th {
        padding: 10px 6px !important;
        font-size: 11px;
        width: 33.33%; /* 1/3 pour user même sur mobile */
    }
    
    .rasci-matrix thead th:first-child {
        width: 66.67%; /* 2/3 pour tâches même sur mobile */
    }
    
    .rasci-matrix tbody th {
        font-size: 13px;
        padding: 12px;
        width: 66.67%; /* 2/3 pour tâches même sur mobile */
    }
    
    .rasci-matrix tbody td {
        padding: 8px 4px;
        width: 33.33%; /* 1/3 pour user même sur mobile */
    }
    
    .rasci-badge {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }
    
    /* Légende responsive */
    .rasci-legend {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
        padding: 16px;
    }
    
    .rasci-legend-item {
        padding: 12px 8px;
    }
    
    .rasci-legend-badge {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
    
    .rasci-legend-text {
        font-size: 11px;
    }
    
    .rasci-legend-text strong {
        font-size: 12px;
    }
}

/* Responsive Tablet */
@media (max-width: 1024px) and (min-width: 769px) {
    .rasci-matrix thead th {
        width: 33.33%; /* 1/3 pour user sur tablette */
    }
    
    .rasci-matrix thead th:first-child {
        width: 66.67%; /* 2/3 pour tâches sur tablette */
    }
    
    .rasci-matrix tbody th {
        width: 66.67%; /* 2/3 pour tâches sur tablette */
    }
    
    .rasci-matrix tbody td {
        width: 33.33%; /* 1/3 pour user sur tablette */
    }
    
    .rasci-badge {
        width: 30px;
        height: 30px;
    }
    
    /* Légende responsive tablette */
    .rasci-legend {
        grid-template-columns: repeat(3, 1fr);
        gap: 14px;
    }
    
    .rasci-legend-item {
        padding: 14px 10px;
    }
    
    .rasci-legend-badge {
        width: 44px;
        height: 44px;
        font-size: 18px;
    }
}

/* Titre de la matrice - CACHÉ */
.rasci-matrix-title {
    display: none !important;
}

/* Note sous la matrice */
.rasci-note {
    margin-top: 12px;
    padding: 10px 14px;
    background: #eff6ff;
    border-left: 4px solid var(--rasci-blue);
    border-radius: 6px;
    font-size: 13px;
    color: #1e40af;
    line-height: 1.5;
}

.rasci-note strong {
    color: #1e3a8a;
}

/* Optimisation espacements articles */
.article-content h2 {
    margin-top: 30px;
    margin-bottom: 15px;
}

.article-content h3 {
    margin-top: 25px;
    margin-bottom: 12px;
}

.article-content .rasci-matrix-container + h2,
.article-content .rasci-matrix-container + h3 {
    margin-top: 25px;
}
