/* Global Styles */
* {
  box-sizing: border-box;
}

body {
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  line-height: 1.6;
}

/* Animations */
.slide-up {
  animation: slideUp 0.25s ease-out;
}

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

.shake {
  animation: shake 0.3s ease-in-out;
}

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

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes shake {
  0%, 100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-8px);
  }
  75% {
    transform: translateX(8px);
  }
}

@keyframes shimmer {
  0% {
    background-position: -200px 0;
  }
  100% {
    background-position: calc(200px + 100%) 0;
  }
}

.skeleton {
  background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
  background-size: 200px 100%;
  animation: shimmer 1.5s infinite;
}

.dark .skeleton {
  background: linear-gradient(90deg, #334155 25%, #475569 50%, #334155 75%);
  background-size: 200px 100%;
}

/* Page Visibility */
.page {
  display: none;
}

.page.active {
  display: block;
}

/* Modal */
.modal-backdrop {
  backdrop-filter: blur(4px);
}

/* Sell modal — payment type tabs */
.pay-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.pay-tab {
  flex: 1 1 auto;
  min-width: 4.5rem;
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 500;
  text-align: center;
  border: 1px solid #e2e8f0;
  background: #f1f5f9;
  color: #64748b;
  cursor: pointer;
  transition: background-color 0.2s, border-color 0.2s, color 0.2s;
}

.dark .pay-tab {
  background: #334155;
  border-color: #475569;
  color: #94a3b8;
}

.pay-tab:hover:not(.active) {
  background: #e2e8f0;
}

.dark .pay-tab:hover:not(.active) {
  background: #475569;
}

.pay-tab.active {
  background: #3b82f6;
  border-color: #3b82f6;
  color: #fff;
}

.dark .pay-tab.active {
  background: #3b82f6;
  border-color: #3b82f6;
  color: #fff;
}

/* TomSelect Customization */
.ts-wrapper .ts-control {
  min-height: 42px;
  border-radius: 10px;
}

.ts-wrapper.single .ts-control {
  padding: 8px 12px;
}

.dark .ts-wrapper .ts-control {
  background: #1e293b;
  border-color: #334155;
  color: #f1f5f9;
}

.dark .ts-dropdown {
  background: #1e293b;
  border-color: #334155;
  color: #f1f5f9;
}

.dark .ts-dropdown .option {
  color: #f1f5f9;
}

.dark .ts-dropdown .active {
  background: #334155;
}

/* Scrollbar Hiding */
.hide-scrollbar::-webkit-scrollbar {
  display: none;
}

.hide-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* Safe Area */
.safe-bottom {
  padding-bottom: env(safe-area-inset-bottom, 0);
}

/* Number Input Spinner */
input[type='number']::-webkit-inner-spin-button {
  -webkit-appearance: none;
}

/* File Upload Styles */
.file-preview-container {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.file-preview-item {
  position: relative;
  width: 80px;
  height: 80px;
  border-radius: 12px;
  overflow: hidden;
}

.file-preview-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.file-remove-btn {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 24px;
  height: 24px;
  background: rgba(0, 0, 0, 0.7);
  border: none;
  border-radius: 50%;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}

.file-remove-btn:hover {
  background: rgba(0, 0, 0, 0.9);
}

.document-upload-section {
  border: 2px dashed #e2e8f0;
  border-radius: 12px;
  padding: 16px;
  margin: 12px 0;
}

.dark .document-upload-section {
  border-color: #334155;
}

.document-list {
  list-style: none;
  padding: 0;
  margin: 8px 0 0 0;
}

.document-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px;
  background: #f1f5f9;
  border-radius: 8px;
  margin-bottom: 8px;
  font-size: 12px;
}

.dark .document-list-item {
  background: #1e293b;
}

.document-list-item-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.document-remove-icon {
  cursor: pointer;
  margin-left: 8px;
  color: #ef4444;
}

.document-remove-icon:hover {
  color: #dc2626;
}
