/* Laravel DataTables Red Theme - Modern & Professional */
:root {
  --dt-row-selected: 209, 6, 6;
  --dt-row-selected-text: 255, 255, 255;
  --dt-row-selected-link: 9, 10, 11;
  --dt-row-stripe: 0, 0, 0;
  --dt-row-hover: 0, 0, 0;
  --dt-column-ordering: 0, 0, 0;
  --dt-html-background: white;
}
/* Main DataTable Wrapper */
.dataTables_wrapper {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    sans-serif;
  padding: 1rem 0;
  color: #374151;
}

.dataTables_length {
  display: none;
}

/* Table Structure */
table.dataTable {
  width: 100% !important;
  margin-bottom: 1rem;
  border-collapse: separate;
  border-spacing: 0;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
  border-radius: 0.5rem;
  overflow: hidden;
}

table.dataTable.no-footer {
  border-bottom: none !important;
}

/* Table Headers */
table.dataTable thead th {
  position: relative;
  background-color: #f9fafb;
  color: #111827;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  padding: 1rem 0.75rem;
  border-bottom: 2px solid #e5e7eb;
}

/* Table Header Hover */
table.dataTable thead th:hover {
  background-color: #f3f4f6;
}

/* Table Body Rows */
table.dataTable tbody tr {
  background-color: #ffffff;
  transition: background-color 0.15s ease-in-out;
}

table.dataTable tbody tr:hover {
  background-color: #f9fafb;
}

/* Table Body Cells */
table.dataTable tbody td {
  padding: 0.7rem 0.5rem;
  vertical-align: middle;
  border-bottom: 1px solid #e5e7eb !important;
}

/* Row Striping */
table.dataTable.stripe tbody tr.odd {
  background-color: #f9fafb;
}

/* Table Footer */
table.dataTable tfoot th {
  padding: 0.75rem;
  border-top: 1px solid #e5e7eb;
  background-color: #f9fafb;
  font-weight: 600;
}

