body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
}
.header {
    position: relative;
    width: 100%;
    height: 500px;
    overflow: hidden;
}
.header img {
    width: 50%;
    height: 100%;
    object-fit: cover;
    float: left;
}
.header-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: white;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}
.header-content h1 {
    margin: 0;
    font-size: 2.5em;
}
.header-content p {
    margin: 0;
    font-size: 1.2em;
}
.main {
    padding: 20px;
    text-align: center;
    margin-bottom: 60px; /* To prevent footer from overlapping */
}
.main button {
    padding: 10px 20px;
    margin: 10px;
    font-size: 1em;
    cursor: pointer;
}
.container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 20px;
}
.item {
    width: 400px;           /* default width */
    height: 500px;          /* default height */
    resize: both;           /* make it resizable */
    overflow: auto;         /* show scrollbars when needed */
    border: 1px solid #ccc;
    padding: 10px;
    box-sizing: border-box;
    margin: 10px;
    text-align: center;
    /*resize: horizontal; */
    max-width: 100%;
    min-width: 200px;
}
.item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;

  /* padding: 10px 12px;
  border-radius: 14px; */

  /* border: 1px solid #e6e6e6;
  background: #fff; */
}
.item-header.is-pending {
  opacity: 0.65;
  cursor: wait;
}

.item-header.is-pending * {
  pointer-events: none !important;
  user-select: none;
}
.item-title {
  flex: 1 1 auto;
  min-width: 0; /* required for ellipsis in flex */

  font-size: 1.12em;
  font-weight: 900;

  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.media-container {
    margin: 10px 0;
}
.media-container img {
    max-width: 100%;
    height: auto;
}
.media-container video, .media-container audio {
    max-width: 100%;
}

.footer {
    background-color: #333;
    color: white;
    text-align: center;
    padding: 5px;
    bottom: 0;
    width: 100%;
    font-size: 0.8em;
}

.items-dropzone {
  position: relative;
}

/* Only visible while dragging over */
.items-dropzone.is-dragover {
  outline: 2px dashed #bdbdbd;
  outline-offset: 8px;
  border-radius: 16px;
  background: rgba(250, 250, 250, 0.6); /* very light tint */
}

/* Small floating hint */
.drop-hint-float {
  position: absolute;
  top: 10px;
  right: 10px;

  padding: 10px 12px;
  border-radius: 12px;

  border: 1px solid #e0e0e0;
  background: rgba(255,255,255,0.95);
  box-shadow: 0 10px 24px rgba(0,0,0,0.10);

  font-weight: 800;
  pointer-events: none; /* never blocks interactions */
}


/* Upload toast */
.toast {
  position: fixed;
  bottom: 18px;
  right: 18px;
  z-index: 3000;

  background: #111;
  color: #fff;
  padding: 10px 12px;
  border-radius: 12px;
  font-weight: 700;
  opacity: 0.92;
}

.toast small {
  display: block;
  font-weight: 600;
  opacity: 0.85;
  margin-top: 2px;
}

.doc-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: nowrap; 
}

/* Left group: delete + title */
.doc-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1 1 auto;
  min-width: 0;
}

/* Document title: primary info */
.doc-name {
  flex: 1 1 auto;
  min-width: 0;

  font-size: 1.05em;
  font-weight: 700;

  padding: 6px 10px;
  border-radius: 10px;

  border: 1px solid #e3e3e3;
  background: #fafafa;

  cursor: text;

  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Make it pop on hover/focus to signal "editable" */
.doc-name:hover {
  background: #f3f3f3;
  border-color: #d6d6d6;
}

.doc-name:focus {
  outline: none;
}

/* Inline rename input should match the title styling */
.doc-rename-input {
  flex: 1;
  min-width: 0;

  font-size: 1.05em;
  font-weight: 700;

  padding: 6px 10px;
  border-radius: 10px;

  border: 1px solid #bdbdbd;
  background: #fff;
}

/* Optional: tone down the action buttons slightly so title dominates */
.doc-open {
  flex: 0 0 auto;             
  white-space: nowrap;

  text-decoration: none;
  font-size: 1em;
  padding: 4px 8px;
  border-radius: 10px;
  border: 1px solid #ddd;
  opacity: 0.9;
}

.doc-open:hover { opacity: 1; }

.delete {
  border: 1px solid #e2b8b8;
  background: #ffecec;
  color: #b00020;
  border-radius: 10px;
  width: 30px;
  height: 30px;
  cursor: pointer;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 0.95;
  flex: 0 0 auto;
}

.delete:hover { opacity: 1; }

.docs-block {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid #e2e2e2;
  border-radius: 14px;
  background: #fff;
}

.doc-row.is-pending {
  opacity: 0.65;
  filter: grayscale(0.2);
  cursor: wait;
  pointer-events: auto;
}

.doc-row.is-pending * {
  pointer-events: none !important;
  user-select: none;
}

.doc-row.is-pending .doc-name {
  background: #f5f5f5;
  border-color: #e5e5e5;
}

.browser-header {
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid #e6e6e6;
  border-radius: 14px;
  background: #fff;
}

.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  position: relative;
}

