/* PayGo Global Styles */
::selection {
  background: rgba(51, 128, 255, 0.2);
}

/* Smooth scroll behaviour is set via HTML class="scroll-smooth" */

/* Modal backdrop */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-content {
  background: white;
  border-radius: 1rem;
  padding: 1.5rem;
  max-width: 32rem;
  width: calc(100% - 2rem);
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.dark .modal-content {
  background: #1e293b;
}

/* Toast notifications */
.toast-container {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast {
  padding: 0.75rem 1.25rem;
  border-radius: 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  animation: slideIn 0.3s ease;
  max-width: 24rem;
}

.toast-success { background: #059669; color: white; }
.toast-error { background: #dc2626; color: white; }
.toast-info { background: #2563eb; color: white; }

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

/* Status badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.125rem 0.625rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

.badge-pending { background: #fef3c7; color: #92400e; }
.badge-awaiting { background: #dbeafe; color: #1e40af; }
.badge-paid { background: #d1fae5; color: #065f46; }
.badge-processing { background: #e0e7ff; color: #3730a3; }
.badge-completed { background: #d1fae5; color: #065f46; }
.badge-cancelled { background: #fee2e2; color: #991b1b; }
.badge-refunded { background: #f3e8ff; color: #6b21a8; }

.dark .badge-pending { background: #78350f; color: #fef3c7; }
.dark .badge-awaiting { background: #1e3a5f; color: #93c5fd; }
.dark .badge-paid { background: #064e3b; color: #6ee7b7; }
.dark .badge-processing { background: #312e81; color: #a5b4fc; }
.dark .badge-completed { background: #064e3b; color: #6ee7b7; }
.dark .badge-cancelled { background: #7f1d1d; color: #fca5a5; }
.dark .badge-refunded { background: #581c87; color: #d8b4fe; }

/* Loading spinner */
.spinner {
  width: 2rem;
  height: 2rem;
  border: 3px solid #e2e8f0;
  border-top-color: #3380ff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

.spinner-current {
  display: inline-block;
  width: 1rem;
  height: 1rem;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

.spinner-sm {
  display: inline-block;
  width: 1.25rem;
  height: 1.25rem;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

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

/* Form styles */
.form-input {
  width: 100%;
  padding: 0.625rem 0.875rem;
  border: none;
  border-radius: 0.75rem;
  font-size: 0.875rem;
  transition: background-color 0.15s;
  background: #f1f5f9;
  color: #0f172a;
}

.form-input:hover {
  background: #e9eef5;
}

.form-input:focus {
  outline: none;
  background: #e2e8f0;
}

.dark .form-input {
  background: #1e293b;
  color: #f1f5f9;
}

.dark .form-input:hover {
  background: #243247;
}

.dark .form-input:focus {
  background: #2b3a52;
}

.form-input[type="file"] {
  padding: 0.5rem;
}

.form-input::file-selector-button {
  margin-right: 0.75rem;
  padding: 0.375rem 0.75rem;
  border: none;
  border-radius: 0.5rem;
  background: rgba(51, 128, 255, 0.12);
  color: #2563eb;
  font-weight: 500;
  cursor: pointer;
}

.dark .form-input::file-selector-button {
  color: #7ab0ff;
}

/* Password show/hide toggle */
.pw-wrap {
  position: relative;
}

.pw-wrap .form-input {
  padding-right: 2.75rem;
}

.pw-wrap input::-ms-reveal,
.pw-wrap input::-ms-clear {
  display: none;
}

.pw-toggle {
  position: absolute;
  top: 50%;
  right: 0.5rem;
  transform: translateY(-50%);
  padding: 0.375rem;
  border-radius: 0.5rem;
  color: #94a3b8;
  line-height: 0;
  transition: color 0.15s;
}

.pw-toggle:hover {
  color: #3380ff;
}

.pw-toggle svg {
  width: 1.125rem;
  height: 1.125rem;
}

.btn-primary {
  padding: 0.625rem 1.25rem;
  background: #3380ff;
  color: white;
  font-weight: 600;
  border-radius: 0.75rem;
  font-size: 0.875rem;
  transition: background 0.15s;
  border: none;
  cursor: pointer;
}

.btn-primary:hover { background: #1a5ff5; }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-secondary {
  padding: 0.625rem 1.25rem;
  background: #f1f5f9;
  border: none;
  color: #334155;
  font-weight: 600;
  border-radius: 0.75rem;
  font-size: 0.875rem;
  transition: background-color 0.15s, color 0.15s;
  cursor: pointer;
}

.btn-secondary:hover { background: #e2e8f0; color: #0f172a; }
.dark .btn-secondary { background: #1e293b; color: #e2e8f0; }
.dark .btn-secondary:hover { background: #334155; color: #f8fafc; }

/* Links: color change on hover instead of underline */
.link-hover { transition: color 0.15s; }
.link-hover:hover { color: #1a5ff5; }
.dark .link-hover:hover { color: #93bbff; }

/* Small action buttons (tables, lists) */
.action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  padding: 0.375rem 0.625rem;
  border: none;
  border-radius: 0.5rem;
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.25rem;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s;
}

.action-btn svg { width: 1rem; height: 1rem; flex-shrink: 0; }
.action-btn.icon-only { padding: 0.375rem; }
.action-btn:disabled { opacity: 0.6; cursor: not-allowed; }

.action-btn-primary { background: rgba(51, 128, 255, 0.1); color: #2563eb; }
.action-btn-primary:hover { background: rgba(51, 128, 255, 0.2); }
.dark .action-btn-primary { color: #7ab0ff; }

.action-btn-warning { background: rgba(245, 158, 11, 0.12); color: #b45309; }
.action-btn-warning:hover { background: rgba(245, 158, 11, 0.22); }
.dark .action-btn-warning { color: #fbbf24; }

.action-btn-success { background: rgba(16, 185, 129, 0.12); color: #047857; }
.action-btn-success:hover { background: rgba(16, 185, 129, 0.22); }
.dark .action-btn-success { color: #34d399; }

.action-btn-danger { background: rgba(239, 68, 68, 0.1); color: #dc2626; }
.action-btn-danger:hover { background: rgba(239, 68, 68, 0.2); }
.dark .action-btn-danger { color: #f87171; }

/* Pagination */
.pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  font-size: 0.8125rem;
  color: #64748b;
}

.dark .pagination { color: #94a3b8; }

.page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  height: 2rem;
  padding: 0 0.5rem;
  border: none;
  border-radius: 0.5rem;
  background: transparent;
  color: inherit;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s;
}

.page-btn svg { width: 1rem; height: 1rem; }
.page-btn:hover:not(:disabled):not(.active) { background: #f1f5f9; color: #0f172a; }
.dark .page-btn:hover:not(:disabled):not(.active) { background: #1e293b; color: #f1f5f9; }
.page-btn.active { background: #3380ff; color: white; cursor: default; }
.page-btn:disabled { opacity: 0.35; cursor: not-allowed; }

/* Product cards */
.product-card {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
}

.product-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
}

.dark .product-card {
  background: #1e293b;
  border-color: #334155;
}

/* Admin sidebar */
.admin-sidebar {
  position: sticky;
  top: 0;
  width: 16rem;
  height: 100vh;
  overflow-y: auto;
  background: white;
  padding: 1rem;
}

.dark .admin-sidebar {
  background: #0f172a;
}

.admin-nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 0.875rem;
  border-radius: 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #64748b;
  transition: all 0.15s;
  cursor: pointer;
  text-decoration: none;
}

.admin-nav-item:hover,
.admin-nav-item.active {
  background: #f1f5f9;
  color: #0f172a;
}

.dark .admin-nav-item:hover,
.dark .admin-nav-item.active {
  background: #1e293b;
  color: #f1f5f9;
}

/* Table */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.data-table th {
  text-align: left;
  padding: 0.75rem;
  font-weight: 600;
  color: #64748b;
  background: #f8fafc;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.dark .data-table th {
  background: #172033;
  color: #94a3b8;
}

.data-table td {
  padding: 0.75rem;
}

.data-table tr:hover td {
  background: #f8fafc;
}

.dark .data-table tr:hover td {
  background: #1e293b;
}