/* ===== RED THEME COLORS ===== */
.dataTables_wrapper .dataTables_paginate .paginate_button.current {
  background: linear-gradient(to bottom, #ffffff 0%, #ffffff 100%) !important;
  color: #000000 !important;
  border: 1px solid rgb(190, 190, 190) !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.active:hover {
  background: linear-gradient(to bottom, #ff0000 0%, #ff0000 100%) !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.active {
  background-color: #ff00008f !important;
  border-color: #fca5a5 !important;
  border: 1px solid #fca5a5 !important;
  color: #ffffff !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.disabled {
  background-color: #f3f4f6 !important;
  border-color: #d1d5db !important;
  color: #9ca3af !important;
}

/* ===== SEARCH BOX ===== */
.dataTables_wrapper .dataTables_filter {
  float: right;
  text-align: right;
  margin-bottom: 1rem;
  position: relative;
}

.dataTables_wrapper .dataTables_filter label {
  font-weight: 500;
  display: inline-flex;
  align-items: center;
}

.dataTables_wrapper .dataTables_filter input {
  margin-left: 0.5rem;
  padding: 0.5rem 0.75rem 0.5rem 2.25rem !important;
  font-size: 0.875rem;
  line-height: 1.25rem;
  border: 1px solid #dfe2e6 !important;
  border-radius: 0.375rem !important;
  outline: none !important;
  background-color: #ffffffd5 !important;
  width: 20rem !important;
  display: inline-block !important;
}

.dataTables_wrapper .dataTables_filter input::placeholder {
  color: hsla(218, 11%, 65%, 0.702); /* placeholder-gray-400/70 */
  font-weight: 400;
}

.dataTables_wrapper .dataTables_filter input:focus {
  border-color: #ef4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2);
}

/* Search Icon */
.dataTables_wrapper .dataTables_filter::before {
  content: "";
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  width: 1.2rem;
  height: 1.2rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke-width='1.5' stroke='%239ca3afb3' class='mx-3 h-5 w-5 text-gray-400'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M21 21l-5.197-5.197m0 0A7.5 7.5 0 105.196 5.196a7.5 7.5 0 0010.607 10.607z'%3E%3C/path%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  z-index: 10;
}

/* ===== LENGTH SELECTOR ===== */
.dataTables_wrapper .dataTables_length {
  float: left;
  margin-bottom: 1rem;
}

.dataTables_wrapper .dataTables_length label {
  font-weight: 500;
  display: inline-flex;
  align-items: center;
}

.dataTables_wrapper .dataTables_length select {
  margin: 0 0.5rem;
  padding: 0.375rem 2rem 0.375rem 0.75rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  border: 1px solid #d1d5db;
  border-radius: 0.375rem;
  appearance: none;
  background-color: #ffffff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%236b7280'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.5rem center;
  background-size: 1rem;
}

.dataTables_wrapper .dataTables_length select:focus {
  border-color: #ef4444;
  outline: none;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2);
}

/* ===== PAGINATION ===== */
.dataTables_wrapper .dataTables_paginate {
  float: right !important;
  padding-top: 0 !important;
  margin-top: 1rem !important;
  display: flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
}

/* Custom Pagination with Input */
.dataTables_paginate .page-input {
  display: inline-block !important;
  width: 4rem !important;
  text-align: center !important;
  height: 2.25rem !important;
  padding: 0.375rem 0.5rem !important;
  font-size: 0.875rem !important;
  line-height: 1.25rem !important;
  border: 1px solid #d1d5db !important;
  border-radius: 0.375rem !important;
  margin: 0 0.5rem !important;
}

/* Remove number input spinners */
.dataTables_paginate .page-input::-webkit-inner-spin-button,
.dataTables_paginate .page-input::-webkit-outer-spin-button {
  -webkit-appearance: none !important;
  margin: 0 !important;
}

.dataTables_paginate .page-input {
  -moz-appearance: textfield !important; /* Firefox */
}

.dataTables_paginate .page-input:focus {
  border-color: #ef4444 !important;
  outline: none !important;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2) !important;
}

/* Pagination of text styling */
.dataTables_paginate span {
  color: #4b5563 !important;
  font-size: 0.875rem !important;
  font-weight: 500 !important;
}

/* Prev/Next Button Styling */
.dataTables_paginate .prev-btn,
.dataTables_paginate .next-btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  height: 2.25rem !important;
  min-width: 2.25rem !important;
  padding: 0 0.75rem !important;
  font-size: 0.875rem !important;
  font-weight: 500 !important;
  color: #4b5563 !important;
  background-color: #ffffff !important;
  border: 1px solid #d1d5db !important;
  border-radius: 0.375rem !important;
  cursor: pointer !important;
  transition: all 150ms ease !important;
}

.dataTables_paginate .prev-btn {
  margin-right: 0.5rem !important;
}

.dataTables_paginate .next-btn {
  margin-left: 0.5rem !important;
}

.dataTables_paginate .prev-btn:hover,
.dataTables_paginate .next-btn:hover {
  background-color: #fee2e2 !important;
  border-color: #fca5a5 !important;
  color: #b91c1c !important;
}

.dataTables_paginate .prev-btn:focus,
.dataTables_paginate .next-btn:focus {
  outline: none !important;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2) !important;
}

.dataTables_paginate .prev-btn:disabled,
.dataTables_paginate .next-btn:disabled {
  opacity: 0.5 !important;
  cursor: not-allowed !important;
  background-color: #f3f4f6 !important;
  border-color: #d1d5db !important;
  color: #9ca3af !important;
}

/* ===== INFO DISPLAY ===== */
.dataTables_wrapper .dataTables_info {
  clear: both;
  float: left !important;
  padding-top: 0 !important;
  margin-top: 1rem !important;
  color: #4b5563;
  font-size: 0.875rem;
  align-items: center !important;
  height: 2.25rem !important;
}

/* Styling for strong elements in info text */
.dataTables_wrapper .dataTables_info strong {
  color: #ef4444;
  font-weight: 600;
}

/* Make info display and pagination align on same row */
.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_paginate {
  margin-top: 1rem !important;
  padding-top: 0 !important;
}

/* Container for bottom controls */
.dataTables_wrapper .bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 1rem;
}

/* ===== PROCESSING TEXT ===== */
.dataTables_wrapper .dataTables_processing {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100%;
  height: 40px;
  margin-left: -50%;
  margin-top: -25px;
  padding-top: 20px;
  text-align: center;
  font-size: 1rem;
  background: linear-gradient(
    to right,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.9) 25%,
    rgba(255, 255, 255, 0.9) 75%,
    rgba(255, 255, 255, 0) 100%
  );
  color: #ef4444 !important;
  font-weight: 600;
}

