* {
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  overscroll-behavior: none;
  background-color: #f8fafc;
}

.dark body,
body.dark {
  background-color: #0f172a;
  color: #e2e8f0;
}

.place-card {
  transition: transform 0.3s ease, opacity 0.3s ease;
  touch-action: none;
  user-select: none;
}

.place-card.dragging {
  transition: none;
}

.place-card.swipe-out-left {
  animation: swipeOutLeft 0.3s ease forwards;
}

.place-card.swipe-out-right {
  animation: swipeOutRight 0.3s ease forwards;
}

.place-card.swipe-out-up {
  animation: swipeOutUp 0.3s ease forwards;
}

@keyframes swipeOutLeft {
  to { transform: translateX(-150%) rotate(-30deg); opacity: 0; }
}

@keyframes swipeOutRight {
  to { transform: translateX(150%) rotate(30deg); opacity: 0; }
}

@keyframes swipeOutUp {
  to { transform: translateY(-150%) scale(0.8); opacity: 0; }
}

.swipe-indicator {
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.toast {
  min-width: 250px;
  padding: 1rem 1.5rem;
  border-radius: 0.75rem;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

* {
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 #f1f5f9;
}

.dark ::-webkit-scrollbar-track { background: #1e293b; }
.dark ::-webkit-scrollbar-thumb { background: #475569; }
.dark ::-webkit-scrollbar-thumb:hover { background: #64748b; }
.dark * { scrollbar-color: #475569 #1e293b; }

#cardStack .place-card:nth-child(2) {
  transform: scale(0.95) translateY(10px);
  opacity: 0.7;
  z-index: 1;
}

#cardStack .place-card:nth-child(3) {
  transform: scale(0.9) translateY(20px);
  opacity: 0.4;
  z-index: 0;
}

#cardStack .place-card:first-child {
  z-index: 10;
}

.place-card * {
  user-select: none;
  -webkit-user-select: none;
}

button:active {
  transform: scale(0.95);
}

#pasteModal, #helpModal, #logoutModal, #filtersModal {
  backdrop-filter: blur(4px);
}

.dark .bg-white { background-color: #1e293b !important; color: #e2e8f0; }
.dark .bg-white\/80 { background-color: rgba(30, 41, 59, 0.8) !important; }
.dark .bg-white\/90 { background-color: rgba(30, 41, 59, 0.9) !important; }
.dark .bg-slate-50 { background-color: #0f172a !important; }
.dark .bg-slate-100 { background-color: #1e293b !important; }
.dark .text-slate-800 { color: #f1f5f9 !important; }
.dark .text-slate-700 { color: #e2e8f0 !important; }
.dark .text-slate-600 { color: #cbd5e1 !important; }
.dark .text-slate-500 { color: #94a3b8 !important; }
.dark .text-slate-400 { color: #64748b !important; }
.dark .border-slate-100 { border-color: #334155 !important; }
.dark .border-slate-200,
.dark .border-slate-200\/50 { border-color: #334155 !important; }
.dark .from-slate-50 { --tw-gradient-from: #0f172a !important; }
.dark .to-blue-50 { --tw-gradient-to: #1e293b !important; }
.dark .from-slate-100 { --tw-gradient-from: #1e293b !important; }
.dark .to-slate-200 { --tw-gradient-to: #334155 !important; }
.dark .bg-cyan-50 { background-color: rgba(8, 145, 178, 0.2) !important; }
.dark .bg-blue-50 { background-color: rgba(37, 99, 235, 0.2) !important; }
.dark .bg-blue-50\/50 { background-color: rgba(37, 99, 235, 0.15) !important; }
.dark .border-blue-100 { border-color: rgba(37, 99, 235, 0.4) !important; }
.dark .text-blue-800\/80 { color: #93c5fd !important; }
.dark .from-slate-800 { --tw-gradient-from: #f1f5f9 !important; }
.dark .to-slate-600 { --tw-gradient-to: #cbd5e1 !important; }

@media (max-width: 640px) {
  .container {
    padding-left: 1rem;
    padding-right: 1rem;
  }
}

.diff-row {
  display: grid;
  grid-template-columns: auto 1fr 1fr;
  gap: 0.5rem;
  align-items: center;
  padding: 0.5rem 0;
  border-bottom: 1px solid #f1f5f9;
}

.dark .diff-row {
  border-bottom-color: #334155;
}

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

.diff-from {
  color: #dc2626;
  text-decoration: line-through;
  font-size: 0.75rem;
  word-break: break-word;
}

.diff-to {
  color: #16a34a;
  font-weight: 600;
  font-size: 0.75rem;
  word-break: break-word;
}

.dark .diff-from { color: #f87171; }
.dark .diff-to { color: #4ade80; }

.card-content {
  min-height: 0;
}

.card-content .card-name {
  font-size: 1.35rem;
  line-height: 1.2;
}

.undo-banner {
  position: fixed;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  background: #1e293b;
  color: white;
  padding: 0.75rem 1.25rem;
  border-radius: 0.75rem;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.875rem;
  animation: slideUp 0.3s ease;
}

.undo-banner button {
  background: #f59e0b;
  color: #1f2937;
  border: none;
  padding: 0.375rem 0.75rem;
  border-radius: 0.5rem;
  font-weight: 600;
  cursor: pointer;
}

@keyframes slideUp {
  from { transform: translate(-50%, 100px); opacity: 0; }
  to { transform: translate(-50%, 0); opacity: 1; }
}
