/* Lumière — thème inspiré du portfolio (fond sombre, accents or, bandeau tricolore) */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  --bg: #0a0b0f;
  --bg-alt: #0e1015;
  --panel: #13151c;
  --panel-2: #171a22;
  --border: rgba(255,255,255,.08);
  --border-strong: rgba(255,255,255,.14);
  --gold: #d4af37;
  --gold-soft: #e8cd6d;
  --text: #edeef2;
  --muted: #8b90a0;
  --muted-2: #6b7080;
  --error: #ef6161;
  --blue: #3b5bdb;
  --red: #d64545;
  --radius: 14px;
  --radius-sm: 9px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background:
    radial-gradient(circle at 15% 0%, rgba(212,175,55,.06), transparent 40%),
    radial-gradient(circle at 85% 100%, rgba(59,91,219,.05), transparent 40%),
    var(--bg);
  color: var(--text);
  min-height: 100vh;
}

/* ---------- Bandeau tricolore, signature du style ---------- */
.tricolor-bar {
  height: 3px;
  background: linear-gradient(90deg, var(--blue) 0%, var(--blue) 33%, #f4f4f4 33%, #f4f4f4 66%, var(--red) 66%, var(--red) 100%);
  border-radius: 999px;
}

/* ---------- Login ---------- */
.centered { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 1rem; }
.card {
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2.2rem 2rem;
  width: 360px;
  box-shadow: 0 20px 60px rgba(0,0,0,.45);
  overflow: hidden;
  position: relative;
}
.card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--blue) 0%, var(--blue) 33%, #f4f4f4 33%, #f4f4f4 66%, var(--red) 66%, var(--red) 100%);
}
.card h1 {
  color: var(--gold);
  text-align: center;
  margin: .5rem 0 1.6rem;
  font-size: 1.7rem;
  font-weight: 800;
  letter-spacing: .01em;
}
label { display: block; margin-bottom: 1rem; font-size: .82rem; color: var(--muted); font-weight: 500; }
input, select {
  width: 100%; padding: .7rem .8rem; margin-top: .4rem;
  background: var(--bg-alt); border: 1px solid var(--border); border-radius: var(--radius-sm);
  color: var(--text); font-size: .95rem; font-family: inherit;
  transition: border-color .15s;
}
input:focus, select:focus { outline: none; border-color: var(--gold); }

button {
  cursor: pointer; border: none; border-radius: 999px;
  font-weight: 600; font-family: inherit; font-size: .88rem;
  padding: .65rem 1.3rem;
  transition: transform .1s, opacity .15s;
}
button:active { transform: scale(.97); }

button[type="submit"], .btn-primary {
  background: linear-gradient(135deg, #2f4bd6, #1c2f8f);
  color: #fff;
  width: 100%;
  box-shadow: 0 6px 18px rgba(47,75,214,.35);
}
button.link {
  background: transparent; color: var(--muted); border: 1px solid var(--border);
  padding: .4rem 1rem; margin-left: .5rem; font-size: .82rem;
}
button.link:hover { color: var(--text); border-color: var(--border-strong); }

.error { color: var(--error); font-size: .85rem; background: rgba(239,97,97,.08); padding: .5rem .7rem; border-radius: var(--radius-sm); }
.muted { color: var(--muted); }
.hidden { display: none !important; }

/* ---------- Header / nav ---------- */
header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 1rem 1.8rem;
  border-bottom: 1px solid var(--border);
  background: rgba(19,21,28,.7);
  backdrop-filter: blur(10px);
  position: sticky; top: 0; z-index: 5;
}
header .brand { display: flex; align-items: center; gap: .7rem; }
header .logo-badge {
  width: 38px; height: 38px; border-radius: 10px;
  background: linear-gradient(135deg, var(--gold-soft), var(--gold));
  color: #16161c; font-weight: 800; font-size: .95rem;
  display: flex; align-items: center; justify-content: center;
}
header h1 { color: var(--text); margin: 0; font-size: 1.15rem; font-weight: 700; }
header .sub { color: var(--muted-2); font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; }
nav { display: flex; align-items: center; }
#whoami {
  color: var(--gold-soft); font-weight: 600; font-size: .85rem;
  padding: .35rem .9rem; border: 1px solid var(--border); border-radius: 999px;
}

/* ---------- Layout principal ---------- */
main { display: flex; min-height: calc(100vh - 70px); }
#tree-panel {
  width: 320px; overflow-y: auto; padding: 1.3rem 1rem;
  border-right: 1px solid var(--border); background: var(--bg-alt);
}
#viewer { flex: 1; padding: 2rem; overflow-y: auto; }

