/* General Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: #0b0c10;
  color: #c5c6c7;
  line-height: 1.6;
}

.app-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

/* Header & Logo */
.app-header {
  margin-bottom: 30px;
  border-bottom: 2px solid #1f2833;
  padding-bottom: 20px;
}

.logo-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 15px;
}

.logo-container h1 {
  color: #ffffff;
  font-size: 2.2rem;
  font-weight: 800;
}

.logo-container h1 span {
  color: #ff4a00;
}

.dev-credits {
  font-size: 0.85rem;
  color: #888;
  margin-top: 4px;
  font-weight: 500;
}

.auth-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.admin-badge {
  background-color: #ff4a00;
  color: #ffffff;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: bold;
  border: 1px solid #ff4a00;
  box-shadow: 0 0 5px rgba(255, 74, 0, 0.4);
}

/* Stats Banner */
.stats-banner {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 15px;
  margin-top: 20px;
}

.stat-card {
  background-color: #1f2833;
  padding: 15px;
  border-radius: 8px;
  text-align: center;
  border: 1px solid #45f3ff33;
}

.stat-value {
  font-size: 1.8rem;
  font-weight: 700;
  color: #45f3ff;
}

.stat-label {
  font-size: 0.9rem;
  color: #c5c6c7;
  text-transform: uppercase;
  margin-top: 5px;
}

/* Containers */
.card-container {
  background-color: #1f2833;
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 25px;
  border: 1px solid #2f3e46;
}

h2 {
  color: #ffffff;
  font-size: 1.4rem;
  margin-bottom: 15px;
}

/* Forms & Inputs */
.import-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.import-form button {
  align-self: flex-end;
}

textarea,
input[type="url"],
input[type="text"],
input[type="number"],
select {
  width: 100%;
  padding: 12px 15px;
  border-radius: 6px;
  border: 1px solid #66fcf1;
  background-color: #0b0c10;
  color: #ffffff;
  font-size: 1rem;
  font-family: inherit;
}

textarea {
  resize: vertical;
  min-height: 100px;
}

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: #ff4a00;
}

button {
  padding: 12px 24px;
  border-radius: 6px;
  border: none;
  background-color: #ff4a00;
  color: #ffffff;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s;
}

button:hover {
  background-color: #e03e00;
}

.btn-secondary {
  background-color: #455a64;
}

.btn-secondary:hover {
  background-color: #37474f;
}

/* Status Messages */
.status-msg {
  margin-top: 10px;
  padding: 10px;
  border-radius: 5px;
  font-weight: 600;
}

.status-msg.error {
  background-color: #b71c1c;
  color: #ffffff;
}

.status-msg.success {
  background-color: #1b5e20;
  color: #ffffff;
}

.status-msg.info {
  background-color: #028090;
  color: #ffffff;
  border: 1px solid #66fcf1;
}

.status-msg.loading {
  background-color: #e65100;
  color: #ffffff;
}

.hidden {
  display: none !important;
}

.controls-section {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.search-bar {
  width: 100%;
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

/* Section Headers */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.card-count-badge {
  background-color: #ff4a00;
  color: white;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
}

/* Card Grid */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}

.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 50px 20px;
  background-color: #1f2833;
  border-radius: 8px;
  color: #888;
}

/* Inventory Card Component */
.card-item {
  background-color: #1f2833;
  border-radius: 10px;
  border: 1px solid #2f3e46;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.card-body {
  display: flex;
  padding: 15px;
  gap: 15px;
}

.card-img-container {
  width: 100px;
  height: 140px;
  flex-shrink: 0;
  background-color: #0b0c10;
  border-radius: 4px;
  overflow: hidden;
}

.card-img-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.card-number-rarity {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 5px;
}

.card-number {
  font-size: 0.85rem;
  color: #ff4a00;
  font-weight: 600;
}

.card-rarity {
  background-color: #0b0c10;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: bold;
  border: 1px solid #66fcf1;
}

.card-title {
  color: #ffffff;
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 2px;
  line-height: 1.2;
}

.card-set {
  font-size: 0.8rem;
  color: #888;
}

.prices-row {
  display: flex;
  justify-content: space-between;
  background-color: #0b0c10;
  padding: 10px;
  margin: 10px 15px;
  border-radius: 6px;
  border: 1px dashed #2f3e46;
}

