/**
 * src/css/pages/cloud.css — Central Cloud page (cloud.html).
 * Owns cloud.html's content area only. Reuses design-system.css tokens
 * (--navy-*, --amber-*, --surface-*, dp-btn/dp-input/dp-empty/dp-skeleton)
 * and the standard app shell (sidebar/topbar) from styles.css.
 */

#cloudPage *, #cloudPage *::before, #cloudPage *::after { box-sizing: border-box; }

/* ── Breadcrumb ──────────────────────────────────────────────────────── */
#cloudBreadcrumb button,
#cloudBreadcrumbMobile button {
  background: none;
  border: none;
  cursor: pointer;
  font: inherit;
  padding: 0;
}

/* ── Root grid (Allgemein + project cards) ──────────────────────────── */
.cloud-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: var(--sp-4, 16px);
}

.cloud-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--sp-3, 12px);
  padding: var(--sp-6, 24px) var(--sp-4, 16px);
  background: var(--bg-card, #fff);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: var(--r-lg, 12px);
  box-shadow: var(--sh-xs, 0 1px 2px rgba(15,23,42,0.05));
  cursor: pointer;
  transition: box-shadow 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
  text-align: center;
  min-height: 140px;
}
.cloud-card:hover,
.cloud-card:focus-visible {
  box-shadow: var(--sh-md, 0 6px 16px rgba(15,23,42,0.08));
  transform: translateY(-2px);
  border-color: var(--surface-300, #cbd5e1);
  outline: none;
}
.cloud-card:focus-visible {
  outline: 2px solid var(--amber-500, #fea619);
  outline-offset: 2px;
}
.cloud-card--amber {
  background: linear-gradient(180deg, var(--amber-50, #fff7e8) 0%, var(--bg-card, #fff) 65%);
  border-color: var(--amber-200, #fde0a3);
}
.cloud-card--amber:hover { border-color: var(--amber-300, #fdc96a); }

.cloud-card-icon {
  width: 48px;
  height: 48px;
  color: var(--amber-500, #fea619);
}
.cloud-card--amber .cloud-card-icon { color: var(--amber-600, #e08f08); }
.cloud-card:not(.cloud-card--amber) .cloud-card-icon { color: var(--navy-400, #3f6ea8); }
.cloud-card-icon svg { width: 100%; height: 100%; }

.cloud-card-label {
  font-size: var(--fs-14, 0.875rem);
  font-weight: 600;
  color: var(--text-1, #0f172a);
  word-break: break-word;
  max-width: 100%;
}
.cloud-card-sub {
  font-size: var(--fs-11, 0.6875rem);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--amber-600, #e08f08);
  min-height: 14px;
}

/* ── List view (inside a directory) ─────────────────────────────────── */
.cloud-list {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: var(--r-lg, 12px);
  overflow: hidden;
  background: var(--bg-card, #fff);
}

.cloud-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 90px 140px 96px;
  align-items: center;
  gap: var(--sp-3, 12px);
  padding: 10px var(--sp-4, 16px);
  border-bottom: 1px solid var(--border-soft, #e8edf3);
  cursor: pointer;
  transition: background 0.12s ease;
}
.cloud-row:last-child { border-bottom: none; }
.cloud-row:hover { background: var(--surface-50, #f8fafc); }
.cloud-row--head {
  cursor: default;
  font-size: var(--fs-11, 0.6875rem);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-3, #64748b);
  background: var(--surface-50, #f8fafc);
}
.cloud-row--head:hover { background: var(--surface-50, #f8fafc); }

.cloud-col-name { display: flex; align-items: center; gap: 10px; min-width: 0; }
.cloud-row-icon { width: 20px; height: 20px; flex-shrink: 0; color: var(--text-4, #94a3b8); }
.cloud-row-icon--folder { color: var(--amber-500, #fea619); }
.cloud-row-icon svg { width: 100%; height: 100%; }
.cloud-row-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: var(--fs-14, 0.875rem);
  color: var(--text-1, #0f172a);
}
.cloud-col-size, .cloud-col-date {
  font-size: var(--fs-13, 0.8125rem);
  color: var(--text-3, #64748b);
  white-space: nowrap;
}
.cloud-col-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 2px;
}

.cloud-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: var(--r-md, 10px);
  border: none;
  background: transparent;
  color: var(--text-3, #64748b);
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
}
.cloud-action-btn:hover { background: var(--surface-100, #f1f5f9); color: var(--navy-500, #022448); }
.cloud-action-btn svg { width: 16px; height: 16px; }

.cloud-search-note {
  padding: var(--sp-3, 12px) var(--sp-4, 16px);
  font-size: var(--fs-12, 0.75rem);
  color: var(--text-3, #64748b);
  text-align: center;
  font-style: italic;
}

/* ── Loading skeletons ───────────────────────────────────────────────── */
.cloud-loading {
  display: none;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: var(--sp-4, 16px);
}
#cloudLoading.cloud-loading[style*="display: none"] { display: none !important; }

/* ── Drag & drop overlay ─────────────────────────────────────────────── */
.cloud-drop-overlay {
  position: fixed;
  inset: 0;
  z-index: var(--z-overlay, 70);
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(2, 36, 72, 0.35);
  backdrop-filter: blur(2px);
}
.cloud-drop-overlay.show { display: flex; }
.cloud-drop-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-3, 12px);
  padding: var(--sp-10, 40px) var(--sp-12, 48px);
  background: #fff;
  border: 3px dashed var(--amber-500, #fea619);
  border-radius: var(--r-xl, 16px);
  color: var(--navy-500, #022448);
  font-weight: 600;
  font-size: var(--fs-16, 1rem);
  pointer-events: none;
}
.cloud-drop-card .material-symbols-outlined { font-size: 40px; color: var(--amber-500, #fea619); }

/* ── Lightbox ────────────────────────────────────────────────────────── */
.cloud-lightbox {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal, 80);
  background: rgba(15, 23, 42, 0.92);
  display: none;
  align-items: center;
  justify-content: center;
  padding: var(--sp-8, 32px);
}
.cloud-lightbox-body {
  max-width: 92vw;
  max-height: 88vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cloud-lightbox-img {
  max-width: 92vw;
  max-height: 88vh;
  object-fit: contain;
  border-radius: var(--r-md, 10px);
}
.cloud-lightbox-pdf {
  width: 86vw;
  height: 86vh;
  border: none;
  border-radius: var(--r-md, 10px);
  background: #fff;
}
.cloud-lightbox-close {
  position: absolute;
  top: var(--sp-4, 16px);
  right: var(--sp-4, 16px);
  width: 40px;
  height: 40px;
  border-radius: var(--r-full, 9999px);
  border: none;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
}
.cloud-lightbox-close:hover { background: rgba(255, 255, 255, 0.22); }

/* ── Toast ───────────────────────────────────────────────────────────── */
.cloud-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  background: var(--navy-500, #022448);
  color: #fff;
  padding: 10px 20px;
  border-radius: var(--r-full, 9999px);
  font-size: var(--fs-14, 0.875rem);
  font-weight: 500;
  box-shadow: var(--sh-lg, 0 14px 32px rgba(15,23,42,0.1));
  z-index: var(--z-toast, 100);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.cloud-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ── Mobile (<=360px clean) ──────────────────────────────────────────── */
@media (max-width: 480px) {
  .cloud-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: var(--sp-3, 12px); }
  .cloud-card { min-height: 116px; padding: var(--sp-4, 16px) var(--sp-3, 12px); }
  .cloud-card-icon { width: 36px; height: 36px; }
  .cloud-row {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "name actions" "meta actions";
    row-gap: 2px;
  }
  .cloud-col-name { grid-area: name; }
  .cloud-col-size { grid-area: meta; }
  .cloud-col-date { display: none; }
  .cloud-row--head .cloud-col-size,
  .cloud-row--head .cloud-col-date { display: none; }
  .cloud-col-actions { grid-area: actions; }
  .cloud-drop-card { padding: var(--sp-8, 32px) var(--sp-6, 24px); font-size: var(--fs-14, 0.875rem); }
}
