/**
 * Plantbaes Favorites — Styles
 * Matches the existing Plantbaes brand: #775973 purple, #2b2b2b dark, #F9F9FB light bg
 */

/* =========================================================================
   HEART / SAVE BUTTON
   ========================================================================= */

.ccc-favorite-post-toggle {
  display: inline-block;
  line-height: 1;
}

.ccc-favorite-post-toggle-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  text-decoration: none;
  color: #2b2b2b;
  transition: all 0.2s ease;
  position: relative;
}

/* Heart icon via ::before pseudo-element */
.ccc-favorite-post-toggle-button::before {
  content: "\2661"; /* empty heart */
  font-size: 18px;
  line-height: 1;
  color: #775973;
  transition: all 0.2s ease;
}

.ccc-favorite-post-toggle-button.is-favorite::before {
  content: "\2665"; /* filled heart */
  color: #775973;
}


/* Heart button animation */
@keyframes pbf-heart-pulse {
  0% { transform: scale(1); }
  25% { transform: scale(1.3); }
  50% { transform: scale(0.95); }
  100% { transform: scale(1); }
}

.ccc-favorite-post-toggle-button.pbf-loading::before {
  animation: pbf-heart-pulse 0.6s ease infinite;
  opacity: 0.5;
}

.ccc-favorite-post-toggle-button.is-favorite::before {
  animation: pbf-heart-pulse 0.35s ease;
}

/* Loading state */
.ccc-favorite-post-toggle-button.pbf-loading {
  pointer-events: none;
  opacity: 0.6;
}

/* No-style variant (for inline use) */
.pbf-no-style .ccc-favorite-post-toggle-button {
  background: none !important;
  border: none !important;
  padding: 0 !important;
}

/* =========================================================================
   FAVORITES LIST PAGE — TABS
   ========================================================================= */

.pbf-favorites-wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding-bottom: 120px;
}

.pbf-tabs-bar {
  display: flex;
  align-items: stretch;
  margin-bottom: 24px;
  border-bottom: 1px solid #e5e5e5;
  overflow: visible;
}

.pbf-tabs-scroll {
  display: flex;
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  flex-wrap: nowrap;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  gap: 0;
  padding-bottom: 0;
}

.pbf-tabs-scroll::-webkit-scrollbar {
  display: none;
}

.pbf-tab {
  flex-shrink: 0;
  padding: 12px 20px;
  border: none;
  background: transparent;
  color: #7a7a7a;
  font-size: 14px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  cursor: pointer;
  white-space: nowrap;
  background: none !important;
  border-bottom: 2px solid transparent;
  transition: all 0.2s ease;
  font-family: inherit;
}

/* Tab hover — no background */
.pbf-tab:hover {
  color: #775973 !important;
  background-color: transparent !important;
}

.pbf-tab:hover .pbf-tab-count {
  color: #775973 !important;
}

.pbf-tab.is-active {
  color: #2b2b2b;
  border-bottom-color: #775973;
}

/* Active tab should not get the purple hover background */
.pbf-tab.is-active:hover {
  background-color: transparent;
  color: #2b2b2b;
}

.pbf-tab.is-active:hover .pbf-tab-count {
  color: #775973;
}

.pbf-tab-count {
  font-size: 11px;
  color: #aaa;
  margin-left: 4px;
}

.pbf-tab.is-active .pbf-tab-count {
  color: #775973;
}

/* Add collection button — no hover state */
.pbf-tab.pbf-tab-add {
  flex-shrink: 0;
  font-size: 20px;
  font-weight: 300;
  color: #775973;
  padding: 8px 16px;
  line-height: 1;
}

.pbf-tab.pbf-tab-add:hover {
  color: #775973;
  background-color: transparent;
}

/* =========================================================================
   COLLECTION ACTIONS (rename / delete)
   ========================================================================= */



.pbf-collection-actions button {
  background: none !important;
  border: 1px solid #e0e0e0;
  border-radius: 20px;
  padding: 6px 16px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #7a7a7a;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.pbf-collection-actions button:hover {
  background: none !important;
  border-color: #775973;
  color: #775973;
}

.pbf-collection-delete:hover {
  border-color: #c0392b !important;
  color: #c0392b !important;
}


/* =========================================================================
   SELECT BUTTON
   ========================================================================= */




