/* =========================================================
   Save Property Button Styles (Gradient + Premium States)
   ========================================================= */

/* Base (works for both <button> and <a>) */
.save-property-button,
a.save-property-button,
button.save-property-button {
  /* Gradient background */
  background: linear-gradient(90deg, #5b247a 0%, #1bcedf 100%) !important;
  color: #fff !important;
  border: none;
  padding: 10px 20px;
  font-size: 16px;
  border-radius: 6px;
  cursor: pointer;

  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;

  text-decoration: none;
  line-height: 1.2;

  /* Subtle premium shadow tuned to palette */
  box-shadow:
    0 10px 22px rgba(91, 36, 122, 0.18),
    0 6px 14px rgba(27, 206, 223, 0.14),
    0 1px 0 rgba(255, 255, 255, 0.18) inset;

  transition:
    filter 0.18s ease,
    transform 0.12s ease,
    box-shadow 0.18s ease;
}

.save-property-button:hover,
a.save-property-button:hover,
button.save-property-button:hover {
  filter: brightness(1.06) saturate(1.05);
  transform: translateY(-1px);
  box-shadow:
    0 14px 28px rgba(91, 36, 122, 0.22),
    0 10px 18px rgba(27, 206, 223, 0.18),
    0 1px 0 rgba(255, 255, 255, 0.22) inset;
}

.save-property-button:active,
a.save-property-button:active,
button.save-property-button:active {
  transform: translateY(0);
  filter: brightness(0.98);
  box-shadow:
    0 8px 16px rgba(91, 36, 122, 0.18),
    0 5px 12px rgba(27, 206, 223, 0.14),
    0 1px 0 rgba(255, 255, 255, 0.16) inset;
}

.save-property-button:focus-visible,
a.save-property-button:focus-visible,
button.save-property-button:focus-visible {
  outline: none;
  box-shadow:
    0 0 0 3px rgba(27, 206, 223, 0.28),
    0 0 0 6px rgba(91, 36, 122, 0.18),
    0 12px 26px rgba(91, 36, 122, 0.18),
    0 8px 16px rgba(27, 206, 223, 0.16);
}

/* Disabled */
.save-property-button.disabled,
.save-property-button:disabled,
a.save-property-button.disabled,
button.save-property-button:disabled {
  cursor: not-allowed;
  opacity: 0.65;
  transform: none;
  filter: grayscale(0.25) brightness(0.98);
  box-shadow: none;
}

/* Saved state: calmer version of the gradient */
.save-property-button.saved,
a.save-property-button.saved,
button.save-property-button.saved {
  background: linear-gradient(
    90deg,
    rgba(91, 36, 122, 0.55) 0%,
    rgba(27, 206, 223, 0.55) 100%
  ) !important;
  color: rgba(255, 255, 255, 0.90) !important;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}

.save-property-button .star-icon,
a.save-property-button .star-icon,
button.save-property-button .star-icon {
  margin-right: 0; /* using gap */
  font-size: 18px;
  color: #fff;
  opacity: 0.95;
  transform: translateY(0.5px);
}

.save-property-button.saved .star-icon,
a.save-property-button.saved .star-icon,
button.save-property-button.saved .star-icon {
  color: rgba(255, 255, 255, 0.85);
}

/* =========================================================
   Saved Properties Table Styles
   ========================================================= */

.saved-properties-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 20px 0;
}

.saved-properties-table th,
.saved-properties-table td {
  padding: 10px;
  border: 1px solid #ddd;
  text-align: left;
}

/* Softer header */
.saved-properties-table thead th {
  background: #f7f7f9;
  font-weight: 600;
}

/* Zebra striping */
.saved-properties-table tbody tr:nth-child(even) {
  background-color: #f0f0f0;
}

