/* SigCleaner – site.css */

/* ── Bootstrap bootstrap-icons fonts already in /libs/ ── */

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

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: #fafafa;
  color: #222;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
}

/* ── Navbar (light) ── */
.site-navbar {
  background: #fff;
  border-bottom: 1px solid #ede9f8;
  box-shadow: 0 1px 12px rgba(124,58,237,.07);
}

.site-navbar-brand {
  background: var(--accent-grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -.01em;
}

.site-navbar .navbar-brand i {
  background: var(--accent-grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.site-navbar .nav-link {
  color: #555 !important;
  border-radius: 7px;
  font-weight: 500;
  font-size: .9rem;
  transition: color .15s, background .15s;
}
.site-navbar .nav-link:hover,
.site-navbar .nav-link.active {
  color: var(--accent) !important;
  background: rgba(124,58,237,.07);
}

/* ── Buttons: accent (gradient purple → pink) ── */
.btn-accent {
  background: var(--accent-grad);
  border: none;
  color: #fff !important;
  font-weight: 600;
  letter-spacing: .015em;
  box-shadow: 0 2px 14px rgba(124,58,237,.28);
  transition: box-shadow .18s, transform .13s, opacity .18s;
  border-radius: 8px;
}
.btn-accent:hover,
.btn-accent:focus {
  opacity: .9;
  color: #fff !important;
  box-shadow: 0 5px 22px rgba(124,58,237,.38);
  transform: translateY(-1px);
}
.btn-accent:active {
  transform: translateY(0);
  opacity: 1;
  box-shadow: 0 2px 10px rgba(124,58,237,.22);
}

/* ── Buttons: outline secondary ── */
.btn-outline-secondary {
  color: #5a5a72 !important;
  border-color: #d6d3e7 !important;
  background: #faf9ff !important;
  font-weight: 500;
  border-radius: 8px !important;
  transition: border-color .15s, background .15s, color .15s, box-shadow .15s;
}
.btn-outline-secondary:hover,
.btn-outline-secondary:focus {
  color: var(--accent) !important;
  border-color: #b8aee8 !important;
  background: #f3f0ff !important;
  box-shadow: 0 2px 8px rgba(124,58,237,.12);
}

/* ── Buttons: outline muted (logout) ── */
.btn-outline-muted-custom {
  color: #888 !important;
  border: 1px solid #e0dce8 !important;
  background: transparent !important;
  border-radius: 8px !important;
  font-weight: 500;
  transition: color .15s, border-color .15s, background .15s;
}
.btn-outline-muted-custom:hover {
  color: #555 !important;
  border-color: #c8c0dc !important;
  background: #f5f3fb !important;
}

/* ── Drop Zone ── */
.drop-zone {
  border: 2px dashed #c5d0e0;
  background: #fff;
  cursor: pointer;
  transition: border-color .2s, background .2s;
  min-height: 220px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.drop-zone:hover,
.drop-zone.drag-over {
  border-color: var(--accent, #7c3aed);
  background: #f5f3ff;
}

.drop-zone.has-image {
  border-color: var(--accent, #7c3aed);
  background: #f9f7ff;
  min-height: unset;
  padding: 16px !important;
}

/* ── Crop block ── */
#crop-wrap {
  width: 100%;
  max-height: 420px;
  background: #1a1a2e;
  border-radius: 1rem;
  overflow: hidden;
}

#crop-source {
  display: block;
  max-width: 100%;
}

/* Cropper.js toolbar overrides */
.cropper-view-box,
.cropper-face {
  border-radius: 0;
}

/* ── Upload animation ── */
@keyframes fadeInScale {
  from { opacity: 0; transform: scale(.9); }
  to   { opacity: 1; transform: scale(1); }
}

#step-crop,
#step-result,
#step-progress {
  animation: fadeInScale .3s ease;
}

/* ── Letter spacing for code input ── */
.letter-spacing-5 {
  letter-spacing: 8px;
  font-size: 26px;
  font-weight: 700;
}

/* ── Magic processing animation ── */
.magic-wrap {
  position: relative;
  overflow: hidden;
  line-height: 0;
  background: #111;
}

.magic-img {
  display: block;
  width: 100%;
  height: auto;
  filter: saturate(.4) brightness(.85);
  animation: magicPulse 2.4s ease-in-out infinite;
}

@keyframes magicPulse {
  0%, 100% { filter: saturate(.4) brightness(.85); }
  50%       { filter: saturate(.7) brightness(1);  }
}

.magic-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

/* sweeping gradient (left→right, loops) */
.magic-sweep {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    105deg,
    transparent 30%,
    rgba(124, 58, 237, .18) 48%,
    rgba(219, 39, 119, .28) 52%,
    transparent 70%
  );
  background-size: 200% 100%;
  animation: magicSweep 2.2s linear infinite;
}

@keyframes magicSweep {
  0%   { background-position: -100% 0; }
  100% { background-position:  200% 0; }
}

/* sparkle particles (injected via JS) */
.magic-particle {
  position: absolute;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 6px 2px rgba(219, 39, 119, .8);
  animation: particleFade 1.6s ease-in-out infinite;
  opacity: 0;
}

@keyframes particleFade {
  0%        { opacity: 0;   transform: scale(.5) translateY(0); }
  30%, 60%  { opacity: 1;   transform: scale(1)  translateY(-8px); }
  100%      { opacity: 0;   transform: scale(.3) translateY(-18px); }
}

/* animated ellipsis after "Удаление фона" */
.magic-dots::after {
  content: '';
  display: inline-block;
  animation: magicEllipsis 1.6s steps(4, end) infinite;
}

@keyframes magicEllipsis {
  0%   { content: ''; }
  25%  { content: '.'; }
  50%  { content: '..'; }
  75%  { content: '...'; }
}

/* ── Before / After comparison slider ── */
.compare-wrap {
  position: relative;
  overflow: hidden;
  cursor: ew-resize;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
  /* checkerboard shows transparency in the "after" image */
  background: repeating-conic-gradient(#d8d8d8 0% 25%, #fff 0% 50%) 0 0 / 20px 20px;
  line-height: 0;
}

.compare-img {
  display: block;
  width: 100%;
  height: auto;
  pointer-events: none;   /* stops browser native image drag */
  -webkit-user-drag: none;
  user-drag: none;
}

.compare-before {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  /* clip-path updated by JS */
  clip-path: inset(0 50% 0 0);
}

.compare-divider {
  position: absolute;
  top: 0; bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 44px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.compare-line {
  position: absolute;
  top: 0; bottom: 0;
  left: 50%;
  width: 2px;
  transform: translateX(-50%);
  background: #fff;
  box-shadow: 0 0 6px rgba(0,0,0,.35);
}

.compare-knob {
  position: relative;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 10px rgba(0,0,0,.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  color: #333;
  gap: 1px;
}

.compare-label {
  position: absolute;
  bottom: 10px;
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(0,0,0,.45);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .4px;
  pointer-events: none;
}

.compare-label-before { left:  10px; }
.compare-label-after  { right: 10px; }

/* ── Keys list ── */
.key-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid #eee;
}

.key-row:last-child {
  border-bottom: none;
}

.key-prefix {
  font-family: monospace;
  font-size: 14px;
  color: #555;
  background: #f3f4f6;
  padding: 3px 8px;
  border-radius: 4px;
}

/* ── Code block theme ── */
pre, code {
  font-family: 'Cascadia Code', 'Fira Mono', 'Courier New', monospace;
}

/* ── Utility ── */
.rounded-4 {
  border-radius: 1rem !important;
}

.shadow-sm {
  box-shadow: 0 2px 8px rgba(0,0,0,.06) !important;
}

/* ── My Files grid ── */
.my-files-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px;
}

.my-file-card {
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 1px 8px rgba(0,0,0,.08);
  transition: box-shadow .18s, transform .15s;
}

.my-file-card:hover {
  box-shadow: 0 4px 18px rgba(124,58,237,.18);
  transform: translateY(-2px);
}

.my-file-thumb {
  position: relative;
  aspect-ratio: 1 / 1;
  /* checkerboard pattern to show transparency */
  background: repeating-conic-gradient(#d8d8d8 0% 25%, #fff 0% 50%) 0 0 / 20px 20px;
  overflow: hidden;
}

.my-file-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.my-file-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.45);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity .18s;
}

.my-file-card:hover .my-file-overlay {
  opacity: 1;
}

.my-file-meta {
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.my-file-date {
  font-size: 12px;
  color: #555;
  font-weight: 500;
}

.my-file-expiry {
  font-size: 11px;
  color: #888;
}

.my-file-expiry--perm {
  color: var(--accent, #7c3aed);
}

.my-file-delete {
  align-self: flex-end;
  opacity: .45;
  transition: opacity .15s;
}

.my-file-delete:hover {
  opacity: 1;
}

/* ── Responsive ── */
@media (max-width: 575px) {
  .drop-zone {
    min-height: 160px;
    padding: 24px 16px !important;
  }
  .letter-spacing-5 {
    letter-spacing: 4px;
    font-size: 22px;
  }
}
