/* ============================================================
   Stratfu — Modale « Créer / éditer un dossier »
   À inclure APRÈS builder.css.
   ============================================================ */

.folder-modal-overlay {
  position: fixed; inset: 0; z-index: 700;
  background: rgba(6,7,10,0.80); backdrop-filter: blur(5px);
  display: none; align-items: center; justify-content: center; padding: 20px;
}
.folder-modal-overlay.open { display: flex; }

.folder-modal {
  width: 100%; max-width: 880px; max-height: 88vh;
  background: linear-gradient(180deg, #101217, #0e1014);
  border: 1px solid rgba(255,255,255,0.10); border-radius: 16px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.55); overflow: hidden;
  font-family: 'Rajdhani', sans-serif; color: #e8e8e0;
  display: flex; flex-direction: column;
}

.folder-modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 22px 14px; border-bottom: 1px solid rgba(255,255,255,0.07);
}
.folder-modal-title {
  font-family: 'Uncial Antiqua', cursive; font-size: 19px;
  color: #f0c040; text-shadow: 0 0 16px rgba(240,192,64,0.22);
}
.folder-modal-close {
  width: 32px; height: 32px; border-radius: 8px;
  background: transparent; border: 1px solid rgba(255,255,255,0.10);
  color: rgba(200,200,190,0.5); font-size: 18px; cursor: pointer; transition: .15s;
  display: flex; align-items: center; justify-content: center;
}
.folder-modal-close:hover { background: rgba(255,255,255,0.08); color: #e8e8e0; }

.folder-modal-body {
  display: grid; grid-template-columns: 1fr 200px 1fr; gap: 20px;
  padding: 20px 22px; overflow-y: auto;
}
.fm-col-preview { align-items: center; }
.fm-col { display: flex; flex-direction: column; min-width: 0; }
.fm-label, .fm-field label {
  font-size: 11px; font-weight: 700; letter-spacing: .5px;
  text-transform: uppercase; color: rgba(200,200,190,0.45); margin-bottom: 8px;
}

/* Grande carte d'aperçu (colonne centrale) */
.fm-preview-big {
  width: 100%; aspect-ratio: 1; max-width: 180px;
  border-radius: 16px; border: 2px solid rgba(240,192,64,0.45); background: #14161c;
  overflow: hidden; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 18px rgba(240,192,64,0.22); margin-bottom: 10px;
}
.fm-preview-big img { width: 100%; height: 100%; object-fit: contain; }
.fm-preview-empty { font-size: 44px; color: rgba(240,192,64,0.5); }
.fm-preview-name {
  text-align: center; font-family: 'Rajdhani', sans-serif; font-weight: 700;
  font-size: 15px; color: #e8e8e0; min-height: 20px;
}

/* Onglets Classes / Monstres */
.fm-asset-tabs { display: flex; gap: 6px; margin-bottom: 8px; }
.fm-asset-tab {
  flex: 1; padding: 7px 8px; border-radius: 8px;
  background: #131519; border: 1px solid rgba(255,255,255,0.10);
  color: rgba(200,200,190,0.55); font-family: 'Rajdhani', sans-serif;
  font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .3px;
  cursor: pointer; transition: .15s;
}
.fm-asset-tab:hover { color: #e8e8e0; border-color: rgba(255,255,255,0.22); }
.fm-asset-tab.active { color: #f0c040; border-color: rgba(240,192,64,0.5); background: rgba(240,192,64,0.10); }

.fm-asset-search {
  width: 100%; box-sizing: border-box; margin-bottom: 8px;
  padding: 8px 11px; background: #131519; border: 1px solid rgba(255,255,255,0.10);
  border-radius: 8px; color: #e8e8e0; font-family: 'Rajdhani', sans-serif; font-size: 13px;
}
.fm-asset-search:focus { outline: none; border-color: rgba(240,192,64,0.5); }

/* Grille d'assets */
.fm-asset-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px;
  max-height: 320px; overflow-y: auto; padding: 2px;
}
.fm-asset {
  height: 84px; border-radius: 10px; border: 2px solid transparent;
  background: #1a1d23; overflow: hidden; cursor: pointer; transition: .12s; padding: 6px;
  display: flex; align-items: center; justify-content: center;
}
.fm-asset img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; }
.fm-asset:hover { border-color: rgba(240,192,64,0.5); transform: scale(1.06); }
.fm-asset.sel { border-color: #f0c040; box-shadow: 0 0 0 2px rgba(240,192,64,0.20); }
.fm-asset-empty { grid-column: 1/-1; text-align: center; color: rgba(200,200,190,0.4); padding: 30px 0; font-size: 13px; }

/* Colonne méta */
.fm-field { margin-bottom: 18px; }
.fm-field input[type="text"] {
  width: 100%; box-sizing: border-box; padding: 11px 13px;
  background: #131519; border: 1px solid rgba(255,255,255,0.10); border-radius: 9px;
  color: #e8e8e0; font-family: 'Rajdhani', sans-serif; font-size: 15px; transition: .15s;
}
.fm-field input[type="text"]:focus { outline: none; border-color: rgba(224,80,122,0.6); box-shadow: 0 0 0 3px rgba(224,80,122,0.12); }

/* Tags (pills) */
.fm-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; min-height: 24px; }
.fm-tags-empty { font-size: 12px; color: rgba(200,200,190,0.35); }
.fm-tag-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 6px 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 600;
  color: var(--pc); background: color-mix(in srgb, var(--pc) 16%, transparent);
  border: 1px solid color-mix(in srgb, var(--pc) 45%, transparent);
}
.fm-tag-del {
  background: transparent; border: none; color: currentColor; opacity: .6;
  cursor: pointer; font-size: 11px; line-height: 1; padding: 2px;
}
.fm-tag-del:hover { opacity: 1; }

