/*--------------------------------------------------------------
# Spreadsheet viewer page
# Reuses .calc-card / .presets-panel / .presets-header / .presets-title /
# .file-count / .search-button / .preset-load-btn / .calc-error from
# style.css. Adds the iframe wrapper and empty state.
--------------------------------------------------------------*/
.spreadsheet-section { padding: 60px 0; }

/* ── Viewer card ──────────────────────────────────────────────── */
.ss-viewer-card {
  /* Override the .presets-panel max-width — spreadsheets need room */
  max-width: 1200px;
  margin: 0 auto;
}

.ss-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.ss-edit-btn {
  /* Override .search-button's default top margin so it sits flush in the header */
  margin: 0 !important;
  padding: 8px 22px !important;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  color: #fff;
}
.ss-edit-btn i { font-size: 16px; }
.ss-edit-btn:hover { color: #fff; }

/* The iframe itself — full-width, ~viewport-height tall, no border */
.ss-frame-wrap {
  position: relative;
  background: #f8fafd;
}
#ss-frame {
  display: block;
  width: 100%;
  height: 75vh;
  min-height: 480px;
  border: none;
  background: #fff;
}

/* ── Empty state (no URL configured) ──────────────────────────── */
.ss-empty {
  text-align: center;
  padding: 60px 40px !important;
}
.ss-empty-icon {
  font-size: 64px;
  color: #adb5bd;
  margin-bottom: 14px;
}
.ss-empty-title {
  font-family: "Poppins", sans-serif;
  font-size: 22px;
  font-weight: 600;
  color: #45505b;
  margin: 0 0 10px;
}
.ss-empty-body {
  font-size: 14px;
  color: #6c757d;
  max-width: 520px;
  margin: 0 auto;
  line-height: 1.6;
}

/* ── Loading skeleton (shown until the API responds) ──────────── */
.ss-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 80px 20px;
  color: #6c757d;
  font-size: 14px;
}
.ss-loading .bx-spin {
  font-size: 22px;
  color: #0563bb;
  animation: ss-spin 0.8s linear infinite;
}
@keyframes ss-spin { to { transform: rotate(360deg); } }

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 768px) {
  /* Stack actions under the title on narrow screens */
  .ss-viewer-card .presets-header {
    flex-direction: column;
    align-items: flex-start;
  }
  .ss-actions { width: 100%; }
  .ss-edit-btn { flex: 1; justify-content: center; }
  #ss-frame { height: 65vh; min-height: 360px; }
  .ss-empty { padding: 40px 24px !important; }
}