.price-item {
  text-align: center;
}

.price-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  color: #888;
}

.price-value {
  font-size: 0.95rem;
  font-weight: 700;
  color: #66fcf1;
}

.price-value.empty {
  color: #555;
  font-weight: normal;
}

/* Stock Section inside Card */
.card-stock-section {
  padding: 0 15px 15px 15px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.stock-title {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: #ffffff;
  border-bottom: 1px solid #2f3e46;
  padding-bottom: 4px;
}

.stock-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  margin-bottom: 10px;
}

.stock-table th, .stock-table td {
  text-align: left;
  padding: 6px 4px;
}

.stock-table th {
  color: #888;
  font-weight: normal;
  border-bottom: 1px solid #0b0c10;
}

.stock-qty {
  font-weight: bold;
  color: #ffffff;
}

.stock-actions {
  text-align: right;
  display: flex;
  gap: 5px;
  justify-content: flex-end;
}

.btn-icon {
  background: none;
  padding: 2px 6px;
  font-size: 0.8rem;
  border-radius: 4px;
  cursor: pointer;
  color: #fff;
  border: 1px solid #555;
}

.btn-icon:hover {
  background-color: #2f3e46;
}

.btn-icon.delete {
  border-color: #d32f2f;
  color: #e57373;
}

.btn-icon.delete:hover {
  background-color: #b71c1c;
  color: #fff;
}

.card-actions {
  display: flex;
  padding: 10px 15px;
  background-color: #0b0c10;
  gap: 10px;
  margin-top: auto;
}

.card-actions button {
  flex: 1;
  padding: 8px 12px;
  font-size: 0.85rem;
}

.card-actions .btn-danger {
  background-color: #b71c1c;
}

.card-actions .btn-danger:hover {
  background-color: #810000;
}

.card-actions-visitor {
  display: flex;
  padding: 10px 15px;
  background-color: #0b0c10;
  gap: 10px;
  margin-top: auto;
  border-top: 1px solid #2f3e46;
}

