/* Plugin: InstructorPro Suite | File Version: 2016v2 */
/* ==========================================================================
   EZ2D Admin Home Page Setting  CSS (ENHANCED WITH PRODUCTS)
   - Added sortable placeholder styling
   - Enhanced drag interaction feedback
   - Fixed checkbox alignment
   - Added products list styles
   ========================================================================== */

/* ======================================================================
   ADMIN SETTINGS (NEUTRAL  NO BRAND COLOURS)
   ====================================================================== */

.ez2d-home-settings {
  background: var(--ez2d-bg-elevated);
  border-radius: 12px;
  padding: 20px 24px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
  font-size: 14px;
}

/* Header banner */
.ez2d-home-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 2rem;
  padding: 1.5rem;
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.25);
}

.ez2d-home-header-content {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.ez2d-home-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  color: #fff;
  flex-shrink: 0;
}

.ez2d-home-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #fff;
  margin: 0;
  line-height: 1.2;
}

.ez2d-home-subtitle {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.85);
  margin: 0.25rem 0 0;
}

.ez2d-home-section {
  border-top: 1px solid var(--ez2d-border-subtle);
  padding-top: 18px;
  margin-top: 18px;
}

.ez2d-home-section h3 {
  margin: 0 0 6px;
}

.ez2d-help {
  margin: 0 0 12px;
  color: var(--ez2d-text-muted);
}

.ez2d-help-small {
  margin: 4px 0 12px;
  font-size: 12px;
  color: var(--ez2d-text-soft);
}

@media (max-width: 720px) {
  .ez2d-home-header {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
  }

  .ez2d-home-header-content {
    flex-direction: column;
    align-items: center;
  }
}

/* ----------------------------------------------------------------------
   HERO IMAGE PICKER (ADMIN)
   ---------------------------------------------------------------------- */

.ez2d-home-hero-bg-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
}

.ez2d-home-bg-preview {
  width: 240px;
  height: 120px;
  border-radius: 12px;
  overflow: hidden;
  background: var(--ez2d-bg-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--ez2d-border-subtle);
  margin-bottom: 12px;
}

.ez2d-home-bg-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ez2d-home-bg-placeholder {
  font-size: 13px;
  color: var(--ez2d-text-soft);
}

/* ----------------------------------------------------------------------
   ADMIN BUTTONS (SAFE OVERRIDE)
   ---------------------------------------------------------------------- */

.ez2d-home-settings .ez2d-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  background: var(--ez2d-primary);
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.15s ease;
}

.ez2d-home-settings .ez2d-btn:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.ez2d-home-settings .ez2d-btn.ez2d-secondary {
  background: var(--ez2d-bg-soft);
  color: var(--ez2d-text);
  border: 1px solid var(--ez2d-border-subtle);
}

.ez2d-home-settings .ez2d-btn.ez2d-danger {
  background: #ef4444;
  color: #fff;
  border: 1px solid #dc2626;
}

/* ----------------------------------------------------------------------
   HOME PAGE CARDS  ADMIN REPEATER
   ---------------------------------------------------------------------- */

.ez2d-home-cards {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ez2d-home-card-row {
  border-radius: 12px;
  border: 1px solid var(--ez2d-border-subtle);
  padding: 12px;
  background: var(--ez2d-bg-elevated);
  display: grid;
  grid-template-columns: 1fr 2fr 1fr auto;
  gap: 10px;
  align-items: start;
}

.ez2d-home-card-row input[type="text"],
.ez2d-home-card-row textarea,
.ez2d-home-card-row select {
  width: 100%;
  border-radius: 8px;
  border: 1px solid var(--ez2d-border-strong);
  padding: 8px 10px;
  font-size: 13px;
  background: #fff;
}

.ez2d-home-card-row textarea {
  min-height: 60px;
  resize: vertical;
}

.ez2d-home-icon-picker {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.ez2d-home-icon-preview {
  width: 44px;
  height: 44px;
  border: 1px solid var(--ez2d-border-subtle);
  border-radius: 10px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ez2d-text-muted);
  overflow: hidden;
}

.ez2d-home-icon-preview svg {
  width: 22px;
  height: 22px;
}

.ez2d-home-icon-placeholder {
  font-size: 11px;
  color: var(--ez2d-text-muted);
}

/* ----------------------------------------------------------------------
   HOME REVIEWS (ADMIN LIST + EDITOR)
   ---------------------------------------------------------------------- */

.ez2d-home-review-editor {
  border: 1px solid var(--ez2d-border-subtle);
  border-radius: 12px;
  padding: 14px;
  background: var(--ez2d-bg-elevated);
  margin-bottom: 16px;
}

.ez2d-home-review-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.ez2d-home-review-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ez2d-home-review-toolbar {
  margin-bottom: 14px;
}

.ez2d-home-review-row {
  border: 1px solid var(--ez2d-border-subtle);
  border-radius: 12px;
  padding: 12px 14px;
  background: #fff;
}

.ez2d-home-review-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}

.ez2d-home-review-label {
  font-weight: 600;
  color: var(--ez2d-text);
}