.pbf-select-btn {
  background: none !important;
  border: 1px solid #e0e0e0;
  border-radius: 20px;
  padding: 6px 18px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #2b2b2b;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.pbf-select-btn:hover,
.pbf-select-btn:focus,
.pbf-select-btn:active {
  border-color: #2b2b2b;
  color: #2b2b2b !important;
  background: none !important;
  outline: none;
}

.pbf-select-btn.pbf-select-active {
  width: 32px;
  height: 32px;
  padding: 0;
  font-size: 18px;
  line-height: 1;
  border-radius: 50%;
  border-color: #775973;
  color: #775973;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* =========================================================================
   SELECT MODE — CHECKBOX OVERLAY
   ========================================================================= */

.pbf-select-mode .pbf-item {
  cursor: pointer;
}

.pbf-select-mode .pbf-item .pbf-item-image::after {
  content: "";
  position: absolute;
  bottom: 8px;
  right: 8px;
  top: auto;
  left: auto;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid #fff;
  background: rgba(0, 0, 0, 0.25);
  z-index: 3;
  box-sizing: border-box;
  transition: all 0.15s ease;
}

.pbf-select-mode .pbf-item.pbf-selected .pbf-item-image::after {
  content: "\2713";
  background: #775973;
  border-color: #775973;
  color: #fff;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Dim non-selected cards slightly in select mode */
.pbf-select-mode .pbf-item:not(.pbf-selected) {
  opacity: 0.8;
}

.pbf-select-mode .pbf-item.pbf-selected {
  opacity: 1;
}

/* Hide the X remove button and + collection button in select mode */
.pbf-select-mode .pbf-item-remove-btn,
.pbf-select-mode .pbf-item-collection-btn,
.pbf-select-mode .pbf-item-collection-link {
  display: none !important;
}

/* =========================================================================
   INLINE SELECT ACTIONS (in select row)
   ========================================================================= */

.pbf-select-count {
  font-size: 12px;
  font-weight: 500;
  color: #7a7a7a;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.pbf-select-delete {
  display: none;
  background: none !important;
  border: 1px solid #e0e0e0;
  border-radius: 20px;
  padding: 6px 16px;
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #2b2b2b;
  transition: all 0.2s ease;
}

.pbf-select-all-btn {
  display: none;
  background: none !important;
  border: 1px solid #e0e0e0;
  border-radius: 20px;
  padding: 6px 16px;
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #2b2b2b;
  transition: all 0.2s ease;
}

.pbf-select-all-btn:hover,
.pbf-select-all-btn:focus,
.pbf-select-all-btn:active {
  border-color: #2b2b2b;
  color: #2b2b2b !important;
  background: none !important;
  outline: none;
}

.pbf-select-delete:hover {
  border-color: #c0392b;
  color: #c0392b;
  background: none !important;
}






/* =========================================================================
   FAVORITES HEADER
   ========================================================================= */

.pbf-favorites-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid #e5e5e5;
}

.pbf-saved-label {
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #2b2b2b;
}

.pbf-saved-count {
  font-size: 14px;
  font-weight: 600;
  color: #775973;
  margin-right: 4px;
}

.pbf-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}


@media (max-width: 767px) {
  .pbf-favorites-header {
    flex-wrap: wrap;
  }

  .pbf-header-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .pbf-select-count {
    width: 100%;
    text-align: right;
    order: 10;
  }
}
/* =========================================================================
   FAVORITES GRID
   ========================================================================= */

.pbf-grid {
  min-height: 50vh;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px 20px;
  row-gap: 36px;
}

@media (max-width: 1024px) {
  .pbf-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    row-gap: 30px;
  }
}

@media (max-width: 767px) {
  .pbf-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    row-gap: 28px;
  }
}

/* =========================================================================
   GRID ITEM
   ========================================================================= */

.pbf-item {
  position: relative;
  transition: opacity 0.3s ease;
}

.pbf-item-image {
  position: relative;
  width: 100%;
  padding-top: 100%; /* 1:1 square */
  overflow: visible;
  border-radius: 8px;
  background: #f0f0f0;
}

.pbf-item-image a {
  overflow: hidden;
  border-radius: 8px;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.pbf-item-image img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.2s ease;
}

.pbf-item:hover .pbf-item-image img {
  transform: scale(1.03);
}

.pbf-no-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #e8e4e7;
}

/* X remove button (bottom-right of image) */
.pbf-item-remove-btn {
  position: absolute;
  bottom: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.45);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: #fff;
  opacity: 0;
  transition: opacity 0.2s ease, background 0.2s ease;
  z-index: 2;
  line-height: 1;
  padding: 0;
}

.pbf-item:hover .pbf-item-remove-btn {
  opacity: 1;
}

.pbf-item-remove-btn:hover {
  background: rgba(0, 0, 0, 0.7);
}

/* Always show on touch devices */
@media (hover: none) {
  .pbf-item-remove-btn {
    opacity: 1;
  }
}


/* + Add to collection button (top-right of image) */
.pbf-item-collection-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.85) !important;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 300;
  color: #775973;
  opacity: 0;
  transition: opacity 0.2s ease;
  z-index: 2;
  line-height: 1;
  padding: 0;
}

.pbf-item:hover .pbf-item-collection-btn {
  opacity: 1;
}

.pbf-item-collection-btn:hover,
.pbf-item-collection-btn:focus,
.pbf-item-collection-btn:active {
  background: rgba(255, 255, 255, 0.85) !important;
  color: #775973 !important;
}

/* Always show on touch devices */
@media (hover: none) {
  .pbf-item-collection-btn {
    opacity: 1;
  }
}