/* Make rows feel clickable */
.saved-properties-table tbody tr {
  cursor: pointer;
  transition: background 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.saved-properties-table tbody tr:hover {
  background: #f6f8fb;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
  transform: translateY(-1px);
}

/* Round corners on first/last header cells */
.saved-properties-table thead tr th:first-child {
  border-top-left-radius: 8px;
}
.saved-properties-table thead tr th:last-child {
  border-top-right-radius: 8px;
}

/* Featured image polish */
.saved-properties-table td img {
  display: block;
  width: 150px;
  height: 150px;
  object-fit: cover;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

/* Align action buttons container */
.action-buttons {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 100%;
  max-width: 160px;
}

/* =========================================================
   Desktop View (992px and above) — FIX IMAGE COLUMN WIDTH
   ========================================================= */

@media (min-width: 992px) {
  /* Prevent first column from shrinking (image getting narrow) */
  .saved-properties-table th:first-child,
  .saved-properties-table td:first-child {
    width: 170px;
    min-width: 170px;
    text-align: center;
    vertical-align: middle;
  }

  /* Center the image inside first column */
  .saved-properties-table td:first-child img {
    margin: 0 auto;
  }

  /* Ensure the Do Action cell is centered */
  .saved-properties-table td:last-child {
    text-align: center;
    vertical-align: middle;
  }

  /* Center action buttons container in its cell */
  .saved-properties-table td:last-child .action-buttons {
    margin: 0 auto;
  }
}

/* =========================================================
   Mobile View (991px and below) — STACKED “CARD” LAYOUT
   ========================================================= */

@media (max-width: 991px) {
  .saved-properties-table,
  .saved-properties-table thead,
  .saved-properties-table tbody,
  .saved-properties-table th,
  .saved-properties-table td,
  .saved-properties-table tr {
    display: block;
  }

  .saved-properties-table thead tr {
    display: none;
  }

  .saved-properties-table tbody tr {
    margin-bottom: 15px;
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(0, 0, 0, 0.06);
  }

  .saved-properties-table td {
    border: none;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    padding: 12px 10px;
    padding-left: 0;
    text-align: center;
    position: relative;
  }

  .saved-properties-table td:before {
    display: block;
    font-weight: bold;
    margin-bottom: 5px;
    text-align: center;
    opacity: 0.75;
    letter-spacing: 0.2px;
  }

  /* Labels */
  .saved-properties-table td:nth-of-type(1):before { content: ""; }
  .saved-properties-table td:nth-of-type(2):before { content: "Property Heading:"; }
  .saved-properties-table td:nth-of-type(3):before { content: "Category:"; }
  .saved-properties-table td:nth-of-type(4):before { content: "Property Type:"; }
  .saved-properties-table td:nth-of-type(5):before { content: "Property Status:"; }
  .saved-properties-table td:nth-of-type(6):before { content: "Property Address:"; }
  .saved-properties-table td:nth-of-type(7):before { content: "Property Price:"; }
  .saved-properties-table td:nth-of-type(8):before { content: "Do Action:"; }

  /* Center image on mobile */
  .saved-properties-table td img {
    margin: 0 auto;
  }

  /* Center action buttons on mobile */
  .saved-properties-table td:last-child {
    text-align: center;
  }
  .action-buttons {
    margin: 0 auto;
    align-items: center;
    justify-content: center;
  }
}

/* =========================================================
   Do Action Column Buttons Style
   ========================================================= */

.saved-properties-table button {
  padding: 6px 12px;
  margin: 3px 0;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  width: 100%;
  min-height: 36px;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.08);
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

.saved-properties-table button:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.10);
}

.saved-properties-table button:active {
  transform: translateY(0);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.08);
}

.saved-properties-table button:focus-visible {
  outline: 3px solid rgba(0, 115, 170, 0.25);
  outline-offset: 2px;
}

.saved-properties-table button:disabled {
  cursor: not-allowed;
  opacity: 0.8;
}

/* Primary */
.visit-listing {
  background-color: #0a66c2;
  color: #fff;
}

/* Softer red */
.remove-saved-property {
  background-color: #c62828;
  color: #fff;
}