/* Custom Customizer Styles */
.app-customizer {
  background: #ffffff;
  box-shadow: -8px 0 30px rgba(0, 0, 0, 0.15);
  border-left: 1px solid #e9ecef;
}

.app-customizer .offcanvas-header {
  background: #ffffff;
  color: #2c3e50;
  border-bottom: 1px solid #e9ecef;
  padding: 1.5rem 2rem;
}

.app-customizer .offcanvas-title {
  font-weight: 700;
  font-size: 1.25rem;
  color: #2c3e50;
}

.app-customizer .offcanvas-body {
  padding: 2rem;
  background: #ffffff;
}

.app-customizer .offcanvas-body h6 {
  color: #2d5016;
  font-weight: 800;
  margin-bottom: 12px;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  border-bottom: 1px solid #e9ecef;
  padding-bottom: 8px;
  position: relative;
}

.app-customizer .offcanvas-body h6::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 100%;
  height: 1px;
  background: #e9ecef;
}

.app-customizer .offcanvas-body p.text-muted {
  font-size: 0.95rem;
  margin-bottom: 2.5rem;
  color: #6c757d;
  line-height: 1.6;
  font-weight: 400;
}

/* Sidebar and Layout Options */
.app-customizer .sidebar-option,
.app-customizer .layout-option {
  display: grid;
  grid-template-columns: 1fr; /* full-width cards per row */
  gap: 12px;
  margin-bottom: 20px;
}

.app-customizer .sidebar-option > li,
.app-customizer .layout-option > li {
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  border: 1px solid #dfe3e6;
  border-radius: 14px;
  overflow: hidden;
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(16, 24, 40, 0.06), 0 1px 2px rgba(16, 24, 40, 0.04);
  position: relative;
}

.app-customizer .sidebar-option > li:hover,
.app-customizer .layout-option > li:hover {
  transform: translateY(-2px);
  border-color: rgba(13, 110, 253, 0.35);
  box-shadow: 0 8px 24px rgba(16, 24, 40, 0.08);
}

.app-customizer .sidebar-option > li.selected,
.app-customizer .layout-option > li.selected {
  border-color: #2d5016; /* green border like reference */
  background: #ffffff; /* no blue gradient */
  box-shadow: 0 2px 6px rgba(16, 24, 40, 0.06);
}

/* Special blue background for box layout when selected */
.app-customizer .layout-option > li.box-layout.selected {
  background: #e8f3f9; /* soft blue tint like reference */
  border-color: #90c2e7;
}

.app-customizer .sidebar-option > li .body,
.app-customizer .layout-option > li .body {
  /* padding: 12px 14px; */
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 78px; /* space for background previews */
  background-repeat: no-repeat;
  background-position: center 18px;
  background-size: 108% auto; /* large but with padding */
}

.app-customizer .sidebar-option > li img,
.app-customizer .layout-option > li img {
  display: block; /* show images */
  max-width: 100%;
  height: auto;
  margin-bottom: 8px;
}

.app-customizer .sidebar-option > li p,
.app-customizer .layout-option > li p {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 700;
  margin-top: -60px;
  color: #2c3e50;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

/* Re-enable color themes and custom color creator (only Sidebar/Page Layout were changed) */
.app-customizer .color-hint,
.app-customizer .custom-color-picker { display: revert; }

.app-customizer .color-hint > li:hover {
  transform: scale(1.2);
  border-color: #0d6efd;
  box-shadow: 0 8px 25px rgba(13, 110, 253, 0.25);
}

.app-customizer .color-hint > li.selected {
  border-color: #0d6efd;
  box-shadow: 0 0 0 4px rgba(13, 110, 253, 0.3), 0 8px 25px rgba(13, 110, 253, 0.25);
  transform: scale(1.15);
}

.app-customizer .color-hint > li div {
  width: 100%;
  height: 100%;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(var(--primary), 1) 0%, rgba(var(--secondary), 1) 100%);
  transition: all 0.3s ease;
}

/* Custom Color Picker */
.app-customizer .custom-color-picker {
  background: #ffffff;
  border-radius: 12px;
  padding: 0.75rem;
  margin-bottom: 0.75rem;
  border: 1px solid #e9ecef;
  box-shadow: 0 2px 8px rgba(16, 24, 40, 0.08);
}

.app-customizer .color-input-group {
  margin-bottom: 0.5rem;
  display: grid;
  grid-template-columns: 88px 44px 1fr; /* label | color | hex */
  column-gap: 8px;
  row-gap: 4px;
  align-items: center;
}

