/* ═══════════════════════════════════════════════════════
   Aquora — Shared Folder Browser Styles
   Used by every files/**\/index.html page
   ═══════════════════════════════════════════════════════ */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html { height: 100%; }

body {
  min-height: 100%;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: #1a1a1a;
  background: #ffffff;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── Sticky header bar ────────────────────────────────── */

.fb-header {
  position: sticky;
  top: 0;
  z-index: 200;
  height: 58px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 28px;
  background: #ffffff;
  border-bottom: 1px solid #ebebeb;
  box-shadow: 0 1px 0 rgba(0,0,0,0.03), 0 2px 10px rgba(0,0,0,0.04);
}

.fb-logo {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid #e6e6e6;
  background: #fff;
  padding: 4px;
  object-fit: contain;
}

.fb-wordmark {
  flex: 1;
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-weight: 500;
  font-size: 20px;
  letter-spacing: 0.3px;
  color: #111;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 0.15s;
}
.fb-wordmark:hover { color: #444; }

.fb-back {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 400;
  color: #555;
  text-decoration: none;
  padding: 6px 15px;
  border: 1px solid #dedede;
  border-radius: 7px;
  background: #fff;
  line-height: 1;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}
.fb-back:hover { background: #f3f3f3; border-color: #ccc; color: #111; }

/* ── Content wrapper ──────────────────────────────────── */

.fb-content {
  max-width: 880px;
  margin: 0 auto;
  padding: 44px 28px 80px;
}

/* ── Folder title ─────────────────────────────────────── */

.fb-title {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-weight: 500;
  font-size: 42px;
  letter-spacing: 0.2px;
  color: #111;
  line-height: 1.15;
  margin-bottom: 9px;
}

/* ── Breadcrumb ───────────────────────────────────────── */

.fb-breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 2px 5px;
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  color: #aaa;
  margin-bottom: 32px;
}

.fb-breadcrumb a {
  color: #aaa;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.13s, border-color 0.13s;
}
.fb-breadcrumb a:hover { color: #444; border-bottom-color: #bbb; }

.fb-crumb-sep {
  color: #d0d0d0;
  user-select: none;
}

.fb-crumb-current {
  color: #555;
  font-weight: 500;
}

/* ── File table ───────────────────────────────────────── */

.fb-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

/* Column widths (Name takes remaining space) */
.fb-table .col-modified { width: 155px; }
.fb-table .col-size     { width: 78px; }

.fb-table thead tr {
  border-bottom: 1px solid #e4e4e4;
}

.fb-table thead th {
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.65px;
  text-transform: uppercase;
  color: #bbb;
  text-align: left;
  padding-bottom: 10px;
  padding-right: 16px;
  user-select: none;
}

.fb-table thead th:last-child {
  text-align: right;
  padding-right: 0;
}

.fb-table tbody tr {
  border-bottom: 1px solid #f3f3f3;
  cursor: pointer;
  transition: background 0.1s;
}
.fb-table tbody tr:hover { background: #f8f9fa; }
.fb-table tbody tr:last-child { border-bottom: none; }

.fb-table tbody td {
  padding: 11px 16px 11px 0;
  vertical-align: middle;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fb-table tbody td:last-child { padding-right: 0; }

/* Name column cell layout */
.fb-name-cell {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.fb-row-icon {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.fb-row-icon svg { width: 20px; height: 20px; display: block; }

.fb-row-name {
  font-size: 14px;
  font-weight: 400;
  color: #1a1a1a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.fb-row-name.is-folder { color: #2563EB; font-weight: 500; }

/* Metadata columns */
.fb-row-modified {
  font-size: 13px;
  color: #b0b0b0;
}

.fb-row-size {
  font-size: 13px;
  color: #b0b0b0;
  text-align: right;
}

/* ── Empty state ──────────────────────────────────────── */

.fb-empty {
  padding: 72px 0 56px;
  text-align: center;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  color: #c8c8c8;
  letter-spacing: 0.1px;
}

/* ── Gallery hint badge on image rows ─────────────────── */

.fb-gallery-hint {
  font-family: 'Inter', sans-serif;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.7px;
  text-transform: uppercase;
  color: #16A34A;
  background: #DCFCE7;
  padding: 2px 8px;
  border-radius: 999px;
  flex-shrink: 0;
  opacity: 0;
  transition: opacity 0.15s;
}
.fb-row-image:hover .fb-gallery-hint { opacity: 1; }
.fb-row-image { cursor: zoom-in; }

/* ── Lightbox / Gallery Viewer ─────────────────────────── */

#fb-lightbox {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
#fb-lightbox.is-open {
  opacity: 1;
  pointer-events: all;
}

.fbl-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.93);
  cursor: zoom-out;
}

/* Centred image stage */
.fbl-stage {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: calc(100vw - 130px);
  max-height: calc(100vh - 150px);
}

/* Spinner shown while image loads */
.fbl-stage.is-loading::after {
  content: '';
  position: absolute;
  width: 34px;
  height: 34px;
  border: 3px solid rgba(255, 255, 255, 0.12);
  border-top-color: rgba(255, 255, 255, 0.7);
  border-radius: 50%;
  animation: fbl-spin 0.75s linear infinite;
}
@keyframes fbl-spin { to { transform: rotate(360deg); } }

.fbl-img {
  display: block;
  max-width: calc(100vw - 130px);
  max-height: calc(100vh - 150px);
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 24px 90px rgba(0, 0, 0, 0.75);
  transition: opacity 0.18s ease;
}
.fbl-img.fbl-img-fade { opacity: 0.25; }
.fbl-img[src=""]      { opacity: 0; }

/* Close button — top right */
.fbl-close {
  position: fixed;
  top: 16px;
  right: 20px;
  z-index: 10;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(0, 0, 0, 0.45);
  color: rgba(255, 255, 255, 0.85);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: background 0.15s, border-color 0.15s, transform 0.15s;
}
.fbl-close:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.28);
  transform: scale(1.08);
}

/* Prev / Next arrow buttons */
.fbl-prev,
.fbl-next {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  width: 52px;
  height: 72px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.32);
  color: rgba(255, 255, 255, 0.85);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 12px;
  transition: background 0.15s, border-color 0.15s;
}
.fbl-prev { left: 12px; }
.fbl-next { right: 12px; }
.fbl-prev:hover,
.fbl-next:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.24);
}

/* Caption bar — bottom gradient */
.fbl-caption {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 10;
  padding: 40px 80px 22px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.72) 0%, transparent 100%);
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  pointer-events: none;
}
.fbl-name {
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.88);
  letter-spacing: 0.15px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fbl-counter {
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.48);
  flex-shrink: 0;
  letter-spacing: 0.4px;
}

/* ── Mobile ───────────────────────────────────────────── */

@media (max-width: 620px) {
  .fb-header { padding: 0 16px; height: 52px; }
  .fb-wordmark { font-size: 18px; }
  .fb-back { font-size: 12px; padding: 5px 12px; }
  .fb-content { padding: 28px 16px 56px; }
  .fb-title { font-size: 30px; }
  .fb-breadcrumb { font-size: 11px; margin-bottom: 22px; }
  .col-modified { display: none; }
  .fb-table .col-size { width: 64px; }

  .fbl-stage,
  .fbl-img {
    max-width: 100vw;
    max-height: calc(100vh - 110px);
  }
  .fbl-prev  { left: 4px;  width: 38px; height: 58px; }
  .fbl-next  { right: 4px; width: 38px; height: 58px; }
  .fbl-caption { padding: 36px 52px 18px; }
  .fbl-name    { font-size: 12px; }
}
