/* 
=============================================================================
FORGEEDU DÉPÔTS AUDIT - CUSTOM CSS
=============================================================================
Ce fichier contient UNIQUEMENT les composants spécifiques à l'application.
Les styles de base de Bootstrap ne sont PLUS surchargés.
*/

/* --------------------------------------------------------------------------
   1. VARIABLES DE L'APPLICATION (Non-Bootstrap)
   -------------------------------------------------------------------------- */
:root {
  --ad-bg:     #F7F8FB;
  --ad-border: #d0d7de;
  --ad-text:   #24292f;
  --ad-muted:  #656d76;
  --ad-blue:   #4c9dcb;
  --ad-card:   #ffffff;
}

body {
  background-color: #F7F8FB;
  font-family: var(--bs-font-monospace);
  font-size:0.9em;
}

.text-muted a {
    text-decoration: none !important;
}

h1 {
    text-transform: uppercase !important;
    font-weight: bold !important;
    font-size: 24px;
}

/* RENDU PIXEL-PERFECT POUR LES ICONES ET PETITES IMAGES */
.btn img, .ad-btn img, .text-muted img, .badge img, i {
    image-rendering: pixelated !important;
    image-rendering: -moz-crisp-edges !important;
    image-rendering: crisp-edges !important;
    -webkit-font-smoothing: none !important;
    -moz-osx-font-smoothing: grayscale !important;
    font-smooth: never !important;
    font-size: 12px !important;
    width: 12px;
    height: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    top: -2px; /* Lift up for breadcrumbs */
}

/* Réajustement spécifique pour les boutons */
.btn img, .ad-btn img, .btn i, .ad-btn i {
    top: 0px; /* Redescend de 2px par rapport à la règle globale */
}

/* --------------------------------------------------------------------------
   2. BOUTONS
   -------------------------------------------------------------------------- */

.btn, .ad-btn {
    text-transform: lowercase;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}




/* BOUTON LIGHT */
.btn-light {
    color: #34495e;
    background-color: transparent;
    border-color: transparent;
}

.btn-light:hover, .btn-light:focus, .btn-light.active {
    color: #2c3e50;
    background-color: #e2e6ea;
    border-color: #dae0e5;
    box-shadow: none;
}

.btn-light.active {
    background-color: transparent;
    border-color: transparent;
}

/* BOUTON PRIMARY (#3071a9) */
.btn-primary {
    background-color: #3071a9;
    border-color: #3071a9;
    color: #ffffff;
    font-weight: 600;
}

.btn-primary:hover {
    background-color: #285e8d;
    border-color: #245580;
    color: #ffffff;
}

.btn-primary:active, .btn-primary:focus {
    background-color: #1e4a6e !important;
    border-color: #1a4160 !important;
    box-shadow: 0 0 0 0.25rem rgba(48, 113, 169, 0.25) !important;
    color: #ffffff !important;
}

/* NAVIGATION ACTIVE */
.navbar .btn-light.active i {
    color: #348f55 !important;
}

/* BUTTONS XS */
.btn-xs, .btn-group-xs > .btn {
    padding: 0.15rem 0.4rem;
    font-size: 0.75rem;
    line-height: 1.2;
    border-radius: 0.2rem;
    margin-top: 1px;
}
/* /BUTTONS XS */

/* --------------------------------------------------------------------------
   3. COMPOSANTS SPÉCIFIQUES (ad-*)
   -------------------------------------------------------------------------- */

/* Cartes personnalisées */
.ad-card { 
  background: var(--ad-card); 
  border: 1px solid var(--ad-border); 
  border-radius: 8px; 
  overflow: hidden; 
}
.ad-card-header { 
  padding: .65rem 1rem; 
  border-bottom: 1px solid var(--ad-border);
  font-weight: 600; 
  font-size: .875rem;
  display: flex; 
  align-items: center; 
  gap: .5rem;
  background: var(--ad-bg); 
}
.ad-card-body { padding: 1rem; }