.app-customizer .color-input-group label {
  display: block;
  font-weight: 600;
  color: #2c3e50;
  margin-bottom: 0;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.app-customizer .color-input-group .color-input {
  width: 34px;
  height: 28px;
  border: 1px solid #e1e5ea;
  border-radius: 8px;
  cursor: pointer;
  margin-right: 0;
  box-shadow: none;
  transition: transform 0.2s ease;
}

.app-customizer .color-input-group .color-input:hover {
  transform: scale(1.03);
}

.app-customizer .color-input-group .hex-input {
  width: 100%;
  padding: 0.5rem 0.6rem;
  border: 1px solid #e1e5ea;
  border-radius: 8px;
  font-family: 'Courier New', monospace;
  font-weight: 600;
  font-size: 0.8rem;
  background: white;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.app-customizer .color-input-group .hex-input:focus {
  outline: none;
  border-color: #0d6efd;
  box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.08);
}

.app-customizer .custom-color-preview {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 6px 0 8px;
  padding: 8px;
  background: #f8f9fb;
  border-radius: 10px;
  border: 1px solid #e9ecef;
  box-shadow: inset 0 1px 2px rgba(16, 24, 40, 0.04);
}

.app-customizer .preview-box {
  width: 46px;
  height: 28px;
  border-radius: 6px;
  background: linear-gradient(135deg, #0d6efd 0%, #6c757d 100%);
  box-shadow: 0 2px 6px rgba(16, 24, 40, 0.12);
  border: 2px solid #fff;
}

.app-customizer .preview-label {
  font-weight: 600;
  color: #2c3e50;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

/* Compact apply button inside custom color picker */
.app-customizer .custom-color-picker .btn {
  padding: 0.55rem 0.85rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  box-shadow: 0 2px 6px rgba(16, 24, 40, 0.08);
}

/* Text Size */
.app-customizer .text-size {
  display: flex;
  gap: 1rem;
  margin-bottom: 2.5rem;
}

.app-customizer .text-size li {
  flex: 1;
  text-align: center;
  padding: 1.25rem 1rem;
  border: 2px solid #e9ecef;
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.3s ease;
  background: white;
  font-weight: 700;
  font-size: 0.95rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.app-customizer .text-size li:hover {
  border-color: #0d6efd;
  background: linear-gradient(135deg, #f8f9ff 0%, #e7f1ff 100%);
  transform: translateY(-4px);
  box-shadow: 0 8px 25px rgba(13, 110, 253, 0.15);
}

.app-customizer .text-size li.selected {
  border-color: #0d6efd;
  background: linear-gradient(135deg, #e7f1ff 0%, #d1e7ff 100%);
  color: #0d6efd;
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(13, 110, 253, 0.25);
}

/* Customizer Buttons */
.app-customizer .customizer-btn {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.app-customizer .customizer-btn .btn {
  border-radius: 16px;
  font-weight: 700;
  padding: 1.25rem 1.5rem;
  transition: all 0.3s ease;
  border: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-size: 0.9rem;
}

.app-customizer .customizer-btn .btn:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

/* Restore green tick indicator */
.app-customizer .offcanvas-body > ul > li.selected::before {
  content: "";
  position: absolute;
  top: 6px;
  left: 6px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #2d5016; /* small green dot like reference */
  box-shadow: 0 0 0 2px #ffffff, 0 0 0 4px rgba(45, 80, 22, 0.15);
}

/* Responsive: 2 columns on small screens */
@media (min-width: 576px) {
  .app-customizer .sidebar-option,
  .app-customizer .layout-option {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 992px) {
  .app-customizer .sidebar-option,
  .app-customizer .layout-option {
    grid-template-columns: repeat(3, 1fr); /* bring back 3 columns for balance */
  }
}

/* Responsive adjustments */
@media (max-width: 576px) {
  .app-customizer {
    width: 100% !important;
  }
  
  .app-customizer .sidebar-option,
  .app-customizer .layout-option {
    flex-direction: column;
  }
  
  .app-customizer .color-hint {
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
  }
}

@media (max-width: 480px) {
  .app-customizer .color-hint {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Custom Color Success Message */
.custom-color-success {
  position: fixed;
  top: 20px;
  right: 20px;
  background: linear-gradient(135deg, #198754 0%, #20c997 100%);
  color: white;
  padding: 1rem 1.5rem;
  border-radius: 12px;
  font-weight: 600;
  box-shadow: 0 8px 25px rgba(25, 135, 84, 0.3);
  z-index: 9999;
  animation: slideInRight 0.5s ease-out;
}

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

/* Global Scrollbar width and styling */
/* WebKit-based browsers (Chrome, Edge, Safari) */
*::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}
*::-webkit-scrollbar-track {
  background: transparent;
}
*::-webkit-scrollbar-thumb {
  background-color: rgba(0, 0, 0, 0.25);
  border-radius: 8px;
}
*::-webkit-scrollbar-thumb:hover {
  background-color: rgba(0, 0, 0, 0.35);
}

/* Firefox */
* {
  scrollbar-width: thin; /* maps to a smaller width */
  scrollbar-color: rgba(0, 0, 0, 0.35) transparent;
}

/* Auto-apply rounded pagination to any .table-pagination .pagination */
.table-pagination .pagination { --pagination-size: 42px; --pagination-gap: 8px; }
.table-pagination .pagination .page-item { margin: 0 var(--pagination-gap); }
.table-pagination .pagination .page-link {
  width: var(--pagination-size);
  height: var(--pagination-size);
  padding: 0;
  border: none;
  border-radius: 50rem !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: #edf1f5;
  color: var(--bs-body-color, #0f172a);
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.06);
  transition: background-color .15s ease, color .15s ease, box-shadow .15s ease;
}
.table-pagination .pagination .page-link:hover { background-color: #e6ebf1; }
.table-pagination .pagination .page-item.active .page-link {
  background-color: rgba(var(--primary), 1);
  color: #fff;
  box-shadow: 0 4px 12px rgba(var(--primary), 0.35);
}
.table-pagination .pagination .page-item.disabled .page-link { opacity: .6; pointer-events: none; }

/* Compact spacing option (no extra gaps) */
.pagination-rounded.gap-0 .page-item { margin: 0; }

/* Row bottom borders for cleaner separation */
.table-row-border tbody tr:not(:last-child) td,
.table-row-border tbody tr:not(:last-child) th {
  border-bottom: 1px solid rgba(16, 24, 40, 0.08);
}
