/* ═══════════════════════════════════════════════════
   LUXURY MOTION SYSTEM — RepairPDF
   Easing: quintic-out (0.22, 1, 0.36, 1)
   ═══════════════════════════════════════════════════ */

.font-serif { font-family: 'Playfair Display', serif; }
.font-sans  { font-family: 'Inter', sans-serif; }

.lux-easing { transition-timing-function: cubic-bezier(0.22, 1, 0.36, 1); }

/* ── Reveal animation ── */
@keyframes luxReveal {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}
.lux-reveal {
  animation: luxReveal 1s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

/* ── Stagger for grid items ── */
@keyframes luxStagger {
  from { opacity: 0; transform: translateY(20px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.stagger-item {
  animation: luxStagger 0.8s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  opacity: 0;
}

/* ── Sidebar slide-in ── */
@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-40px); }
  to   { opacity: 1; transform: translateX(0); }
}
.lux-sidebar {
  animation: slideInLeft 1s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
@keyframes slideInRight {
  from { opacity: 0; transform: translateX(40px); }
  to   { opacity: 1; transform: translateX(0); }
}
.lux-sidebar-r {
  animation: slideInRight 1s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

/* ── Modal ── */
@keyframes modalIn {
  from { opacity: 0; transform: translateY(16px) scale(0.95); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.lux-modal-in { animation: modalIn 0.7s cubic-bezier(0.22, 1, 0.36, 1) forwards; }

/* ── Toast ── */
@keyframes toastIn {
  from { opacity: 0; transform: translateX(100%); }
  to   { opacity: 1; transform: translateX(0); }
}
.lux-toast-in { animation: toastIn 0.7s cubic-bezier(0.22, 1, 0.36, 1) forwards; }

/* ── Tool sidebar buttons ── */
.lux-tool-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.5rem;
  border-radius: 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: #94a3b8;
  transition: all 0.5s cubic-bezier(0.22, 1, 0.36, 1);
  position: relative;
  overflow: hidden;
}
.lux-tool-btn:hover { color: #0f172a; background: #f8fafc; }
.lux-tool-btn.active {
  background: #0f172a;
  color: #fff;
  box-shadow: 0 10px 25px -5px rgba(15,23,42,0.15);
  transform: translateX(8px);
}
.lux-tool-btn.lux-tool-danger:not(.active):hover {
  color: #ef4444;
  background: #fef2f2;
}
.lux-tool-icon {
  transition: all 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}
.lux-tool-btn:hover .lux-tool-icon { transform: scale(1.25) rotate(12deg); }
.lux-tool-btn.active .lux-tool-icon { transform: scale(1.1); }

/* ── Floating tooltip ── */
.lux-tooltip {
  position: absolute;
  left: 100%;
  margin-left: 1rem;
  top: 50%;
  transform: translateY(-50%) translateX(8px);
  padding: 0.375rem 0.75rem;
  background: #0f172a;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  border-radius: 0.5rem;
  opacity: 0;
  pointer-events: none;
  white-space: nowrap;
  transition: all 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}
.group:hover .lux-tooltip {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}

/* ── Luxury inputs ── */
.lux-input-group label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: #94a3b8;
  margin-bottom: 0.5rem;
  transition: color 0.5s;
}
.lux-input-group:focus-within label { color: #6366f1; }
.lux-input {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1px solid #e2e8f0;
  padding: 0.75rem 0;
  font-size: 0.875rem;
  font-weight: 500;
  outline: none;
  transition: border-color 0.5s;
  color: #0f172a;
}
.lux-input:focus { border-color: #6366f1; }
.lux-input::placeholder { color: #cbd5e1; }

.lux-select {
  width: 100%;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
  padding: 0.625rem 2.75rem 0.625rem 0.9rem;
  font-size: 0.875rem;
  font-weight: 500;
  outline: none;
  transition: border-color 0.5s;
  color: #0f172a;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 20 20' fill='none'%3E%3Cpath d='M6 8l4 4 4-4' stroke='%2394A3B8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.9rem center;
  background-size: 1.1rem 1.1rem;
  cursor: pointer;
}
.lux-select:hover { border-color: #cbd5e1; }
.lux-select:focus { border-color: #6366f1; }

.lux-mini-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.5rem 0.75rem;
  border-radius: 0.75rem;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  color: #0f172a;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  transition: all 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}
.lux-mini-btn:hover {
  border-color: #cbd5e1;
  transform: translateY(-1px);
  box-shadow: 0 10px 20px -12px rgba(15,23,42,0.18);
}
.lux-mini-btn:active { transform: translateY(0) scale(0.98); }
.lux-mini-btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; box-shadow: none; }

.lux-mini-btn-alt {
  background: #0f172a;
  border-color: #0f172a;
  color: #ffffff;
}
.lux-mini-btn-alt:hover {
  background: #4f46e5;
  border-color: #4f46e5;
}

.lux-max-btn {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.9rem;
  border: 1px solid rgba(226, 232, 240, 0.9);
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(10px);
  color: #0f172a;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 25px -15px rgba(15,23,42,0.25);
  transition: all 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}
.lux-max-btn:hover { transform: translateY(-2px) scale(1.03); border-color: #cbd5e1; }
.lux-max-btn:active { transform: translateY(0) scale(0.97); }

.lux-zoomable { cursor: zoom-in; }

.lux-file-input {
  width: 100%;
  border-radius: 1rem;
  border: 1px solid #e2e8f0;
  background: #fff;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
}
.lux-file-input::file-selector-button {
  margin-right: 1rem;
  border-radius: 0.5rem;
  border: 0;
  background: #0f172a;
  color: #fff;
  padding: 0.5rem 1rem;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.3s;
}
.lux-file-input::file-selector-button:hover { background: #4f46e5; }

/* ── Page thumbnail card ── */
.page-thumb {
  position: relative;
  aspect-ratio: 3/4.2;
  background: #fff;
  border-radius: 2rem;
  padding: 1.25rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  border: 2px solid transparent;
  cursor: pointer;
  overflow: hidden;
  transition: all 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}
.page-thumb:hover {
  border-color: #e2e8f0;
  transform: translateY(-12px);
  box-shadow: 0 25px 50px -12px rgba(0,0,0,0.1);
}
.page-thumb.selected {
  border-color: #6366f1;
  box-shadow: 0 25px 50px -12px rgba(99,102,241,0.2);
  transform: scale(1.05);
  z-index: 10;
}

/* ── Primary action button ── */
.lux-btn-primary {
  width: 100%;
  padding: 1rem 1.5rem;
  background: #0f172a;
  color: #fff;
  border-radius: 1rem;
  font-size: 0.875rem;
  font-weight: 700;
  transition: all 0.5s cubic-bezier(0.22, 1, 0.36, 1);
  box-shadow: 0 10px 25px -5px rgba(15,23,42,0.15);
  position: relative;
  overflow: hidden;
}
.lux-btn-primary:hover {
  background: #4f46e5;
  box-shadow: 0 10px 25px -5px rgba(99,102,241,0.25);
}
.lux-btn-primary:active { transform: scale(0.97); }
.lux-btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
.lux-btn-primary .spinner {
  display: inline-block;
  width: 1rem;
  height: 1rem;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  margin-left: 0.5rem;
  vertical-align: -2px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Shimmer on busy ── */
@keyframes shimmer {
  0% { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}
.shimmer {
  background-size: 200% 200%;
  animation: shimmer 1.4s ease infinite;
}

/* ── Floating background blobs ── */
@keyframes floaty {
  0%   { transform: translate3d(0, 0, 0) scale(1); }
  50%  { transform: translate3d(0, 14px, 0) scale(1.02); }
  100% { transform: translate3d(0, 0, 0) scale(1); }
}
.floaty { animation: floaty 6s ease-in-out infinite; }

/* ── Nav status highlight ── */
#nav-status {
  transition: color 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}
#nav-status.nav-status--busy {
  color: #4f46e5 !important;
}
#nav-status.nav-status--ready {
  color: #94a3b8 !important;
}
#nav-status.nav-status--busy::before,
#nav-status.nav-status--ready::before {
  content: '●';
  display: inline-block;
  margin-right: 0.45rem;
  font-size: 0.6rem;
  vertical-align: 1px;
}
#nav-status.nav-status--busy::before { color: #4f46e5; }
#nav-status.nav-status--ready::before { color: #94a3b8; }

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  .lux-reveal, .stagger-item, .lux-sidebar, .lux-sidebar-r, .lux-modal-in, .lux-toast-in { animation: none; opacity: 1; transform: none; }
  .shimmer, .floaty { animation: none; }
}

/* ── Preview slot in sidebar ── */
.lux-preview-slot {
  border-radius: 1rem;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  overflow-y: auto;
  padding: 0.5rem;
}
.lux-preview-slot img {
  width: 100%;
  border-radius: 0.75rem;
  border: 1px solid #e2e8f0;
  background: #fff;
  cursor: zoom-in;
}

/* ── Scrollbar styling ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }
