/* style.css v2 — Avec dossiers */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #f0f2f5;
  color: #333;
  line-height: 1.6;
}

header {
  background: #2c3e50;
  color: white;
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

header h1 { font-size: 1.4rem; }
#auth-section { display: flex; align-items: center; gap: 0.8rem; }
#auth-section span { font-size: 0.9rem; }

main {
  max-width: 900px;
  margin: 2rem auto;
  padding: 0 1rem;
}

.card {
  background: white;
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.card h2 { margin-bottom: 1rem; color: #2c3e50; }

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.section-header h2 { margin-bottom: 0; }

/* ── Grille de dossiers ────────────────────────────────── */
.folders-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}

.folder-card {
  background: #ecf0f1;
  border: 2px solid #bdc3c7;
  border-radius: 8px;
  padding: 1.2rem;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}

.folder-card:hover {
  border-color: #3498db;
  background: #d6eaf8;
  transform: translateY(-2px);
}

.folder-card .folder-icon { font-size: 2.5rem; margin-bottom: 0.5rem; }
.folder-card .folder-name { font-weight: 600; color: #2c3e50; font-size: 1.05rem; }
.folder-card .folder-count { font-size: 0.85rem; color: #777; margin-top: 0.3rem; }

/* ── Breadcrumb ────────────────────────────────────────── */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.breadcrumb a {
  color: #3498db;
  text-decoration: none;
  font-weight: 500;
}

.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb h2 { margin-bottom: 0; }

/* ── Onglets upload ─────────────────────────────────────── */
.upload-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.tab-btn {
  background: #ecf0f1;
  color: #333;
  border: 2px solid transparent;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  font-size: 0.9rem;
}

.tab-btn:hover { background: #d5dbdb; }
.tab-btn.active { background: #3498db; color: white; border-color: #2980b9; }

/* ── Raccourcis web ────────────────────────────────────── */
.doc-item.is-link { border-left: 3px solid #3498db; }
.link-badge {
  display: inline-block;
  background: #3498db;
  color: white;
  font-size: 0.7rem;
  padding: 0.1rem 0.4rem;
  border-radius: 3px;
  margin-left: 0.5rem;
  vertical-align: middle;
}

/* ── Formulaires ───────────────────────────────────────── */
input[type="text"],
input[type="password"],
textarea {
  width: 100%;
  padding: 0.6rem;
  margin-bottom: 0.8rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 0.95rem;
}

textarea { min-height: 60px; resize: vertical; }

/* ── Boutons ───────────────────────────────────────────── */
button {
  background: #3498db;
  color: white;
  border: none;
  padding: 0.6rem 1.2rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.95rem;
  margin-right: 0.5rem;
}

button:hover { background: #2980b9; }
button.btn-secondary { background: #95a5a6; }
button.btn-secondary:hover { background: #7f8c8d; }
button.btn-danger { background: #e74c3c; }
button.btn-danger:hover { background: #c0392b; }

.btn-zip {
  background: #27ae60;
  white-space: nowrap;
}
.btn-zip:hover { background: #219a52; }

.hidden { display: none !important; }
.error { color: #e74c3c; margin-top: 0.5rem; }

/* ── Document individuel ───────────────────────────────── */
.doc-item {
  border: 1px solid #eee;
  border-radius: 6px;
  padding: 1rem;
  margin-bottom: 0.8rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
}

.doc-info { flex: 1; min-width: 200px; }
.doc-info h3 { margin-bottom: 0.3rem; color: #2c3e50; }
.doc-meta { font-size: 0.85rem; color: #777; }
.doc-desc { font-size: 0.9rem; margin-top: 0.3rem; }
.doc-actions { display: flex; gap: 0.4rem; flex-shrink: 0; }

/* ── Modale ────────────────────────────────────────────── */
.modal {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 100;
}

.modal-content {
  background: white;
  padding: 2rem;
  border-radius: 8px;
  width: 90%;
  max-width: 500px;
}

/* ── Responsive ────────────────────────────────────────── */
@media (max-width: 600px) {
  header { flex-direction: column; text-align: center; }
  .doc-item { flex-direction: column; }
  .folders-grid { grid-template-columns: 1fr; }
}
