/* Variables de couleurs CMQ */
:root {
    --primary-color: #5ab9b3;
    --secondary-color: #aad9db;
    --accent-color: #2c7873;
    --success-color: #27ae60;
    --warning-color: #e67e22;
    --light-bg: #f8f9fa;
    --dark-text: #333;
    --light-text: #666;
}

/* Reset et styles de base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--dark-text);
    background-color: var(--light-bg);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-color) 100%);
    color: white;
    padding: 2rem 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

header h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.subtitle {
    font-size: 1rem;
    opacity: 0.9;
}

/* Navigation */
.main-nav {
    background: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.main-nav .container {
    display: flex;
    gap: 0;
}

.main-nav a {
    padding: 1rem 1.5rem;
    text-decoration: none;
    color: var(--dark-text);
    border-bottom: 3px solid transparent;
    transition: all 0.3s;
    font-weight: 500;
}

.main-nav a:hover {
    background-color: #f0f0f0;
    border-bottom-color: var(--primary-color);
}

.main-nav a.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

/* Main content */
main {
    padding: 2rem 20px;
}

/* Hero section */
.hero {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.hero h2 {
    color: var(--accent-color);
    margin-bottom: 1rem;
}

/* Stats grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.stat-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--accent-color);
    margin-bottom: 0.5rem;
}

.stat-label {
    color: var(--light-text);
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

.stat-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    display: inline-block;
    padding: 0.5rem 1rem;
    border: 2px solid var(--primary-color);
    border-radius: 4px;
    transition: all 0.3s;
}

.stat-link:hover {
    background-color: var(--primary-color);
    color: white;
}

/* Data section */
.data-section {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

.data-section h2 {
    color: var(--accent-color);
    margin-bottom: 1.5rem;
}

/* Filtres */
.filters {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.search-box {
    flex: 1;
    min-width: 250px;
}

.search-box input {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.filter-selects {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.filter-selects select {
    padding: 0.75rem;
    border: 2px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    background-color: white;
    cursor: pointer;
    min-width: 180px;
}

.filter-selects select:hover {
    border-color: var(--secondary-color);
}

.filter-selects select:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Data grid */
.data-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.data-card {
    background: #f9f9f9;
    padding: 1.5rem;
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
    transition: all 0.3s;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    display: block;
}

.data-card:hover {
    transform: translateX(5px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.data-card h3 {
    color: var(--accent-color);
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.data-card .meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.data-card .tag {
    background-color: rgba(90, 185, 179, 0.15);
    color: var(--accent-color);
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 500;
}

/* Messages */
.loading {
    text-align: center;
    padding: 3rem;
    color: var(--light-text);
}

.error {
    background-color: #ffebee;
    color: #c62828;
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.empty {
    text-align: center;
    padding: 3rem;
    color: #999;
}

/* Footer */
footer {
    background-color: var(--accent-color);
    color: white;
    text-align: center;
    padding: 2rem 0;
    margin-top: 3rem;
}

/* Breadcrumb */
.breadcrumb {
    padding: 1rem 0;
    color: var(--light-text);
    font-size: 0.9rem;
}

.breadcrumb a {
    color: var(--primary-color);
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

/* Detail Header */
.detail-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-color) 100%);
    color: white;
    padding: 40px 0;
    text-align: center;
    border-radius: 10px 10px 0 0;
    margin-bottom: 20px;
    position: relative;
}

.detail-header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.metier-badge {
    display: inline-block;
    background: rgba(255,255,255,0.2);
    padding: 8px 20px;
    border-radius: 20px;
    margin-top: 10px;
}

/* Tampon date/source dans le bandeau vert */
.fiche-date-stamp {
    position: absolute;
    bottom: 8px;
    right: 14px;
    font-size: 0.67rem;
    color: rgba(255, 255, 255, 0.70);
    font-style: italic;
    text-align: right;
    max-width: 60%;
    line-height: 1.4;
    pointer-events: none;
}
.fiche-date-stamp em {
    font-style: normal;
    background: rgba(255,255,255,0.15);
    border-radius: 3px;
    padding: 1px 5px;
    font-size: 0.95em;
}

@media (max-width: 600px) {
    .fiche-date-stamp {
        position: static;
        display: block;
        text-align: center;
        margin-top: 10px;
        max-width: 100%;
        color: rgba(255,255,255,0.65);
    }
}

/* Barre de positionnement */
.positionnement-bar {
    background-color: white;
    margin: 20px 0;
    padding: 20px 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.positionnement-bar h3 {
    color: var(--accent-color);
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.positionnement-steps {
    display: flex;
    justify-content: space-between;
    position: relative;
    margin-top: 25px;
}

.positionnement-steps::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 0;
    right: 0;
    height: 3px;
    background-color: var(--secondary-color);
    z-index: 1;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 2;
    flex: 1;
}

.step-symbol {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--light-bg);
    border: 3px solid var(--secondary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--light-text);
    margin-bottom: 8px;
    transition: all 0.3s ease;
    font-size: 1.2rem;
}

.step.active .step-symbol {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.step-label {
    font-size: 0.85rem;
    text-align: center;
    color: var(--light-text);
    max-width: 100px;
    line-height: 1.2;
}

.step.active .step-label {
    color: var(--accent-color);
    font-weight: bold;
}

/* Élément central */
.step-central {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 3;
    flex: 1;
}

.step-central-symbol {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: white;
    border: 3px solid var(--accent-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-color);
    margin-bottom: 8px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
    font-size: 1.2rem;
}

.step-central-label {
    font-size: 0.85rem;
    text-align: center;
    color: var(--accent-color);
    max-width: 100px;
    line-height: 1.2;
}

/* Sections */
.section {
    background: white;
    margin: 20px 0;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.section h2 {
    color: var(--primary-color);
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--secondary-color);
    display: flex;
    align-items: center;
}

.section h2 i {
    margin-right: 10px;
}

.section h3 {
    color: var(--accent-color);
    margin: 20px 0 15px 0;
}

/* Info grid */
.info-grid-detail {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin: 20px 0;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 15px;
    background: var(--light-bg);
    border-radius: 5px;
}

.info-item strong {
    color: var(--accent-color);
    font-size: 0.9rem;
}

.info-item span {
    color: var(--dark-text);
}

/* Related grid */
.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
    margin-top: 20px;
}

.related-card {
    background: #f9f9f9;
    padding: 1rem;
    border-radius: 6px;
    border-left: 3px solid var(--primary-color);
    text-decoration: none;
    color: inherit;
    display: block;
    transition: all 0.3s;
}

.related-card:hover {
    transform: translateX(5px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    background: white;
}

.related-card strong {
    display: block;
    color: var(--accent-color);
    margin-bottom: 0.5rem;
}

.related-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag-small {
    background-color: rgba(90, 185, 179, 0.15);
    color: var(--accent-color);
    padding: 0.2rem 0.6rem;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 500;
}

/* Boutons */
.btn {
    display: inline-block;
    background-color: var(--primary-color);
    color: white;
    padding: 12px 25px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: bold;
    transition: background-color 0.3s;
    border: none;
    cursor: pointer;
    margin: 5px;
}

.btn:hover {
    background-color: var(--accent-color);
}

.btn-back {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s;
}

.btn-back:hover {
    background-color: var(--accent-color);
}

/* Detail footer */
.detail-footer {
    padding: 1.5rem 2rem;
    background-color: #f9f9f9;
    border-top: 1px solid #eee;
    text-align: center;
}

/* Responsive */
@media (max-width: 768px) {
    header h1 {
        font-size: 1.5rem;
    }

    .main-nav .container {
        flex-direction: column;
    }

    .main-nav a {
        padding: 0.75rem;
        border-bottom: 1px solid #eee;
        border-left: 3px solid transparent;
    }

    .main-nav a.active,
    .main-nav a:hover {
        border-bottom-color: #eee;
        border-left-color: var(--primary-color);
    }

    .stats-grid,
    .data-grid,
    .info-grid-detail {
        grid-template-columns: 1fr;
    }

    .detail-header h1 {
        font-size: 2rem;
    }

    /* Positionnement en croix sur mobile */
    .positionnement-steps {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        grid-template-rows: repeat(3, auto);
        gap: 20px;
        margin-top: 0;
    }

    .positionnement-steps::before {
        display: none;
    }

    .step:nth-child(1) { grid-column: 2; grid-row: 1; justify-self: center; }
    .step:nth-child(2) { grid-column: 1; grid-row: 2; justify-self: center; }
    .step-central { grid-column: 2; grid-row: 2; justify-self: center; }
    .step:nth-child(4) { grid-column: 3; grid-row: 2; justify-self: center; }
    .step:nth-child(5) { grid-column: 2; grid-row: 3; justify-self: center; }
}

/* ── Bandeaux de statut (fiches formations, métiers, etc.) ── */
.statut-lieux {
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 0.88rem;
    line-height: 1.5;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}
.statut-lieux i { margin-top: 2px; flex-shrink: 0; }
.statut-ok       { background: #e8f5e9; color: #2e7d32; border-left: 4px solid #2e7d32; }
.statut-pending  { background: #fff3e0; color: #bf5e00; border-left: 4px solid #e67e22; }
.statut-inactive { background: #ffebee; color: #b71c1c; border-left: 4px solid #c62828; font-weight: 500; }
/* ─────────────────────────────────────────────────────────
   Widget France Travail — CMQ Forêt-Bois Occitanie
   Ajouter dans 3_interface/style.css
   ───────────────────────────────────────────────────────── */

.ft-widget {
  border: 1px solid #d9e3f0;
  border-radius: 8px;
  margin-top: 1.5rem;
  font-size: 0.9rem;
  overflow: hidden;
  background: #f9fbfd;
}

.ft-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: #003189;  /* bleu France Travail */
  color: #fff;
}

.ft-header h4 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
}

.ft-logo {
  width: 24px;
  height: 24px;
  border-radius: 3px;
  flex-shrink: 0;
}

/* Sections dépliantes */
.ft-section {
  border-top: 1px solid #d9e3f0;
  padding: 0;
}

.ft-section summary {
  cursor: pointer;
  padding: 10px 16px;
  font-weight: 600;
  background: #eef3fa;
  color: #003189;
  user-select: none;
  list-style: none;
}

.ft-section summary::after {
  content: " ▸";
  float: right;
  font-size: 0.75rem;
}

.ft-section[open] summary::after {
  content: " ▾";
}

.ft-section > *:not(summary) {
  padding: 12px 16px;
}

/* Offres */
.ft-total {
  color: #555;
  margin: 0 0 8px;
  font-size: 0.85rem;
}

.ft-offre-list,
.ft-formation-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.ft-offre-item,
.ft-formation-item {
  padding: 8px 0;
  border-bottom: 1px solid #e8edf3;
}

.ft-offre-item:last-child,
.ft-formation-item:last-child {
  border-bottom: none;
}

.ft-offre-titre {
  display: block;
  font-weight: 600;
  color: #003189;
  text-decoration: none;
}

.ft-offre-titre:hover {
  text-decoration: underline;
}

.ft-offre-meta {
  display: block;
  color: #666;
  font-size: 0.82rem;
  margin-top: 2px;
}

.ft-voir-plus {
  display: inline-block;
  margin-top: 10px;
  font-size: 0.85rem;
  color: #003189;
  text-decoration: none;
  font-weight: 600;
}

/* Statistiques */
.ft-stat-bloc {
  background: #fff;
  border: 1px solid #d9e3f0;
  border-radius: 6px;
  padding: 10px 14px;
  margin-bottom: 8px;
}

.ft-stat-bloc h5 {
  margin: 0 0 6px;
  font-size: 0.85rem;
  color: #444;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Tableau évolution */
.ft-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.ft-table th,
.ft-table td {
  padding: 6px 10px;
  border: 1px solid #d9e3f0;
  text-align: left;
}

.ft-table th {
  background: #eef3fa;
  font-weight: 600;
}

/* États */
.ft-vide {
  color: #888;
  font-style: italic;
  margin: 0;
}

.ft-erreur {
  color: #c00;
  background: #fff3f3;
  border: 1px solid #fcc;
  border-radius: 4px;
  padding: 8px 12px;
  margin: 8px 16px;
  font-size: 0.82rem;
}

.ft-chargement {
  padding: 16px;
  color: #555;
  display: flex;
  align-items: center;
  gap: 10px;
}

.ft-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid #ccc;
  border-top-color: #003189;
  border-radius: 50%;
  animation: ft-spin 0.8s linear infinite;
}

@keyframes ft-spin {
  to { transform: rotate(360deg); }
}

/* ── Filtre département ──────────────────────────────────── */
.ft-filtre-dept {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: #f0f4fb;
  border-top: 1px solid #d9e3f0;
  flex-wrap: wrap;
}

.ft-filtre-label {
  font-size: 0.85rem;
  color: #444;
  font-weight: 600;
  white-space: nowrap;
}

.ft-select {
  flex: 1;
  min-width: 180px;
  padding: 5px 10px;
  border: 1px solid #b0c4de;
  border-radius: 5px;
  font-size: 0.85rem;
  background: #fff;
  color: #222;
  cursor: pointer;
}

.ft-select:focus {
  outline: 2px solid #003189;
  outline-offset: 1px;
}

/* Pied de widget */
.ft-footer {
  padding: 8px 16px;
  font-size: 0.75rem;
  color: #888;
  border-top: 1px solid #d9e3f0;
  background: #f4f7fb;
}

.ft-footer a {
  color: #003189;
}

/* ── Grilles de lecture ───────────────────────────────────────────────────── */

/* Avertissement périmètre ROME */
.ft-avertissement-rome {
  font-size: 0.78rem;
  color: #7a5c00;
  background: #fffbea;
  border: 1px solid #ffe082;
  border-radius: 4px;
  padding: 6px 10px;
  margin: 0 16px 10px;
  line-height: 1.4;
}

.ft-rome-link {
  color: #7a5c00;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.ft-rome-link:hover { color: #003189; }

/* Légende sous le titre de chaque bloc */
.ft-legende {
  font-size: 0.78rem;
  color: #6b7a8d;
  font-style: italic;
  margin: 0 0 8px;
  line-height: 1.4;
}

/* Icône info-bulle ℹ */
.ft-info {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  font-size: 10px;
  font-style: normal;
  font-weight: 700;
  border-radius: 50%;
  background: #b0c4de;
  color: #fff;
  cursor: help;
  vertical-align: middle;
  margin-left: 4px;
  line-height: 1;
  position: relative;
  top: -1px;
  flex-shrink: 0;
}
.ft-info:hover { background: #003189; }

/* Pourcentage discret dans les tableaux */
.ft-pct {
  font-size: 0.78rem;
  color: #777;
  font-weight: normal;
  margin-left: 4px;
}

/* Jauge visuelle 1–5 pour les tensions */
.ft-jauge {
  display: inline-flex;
  gap: 3px;
  vertical-align: middle;
  margin-right: 6px;
}
.ft-jauge-pt {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 2px;
}
.ft-jauge-lib {
  font-size: 0.8rem;
  font-weight: 600;
  vertical-align: middle;
}

/* ── Contenu riche (Quill) dans les fiches détail ── */
.rich-content p { margin: 0 0 5px; }
.rich-content ul, .rich-content ol { padding-left: 1.4em; margin: 4px 0 6px; }
.rich-content li { margin-bottom: 2px; }
.rich-content strong { font-weight: 700; }
.rich-content em { font-style: italic; }