.card-actions-visitor button {
  flex: 1;
  padding: 10px 15px;
  font-size: 0.9rem;
  font-weight: 600;
  background: linear-gradient(135deg, #ff4a00, #ff7b00);
  border-radius: 4px;
}

.card-actions-visitor button:hover {
  background: linear-gradient(135deg, #e03e00, #e05e00);
}

/* Modal styles */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  display: flex;
  justify-content: center;
  align-items: flex-start; /* Align to top to allow scroll spacing */
  overflow-y: auto; /* Enable vertical scrolling */
  padding: 40px 10px; /* Margin at top/bottom and sides */
  z-index: 1000;
}

.modal::-webkit-scrollbar {
  width: 8px;
}

.modal::-webkit-scrollbar-track {
  background: #0b0c10;
}

.modal::-webkit-scrollbar-thumb {
  background: #ff4a00;
  border-radius: 4px;
}

.modal::-webkit-scrollbar-thumb:hover {
  background: #e03e00;
}

.modal-content {
  width: 90%;
  max-width: 450px;
  margin-bottom: 0; /* Override */
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.close-btn {
  background: none;
  color: #fff;
  font-size: 1.5rem;
  padding: 0 5px;
  cursor: pointer;
}

.close-btn:hover {
  background: none;
  color: #ff4a00;
}

.form-group {
  margin-bottom: 15px;
}

.form-group label {
  display: block;
  font-size: 0.9rem;
  margin-bottom: 5px;
  color: #fff;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}

.price-input-container {
  display: flex;
  gap: 10px;
  align-items: center;
}

.price-input-container input {
  flex: 1;
}

.btn-small {
  padding: 8px 12px;
  font-size: 0.85rem;
  height: 100%;
  white-space: nowrap;
}

.btn-secondary.active {
  background-color: #ff4a00;
  color: #ffffff;
}

.btn-secondary.active:hover {
  background-color: #e03e00;
}

/* Mobile responsive fixes */
@media (max-width: 600px) {
  .import-form {
    flex-direction: column;
  }
  
  .import-form button {
    width: 100%;
    align-self: stretch;
  }

  .stats-banner {
    grid-template-columns: 1fr;
  }

  .card-grid {
    grid-template-columns: 1fr;
  }

  .page-size-container {
    margin-left: 0 !important;
    width: 100%;
    justify-content: center;
    margin-top: 10px;
  }
}

/* Pagination Controls */
.pagination-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 15px;
  margin-top: 30px;
  margin-bottom: 30px;
  background-color: #1f2833;
  padding: 15px;
  border-radius: 8px;
  border: 1px solid #2f3e46;
  flex-wrap: wrap;
}

.page-indicator {
  font-weight: 600;
  color: #ffffff;
}

.page-size-container {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.page-size-select {
  padding: 6px 10px;
  border-radius: 4px;
  font-size: 0.9rem;
  max-width: 80px;
  border: 1px solid #66fcf1;
  background-color: #0b0c10;
  color: #ffffff;
}

/* ==========================================
   ADMIN NAVIGATION TABS
   ========================================== */
.admin-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 25px;
  border-bottom: 2px solid #1f2833;
  padding-bottom: 10px;
  overflow-x: auto;
}

.admin-tabs .tab-btn {
  background: none;
  border: 1px solid transparent;
  color: #c5c6c7;
  padding: 10px 18px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  border-radius: 6px 6px 0 0;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.admin-tabs .tab-btn:hover {
  color: #66fcf1;
  background-color: rgba(102, 252, 241, 0.05);
}

.admin-tabs .tab-btn.active {
  color: #1f2833;
  background-color: #66fcf1;
  border: 1px solid #66fcf1;
  box-shadow: 0 -2px 10px rgba(102, 252, 241, 0.2);
}

.tab-content {
  animation: fadeIn 0.3s ease;
}

.tab-content.hidden {
  display: none !important;
}

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

/* ==========================================
   CLIENT INFO & AUTH CONTROLS
   ========================================== */
.client-info-container {
  display: flex;
  align-items: center;
  gap: 12px;
}

#client-welcome-msg {
  font-size: 0.9rem;
  font-weight: 600;
  color: #66fcf1;
}

.btn-link, .btn-link-help {
  background: none;
  border: none;
  color: #66fcf1;
  cursor: pointer;
  text-decoration: underline;
  font-size: 0.9rem;
  padding: 0;
  transition: color 0.2s;
}

.btn-link:hover, .btn-link-help:hover {
  color: #45f3ff;
}

/* ==========================================
   MODAL TOGGLE & FORM WIDGETS
   ========================================== */
.bidding-toggle-container {
  display: flex;
  border: 1px solid #45f3ff;
  border-radius: 6px;
  overflow: hidden;
  background-color: #1f2833;
  margin-top: 5px;
}

.bidding-toggle-container .toggle-option {
  flex: 1;
  text-align: center;
  padding: 10px;
  cursor: pointer;
  transition: all 0.2s;
  font-weight: 600;
  color: #888;
  background: none;
}

.bidding-toggle-container .toggle-option.active {
  background-color: #45f3ff;
  color: #1f2833;
}

.bid-helpers-container {
  margin-top: 10px;
}

.bid-helper-buttons {
  display: flex;
  gap: 8px;
}

.btn-helper {
  flex: 1;
  padding: 6px !important;
  font-size: 0.8rem !important;
  font-weight: bold;
}

.fb-help-box {
  background-color: #0b0c10;
  border: 1px solid #45f3ff;
  border-radius: 6px;
  padding: 12px;
  margin: 10px 0;
}

.fb-help-box h4 {
  color: #66fcf1;
  font-size: 0.9rem;
  margin-bottom: 8px;
}

.fb-help-box ol {
  padding-left: 18px;
  font-size: 0.8rem;
  color: #c5c6c7;
}

.fb-help-box li {
  margin-bottom: 6px;
}

/* ==========================================
   TABLES & BADGES
   ========================================== */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  margin: 15px 0;
  border-radius: 8px;
  border: 1px solid #1f2833;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  background-color: #1f2833;
  font-size: 0.9rem;
}

.admin-table th, .admin-table td {
  padding: 12px 15px;
  border-bottom: 1px solid #2d3748;
}

.admin-table th {
  background-color: #1a202c;
  color: #66fcf1;
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.8rem;
}

.admin-table tbody tr:hover {
  background-color: rgba(102, 252, 241, 0.03);
}

.badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-pending {
  background-color: rgba(255, 170, 0, 0.15);
  color: #ffaa00;
  border: 1px solid #ffaa00;
}

.badge-accepted, .badge-delivered, .badge-paid {
  background-color: rgba(76, 175, 80, 0.15);
  color: #4caf50;
  border: 1px solid #4caf50;
}

.badge-rejected, .badge-cancelled {
  background-color: rgba(244, 67, 54, 0.15);
  color: #f44336;
  border: 1px solid #f44336;
}

.badge-outbid {
  background-color: rgba(255, 94, 98, 0.15);
  color: #ff5e62;
  border: 1px solid #ff5e62;
}

.badge-bin {
  background-color: rgba(102, 252, 241, 0.15);
  color: #66fcf1;
  border: 1px solid #66fcf1;
}

.badge-shipped {
  background-color: rgba(0, 150, 136, 0.15);
  color: #009688;
  border: 1px solid #009688;
}

/* ==========================================
   MANUAL ORDER BUILDER STYLES
   ========================================== */
.order-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 25px;
  margin-bottom: 25px;
}