.ez2d-home-review-summary {
  color: var(--ez2d-text);
  font-size: 13px;
}

.ez2d-home-review-snippet {
  margin-top: 6px;
  color: var(--ez2d-text-muted);
  font-size: 12px;
}

.ez2d-review-source-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px;
  margin: 8px 0 14px;
  border: 1px solid var(--ez2d-border-subtle);
  border-radius: 999px;
  background: #f8fafc;
}

.ez2d-review-source-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.ez2d-review-source-option span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 600;
  color: var(--ez2d-text-muted);
  transition: all .2s ease;
}

.ez2d-review-source-option input[type="radio"]:checked + span {
  background: var(--ez2d-primary);
  color: #fff;
  box-shadow: 0 6px 16px rgba(2, 6, 23, .15);
}

.ez2d-reviews-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000010;
}

.ez2d-reviews-modal.is-open {
  display: flex;
}

.ez2d-reviews-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 23, 0.45);
}

.ez2d-reviews-modal-dialog {
  position: relative;
  width: min(760px, calc(100vw - 32px));
  max-height: calc(100vh - 50px);
  overflow: auto;
  background: #fff;
  border-radius: 14px;
  border: 1px solid var(--ez2d-border-subtle);
  box-shadow: 0 20px 46px rgba(2, 6, 23, .25);
  padding: 16px;
}

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

.ez2d-rating-stars {
  display: inline-flex;
  gap: 6px;
  align-items: center;
}

.ez2d-rating-star {
  border: 0;
  background: transparent;
  padding: 0;
  margin: 0;
  line-height: 1;
  font-size: 24px;
  color: #cbd5e1;
  cursor: pointer;
}

.ez2d-rating-star.is-active {
  color: #f59e0b;
}

/* Icon picker modal */
.ez2d-icon-modal {
  position: fixed;
  inset: 0;
  z-index: 1000001;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ez2d-icon-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
}

.ez2d-icon-modal-box {
  position: relative;
  background: #fff;
  border-radius: 14px;
  padding: 20px;
  max-width: 900px;
  width: min(90vw, 900px);
  max-height: 80vh;
  overflow: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
}

.ez2d-icon-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.ez2d-icon-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  cursor: pointer;
  background: #f9fafb;
}

.ez2d-icon-option svg {
  width: 24px;
  height: 24px;
}

.ez2d-icon-option span {
  font-size: 0.75rem;
  color: #374151;
  text-align: center;
  word-break: break-word;
}

.ez2d-icon-option:hover {
  border-color: var(--ez2d-primary);
  background: #fff;
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.15);
}

.ez2d-icon-close {
  margin-top: 12px;
}

.ez2d-home-card-remove {
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
  color: var(--ez2d-text-muted);
  padding: 4px 8px;
  border-radius: 4px;
  transition: all 0.15s ease;
}

.ez2d-home-card-remove:hover {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

.ez2d-home-card-add {
  margin-top: 10px;
}

/* ----------------------------------------------------------------------
   PRODUCTS SORTABLE LIST (ENHANCED)
   ---------------------------------------------------------------------- */

.ez2d-home-products-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 10px;
  min-height: 100px;
}

.ez2d-home-product-row {
  display: grid;
  grid-template-columns: 34px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid var(--ez2d-border-subtle);
  border-radius: 12px;
  background: var(--ez2d-bg-elevated);
  transition: all 0.2s ease;
  position: relative;
}

.ez2d-home-product-row:hover {
  border-color: var(--ez2d-border-strong);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

/* Most Popular checkbox section */
.ez2d-home-product-popular {
  display: flex;
  align-items: center;
  margin-left: 8px;
}

.ez2d-popular-label {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  user-select: none;
  font-size: 13px;
  color: var(--ez2d-text-soft);
  white-space: nowrap;
}

.ez2d-popular-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
  margin: 0;
}

.ez2d-popular-label:has(input:checked) {
  color: var(--ez2d-primary);
  font-weight: 500;
}

/* Drag handle */
.ez2d-home-drag {
  cursor: grab;
  user-select: none;
  font-size: 18px;
  opacity: 0.4;
  transition: opacity 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ez2d-text-muted);
}

.ez2d-home-product-row:hover .ez2d-home-drag {
  opacity: 0.7;
}

.ez2d-home-drag:hover {
  opacity: 1 !important;
}

.ez2d-home-drag:active {
  cursor: grabbing;
}

/* Checkbox container */
.ez2d-home-product-check {
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: 14px;
}

.ez2d-home-product-check input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  margin: 0;
  flex-shrink: 0;
}