/* Tableaux personnalisés */
.ad-table { width: 100%; border-collapse: collapse; font-size: .8rem; }
.ad-table th { 
  background: var(--ad-bg); 
  border-bottom: 2px solid var(--ad-border);
  padding: .5rem .75rem; 
  font-weight: 600; 
  color: var(--ad-muted);
  white-space: nowrap; 
}
.ad-table td { 
  padding: .5rem .75rem; 
  border-bottom: 1px solid var(--ad-border);
  vertical-align: middle; 
}
.ad-table tr:last-child td { border-bottom: none; }

/* Badges personnalisés et Bootstrap */
.badge {
  font-weight: normal !important;
  border-radius: 3px !important;
  font-size: .68rem !important;
  padding-top: .3rem !important;
}
.badge.text-bg-danger {
  background-color: #d93c3c !important;
  color: #ffffff !important;
}
.badge.text-bg-warning {
  background-color: #f2c84f !important;
  color: #24292f !important;
}
.badge.text-bg-success {
  background-color: #3ab43c !important;
  color: #ffffff !important;
}
.badge.text-bg-info {
  background-color: #8cda3c !important;
  color: #24292f !important;
}
.badge.text-bg-secondary {
  background-color: #656d76 !important;
  color: #ffffff !important;
}
.ad-badge { 
  display: inline-block; 
  padding: .15rem .5rem;
  padding-top: calc(.15rem + 2px);
  border-radius: 3px;
  font-size: .68rem; 
  font-weight: 600; 
  border: 1px solid transparent; 
  color: #fff !important;
}
.ad-badge-danger  { background: #d93c3c; border-color: #d93c3c; }
.ad-badge-warning { background: #f2c84f; color: #24292f !important; border-color: #f2c84f; }
.ad-badge-info    { background: #8cda3c; color: #24292f !important; border-color: #8cda3c; }
.ad-badge-success { background: #3ab43c; border-color: #3ab43c; }
.ad-badge-muted   { background: #656d76; border-color: #656d76; }

/* Cercles de score */
.score-circle-sm { 
  display: inline-flex; 
  align-items: center; 
  justify-content: center;
  width: 32px; 
  height: 32px; 
  border-radius: 50%; 
  color: #fff;
  font-size: 11px; 
  font-weight: 700; 
  border: 1px solid rgba(0,0,0,0.1);
  box-sizing: border-box;
}

/* Grille de statistiques */
.ad-stat-grid { 
  display: grid; 
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: .75rem; 
  margin-bottom: 1rem; 
}
.ad-stat { padding: 1.25rem; text-align: center; }
.ad-stat-value { font-size: 2rem; font-weight: 700; line-height: 1.1; }
.ad-stat-label { font-size: .75rem; color: var(--ad-muted); margin-top: .25rem; }

/* Bloc JSON */
.json-block { 
  background: #161b22; 
  color: #c9d1d9;
  padding: 1rem; 
  font-size: .78rem; 
  overflow-x: auto; 
}

/* Animations & Spinners */
@keyframes ad-spin { to { transform: rotate(360deg); } }
.ad-spinner { 
  width: 14px; 
  height: 14px; 
  border: 2px solid var(--ad-border);
  border-top-color: var(--ad-blue); 
  border-radius: 50%;
  animation: ad-spin .65s linear infinite; 
  flex-shrink: 0;
  display: inline-block; 
}

/* --------------------------------------------------------------------------
   3. STYLES DES RÉSULTATS D'AUDIT
   -------------------------------------------------------------------------- */
.ad-verdict-card {
  flex: 1;
  border-radius: 8px;
  background: #1c2128;
  padding: 1.1rem 1.4rem;
  font-family: ui-monospace, 'SFMono-Regular', Consolas, monospace;
}
.ad-verdict-badge {
  font-size: .68rem;
  color: #6e7681;
  text-transform: uppercase;
  letter-spacing: .07em;
  margin-bottom: .55rem;
}
.ad-verdict-title { font-size: .9rem; font-weight: 700; }
.ad-verdict-title.success { color: #4ade80; }
.ad-verdict-title.danger { color: #f87171; }
.ad-verdict-desc { font-size: .76rem; opacity: .75; margin-top: .35rem; }
.ad-verdict-desc.success { color: #4ade80; }
.ad-verdict-desc.danger { color: #f87171; }

.ad-verdict-blocages { margin-top: .65rem; }
.ad-verdict-blocages-title {
  font-size: .68rem;
  color: #f87171;
  opacity: .7;
  text-transform: uppercase;
  letter-spacing: .07em;
  margin-bottom: .35rem;
}
.ad-verdict-blocage-item { font-size: .8rem; color: #f87171; margin-bottom: .2rem; }

.ad-score-card-body {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
  height: 100%;
}
.ad-score-title { font-size: 1.05rem; font-weight: 700; margin-bottom: .25rem; }
.ad-score-meta { margin-top: .4rem; font-size: .75rem; color: var(--ad-muted); }

.ad-findings-table { width: 100%; word-break: break-word; }
.ad-findings-table tr:last-child td { border-bottom: none; }
.ad-findings-table th.col-sev { width: 80px; }
.ad-findings-table th.col-axe { width: 90px; }
.ad-findings-table th.col-type { width: 12%; }
.ad-findings-table th.col-file { width: 12%; }
.ad-findings-table th.col-rec { width: 22%; }

/* --------------------------------------------------------------------------
   4. STYLES DE LA LISTE DES AUDITS
   -------------------------------------------------------------------------- */
.ad-elim-card { padding: 1rem 1.25rem; }
.ad-elim-title {
  font-size: .7rem;
  font-weight: 700;
  color: var(--ad-muted);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: .6rem;
}
.ad-elim-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .22rem .75rem;
}
.ad-elim-item { font-size: .75rem; }
.ad-elim-code {
  font-size: .68rem;
  background: #f6f8fa;
  border: 1px solid var(--ad-border);
  border-radius: 3px;
  padding: .05rem .3rem;
  margin-right: .3rem;
  font-family: inherit;
}

.ad-filter-input {
  border: none;
  box-shadow: none;
  padding: .2rem 0;
  background: transparent;
  font-size: .85rem;
}

.ad-repos-table-card {
  overflow-x: auto;
  border-radius: 4px;
  margin: 0rem 1rem 0rem 1rem;
}
.ad-repos-table { width: 100%; min-width: 860px; }
.ad-repos-table tr:last-child td { border-bottom: none !important; }

.ad-legende { padding-top: .35rem; padding-bottom: 4rem; }
.ad-legende-wrap {
  font-size: .72rem;
  color: var(--ad-muted);
  display: flex;
  flex-wrap: wrap;
  gap: .3rem .75rem;
}

/* --------------------------------------------------------------------------
   5. UTILITAIRES & CLASSES GÉNÉRIQUES
   -------------------------------------------------------------------------- */
.ad-breadcrumb-current {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 300px;
  display: inline-block;
  vertical-align: bottom;
}

.ad-info-card-body { padding: .75rem 1rem; }
.ad-info-grid {
  display: flex;
  flex-wrap: wrap;
  column-gap: 2rem;
  row-gap: .5rem;
  font-size: .85rem;
}
.ad-info-label { color: var(--ad-muted); margin-right: .3rem; }
.ad-info-value { font-weight: 600; }

.ad-repo-link {
  max-width: 280px;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
  display: block;
  text-decoration: none;
}

.ad-text-small { font-size: .78rem; }
.ad-text-xsmall { font-size: .72rem; }

.ad-provider-badge { padding: .3rem .75rem; font-size: .8rem; }
.ad-audit-form-input { margin-bottom: .75rem; }
.ad-audit-iframe { display: none; width: 100%; border: none; background: transparent; }
.ad-audit-results-container { padding: 0 1.5rem 4rem; }

/* --------------------------------------------------------------------------
   6. STYLES SPÉCIFIQUES À L'IFRAME D'AUDIT
   -------------------------------------------------------------------------- */
.audit-iframe-body {
  margin: 0;
  padding: 10px 0 4px;
  background: #F7F8FB;
  overflow: hidden;
}
.audit-iframe-body, .audit-iframe-body * {
  font-family: var(--bs-font-monospace) !important;
}

@keyframes ad-pulse {
  0%, 100% { opacity: .4; }
  50% { opacity: 1; }
}
