/* Base & Paper Craft Styling */
:root {
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

.safe-top {
  padding-top: var(--safe-top);
}

.safe-bottom-bar {
  padding-bottom: calc(10px + var(--safe-bottom));
}

body {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  background-color: #F7F6F2;
  background-image: radial-gradient(#E5E3DC 0.75px, transparent 0.75px);
  background-size: 16px 16px;
  font-family: 'Tajawal', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* Active orientation/margin button states */
.active-orient, .active-margin, .active-fmt, .active-scale {
  background-color: #FFFFFF !important;
  color: #0D9488 !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* Drag and Drop Card Styles */
.image-card {
  transition: transform 0.2s cubic-bezier(0.2, 1, 0.3, 1), box-shadow 0.2s ease, opacity 0.2s ease;
  user-select: none;
}

.image-card.is-dragging {
  opacity: 0.4;
  transform: scale(0.96);
}

.image-card.drag-over {
  border-color: #0D9488 !important;
  box-shadow: 0 0 0 2px rgba(13, 148, 136, 0.3) !important;
  transform: scale(1.02);
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.98); }
  to { opacity: 1; transform: scale(1); }
}

.animate-fade-in {
  animation: fadeIn 0.2s ease-out forwards;
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(100%); }
  to { opacity: 1; transform: translateY(0); }
}

.animate-slide-up {
  animation: slideUp 0.28s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Toast Styles */
.toast-item {
  animation: slideToast 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  pointer-events: auto;
}

@keyframes slideToast {
  from { opacity: 0; transform: translateY(12px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Custom Scrollbar for Previews */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: #DDD9CF;
  border-radius: 9999px;
}
::-webkit-scrollbar-thumb:hover {
  background: #B8B3A4;
}