/* FSC Record Viewer — Google Gemini Inspired Styles */
/* Mobile-first, HIPAA/CCPA compliant */

/* ── Gemini SVG Icons ──────────────────────────────── */
.fscrv-container svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.fscrv-container svg circle,
.fscrv-container svg rect,
.fscrv-container svg line { fill: none; stroke: currentColor; stroke-width: 2; }

/* ── Container ────────────────────────────────────────── */
.fscrv-container {
  max-width: 960px;
  margin: 24px auto;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: #202124;
  line-height: 1.5;
}

/* ── Access Denied ───────────────────────────────────── */
.fscrv-access-denied {
  text-align: center;
  padding: 60px 20px;
  max-width: 480px;
  margin: 40px auto;
}
.fscrv-access-denied h2 { font-size: 22px; margin: 16px 0 8px; }
.fscrv-access-denied p { color: #5f6368; margin-bottom: 20px; }
.fscrv-btn {
  display: inline-block;
  padding: 10px 28px;
  background: #1a73e8;
  color: #fff;
  border-radius: 24px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
}

/* ── Navigation ──────────────────────────────────────── */
.fscrv-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fff;
  border: 1px solid #dadce0;
  border-radius: 8px;
  padding: 12px 20px;
  margin-bottom: 12px;
}
.fscrv-nav-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #1a73e8;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 20px;
  transition: background 0.15s;
}
.fscrv-nav-btn:hover { background: #e8f0fe; }
.fscrv-nav-title { font-size: 16px; font-weight: 600; }

/* ── Urgent ──────────────────────────────────────────── */
.fscrv-urgent-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #fce8e6;
  border: 1px solid #d93025;
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 12px;
  font-size: 13px;
  color: #d93025;
  font-weight: 500;
}
.fscrv-urgent-banner svg { fill: #d93025; flex-shrink: 0; }

.fscrv-urgent-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fff;
  border: 1px solid #dadce0;
  border-radius: 8px;
  padding: 12px 20px;
  margin-bottom: 12px;
}
.fscrv-urgent-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: #5f6368;
  font-weight: 500;
}
.fscrv-urgent-label svg { width: 18px; height: 18px; color: #5f6368; }

/* ── Urgent Slider Switch ──────────────────────── */
.fscrv-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  cursor: pointer;
}
.fscrv-switch input { opacity: 0; width: 0; height: 0; }
.fscrv-slider {
  position: absolute;
  inset: 0;
  background: #dadce0;
  border-radius: 24px;
  transition: background 0.2s;
}
.fscrv-slider::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  bottom: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s cubic-bezier(0.2, 0, 0, 1);
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.fscrv-switch input:checked + .fscrv-slider { background: #d93025; }
.fscrv-switch input:checked + .fscrv-slider::before { transform: translateX(20px); }
.fscrv-switch:hover .fscrv-slider { box-shadow: 0 0 0 4px rgba(217,48,37,0.1); }
.fscrv-switch input:active + .fscrv-slider::before { width: 22px; }

/* ── Cards ───────────────────────────────────────────── */
.fscrv-card {
  background: #fff;
  border: 1px solid #dadce0;
  border-radius: 8px;
  padding: 24px;
  margin-bottom: 12px;
}
.fscrv-card-title {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #5f6368;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid #e8eaed;
  display: flex;
  align-items: center;
  gap: 8px;
}
.fscrv-card-title svg { fill: #5f6368; flex-shrink: 0; }

/* ── Fields ──────────────────────────────────────────── */
.fscrv-row { display: flex; gap: 32px; }
.fscrv-col { flex: 1; }
.fscrv-field {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid #f1f3f4;
}
.fscrv-field:last-child { border-bottom: none; }
.fscrv-label {
  font-size: 13px;
  color: #5f6368;
  display: flex;
  align-items: center;
  gap: 6px;
}
.fscrv-label svg { fill: #5f6368; flex-shrink: 0; }
.fscrv-value {
  font-size: 14px;
  font-weight: 500;
  color: #202124;
  text-align: right;
}
.fscrv-mail { color: #1a73e8; text-decoration: none; font-weight: 500; }
.fscrv-mail:hover { text-decoration: underline; }

/* ── Document Grid ───────────────────────────────────── */
.fscrv-doc-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.fscrv-doc-card {
  display: block;
  border: 1px solid #e8eaed;
  border-radius: 8px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: box-shadow 0.15s;
  cursor: pointer;
}
.fscrv-doc-card:hover { box-shadow: 0 1px 6px rgba(0,0,0,0.1); }
.fscrv-doc-thumb {
  aspect-ratio: 4/3;
  background: #f1f3f4;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}
.fscrv-doc-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  -webkit-user-drag: none;
  user-select: none;
}

/* Thumbnail overlay (date/time/uploader on top of image) */
.fscrv-thumb-overlay {
  position: absolute;
  top: 0; left: 0; right: 0;
  display: flex;
  gap: 8px;
  padding: 6px 8px;
  background: linear-gradient(to bottom, rgba(0,0,0,0.55), transparent);
  color: #fff;
  font-size: 10px;
  z-index: 1;
  pointer-events: none;
  flex-wrap: wrap;
}
.fscrv-thumb-overlay .fscrv-thumb-uploader { font-weight: 600; opacity: 0.9; }
.fscrv-thumb-overlay .fscrv-thumb-date { opacity: 0.85; margin-left: auto; }
.fscrv-thumb-overlay .fscrv-thumb-time { opacity: 0.7; }
.fscrv-doc-thumb svg { fill: #9aa0a6; }
.fscrv-doc-info { padding: 10px 12px; }
.fscrv-doc-name { font-size: 13px; font-weight: 500; }
.fscrv-doc-meta { font-size: 11px; color: #5f6368; margin-top: 2px; }

/* ── Staff Gallery ─────────────────────────────── */
.fscrv-staff-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}
.fscrv-gallery-item {
  display: flex;
  flex-direction: column;
  border: 1px solid #e8eaed;
  border-radius: 8px;
  overflow: hidden;
  background: #fafafa;
  transition: box-shadow 0.15s, border-color 0.15s;
  position: relative;
}
.fscrv-gallery-item:hover { box-shadow: 0 1px 6px rgba(0,0,0,0.08); }
.fscrv-gallery-item.dragging { opacity: 0.4; }
.fscrv-gallery-item.drag-over { border-color: #1a73e8; background: #e8f0fe; }

.fscrv-grip {
  position: absolute;
  top: 6px;
  left: 6px;
  cursor: grab;
  color: rgba(255,255,255,0.8);
  display: flex;
  padding: 4px;
  border-radius: 4px;
  background: rgba(0,0,0,0.3);
  z-index: 2;
  opacity: 0;
  transition: opacity 0.15s;
}
.fscrv-gallery-item:hover .fscrv-grip { opacity: 1; }
.fscrv-grip:hover { background: rgba(0,0,0,0.5); }
.fscrv-grip:active { cursor: grabbing; }
.fscrv-grip svg { width: 16px; height: 16px; }

.fscrv-gallery-thumb {
  aspect-ratio: 16/10;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #f1f3f4;
  position: relative;
}
.fscrv-gallery-thumb a { display: flex; width: 100%; height: 100%; align-items: center; justify-content: center; }
.fscrv-gallery-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  -webkit-user-drag: none;
  user-select: none;
}
.fscrv-gallery-thumb .fscrv-file-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
}
.fscrv-gallery-thumb .fscrv-file-icon.pdf { background: #fef7e0; color: #f9ab00; }
.fscrv-gallery-thumb .fscrv-file-icon.doc,
.fscrv-gallery-thumb .fscrv-file-icon.word { background: #e8f0fe; color: #1a73e8; }
.fscrv-gallery-thumb .fscrv-file-icon.file { background: #f1f3f4; color: #5f6368; }
.fscrv-gallery-thumb .fscrv-file-icon svg { width: 32px; height: 32px; }

.fscrv-gallery-info {
  padding: 8px 10px;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.fscrv-gallery-name { font-size: 12px; font-weight: 500; }
.fscrv-gallery-meta { font-size: 10px; color: #5f6368; margin-top: 2px; }

.fscrv-gallery-actions {
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 2;
  opacity: 0;
  transition: opacity 0.15s;
}
.fscrv-gallery-item:hover .fscrv-gallery-actions { opacity: 1; }
.fscrv-gallery-actions button {
  background: rgba(0,0,0,0.3);
  border: none;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  display: flex;
  color: #fff;
}
.fscrv-gallery-actions button:hover { background: rgba(220,38,38,0.8); }
.fscrv-gallery-actions button svg { width: 14px; height: 14px; }

/* SortableJS drag classes */
.fscrv-sort-ghost {
  opacity: 0.4 !important;
  background: #e8f0fe !important;
  outline: 2px dashed #1a73e8 !important;
  outline-offset: -2px;
  border-radius: 8px !important;
}
.fscrv-sort-chosen {
  background: #fff !important;
}
.fscrv-sort-drag {
  transform: rotate(1deg) scale(1.02) !important;
  box-shadow: 0 12px 40px rgba(0,0,0,0.18) !important;
  border-radius: 8px !important;
  overflow: hidden !important;
  opacity: 0.95 !important;
  z-index: 9999 !important;
}

/* Upload button (shared) */
.fscrv-upload-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 28px;
  background: #1a73e8;
  color: #fff;
  border: none;
  border-radius: 24px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
}
.fscrv-upload-btn svg { color: #fff; width: 18px; height: 18px; }
.fscrv-upload-btn:hover { background: #1557b0; }
.fscrv-upload-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.fscrv-empty {
  font-size: 13px;
  color: #9aa0a6;
  text-align: center;
  padding: 24px;
}

/* ── Upload Dropzone ─────────────────────────── */
.fscrv-upload-area { margin-top: 16px; }
.fscrv-dropzone {
  border: 2px dashed #dadce0;
  border-radius: 12px;
  padding: 28px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s;
  position: relative;
}
.fscrv-dropzone:hover,
.fscrv-dropzone.dragover { border-color: #1a73e8; background: #e8f0fe; }
.fscrv-dropzone svg { width: 32px; height: 32px; color: #9aa0a6; margin-bottom: 4px; }
.fscrv-dropzone:hover svg,
.fscrv-dropzone.dragover svg { color: #1a73e8; }
.fscrv-drop-text { font-size: 14px; color: #5f6368; margin: 4px 0; }
.fscrv-drop-hint { font-size: 11px; color: #9aa0a6; margin: 0; }
.fscrv-dropzone.has-file { border-color: #1a73e8; background: #e8f0fe; padding-bottom: 16px; }
.fscrv-dropzone.has-file svg { color: #1a73e8; }

/* File preview before upload */
.fscrv-file-preview {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  border: 1px solid #e8eaed;
  border-radius: 8px;
  padding: 10px 14px;
  margin: 12px auto 0;
  max-width: 360px;
  text-align: left;
}
.fscrv-file-preview svg { width: 24px; height: 24px; color: #1a73e8; margin: 0; flex-shrink: 0; }
.fscrv-preview-name { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fscrv-preview-size { font-size: 11px; color: #5f6368; margin-left: auto; white-space: nowrap; }

/* Progress bar */
.fscrv-progress-bar {
  width: 100%;
  height: 6px;
  background: #e8eaed;
  border-radius: 3px;
  overflow: hidden;
  margin-top: 12px;
}
.fscrv-progress-fill {
  height: 100%;
  width: 0%;
  background: #1a73e8;
  border-radius: 3px;
  transition: width 0.2s;
}

  .fscrv-upload-area .fscrv-upload-btn {
  margin-top: 12px;
  padding: 10px 28px;
  font-size: 14px;
}

/* ── Dashboard ────────────────────────────────── */
.fscrv-dashboard { max-width: 1280px; margin: 0 auto; padding: 20px; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; }

/* Controls bar */
.fscrv-dash-controls { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.fscrv-dash-tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.fscrv-dash-tab {
  padding: 8px 18px; border-radius: 20px; border: 1px solid #dadce0; background: #fff;
  font-size: 13px; font-weight: 500; cursor: pointer; color: #5f6368; transition: all 0.15s;
  display: flex; align-items: center; gap: 6px;
}
.fscrv-dash-tab:hover { background: #f1f3f4; }
.fscrv-dash-tab.active { background: #1a73e8; color: #fff; border-color: #1a73e8; }
.fscrv-dash-count {
  font-size: 11px; background: rgba(0,0,0,0.08); padding: 1px 8px; border-radius: 10px;
  font-weight: 600;
}
.fscrv-dash-tab.active .fscrv-dash-count { background: rgba(255,255,255,0.2); }

.fscrv-dash-toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.fscrv-dash-search {
  display: flex; align-items: center; gap: 6px; background: #fff; border: 1px solid #dadce0;
  border-radius: 24px; padding: 6px 14px; transition: border-color 0.15s;
}
.fscrv-dash-search:focus-within { border-color: #1a73e8; }
.fscrv-dash-search svg { width: 18px; height: 18px; color: #9aa0a6; flex-shrink: 0; }
.fscrv-dash-input {
  border: none; outline: none; font-size: 13px; width: 180px; background: transparent;
  font-family: inherit;
}
.fscrv-dash-sort {
  padding: 8px 14px; border: 1px solid #dadce0; border-radius: 24px; font-size: 13px;
  background: #fff; cursor: pointer; outline: none; font-family: inherit;
}

/* Grid */
.fscrv-dashboard-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.fscrv-dash-card {
  display: flex; flex-direction: column; background: #fff; border: 1px solid #e8eaed;
  border-radius: 8px; overflow: hidden; text-decoration: none; color: inherit;
  transition: box-shadow 0.15s, transform 0.15s;
}
.fscrv-dash-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.08); transform: translateY(-2px); }
.fscrv-dash-card.is-urgent { border-left: 3px solid #d93025; }

.fscrv-dash-thumb {
  aspect-ratio: 16/10; background: #f1f3f4; display: flex; align-items: center;
  justify-content: center; overflow: hidden; position: relative;
}
.fscrv-dash-thumb img { width: 100%; height: 100%; object-fit: cover; }
.fscrv-dash-thumb .fscrv-dash-icon svg { width: 36px; height: 36px; color: #9aa0a6; }
.fscrv-dash-urgent-badge {
  position: absolute; top: 6px; right: 6px; background: #d93025; color: #fff;
  width: 24px; height: 24px; border-radius: 50%; display: flex; align-items: center;
  justify-content: center; box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}
.fscrv-dash-urgent-badge svg { width: 14px; height: 14px; color: #fff; }

.fscrv-dash-body { padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; }
.fscrv-dash-name { font-size: 15px; font-weight: 600; color: #202124; }
.fscrv-dash-meta { font-size: 12px; color: #5f6368; }

/* Dashboard mobile */
@media (max-width: 900px) { .fscrv-dashboard-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) {
  .fscrv-dashboard-grid { grid-template-columns: 1fr; }
  .fscrv-dash-controls { flex-direction: column; align-items: stretch; }
  .fscrv-dash-toolbar { flex-direction: column; }
  .fscrv-dash-input { width: 100%; }
}
  .fscrv-staff-gallery { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .fscrv-container { margin: 12px auto; }
  .fscrv-nav { padding: 10px 12px; }
  .fscrv-nav-title { font-size: 14px; }
  .fscrv-nav-label { display: none; }
  .fscrv-row { flex-direction: column; gap: 0; }
  .fscrv-doc-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .fscrv-card { padding: 16px; }
  .fscrv-upload-row input[type="text"] { min-width: 100%; }
  .fscrv-upload-row input[type="file"] { width: 100%; }
}

/* ── Dark Mode ───────────────────────────────────────── */
@media (prefers-color-scheme: dark) {
  .fscrv-container { color: #e8eaed; }
  .fscrv-nav,
  .fscrv-card,
  .fscrv-urgent-toggle { background: #1e1e2e; border-color: #333; }
  .fscrv-urgent-label { color: #9aa0a6; }
  .fscrv-urgent-label svg { color: #9aa0a6; }
  .fscrv-nav-title { color: #e8eaed; }
  .fscrv-nav-btn { color: #8ab4f8; }
  .fscrv-nav-btn:hover { background: #2d2d44; }
  .fscrv-value,
  .fscrv-doc-name,
  .fscrv-staff-name { color: #e8eaed; }
  .fscrv-label { color: #9aa0a6; }
  .fscrv-label svg { fill: #9aa0a6; }
  .fscrv-card-title { color: #9aa0a6; border-bottom-color: #333; }
  .fscrv-card-title svg { fill: #9aa0a6; }
  .fscrv-field { border-bottom-color: #333; }
  .fscrv-staff-item { background: #252535; border-color: #333; }
  .fscrv-doc-card { border-color: #333; }
  .fscrv-doc-thumb { background: #2d2d44; }
  .fscrv-upload-area { border-color: #444; }
  .fscrv-upload-row input[type="text"] { background: #252535; border-color: #444; color: #e8eaed; }
}
