/* SBIX v5 UI – style.css */

/* ─────────────────────────────────────────────── */
/* 🎨 Base Variables et Thème Principal           */
/* ─────────────────────────────────────────────── */
@import url("/static/css/fonts.css");

:root {
  --sbix-primary: #00796b;
  --sbix-accent: #00b2a9;
  --sbix-bg: #f9fafa;
  --sbix-surface: #ffffff;
  --sbix-text: #1a1a1a;
  --sbix-muted: #7a7a7a;
  --sbix-border: #e0e0e0;
  --sbix-alert: #d32f2f;
  --sbix-success: #388e3c;
  --sbix-warning: #fbc02d;
  --sbix-font: 'Inter', 'Segoe UI', sans-serif;
  --sbix-radius: 6px;
  --sbix-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

/* ─────────────────────────────────────────────── */
/* 🧱 Structure Globale                            */
/* ─────────────────────────────────────────────── */
body {
  font-family: var(--sbix-font);
  background-color: var(--sbix-bg);
  color: var(--sbix-text);
  margin: 0;
  padding: 0;
  line-height: 1.6;
}

header {
  background-color: var(--sbix-surface);
  color: var(--sbix-text);
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--sbix-border);
  box-shadow: var(--sbix-shadow);
  position: sticky;
  top: 0;
  z-index: 10;
}

header h1 {
  margin: 0;
  font-size: 1.3rem;
  font-weight: 600;
  flex-grow: 1;
}

nav {
  display: flex;
  gap: 1.5rem;
}

nav a {
  color: var(--sbix-primary);
  text-decoration: none;
  font-weight: 500;
  padding: 0.25rem 0.5rem;
  transition: color 0.2s ease;
}

nav a:hover {
  color: var(--sbix-accent);
}

.container {
  max-width: 1280px;
  margin: auto;
  padding: 2rem;
}

.card {
  background: var(--sbix-surface);
  border: 1px solid var(--sbix-border);
  border-radius: var(--sbix-radius);
  box-shadow: var(--sbix-shadow);
  padding: 1.5rem;
  margin-bottom: 2rem;
}


/* ──────────────────────────────────────────────────────────── */
/* 📂 SBIX Ledger — Styles UX                                   */   
/*  TABLE STYLES                                                 */
/* ──────────────────────────────────────────────────────────── */
/* 🧾 Tableaux de Données */
table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1.5rem;
  background-color: white;
  border: 1px solid var(--sbix-border);
  border-radius: var(--sbix-radius);
  overflow: hidden;
}

th, td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--sbix-border);
  text-align: left;
  font-size: 0.92rem;
  vertical-align: top;
}

th {
  background-color: #f1f3f4;
  font-weight: 600;
  color: var(--sbix-muted);
}

ul.reason-list {
  padding-left: 1.2rem;
  margin: 0;
}

/* 🔖 Status Tags */
.status-tag {
  padding: 0.3rem 0.65rem;
  border-radius: var(--sbix-radius);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  display: inline-block;
}


button, .btn {
  background-color: var(--sbix-primary);
  color: white;
  border: none;
  padding: 0.6rem 1.1rem;
  border-radius: var(--sbix-radius);
  cursor: pointer;
  font-weight: 500;
  font-size: 0.9rem;
  transition: background-color 0.2s ease;
}

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

/* ⚠️ Alertes */
.alert {
  padding: 1rem;
  border-radius: var(--sbix-radius);
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
}

.alert-success {
  background-color: #e6f4ea;
  color: #2e7d32;
  border: 1px solid #c8e6c9;
}

.alert-error {
  background-color: #fcebea;
  color: #c62828;
  border: 1px solid #f5c6cb;
}

footer {
  text-align: center;
  color: var(--sbix-muted);
  padding: 1.5rem;
  font-size: 0.85rem;
  border-top: 1px solid var(--sbix-border);
  margin-top: 3rem;
}

/* 🧩 Coloriage des lignes */

.badge {
  display: inline-block;
  padding: 0.25rem 0.6rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 4px;
  text-transform: uppercase;
}


.badge-tezos {
  background-color: #2c7df7;
  color: white;
  padding: 2px 6px;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 4px;
}

.badge-aleph-custom {
  background-color: #4B0082;
  color: #FFD700;
  padding: 2px 6px;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 4px;
}

.badge-pending {
  background-color: #aaa;
  color: black;
  padding: 2px 6px;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 4px;
}

/* 🔍 Filtres Ledger */
.filter-bar {
  margin: 1em 0;
  padding: 0.8em 1em;
  background-color: #f5f5f5;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 0.95em;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5em;
  align-items: center;
  justify-content: space-between;
}

.filter-bar input[type="text"],
.filter-bar select {
  padding: 4px 8px;
  border: 1px solid #ccc;
  border-radius: 6px;
  min-width: 120px;
}

