/* =============================================
   Zoe Elan POS - Custom overrides for Tabler
   ============================================= */

/* Reduce top gap between navbar and page content */
.page-wrapper { padding-top: 0 !important; margin-top: 0 !important; }
.page-body { padding-top: 0.75rem !important; margin-top: 0 !important; }
.page-body > .container-xl { padding-top: 0 !important; }
.page-header { margin-top: 0 !important; }

/* Clickable table rows */
tr[data-href] { cursor: pointer; }
tr[data-href]:hover { background: #fdf8ec !important; }

/* POS Terminal Layout */
.pos-container { display: flex; gap: 1rem; height: calc(100vh - 160px); }
.pos-left { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.pos-right { width: 420px; display: flex; flex-direction: column; gap: 0.75rem; }
.pos-cart { flex: 1; overflow-y: auto; }
.pos-cart input[type="number"] { width: 65px; }
.pos-totals .row { padding: 0.15rem 0; }
.pos-grand-total { font-size: 1.4rem; font-weight: 700; border-top: 2px solid #dee2e6; padding-top: 0.5rem; margin-top: 0.25rem; }
.pos-shift-info { font-size: 0.75rem; text-align: center; margin-top: 0.5rem; }

/* Payment button group */
.payment-methods { display: flex; gap: 0.4rem; flex-wrap: wrap; margin-bottom: 0.75rem; }
.btn-payment { border: 2px solid #dee2e6; background: #fff; }
.btn-payment.active { border-color: #d4a843; background: #fdf8ec; color: #1a1a1a; }

/* Product thumbnail */
.product-thumb { width: 40px; height: 40px; border-radius: 4px; overflow: hidden; flex-shrink: 0; background: #f1f3f5; }
.product-thumb img { width: 100%; height: 100%; object-fit: cover; }
.product-thumb-placeholder {
  width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 1rem; color: #adb5bd;
}

/* Image upload */
.image-upload-area {
  border: 2px dashed #dee2e6; border-radius: 4px; min-height: 160px;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  transition: border-color 0.15s; background: #f8f9fa; overflow: hidden;
}
.image-upload-area:hover { border-color: #d4a843; }
.image-preview { width: 100%; height: 160px; object-fit: contain; }

/* File upload zone */
.file-upload-zone {
  border: 2px dashed #dee2e6; border-radius: 4px; padding: 2rem;
  display: flex; flex-direction: column; align-items: center; gap: 0.35rem;
  cursor: pointer; transition: border-color 0.15s, background 0.15s; background: #f8f9fa;
}
.file-upload-zone:hover { border-color: #d4a843; background: #fdf8ec; }

/* Form grid for product form */
.form-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 1rem; }

/* Input with inline add button */
.input-with-action { display: flex; gap: 0.35rem; }
.input-with-action .form-select, .input-with-action .form-control { flex: 1; }

/* Inline form for category add */
.inline-form-row { display: flex; gap: 0.5rem; align-items: flex-start; }
.inline-form-row .form-control { flex: 1; }

/* Category edit form */
.cat-edit-form { display: flex; gap: 0.35rem; }
.cat-edit-form .form-control { flex: 1; }

/* Page constraints */
.import-layout, .categories-layout { max-width: 720px; }

/* Search dropdown (POS) */
.search-dropdown {
  position: absolute; top: 100%; left: 0; right: 0; background: #fff;
  border: 1px solid #dee2e6; border-radius: 4px; box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  max-height: 300px; overflow-y: auto; z-index: 20;
}
.search-dropdown .search-item { padding: 0.5rem 0.75rem; cursor: pointer; border-bottom: 1px solid #f1f3f5; }
.search-dropdown .search-item:hover { background: #fdf8ec; }

/* Toast notifications */
.toast-container {
  position: fixed; top: 20px; right: 20px; z-index: 9999;
}

/* Help Tooltips */
.help-tip {
  display: inline-flex; align-items: center; justify-content: center;
  width: 16px; height: 16px; border-radius: 50%;
  background: #e2e8f0; color: #64748b; font-size: 10px; font-weight: 700;
  cursor: help; position: relative; margin-left: 4px; vertical-align: middle;
  text-decoration: none; line-height: 1;
}
.help-tip:hover, .help-tip:focus { background: #cbd5e1; color: #475569; outline: none; }
.help-tip:hover::after, .help-tip:focus::after {
  content: attr(data-tooltip);
  position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%);
  background: #1e293b; color: #fff; padding: 6px 10px; border-radius: 6px;
  font-size: 12px; font-weight: 400; white-space: normal; width: max-content; max-width: 250px;
  z-index: 1000; line-height: 1.4; box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.help-tip:hover::before, .help-tip:focus::before {
  content: ''; position: absolute; bottom: calc(100% + 2px); left: 50%; transform: translateX(-50%);
  border: 5px solid transparent; border-top-color: #1e293b; z-index: 1000;
}

/* Floating Help Button */
.floating-help-btn {
  position: fixed; bottom: 20px; right: 20px; width: 48px; height: 48px;
  border-radius: 50%; background: #1e293b; color: #fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2); text-decoration: none;
  z-index: 1000; transition: transform 0.2s, background 0.2s;
}
.floating-help-btn:hover { transform: scale(1.1); color: #fff; background: #334155; }
.floating-help-btn svg { width: 22px; height: 22px; }

/* Getting Started Checklist */
.onboarding-card { border-left: 4px solid #066fd1; }
.onboarding-card .checklist-item { padding: 0.4rem 0; display: flex; align-items: center; gap: 0.5rem; }
.onboarding-card .checklist-item.done { opacity: 0.6; }
.onboarding-card .checklist-icon { width: 20px; height: 20px; flex-shrink: 0; }
.onboarding-card .checklist-icon.done { color: #2fb344; }
.onboarding-card .checklist-icon.pending { color: #cbd5e1; }
.onboarding-progress { height: 6px; border-radius: 3px; background: #e2e8f0; overflow: hidden; }
.onboarding-progress-bar { height: 100%; background: #066fd1; border-radius: 3px; transition: width 0.3s; }

/* Help Center */
.help-section details summary { list-style: none; }
.help-section details summary::-webkit-details-marker { display: none; }
.help-section details summary::before {
  content: '\25B6'; display: inline-block; margin-right: 8px; font-size: 0.7em;
  transition: transform 0.2s; vertical-align: middle;
}
.help-section details[open] summary::before { transform: rotate(90deg); }

/* Responsive */
@media (max-width: 768px) {
  .pos-container { flex-direction: column; height: auto; }
  .pos-right { width: 100%; }
  .form-grid { grid-template-columns: 1fr; }
}
