/* =================================================================
   BASE STYLES & LAYOUT
   ================================================================= */
.dual-list-wrapper {
  font-family: Arial, sans-serif;
  padding: 20px;
  background-color: #f4f4f4;
}

/* Main Flex Container: Establishes 50% width columns with spacing */
.dual-list-container {
  display: flex;
  justify-content: space-between;
  gap: 15px; /* Gutter between the two panels */
  align-items: flex-start;
  flex-wrap: nowrap;
}

.list-panel {
  /* Precise 50% width accounting for the 15px gap */
  flex: 1 1 50%;
  background: #ffffff;
  border: 1px solid #ccc;
  border-radius: 8px;
  padding: 15px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.list-title {
  margin-top: 0;
  font-size: 1.3em;
  color: #212529;
  padding-bottom: 10px;
  border-bottom: 1px solid #eee;
  margin-bottom: 15px;
}

/* =================================================================
   FILTER CONTROLS
   ================================================================= */
.list-filters {
  display: flex;
  gap: 8px;
  margin-bottom: 15px;
}

.list-filters input[type="text"] {
  flex-grow: 1;
  padding: 8px 10px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 14px;
}

/* Custom Rounded Filter Buttons */
.filter-button {
  padding: 8px 15px;
  border: 1px solid #007bff;
  border-radius: 20px; /* Rounded corners */
  background-color: #007bff;
  color: white;
  cursor: pointer;
  transition: background-color 0.2s, border-color 0.2s;
  font-size: 14px;
  white-space: nowrap;
}

.filter-button:hover:not(:disabled) {
  background-color: #0056b3;
  border-color: #0056b3;
}

/* Disabled State for Filter Buttons (Pill shape) */
.filter-button:disabled {
  opacity: 0.6; /* Dim the button */
  cursor: not-allowed; /* Change cursor */
  background-color: #007bff; /* Keep original color but dimmed */
  border-color: #007bff;
  box-shadow: none;
}

/* =================================================================
   DRAG-AND-DROP CONTAINERS & SCROLLING
   ================================================================= */

.list-drop-zone {
  position: relative;
  height: 60vh;
  overflow: hidden; /* Clips content outside this fixed area */
  min-width: 300px;
  min-height: 200px;
  max-height: 900px;
}

.list-items-wrapper {
  /* Takes 100% of the parent's fixed height to enable scrolling within that space */
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 5px;

  /* CRITICAL: Padding ensures the last scrolling item clears the fixed footer */
  padding-bottom: 60px;
}

/* =================================================================
   INDIVIDUAL LIST ITEMS
   ================================================================= */
.list-item {
  padding: 10px;
  margin-bottom: 8px;
  border: 1px solid #eee;
  border-radius: 4px;
  background-color: #fcfcfc;
  cursor: grab;
  transition: background-color 0.1s, border-color 0.1s;
  user-select: none;
}

.list-item:last-child {
  margin-bottom: 0;
}

/* Multi-Drag Selected State (Used by SortableJS MultiDrag plugin) */
.dnd-item-selected {
  background-color: #e6f7ff;
  border-color: #91d5ff;
  box-shadow: 0 0 5px rgba(0, 123, 255, 0.2);
}

/* Item Content Layout (Logo, Details, Rating) */
.dnd-item-content {
  display: flex;
  align-items: center;
  gap: 10px;
}

.dnd-logo-container {
  width: 40px;
  height: 40px;
  border-radius: 4px;
  overflow: hidden;
  background-color: #f8f9fa;
  display: flex;
  justify-content: center;
  align-items: center;
}

.list-logo {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.dnd-item-details {
  flex-grow: 1;
}

.item-name {
  font-weight: bold;
  color: #343a3f;
  font-size: 15px;
}

.item-address {
  font-size: 12px;
  color: #6c757d;
  margin-bottom: 3px;
}

/* Star Rating Styling */
.star-rating {
  display: flex;
  align-items: center;
  font-size: 13px;
  color: #ffc107;
}

.review-count {
  margin-left: 5px;
  color: #6c757d;
  font-size: 11px;
}

/* =================================================================
   DROP ZONE PLACEHOLDER (STATIC POSITIONED)
   ================================================================= */
.list-item-placeholder {
  padding: 15px;
  margin: 0;
  border: 2px dashed #a4a4a4;
  border-radius: 4px;
  background-color: #f8f8f8;
  text-align: center;
  color: #999;
  font-style: italic;
  cursor: default;

  /* STATIC POSITIONING relative to list-drop-zone */
  position: absolute;
  bottom: 0;
  left: 0;
  width: 96%;
  box-sizing: border-box;
  z-index: 10;
}

.list-item-placeholder.placeholder-content {
  font-size: 1.1em;
  font-weight: bold;
}

/* =================================================================
   ACTION BAR (SAVE/CANCEL)
   ================================================================= */

.action-bar {
  background-color: #343a40; /* Dark background matching the image */
  padding: 10px 15px;
  border-radius: 4px;
  display: flex;
  gap: 10px;
  /* FIX: Align buttons to the right side of the container */
  justify-content: flex-end;
}

.action-button {
  /* Base styling for all action buttons */
  padding: 10px 20px;
  font-size: 15px;
  font-weight: bold;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.2s, opacity 0.2s;
}

/* Save Button (Default Dark Color) */
.save-button {
  background-color: #555c63; /* Dark gray, matching the Save Content button in the image */
  color: white;
}
.save-button:hover:not(:disabled) {
  background-color: #6c757d;
}

/* Cancel Button (Red Color) */
.cancel-button {
  background-color: #dc3545; /* Red color requested */
  color: white;
}
.cancel-button:hover:not(:disabled) {
  background-color: #c82333;
}

/* Disabled State */
.action-button:disabled,
.action-button.button-disabled {
  opacity: 0.6; /* Dim the button */
  cursor: not-allowed; /* Change cursor */
  box-shadow: none;
}

/* =================================================================
   STARS REVIEWS
   ================================================================= */

/* review details */
.review-details {
  display: flex;
  flex-direction: row;
  align-items: center;
  padding: 0px;
  gap: 5px;
  width: 100%;
  height: 20px;
}

/* === STAR RATING DYNAMIC FILL STYLES === */
.star-rating {
  /* Use position relative to contain absolute position of filled layer */
  position: relative;
  display: inline-flex;
  /* Hide overflow to clip the filled stars container */
  overflow: hidden;
  height: 20px; /* Set a fixed height for visual consistency */
  flex-shrink: 0; /* Prevents the star container from being squished */
}

/* Container for empty stars (base layer) */
.star-empty {
  display: flex;
  gap: 1px;
}

/* Container for filled stars (overlay layer) */
.star-filled {
  position: absolute;
  top: 0;
  left: 0;
  white-space: nowrap; /* Keeps all 5 filled stars on one line */
  display: flex;
  gap: 1px;

  /* THE MAGIC: Dynamically calculate the width based on --rating variable */
  width: calc(var(--rating) / 5 * 100%);
  overflow: hidden; /* Clips the filled stars container */
}

/* Style for each individual star SVG */
.star-rating svg {
  width: 15px; /* Matches your previous 15px width */
  height: 15px;
  flex-shrink: 0; /* Prevents stretching */
  margin: 0;
}

/* Empty (base) stars are black */
.star-empty svg {
  fill: transparent;
  stroke: #000000;
  stroke-width: 1px;
}

/* Filled (overlay) stars are gold */
.star-filled svg {
  fill: #ffdd00;
  stroke: #ffdd00;
  stroke-width: 1px;
}
/* === END STAR RATING DYNAMIC FILL STYLES === */

/* [50 Reviewers] */
.review-count {
  font-weight: 300;
  font-size: 16px;
  line-height: 1;
  color: #000000;
  flex-shrink: 0;
}

/* =================================================================
   DND STYLES
   ================================================================= */

/**
 * An element with .dndPlaceholder class will be
 * added to the dnd-list while the user is dragging
 * over it.
 */
.multiDemo div[dnd-list] .dndPlaceholder {
  background-color: #ddd;
  display: block;
  min-height: 35px;
}

.multiDemo div[dnd-list] div {
  background-color: #fff;
}

/**
 * Show selected elements in green
 */
.multiDemo div[dnd-list] div.selected {
  background-color: #dff0d8;
  color: #3c763d;
}

.multiDemo div[dnd-list] div.selected div {
  background-color: #dff0d8;
  color: #3c763d;
}