/* Arrow "go to collection" button (shown after recipe is added) */
.pbf-item-collection-link {
  position: absolute !important;
  top: 8px !important;
  right: 8px !important;
  left: auto !important;
  width: 28px !important;
  height: 28px !important;
  min-width: 0 !important;
  max-width: 28px !important;
  border-radius: 50% !important;
  background: rgba(255, 255, 255, 0.85) !important;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none !important;
  font-size: 16px !important;
  font-weight: 600 !important;
  color: #775973 !important;
  z-index: 2 !important;
  line-height: 1 !important;
  padding: 0 !important;
  margin: 0 !important;
  border: none !important;
  opacity: 1 !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
}

.pbf-item-collection-link:hover {
  background: rgba(255, 255, 255, 0.85) !important;
  color: #775973 !important;
}

/* =========================================================================
   REMOVE CONFIRM OVERLAY (appears on image when X is clicked)
   ========================================================================= */

.pbf-remove-confirm {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  z-index: 10;
  border-radius: 8px;
}

.pbf-remove-confirm-text {
  color: #fff;
  font-size: 15px;
  font-weight: 500;
}

.pbf-remove-confirm-actions {
  display: flex;
  gap: 10px;
}

.pbf-remove-confirm-actions button {
  padding: 8px 18px;
  border: none;
  border-radius: 20px;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: opacity 0.2s;
}

.pbf-remove-yes {
  background: #775973 !important;
  color: #fff;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.pbf-remove-yes:hover {
  opacity: 0.85;
}

.pbf-remove-no {
  background: rgba(255, 255, 255, 0.25);
  color: #fff;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  padding: 0;
  font-size: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.pbf-remove-no:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.25) !important;
}

/* Responsive remove confirm */
.pbf-rc-mobile {
  display: none;
}

@media (max-width: 767px) {
  .pbf-rc-desktop {
    display: none !important;
  }

  .pbf-rc-mobile {
    display: inline-flex !important;
  }

  .pbf-remove-confirm {
    gap: 10px;
  }

  .pbf-remove-confirm-actions {
    gap: 8px;
  }

  .pbf-remove-confirm-actions button.pbf-rc-mobile {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    padding: 0;
    font-size: 16px;
    align-items: center;
    justify-content: center;
  }
}

/* Item info */
.pbf-item-info {
  padding: 10px 0 0 0;
}

.pbf-item-title {
  display: block;
  font-size: 16px;
  line-height: 1.3;
  color: #2b2b2b;
  text-decoration: none;
  margin-bottom: 1px;
}

@media (max-width: 767px) {
  .pbf-item-title {
    font-size: 14px;
  }
}

.pbf-item-category {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #775973;
  text-decoration: none;
}

a.pbf-item-category:hover {
  text-decoration: none;
}

/* =========================================================================
   EMPTY STATES
   ========================================================================= */

.pbf-empty-message,
.pbf-empty-filtered {
  grid-column: 1 / -1;
  text-align: center;
  color: #7a7a7a;
  font-size: 16px;
  padding: 60px 20px;
}

.pbf-login-message {
  text-align: center;
  color: #7a7a7a;
  font-size: 16px;
  padding: 60px 20px;
}

.pbf-login-message a {
  color: #775973;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* =========================================================================
   MODALS
   ========================================================================= */

.pbf-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pbf-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.pbf-modal-content {
  position: relative;
  background: #fff;
  border-radius: 16px;
  padding: 32px;
  max-width: 400px;
  width: 90%;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.15);
  z-index: 1;
}

.pbf-modal-content h3 {
  margin: 0 0 20px 0;
  font-size: 18px;
  color: #2b2b2b;
}

.pbf-modal-close {
  position: absolute;
  top: 12px;
  right: 16px;
  background: none;
  border: none;
  font-size: 24px;
  color: #aaa;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
}

.pbf-modal-close:hover {
  color: #2b2b2b;
}

.pbf-collection-name-input,
.pbf-rename-input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid #ddd;
  border-radius: 22px;
  font-size: 16px;
  font-family: inherit;
  color: #2b2b2b;
  box-sizing: border-box;
  outline: none;
  transition: border-color 0.2s;
}

.pbf-collection-name-input:focus,
.pbf-rename-input:focus {
  border-color: #775973;
}

.pbf-modal-save {
  display: block;
  width: 100%;
  margin-top: 16px;
  padding: 14px 20px;
  background: #775973;
  color: #fff;
  border: none;
  border-radius: 22px;
  font-size: 16px;
  font-family: inherit;
  cursor: pointer;
  transition: background-color 0.2s;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.pbf-modal-save:hover {
  background: #2b2b2b;
}

.pbf-modal-save:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}


/* Bulk remove modal text */
.pbf-bulk-remove-text {
  color: #7a7a7a;
  font-size: 14px;
  margin: 0 0 8px 0;
  line-height: 1.5;
}

.pbf-bulk-remove-confirm {
  background: #775973 !important;
}

.pbf-bulk-remove-confirm:hover {
  background: #2b2b2b !important;
}

/* =========================================================================
   MENU LINK (shortcode)
   ========================================================================= */

.pbf-menu-link {
  color: inherit;
  text-decoration: none;
}

.pbf-menu-count {
  font-size: 0.85em;
  color: #7a7a7a;
}