.ez2d-home-product-check label {
  cursor: pointer;
  user-select: none;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.ez2d-product-category {
  font-size: 12px;
  font-weight: 400;
  color: var(--ez2d-text-soft);
  background: var(--ez2d-bg-soft);
  padding: 2px 8px;
  border-radius: 4px;
}

/* Sortable placeholder (shown while dragging) */
.ez2d-home-product-placeholder {
  background: rgba(59, 130, 246, 0.08);
  border: 2px dashed rgba(59, 130, 246, 0.3);
  border-radius: 12px;
  height: 52px;
  margin-bottom: 10px;
}

/* While being dragged */
.ui-sortable-helper {
  opacity: 0.85;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  cursor: grabbing !important;
  z-index: 1000;
}

.ui-sortable-helper .ez2d-home-drag {
  cursor: grabbing !important;
  opacity: 1 !important;
}

/* Visual feedback for checked items */
.ez2d-home-product-row:has(input[type="checkbox"]:checked) {
  background: rgba(59, 130, 246, 0.03);
  border-color: rgba(59, 130, 246, 0.2);
}

.ez2d-home-product-row:has(input[type="checkbox"]:checked) .ez2d-home-drag {
  color: var(--ez2d-primary);
  opacity: 0.6;
}

/* ----------------------------------------------------------------------
   SAVE SECTION
   ---------------------------------------------------------------------- */

.ez2d-home-save-wrap {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--ez2d-border-subtle);
  display: flex;
  align-items: center;
  gap: 12px;
}

.ez2d-home-save-status {
  font-size: 13px;
  color: var(--ez2d-text-muted);
  font-weight: 500;
}

.ez2d-home-save-status.ez2d-home-save-status--ok {
  color: #10b981;
}

.ez2d-home-save-status.ez2d-home-save-status--error {
  color: #ef4444;
}

/* ======================================================================
   PUBLIC HOME PAGE (BRANDED  INTENTIONAL)
   ====================================================================== */

.ez2d-home-page {
  font-size: 16px;
}

/* HERO */

.ez2d-home-hero {
  position: relative;
  min-height: 260px;
  background-size: cover;
  background-position: center center;
}

.ez2d-home-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.25),
    rgba(0, 0, 0, 0.45)
  );
}

/* CARDS */

.ez2d-home-cards-public {
  padding: 40px 0 60px;
}

.ez2d-home-cards-grid {
  max-width: 1120px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(1, minmax(0, 1fr));
  gap: 18px;
}

@media (min-width: 800px) {
  .ez2d-home-cards-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.ez2d-home-card {
  text-decoration: none;
  color: inherit;
}

.ez2d-home-card-inner {
  background: var(--ez2d-primary);
  border-radius: 16px;
  padding: 24px 22px;
  box-shadow: 0 18px 40px rgba(37, 99, 235, 0.35);
  text-align: center;
  color: #fff;
}

.ez2d-home-card-title {
  font-size: 18px;
  margin: 0 0 10px;
}

.ez2d-home-card-text {
  margin: 0;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.85);
}

/* PUBLIC MENU */

.ez2d-home-public-menu {
  padding: 12px 0 30px;
  text-align: center;
}

.ez2d-home-public-menu ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: inline-flex;
  flex-wrap: wrap;
  gap: 16px;
}

.ez2d-home-public-menu a {
  text-decoration: none;
  font-size: 14px;
  color: var(--ez2d-primary-strong);
}

/* ----------------------------------------------------------------------
   RESPONSIVE ADJUSTMENTS
   ---------------------------------------------------------------------- */

@media (max-width: 900px) {
  .ez2d-home-card-row {
    grid-template-columns: 1fr;
  }
  
  .ez2d-home-card-remove {
    justify-self: end;
  }

  .ez2d-home-product-row {
    grid-template-columns: 28px 1fr;
    gap: 10px;
    padding: 10px 12px;
  }

  .ez2d-home-drag {
    font-size: 16px;
  }

  .ez2d-home-product-check {
    font-size: 13px;
  }

  .ez2d-product-category {
    font-size: 11px;
  }
}
/* PUBLIC MENU PAGE ROW */
.ez2d-home-menu-page-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* DRAG HANDLE */
.ez2d-home-drag {
    cursor: grab;
    font-size: 18px;
    color: #9aa3af;
    user-select: none;
}

.ez2d-home-drag::before {
    content: "\2630";
    line-height: 1;
}

.ez2d-home-drag:active {
    cursor: grabbing;
}

/* LABEL */
.ez2d-home-menu-label {
    display: flex;
    align-items: center;
    gap: 8px;
}
.ez2d-home-card-group {
    margin-bottom: 18px;
}

.ez2d-home-card-group-title {
    margin: 0 0 10px;
    font-size: 14px;
    font-weight: 700;
    color: #1f2937;
}

.ez2d-home-hero-buttons {
    margin-top: 20px;
}

.ez2d-home-hero-button-row {
    padding: 12px 0;
    border-top: 1px dashed #e2e8f0;
}

.ez2d-home-hero-button-row:first-child {
    border-top: none;
    padding-top: 0;
}

/* ----------------------------------------------------------------------
   REVIEWS (ADMIN)
   ---------------------------------------------------------------------- */

.ez2d-home-reviews {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ez2d-home-review-row {
  border: 1px solid var(--ez2d-border-subtle);
  border-radius: 12px;
  padding: 12px;
  background: var(--ez2d-bg-elevated);
}

.ez2d-home-review-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.ez2d-home-review-label {
  font-weight: 600;
  color: var(--ez2d-text);
}
