/* ==========================================================================
   Drag overlay, upload progress dock, conflict dialog, success keyframes.
   Owning feature: browse / upload
   Load order is defined in Views/Shared/_CssIncludes.cshtml — do not reorder.
   ========================================================================== */

/* ==========================================================================
   Google Drive Inspired Upload Progress Dock & Animations
   ========================================================================== */

/* Full Drag & Drop Overlay */
.fh-drag-overlay {
  position: fixed;
  inset: 0;
  z-index: 1055;
  background: rgba(248, 250, 252, 0.88);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.fh-drag-overlay.is-active {
  opacity: 1;
  pointer-events: auto;
}
.fh-drag-card {
  background: #ffffff;
  border: 2px dashed var(--fh-primary);
  border-radius: var(--fh-radius-lg, 0.75rem);
  padding: 2.5rem 3.5rem;
  text-align: center;
  box-shadow: 0 20px 40px rgba(37, 99, 235, 0.12);
  pointer-events: none;
  transform: scale(0.96);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.fh-drag-overlay.is-active .fh-drag-card {
  transform: scale(1);
}
.fh-drag-icon {
  font-size: var(--fh-text-6xl);
  color: var(--fh-primary);
  display: inline-block;
  animation: floatBounce 2s ease-in-out infinite;
}
.fh-drag-text {
  font-size: var(--fh-text-xl);
  font-weight: var(--fh-weight-semibold);
  color: var(--fh-text);
  margin-top: 1rem;
  margin-bottom: 0.25rem;
}
.fh-drag-subtext {
  font-size: var(--fh-text-sm);
  color: var(--fh-muted);
}

/* Floating Upload Progress Dock (Bottom Right) */
.fh-upload-dock {
  position: fixed;
  bottom: var(--fh-float-inset, 1.5rem);
  right: var(--fh-float-inset, 1.5rem);
  z-index: 1060;
  width: 370px;
  max-width: calc(100vw - 2rem);
  background: #ffffff;
  border: 1px solid var(--fh-border);
  border-radius: var(--fh-radius-lg, 0.75rem);
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.16), 0 2px 8px rgba(15, 23, 42, 0.08);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transform: translateY(0);
  opacity: 1;
  animation: uploadDockSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s ease, box-shadow 0.2s ease;
}
.fh-upload-dock.is-hidden {
  display: none !important;
}

/* Dock Header */
.fh-upload-dock-header {
  background: var(--fh-ink, #14161a);
  color: #ffffff;
  padding: 0.65rem 0.9rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  user-select: none;
  cursor: pointer;
}
.fh-upload-dock-left {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex: 1;
  min-width: 0;
}
.fh-upload-dock-status-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.1rem;
  font-size: var(--fh-text-md);
  flex-shrink: 0;
}
.fh-upload-dock-status-icon .fa-spinner {
  color: #38bdf8;
}
.fh-upload-dock-status-icon .fa-circle-check {
  color: #4ade80;
  animation: checkmarkPop 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.fh-upload-dock-status-icon .fa-circle-exclamation {
  color: #f87171;
}
.fh-upload-dock-title {
  font-size: var(--fh-text-sm);
  font-weight: var(--fh-weight-semibold);
  letter-spacing: var(--fh-tracking-tight);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #f8fafc;
}
.fh-upload-dock-actions {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  flex-shrink: 0;
}
.fh-upload-dock-btn {
  background: transparent;
  border: 0;
  color: var(--fh-muted);
  padding: 4px 6px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: var(--fh-text-xs);
  cursor: pointer;
  line-height: var(--fh-leading-none);
  transition: color 0.15s, background 0.15s;
}
.fh-upload-dock-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.12);
}

/* Overall Progress Strip directly under header */
.fh-upload-dock-bar {
  height: 3px;
  background: rgba(255, 255, 255, 0.15);
  width: 100%;
  position: relative;
  overflow: hidden;
}
.fh-upload-dock-bar-fill {
  height: 100%;
  width: 0%;
  background: #38bdf8;
  transition: width 0.22s ease-out;
}
.fh-upload-dock-bar.is-complete .fh-upload-dock-bar-fill {
  background: #4ade80;
}

/* Dock Item List */
.fh-upload-dock-body {
  max-height: 240px;
  overflow-y: auto;
  background: #ffffff;
  overscroll-behavior: contain;
  transition: max-height 0.25s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s ease;
}
.fh-upload-dock-body::-webkit-scrollbar {
  width: 5px;
}
.fh-upload-dock-body::-webkit-scrollbar-track {
  background: #f8fafc;
}
.fh-upload-dock-body::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 3px;
}
.fh-upload-dock-body::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Dock Item Row */
.fh-upload-item {
  display: flex;
  align-items: center;
  padding: 0.55rem 0.85rem;
  gap: 0.65rem;
  border-bottom: 1px solid #f1f5f9;
  position: relative;
  transition: background 0.15s;
}
.fh-upload-item:last-child {
  border-bottom: 0;
}
.fh-upload-item:hover {
  background: #f8fafc;
}
.fh-upload-item-icon {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--fh-text-base);
  flex-shrink: 0;
  background: #f1f5f9;
  color: var(--fh-muted);
}
/* Per-type tinted palette lives with .fh-card-icon's own rules (Browse Cards
   section above) — one declaration per type shared by both surfaces. */