.filter-bar button {
  padding: 6px 12px;
  background-color: #0078d4;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}

.filter-bar button:hover {
  background-color: #005fa3;
}

.filter-bar a {
  margin-left: 0.5em;
  color: #0078d4;
  text-decoration: none;
  font-weight: bold;
}

.filter-bar a:hover {
  text-decoration: underline;
}

.filter-bar label {
  display: flex;
  align-items: center;
  gap: 4px;
  font-weight: 500;
}

/* 🧠 Badges dynamiques */

.tag-list, .reason-list {
  padding: 0; margin: 0;
  list-style: none;
}
.tag {
  background: #222;
  color: #ffd700;
  padding: 2px 5px;
  margin-right: 3px;
  border-radius: 3px;
  font-size: 0.8em;
  display: inline-block;
}


/* ✨ Animation Modale ledger */

.modal {
  display: none;
  position: fixed;
  z-index: 9999;
  left: 0; top: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  justify-content: center;
  align-items: center;
}

.modal.show {
  display: flex;
}

.modal-content {
  background: #1e1e1e;
  padding: 24px;
  border-radius: 12px;
  width: 600px;
  max-width: 90%;
  color: white;
}

.modal-content h2 {
  margin-top: 0;
}

.modal-content .close {
  float: right;
  font-size: 24px;
  cursor: pointer;
}

/* tableau  ldger colone anchor */

.proof-inline {
  margin-top: 5px;
  font-size: 0.9em;
}
.proof-inline summary {
  cursor: pointer;
  color: #007bff;
}
.proof-content {
  background: #f9f9f9;
  border: 1px dashed #ccc;
  padding: 8px;
  margin-top: 5px;
  border-radius: 8px;
}

  details.proof-inline {
    margin-top: 6px;
    background: #f9f9f9;
    border-radius: 6px;
    padding: 8px;
  }
  details.proof-inline summary {
    cursor: pointer;
    font-weight: bold;
    color: #2c3e50;
  }
  .proof-content {
    margin-top: 5px;
    font-size: 0.9em;
  }


/* message upload proof */

.alert-box {
  margin: 1em 0;
  padding: 10px 14px;
  border-radius: 6px;
  background-color: #ffefef;
  border: 1px solid #e99;
  color: #900;
  font-size: 0.95em;
}
.alert-box ul {
  margin: 0;
  padding-left: 1.2em;
}
.alert-box li.error::before {
  content: "❌ ";
}



/* FIN message upload proof */



.btn-anchor {
  background-color: #4CAF50; /* vert */
  color: white;
}
.btn-anchor:hover {
  background-color: #388E3C;
}


.btn-reset {
  background-color: #607D8B;
  color: white;
}
.btn-reset:hover {
  background-color: #455A64;
}

.badge-proof {
  background-color: #2e8b57;
  color: white;
  padding: 4px 8px;
  border-radius: 5px;
}
.btn-view-proof {
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 1em;
}


.sticky-footer {
  position: fixed;
  bottom: 10px;
  right: 20px;
  background: #f8f9fa;
  border: 1px solid #ddd;
  padding: 10px 15px;
  border-radius: 8px;
  box-shadow: 0 0 10px rgba(0,0,0,0.15);
  z-index: 1000;
}

.btn-sticky {
  background-color: #0066cc;
  color: white;
  border: none;
  padding: 8px 14px;
  border-radius: 5px;
  cursor: pointer;
  font-weight: bold;
}

.btn-sticky:hover {
  background-color: #004c99;
}


/* 🩺 STATUS TABLE STYLES */

/* 👇 Style pour le tableau de statut */
.status-table {
  border-collapse: collapse;
  width: 100%;
}
.status-table th, .status-table td {
  padding: 12px 16px;
  border: 1px solid #ddd;
  text-align: left;
}
.status-icon {
  margin-right: 6px;
}
.ok {
  background-color: #e9ffe9;
  color: #2ecc71;
}
.fail {
  background-color: #ffe9e9;
  color: #e74c3c;
}
.warn {
  background-color: #fffbe5;
  color: #f39c12;
}



/*  RULESET EDITOR TABLE STYLES */

.flex-columns {
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
}
.column {
  flex: 1;
  min-width: 300px;
}
.yaml-editor {
  background-color: #f9fafb;
  font-family: "Fira Code", monospace;
  padding: 1rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  width: 100%;
  line-height: 1.5;
  color: #111827;
}
.section {
  background-color: #ffffff;
  border: 1px solid #e5e7eb;
  padding: 1.5rem;
  margin-bottom: 2rem;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.rule-box {
  margin-bottom: 1rem;
  padding: 1rem;
  background-color: #f3f4f6;
  border: 1px solid #d1d5db;
  border-radius: 8px;
}
pre {
  background-color: #f3f4f6;
  padding: 0.75rem;
  border-radius: 6px;
  overflow-x: auto;
  font-family: "Fira Code", monospace;
  font-size: 0.9rem;
  color: #1f2937;
}
.btn-row {
  margin-top: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}
button, select, input[type="file"] {
  padding: 0.4rem 0.8rem;
  font-size: 0.9rem;
  border-radius: 6px;
  border: 1px solid #ccc;
  background: #f9fafb;
  color: #111827;
  cursor: pointer;
}
button:hover {
  background: #e5e7eb;
}
dialog {
  border: none;
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 0 10px rgba(0,0,0,0.2);
  width: 90%;
  max-width: 600px;
  background: white;
}
dialog::backdrop {
  background: rgba(0,0,0,0.4);
}
.copy-success {
  background: #d1fae5;
  color: #065f46;
  padding: 0.5rem;
  border-radius: 6px;
  margin-top: 0.5rem;
  display: none;
}


//* ──────────────────────────────────────────────────────────── */
/* 📂 SBIX Proof Checker — Styles UX                            */
/* Ce fichier contient les améliorations visuelles pour rendre */
/* la page plus claire, moderne et intuitive.                  */
/* ──────────────────────────────────────────────────────────── */

/* 💡 Messages de statut */
.success {
  background-color: #e6ffed;
  color: #1a7f37;
  border-left: 5px solid #1a7f37;
  padding: 10px;
  margin-top: 1em;
  font-weight: bold;
  border-radius: 6px;
}

.error {
  background-color: #ffe6e6;
  color: #bf1a1a;
  border-left: 5px solid #bf1a1a;
  padding: 10px;
  margin-top: 1em;
  font-weight: bold;
  border-radius: 6px;
}

/* 📁 Formulaire de chargement */
form#uploadForm {
  background-color: #f8f9fa;
  padding: 1.2rem;
  border: 1px solid #ddd;
  border-radius: 8px;
  margin-top: 1em;
}

/* 🎛️ Menu déroulant tx_id issu de anchor_log */
.tx-dropdown {
  width: 100%;
  padding: 8px;
  margin-top: 0.3rem;
  border: 1px solid #ccc;
  border-radius: 5px;
  font-family: monospace;
}

/* 📜 Zone d'affichage JSON */
pre {
  background-color: #f2f2f2;
  padding: 10px;
  border-radius: 6px;
  font-size: 0.95rem;
  overflow-x: auto;
}

/* 🔘 Boutons d'action */
button {
  background-color: #0056b3;
  color: white;
  padding: 8px 14px;
  margin-top: 1rem;
  margin-right: 0.5rem;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-weight: bold;
  transition: background-color 0.3s ease;
}

button:hover {
  background-color: #003d80;
}

/* 📎 Liens de téléchargement */
a#downloadLink,
a#downloadLinkPost {
  background-color: #eee;
  padding: 6px 10px;
  border-radius: 5px;
  display: inline-block;
  margin-top: 0.5rem;
  color: #333;
  text-decoration: none;
  font-size: 0.95rem;
  transition: background-color 0.3s ease;
}

