body {
    background-color: #121212;
    color: #eee;
    font-family: 'Segoe UI', Roboto, sans-serif;
    margin: 0;
    padding: 0;
}
main {
    max-width: 700px;
    margin: 4em auto;
    padding: 2em;
    background-color: #1e1e1e;
    border-radius: 10px;
    box-shadow: 0 0 20px #000;
}
h1 {
    text-align: center;
    color: #00d4ff;
    margin-bottom: 2em;
}
ul.file-list {
    list-style: none;
    padding: 0;
}
.file-list li {
    background-color: #2a2a2a;
    padding: 1em;
    margin: 0.5em 0;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.file-list a {
    color: #00d4ff;
    text-decoration: none;
    font-weight: 500;
}
.file-size {
    color: #aaa;
    font-size: 0.9em;
    margin-left: 1em;
}
.preview-btn {
    background: none;
    border: none;
    color: #eee;
    font-size: 1.2em;
    cursor: pointer;
}
.preview-btn:hover {
    color: #00d4ff;
}

.modal[hidden] {
    display: none;
}
.modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: rgba(0,0,0,0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 1em;
}

.modal-content {
    background: #222;
    padding: 1em 1.5em 1.5em 1.5em;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
    box-sizing: border-box;
    /* Par défaut, modale grande (pdf, vidéo...) */
    max-width: 95vw;
    max-height: 90vh;
    width: 100%;
}

.modal.adaptive #preview-container {
    display: flex;
    justify-content: center;
    align-items: center;
}


.modal-content.adaptive {
    max-width: none;
    max-height: none;
    width: auto;
    padding: 1em;
}

.modal-content iframe {
    width: 100%;
    height: 80vh;
    border: none;
    display: block;
}

.modal.adaptive #preview-container {
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5em;
}

.modal-filename {
    color: #ccc;
    font-size: 1em;
    font-weight: 600;
    word-break: break-all;
}

.modal .close {
    cursor: pointer;
    font-size: 1.5em;
    color: #eee;
    user-select: none;
    padding: 0 0.3em;
    line-height: 1;
}

.modal .close:hover {
    color: #00d4ff;
}

/* iframe styling pour pdf/vidéo */
.modal-content iframe,
.modal-content video,
.modal-content audio {
    max-width: 100%;
    max-height: 80vh;
    display: block;
}

/* image centrée dans adaptative */
.modal.adaptive img {
    max-width: 90vw;
    max-height: 80vh;
    display: block;
    margin: 0 auto;
    border-radius: 6px;
}

.icon-eye,
.icon-arrow {
    width: 1.2em;
    height: 1.2em;
    stroke: white;
}

.preview-btn,
.nav-btn {
    background: none;
    border: none;
    padding: 0.3em;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: stroke 0.2s ease;
}

.preview-btn:hover svg,
.nav-btn:hover svg {
    stroke: #00d4ff;
}
.modal-controls {
    margin-top: 1em;
    text-align: center;
}
.modal-controls button {
    background: none;
    border: 1px solid #555;
    color: #eee;
    font-size: 1.2em;
    padding: 0.3em 1em;
    margin: 0 0.5em;
    cursor: pointer;
    border-radius: 5px;
}
.modal-controls button:hover {
    border-color: #00d4ff;
    color: #00d4ff;
}
.modal-filename {
    color: #ccc;
    font-size: 0.95em;
    margin-bottom: 0.5em;
    text-align: center;
    word-break: break-all;
}
.modal-controls {
    margin-top: 1em;
    display: flex;              /* aligne les boutons en ligne */
    justify-content: space-between; /* espace maximum entre les boutons */
    align-items: center;        /* centre verticalement */
    max-width: 200px;           /* largeur max de la zone pour éviter trop d’espacement */
    margin-left: auto;          /* centre horizontalement le bloc si la largeur est inférieure au container */
    margin-right: auto;
}
.breadcrumb {
  font-size: 0.9em;
  color: #888;
  margin-bottom: 1.5em;
  user-select: none;
  white-space: nowrap;
  overflow-x: auto;
  padding-bottom: 0.3em;
  border-bottom: 1px solid #333;
}

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

.breadcrumb a:hover,
.breadcrumb a:focus {
  text-decoration: underline;
}

.breadcrumb-sep {
  margin: 0 0.4em;
  color: #555;
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5em;
}

.modal-filename {
    color: #ccc;
    font-size: 1em;
    font-weight: 600;
    word-break: break-all;
}

.modal .close {
    cursor: pointer;
    font-size: 1.5em;
    color: #eee;
    user-select: none;
    padding: 0 0.3em;
    line-height: 1;
}

.modal .close:hover {
    color: #00d4ff;
}

.modal-content.adaptive img {
    max-width: 90vw;
    max-height: 85vh;
    height: auto;
    width: auto;
    display: block;
    margin: 0 auto;
    border-radius: 6px;
    object-fit: contain;
}
.disclaimer {
    margin-top: 2em;
    font-size: 0.85em;
    color: #888;
    text-align: left;
    line-height: 1.4;
    border-top: 1px solid #333;
    padding-top: 1em;
}
.modal-content.narrow {
    max-width: 500px;
    max-height: none;
    width: 100%;
    padding: 1em 2em;
}
.modal-content iframe,
.modal-content video,
.modal-content audio {
    max-width: 100%;
    max-height: 80vh;
    margin: 0 auto;
    display: block;
}