/* ===== BUTTONS STYLING AS LIST ===== */
.dt-buttons {
  margin-bottom: 1rem;
  display: inline-block;
  position: relative;
}

/* List container */
.dt-buttons .dt-button-collection {
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 1000;
  display: none;
  min-width: 10rem;
  padding: 0.5rem 0;
  margin: 0.125rem 0 0;
  background-color: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 0.375rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1),
    0 2px 4px -1px rgba(0, 0, 0, 0.06);

  z-index: 9999 !important;
}

/* Show the list when active */
.dt-buttons .dt-button-collection.dropdown-menu {
  display: block;
}

/* Main dropdown button */
.dt-button {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0.5rem 1rem !important;
  font-size: 0.875rem !important;
  font-weight: 500 !important;
  color: #ffffff !important;

  border: none !important;
  border-radius: 0.375rem !important;
  cursor: pointer !important;
  transition: all 150ms ease !important;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05) !important;
}

.dt-button:focus {
  outline: none !important;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2) !important;
}

/* Style for dropdown caret */
.dt-button::after {
  border-top: 0.3rem solid;
  border-right: 0.3rem solid transparent;
  border-bottom: 0;
  border-left: 0.3rem solid transparent;
}

/* List item buttons */
.dt-button-collection .dt-button {
  display: block !important;
  width: 100% !important;
  padding: 0.5rem 1rem !important;
  clear: both !important;
  font-weight: 500 !important;
  text-align: left !important;
  white-space: nowrap !important;
  background-color: transparent !important;
  border: 0 !important;
  color: #374151 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  margin-right: 0 !important;
}

.dt-button-collection .dt-button:hover {
  color: #111827 !important;
  background-color: #f9fafb !important;
}

.dt-button-collection .dt-button:active {
  color: #ef4444 !important;
  background-color: #fee2e2 !important;
}

/* Remove dropdown caret from list items */
.dt-button-collection .dt-button::after {
  display: none !important;
}

/* Responsive styles */
@media (max-width: 768px) {
  .dt-buttons {
    text-align: center !important;
    margin-bottom: 0.75rem !important;
    display: block;
  }

  .dt-button-collection {
    position: static;
    width: 100%;
  }
}

/* ===== RESPONSIVE STYLES ===== */
@media (max-width: 768px) {
  .dataTables_wrapper .dataTables_info,
  .dataTables_wrapper .dataTables_paginate {
    float: none !important;
    text-align: center !important;
    display: block !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }

  .dataTables_wrapper .dataTables_length,
  .dataTables_wrapper .dataTables_filter {
    float: none !important;
    text-align: center !important;
    display: block !important;
    margin-left: auto !important;
    margin-right: auto !important;
    margin-bottom: 0.75rem !important;
  }

  .dataTables_wrapper .bottom {
    flex-direction: column;
  }

  .dataTables_wrapper .dataTables_paginate {
    margin-top: 0.75rem !important;
    justify-content: center !important;
  }

  .dt-buttons {
    text-align: center !important;
    margin-bottom: 0.75rem !important;
  }

  .dt-button {
    margin-bottom: 0.5rem !important;
  }
}

/* Style for selected rows */
table.dataTable tbody tr.selected {
  background-color: #fee2e2 !important;
}

/* Style for checkboxes */
table.dataTable tbody td .barang-checkbox,
table.dataTable thead th .select-all {
  width: 1.125rem;
  height: 1.125rem;
  border: 1px solid #d1d5db;
  border-radius: 0.25rem;
  cursor: pointer;
  position: relative;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-color: #fff;
}

table.dataTable tbody td .barang-checkbox:checked,
table.dataTable thead th .select-all:checked {
  background-color: #ef4444;
  border-color: #ef4444;
}

table.dataTable tbody td .barang-checkbox:checked::after,
table.dataTable thead th .select-all:checked::after {
  content: "";
  position: absolute;
  left: 0.3rem;
  top: 0.15rem;
  width: 0.375rem;
  height: 0.625rem;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

table.dataTable tbody td .barang-checkbox:focus,
table.dataTable thead th .select-all:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2);
}