.fm-tag-add { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.fm-tag-add input {
  flex: 1; min-width: 120px; padding: 9px 11px;
  background: #131519; border: 1px solid rgba(255,255,255,0.10); border-radius: 8px;
  color: #e8e8e0; font-family: 'Rajdhani', sans-serif; font-size: 13px;
}
.fm-tag-add input:focus { outline: none; border-color: rgba(240,192,64,0.5); }
.fm-tag-colors { display: flex; gap: 4px; }
.fm-color-dot {
  width: 20px; height: 20px; border-radius: 50%; cursor: pointer; padding: 0;
  border: 2px solid transparent; transition: .12s;
}
.fm-color-dot:hover { transform: scale(1.15); }
.fm-color-dot.sel { border-color: #fff; box-shadow: 0 0 0 2px rgba(255,255,255,0.25); }
.fm-tag-addbtn {
  padding: 8px 14px; border-radius: 8px; cursor: pointer;
  background: rgba(240,192,64,0.14); border: 1px solid rgba(240,192,64,0.5); color: #f0c040;
  font-family: 'Rajdhani', sans-serif; font-weight: 700; font-size: 12px;
  text-transform: uppercase; letter-spacing: .3px; transition: .15s;
}
.fm-tag-addbtn:hover { background: rgba(240,192,64,0.24); }

/* Pied */
.folder-modal-foot {
  display: flex; gap: 10px; padding: 14px 22px 18px;
  border-top: 1px solid rgba(255,255,255,0.07);
}
.fm-btn-cancel {
  flex: 1; padding: 11px; border-radius: 10px; background: transparent;
  border: 1px solid rgba(255,255,255,0.10); color: rgba(200,200,190,0.55);
  font-family: 'Rajdhani', sans-serif; font-weight: 600; font-size: 14px; cursor: pointer; transition: .15s;
}
.fm-btn-cancel:hover { border-color: rgba(255,255,255,0.22); color: #e8e8e0; }
.fm-btn-save {
  flex: 2; padding: 11px; border-radius: 10px;
  background: linear-gradient(180deg, #f07090, #e0507a); border: none; color: #fff;
  font-family: 'Rajdhani', sans-serif; font-weight: 700; font-size: 15px;
  cursor: pointer; transition: .15s; box-shadow: 0 4px 16px rgba(224,80,122,0.28);
}
.fm-btn-save:hover { filter: brightness(1.08); transform: translateY(-1px); }
.fm-btn-save:disabled { opacity: .5; pointer-events: none; }

@media (max-width: 820px) {
  .folder-modal-body { grid-template-columns: 1fr; }
  .fm-preview-big { max-width: 140px; }
}