a#downloadLink:hover,
a#downloadLinkPost:hover {
  background-color: #ddd;
}

/* ✅ Zone d’animation de résultat */
.result-anim {
  padding: 1em;
  border-radius: 12px;
  margin: 1em 0;
  font-weight: bold;
  animation: fadeIn 0.6s ease-in;
  position: relative;
}
.result-anim.valid {
  background-color: #e5ffe5;
  border: 2px solid #00b200;
}
.result-anim.invalid {
  background-color: #ffe5e5;
  border: 2px solid #b20000;
}

/* ✔️ Animation checkmark */
.checkmark-animation::after {
  content: "✔️";
  position: absolute;
  right: 1em;
  top: 0.5em;
  font-size: 2em;
  animation: bounce 0.6s ease;
}

/* 🌀 Animations */

  to   { opacity: 1; transform: translateY(0); }
}

  100% { transform: scale(1); }
}

/* ── Ledger card: forcer l'encadrement du partial ───────────────── */
#ledger-card {
  padding: 0;                /* pas de padding autour du tableau */
  overflow: hidden;          /* arrondis respectés */
}

#ledger-card .table-wrap {
  overflow-x: auto;          /* scroll horizontal si trop de colonnes */
}

/* Le style global de table donnait l’impression d’un bloc séparé.
   On neutralise tout ça uniquement dans #ledger-card */
#ledger-card table {
  margin: 0;                 /* enlève le marge-top globale */
  border: 0;                 /* supprime la bordure extérieure */
  background: transparent;   /* laisse voir le fond de la card */
  border-radius: 0;          /* pas d'arrondi sur le tableau lui-même */
}

#ledger-card thead th {
  background: #f7f8fb;       /* léger contraste en-tête dans la card */
}

/* Optionnel: lignes plus nettes dans la card */
#ledger-card tbody tr {
  background: transparent;
}

.copy-feedback {
  margin-left: 6px;
  font-weight: 600;
  color: #2e7d32;
}
.copy-btn {
  background: transparent;
  border: 0;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
}
.copy-btn:hover { opacity: .8; }



/* 🎯 Liens dans la modale de preuve */
#proofModal a {
  color: #007bff; /* Bleu clair type Bootstrap */
  text-decoration: underline;
  font-weight: 500;
}

#proofModal a:hover {
  color: #0056b3; /* Bleu plus foncé au hover */
  text-decoration: none;
}