.tree-dir > .tree-label {
  font-weight: 600; cursor: pointer; padding: .5rem .6rem; border-radius: var(--radius-sm);
  display: flex; align-items: center; gap: .4rem;
}
.tree-dir > .tree-label:hover { background: var(--panel); }
.tree-children { margin-left: .6rem; border-left: 1px dashed var(--border); padding-left: .8rem; }
.tree-file {
  cursor: pointer; padding: .4rem .6rem; color: var(--muted); border-radius: var(--radius-sm);
  font-size: .88rem;
}
.tree-file:hover { color: var(--gold-soft); background: var(--panel); }

video, img { max-width: 100%; border-radius: var(--radius); box-shadow: 0 10px 40px rgba(0,0,0,.4); }
iframe { border-radius: var(--radius); }

/* ---------- Fil d'ariane ---------- */
.breadcrumb {
  display: flex; align-items: center; flex-wrap: wrap; gap: .3rem;
  margin-bottom: 1.4rem; font-size: .85rem;
}
.breadcrumb .crumb {
  cursor: pointer; color: var(--muted); padding: .2rem .5rem; border-radius: 6px;
}
.breadcrumb .crumb:hover { color: var(--gold-soft); background: var(--panel); }
.breadcrumb .crumb:last-child { color: var(--text); font-weight: 600; }
.breadcrumb .crumb-sep { color: var(--muted-2); }

/* ---------- Grille dossier (explorateur dans le plan de travail) ---------- */
.folder-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .9rem;
}
.folder-card {
  display: flex; flex-direction: column; align-items: center; gap: .5rem;
  padding: 1.1rem .7rem; border-radius: var(--radius-sm);
  background: var(--panel); border: 1px solid var(--border);
  cursor: pointer; text-align: center;
  transition: border-color .15s, transform .1s;
}
.folder-card:hover { border-color: var(--gold); transform: translateY(-2px); }
.folder-card-icon { font-size: 1.8rem; }
.folder-card-name {
  font-size: .8rem; color: var(--text); word-break: break-word;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

/* ---------- Badges "pilule" façon portfolio ---------- */
.badge {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .45rem .95rem; border-radius: 999px;
  background: var(--panel-2); border: 1px solid var(--border);
  font-size: .82rem; color: var(--muted); font-weight: 500;
}

/* ---------- Modales ---------- */
.modal {
  position: fixed; inset: 0; background: rgba(4,5,8,.72);
  display: flex; align-items: center; justify-content: center; z-index: 10;
  padding: 1rem;
}
.modal-content {
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.8rem; width: min(640px, 94vw); max-height: 85vh; overflow-y: auto;
  position: relative;
  box-shadow: 0 24px 70px rgba(0,0,0,.5);
}
.modal-content::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; border-radius: var(--radius) var(--radius) 0 0;
  background: linear-gradient(90deg, var(--blue) 0%, var(--blue) 33%, #f4f4f4 33%, #f4f4f4 66%, var(--red) 66%, var(--red) 100%);
}
.modal-content h2 { color: var(--gold); margin-top: .3rem; }
.modal-close {
  position: absolute; top: .8rem; right: .9rem; background: var(--panel); color: var(--muted);
  font-size: 1.1rem; width: 28px; height: 28px; border-radius: 50%; padding: 0; line-height: 1;
}
.modal-close:hover { color: var(--text); }

/* ---------- Onglets admin ---------- */
.tabs { display: flex; gap: .5rem; margin-bottom: 1.3rem; flex-wrap: wrap; }
.tab {
  background: transparent; color: var(--muted); border: 1px solid var(--border);
  padding: .5rem 1.1rem; font-size: .82rem;
}
.tab.active { background: var(--gold); color: #16161c; border-color: var(--gold); }

/* ---------- Tables ---------- */
table { width: 100%; border-collapse: collapse; font-size: .85rem; }
th { text-align: left; padding: .5rem; color: var(--muted-2); font-weight: 600; text-transform: uppercase; font-size: .7rem; letter-spacing: .05em; border-bottom: 1px solid var(--border-strong); }
td { text-align: left; padding: .55rem .5rem; border-bottom: 1px solid var(--border); }
table button { padding: .3rem .8rem; font-size: .76rem; margin-right: .3rem; background: var(--panel-2); color: var(--text); border: 1px solid var(--border); }
table button:hover { border-color: var(--gold); color: var(--gold-soft); }

@media (max-width: 720px) {
  main { flex-direction: column; }
  #tree-panel { width: 100%; border-right: none; border-bottom: 1px solid var(--border); }
}