.fh-upload-item-details {
  flex: 1;
  min-width: 0;
}
.fh-upload-item-name {
  font-size: var(--fh-text-sm);
  font-weight: var(--fh-weight-medium);
  color: var(--fh-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: var(--fh-leading-tight);
}
.fh-upload-item-meta {
  font-size: var(--fh-text-xs);
  color: var(--fh-muted);
  margin-top: 1px;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.fh-upload-item-progress-track {
  margin-top: 4px;
  height: 3px;
  border-radius: 2px;
  background: #e2e8f0;
  overflow: hidden;
  width: 100%;
}
.fh-upload-item-progress-fill {
  height: 100%;
  width: 0%;
  background: var(--fh-primary);
  border-radius: 2px;
  transition: width 0.2s ease-out;
}
.fh-upload-item-status {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
}
.fh-upload-item-status .fa-circle-check {
  color: #16a34a;
  font-size: var(--fh-text-lg);
  animation: checkmarkPop 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.fh-upload-item-status .fa-circle-exclamation {
  color: #dc2626;
  font-size: var(--fh-text-lg);
}
.fh-upload-item-cancel {
  border: 0;
  background: transparent;
  color: var(--fh-muted);
  cursor: pointer;
  padding: 3px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: var(--fh-text-xs);
  transition: color 0.15s, background 0.15s;
}
.fh-upload-item-cancel:hover {
  color: var(--fh-danger);
  background: #fee2e2;
}

/* Minimized Dock State */
.fh-upload-dock.is-minimized {
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.12);
}
.fh-upload-dock.is-minimized .fh-upload-dock-body {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
}

/* Conflict Dialog (Upload / New-Folder) — Windows "Replace or skip files"
   layout: stacked action rows instead of a button strip, since each row is a
   whole resolution (Overwrite / Keep both / Skip / Open existing). */
.fh-conflict-message {
  color: var(--fh-text);
  margin-bottom: 1rem;
}
.fh-conflict-actions {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.fh-conflict-row {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  width: 100%;
  padding: 0.65rem 0.75rem;
  background: transparent;
  border: 1px solid var(--fh-border);
  border-radius: var(--fh-radius, 0.5rem);
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.fh-conflict-row:hover,
.fh-conflict-row:focus-visible {
  background: #f1f5f9;
  border-color: var(--fh-primary);
  outline: none;
}
.fh-conflict-row-icon {
  flex-shrink: 0;
  width: 1.75rem;
  height: 1.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #eef2ff;
  color: var(--fh-primary);
  font-size: var(--fh-text-base);
}
.fh-conflict-row-text {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}
.fh-conflict-row-title {
  font-weight: var(--fh-weight-semibold);
  color: var(--fh-text);
  font-size: var(--fh-text-md);
}
.fh-conflict-row-sub {
  font-size: var(--fh-text-xs);
  color: var(--fh-muted);
}
.fh-conflict-apply-all {
  margin-top: 0.85rem;
  padding-left: 1.5rem;
}
.fh-conflict-apply-all .form-check-label {
  font-size: var(--fh-text-base);
  color: var(--fh-muted);
}

/* Success Highlight Animation on Newly Uploaded Grid Cards and Table Rows */
.fh-card.is-newly-uploaded,
.fh-list-card table.table-hover > tbody > tr.is-newly-uploaded > * {
  animation: uploadSuccessFlash 2.8s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

/* Keyframes */
@keyframes uploadDockSlideUp {
  0% {
    transform: translateY(24px) scale(0.96);
    opacity: 0;
  }
  100% {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

@keyframes checkmarkPop {
  0% {
    transform: scale(0.5);
    opacity: 0;
  }
  65% {
    transform: scale(1.2);
    opacity: 1;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes floatBounce {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-6px);
  }
}

@keyframes uploadSuccessFlash {
  0% {
    background-color: rgba(37, 99, 235, 0.2);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.35);
    transform: translateY(-2px);
  }
  25% {
    background-color: rgba(37, 99, 235, 0.12);
    box-shadow: 0 0 0 1.5px rgba(37, 99, 235, 0.2);
    transform: translateY(0);
  }
  100% {
    background-color: transparent;
    box-shadow: none;
    transform: translateY(0);
  }
}