@media (max-width: 900px) {
  .order-grid {
    grid-template-columns: 1fr;
  }
}

.order-client-info, .order-items-info {
  background-color: rgba(31, 40, 51, 0.5);
  padding: 20px;
  border-radius: 8px;
  border: 1px solid #2d3748;
}

.order-client-info h3, .order-items-info h3, .order-payment-details h3, .order-detail-body h3 {
  margin-top: 0;
  margin-bottom: 15px;
  color: #ffffff;
  font-size: 1.1rem;
  border-left: 3px solid #66fcf1;
  padding-left: 8px;
}

/* Autocomplete Card Search Dropdown */
.select-card-container {
  position: relative;
}

.search-results-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background-color: #1f2833;
  border: 1px solid #45f3ff;
  border-radius: 0 0 6px 6px;
  max-height: 220px;
  overflow-y: auto;
  z-index: 100;
  box-shadow: 0 5px 15px rgba(0,0,0,0.5);
}

.search-result-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  cursor: pointer;
  border-bottom: 1px solid #2d3748;
  font-size: 0.85rem;
  transition: background 0.15s;
}

.search-result-item:hover {
  background-color: rgba(102, 252, 241, 0.08);
}

.search-result-item img {
  width: 30px;
  height: 42px;
  object-fit: cover;
  border-radius: 3px;
}

.search-result-item .result-card-info {
  display: flex;
  flex-direction: column;
}

.search-result-item .result-card-name {
  color: #ffffff;
  font-weight: 600;
}

.search-result-item .result-card-meta {
  color: #888;
  font-size: 0.75rem;
}

/* Selected item editor bar */
.add-item-bar {
  background-color: #0b0c10;
  border: 1px solid #45f3ff;
  padding: 12px;
  border-radius: 6px;
  margin-bottom: 15px;
  animation: fadeIn 0.2s ease;
}

.adder-details {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
  font-size: 0.9rem;
}

.adder-controls {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr 1fr auto;
  gap: 10px;
  align-items: flex-end;
}

.adder-controls button {
  padding: 8px 15px;
  height: 38px;
}

/* Cart table inside Order Creator */
.order-items-table, .detail-items-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  margin-top: 15px;
}

.order-items-table th, .order-items-table td, .detail-items-table th, .detail-items-table td {
  padding: 8px 10px;
  border-bottom: 1px solid #2d3748;
  text-align: left;
}

.order-items-table th, .detail-items-table th {
  color: #888;
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
}

.order-total-bar {
  display: flex;
  justify-content: flex-end;
  margin-top: 15px;
  font-size: 1rem;
}

.order-total-bar span {
  color: #ffffff;
}

.order-total-bar strong {
  color: #66fcf1;
  font-size: 1.2rem;
  margin-left: 5px;
}

/* Payment Info Grid */
.order-payment-details {
  background-color: rgba(31, 40, 51, 0.5);
  padding: 20px;
  border-radius: 8px;
  border: 1px solid #2d3748;
  margin-bottom: 25px;
}

.order-payment-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
}

.order-form-actions {
  display: flex;
  gap: 15px;
}

/* Overlay & Tooltip descriptions */
.help-tooltip {
  display: inline-block;
  cursor: help;
  background-color: #2d3748;
  color: #ffffff;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  text-align: center;
  font-size: 0.75rem;
  line-height: 16px;
  margin-left: 4px;
}