/* Each crumb */
.crumb {
  display: inline-block;
  max-width: 240px;
  min-width: 0;

  padding: 6px 10px;
  border-radius: 10px;
  text-decoration: none;

  border: 1px solid transparent;
  background: transparent;

  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;

  color: inherit;
}

.crumb:hover {
  background: #f3f3f3;
  border-color: #e0e0e0;
}

.crumb-current {
  font-weight: 800;
  background: #f6f6f6;
  border-color: #e0e0e0;
}

.crumb-sep {
  opacity: 0.5;
  user-select: none;
}

/* Ellipsis button that replaces hidden middle crumbs */
.crumb-ellipsis {
  flex: 0 0 auto;
  padding: 6px 10px;
  border-radius: 10px;
  border: 1px solid #e0e0e0;
  background: #f6f6f6;
  cursor: pointer;
  font-weight: 800;
  line-height: 1;
}

.crumb-ellipsis:hover {
  background: #efefef;
}

/* Dropdown menu */
.crumb-menu {
  position: absolute;
  top: 42px;
  left: 0;
  z-index: 1000;

  min-width: 240px;
  max-width: 360px;

  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.08);
  padding: 6px;
}

.crumb-menu a {
  display: block;
  padding: 8px 10px;
  border-radius: 10px;
  text-decoration: none;
  color: inherit;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.crumb-menu a:hover {
  background: #f3f3f3;
}

.folders-section {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid #e6e6e6;
  border-radius: 14px;
  background: #fff;
}

.folders-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.folders-title {
  margin: 0;
  font-size: 1.05em;
  font-weight: 800;
}

.folders-toggle {
  flex: 0 0 auto;
  border: 1px solid #dcdcdc;
  background: #f6f6f6;
  border-radius: 12px;
  padding: 8px 12px;
  cursor: pointer;
  font-weight: 700;
}

.folders-toggle:hover {
  background: #efefef;
}

/* Grid-like wrap, similar to Drive */
.folders-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* Folder "pill card" */
.folder-card {
  display: flex;
  align-items: center;
  gap: 10px;

  width: 240px;            /* Drive-ish card width */
  max-width: 100%;
  padding: 10px 12px;

  border: 1px solid #e3e3e3;
  border-radius: 14px;
  background: #fafafa;

  text-decoration: none;
  color: inherit;

  transition: transform 0.02s ease-in-out;
}

.folder-card:hover {
  background: #f3f3f3;
  border-color: #d6d6d6;
}

.folder-card:active {
  transform: translateY(1px);
}

.folder-icon {
  font-size: 1.15em;
  line-height: 1;
  flex: 0 0 auto;
}

.folder-name {
  font-size: 1.02em;
  font-weight: 800;

  flex: 1 1 auto;
  min-width: 0;

  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Collapsed state: show only first two rows (approx) */
.folders-grid.is-collapsed {
  max-height: 116px;       /* tweak if your cards/padding differ */
  overflow: hidden;
  position: relative;
}

/* Optional subtle fade at bottom when collapsed */
.folders-grid.is-collapsed::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 28px;
  background: linear-gradient(to bottom, rgba(255,255,255,0), rgba(255,255,255,1));
}

.folder-more {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  border: 1px solid #dddddd;
  background: #ffffff;
  cursor: pointer;
  font-size: 1.1em;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.folder-more:hover {
  background: #f3f3f3;
}

/* Base: bouton réutilisable */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;

  padding: 8px 12px;
  border-radius: 12px;

  border: 1px solid #dcdcdc;
  background: #f6f6f6;

  cursor: pointer;
  font-weight: 700;
  font-size: 0.98em;

  user-select: none;
  text-decoration: none;
  color: inherit;
}

.btn:hover {
  background: #efefef;
}

.btn:active {
  transform: translateY(1px);
}

.btn:disabled,
.btn[aria-disabled="true"] {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* Variante “petit” si besoin (header compact) */
.btn-sm {
  padding: 6px 10px;
  border-radius: 10px;
  font-size: 0.95em;
}

/* Variante “danger” (supprimer) */
.btn-danger {
  border-color: #e2b8b8;
  background: #ffecec;
  color: #b00020;
}

.btn-danger:hover {
  background: #ffdede;
}

/* Context menu container */
.ctx-menu {
  position: fixed;
  z-index: 2000;
  min-width: 160px;

  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  box-shadow: 0 10px 24px rgba(0,0,0,0.12);
  padding: 6px;
}

/* Context menu item */
.ctx-item {
  width: 100%;
  text-align: left;
  padding: 10px 10px;
  border: 0;
  background: transparent;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 700;
}

.ctx-item:hover {
  background: #f3f3f3;
}

/* Inline rename input inside folder card */
.folder-rename-input {
  flex: 1 1 auto;
  min-width: 0;

  font-size: 1.02em;
  font-weight: 800;

  padding: 6px 10px;
  border-radius: 10px;
  border: 1px solid #bdbdbd;
  background: #fff;
}
