/**
 * YOOAdmin - Pages page styles
 *
 * @package YOOAdmin
 */

/* WordPress / WooCommerce role chips (Front page, Blog, Shop, …) */
.yoo-page-wp-roles {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: flex-start;
  justify-content: flex-end;
}

.yoo-page-wp-role {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.06);
  color: inherit;
  cursor: default;
}

.yoo-page-wp-role .dashicons {
  font-size: 14px;
  width: 14px;
  height: 14px;
}

/* Card image: tags top-right over featured image */
.yoo-page-image .yoo-page-wp-roles {
  position: absolute;
  top: 8px;
  right: 8px;
  left: 12px;
  margin: 0;
  z-index: 4;
  max-width: none;
  pointer-events: none;
}

.yoo-page-image .yoo-page-wp-role {
  pointer-events: auto;
  background: rgba(0, 0, 0, 0.72);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
}

.yoo-page-image .yoo-page-wp-role .dashicons {
  color: rgba(255, 255, 255, 0.95);
}

/* Table thumbnail: compact tags on image */
.yoo-table-thumb-wrap {
  position: relative;
  display: inline-block;
  max-width: 100%;
  vertical-align: top;
}

.yoo-table-thumb-wrap .yoo-page-wp-roles {
  position: absolute;
  top: 4px;
  right: 4px;
  left: 4px;
  margin: 0;
  z-index: 2;
  justify-content: flex-end;
  pointer-events: none;
}

.yoo-table-thumb-wrap .yoo-page-wp-role {
  pointer-events: auto;
  font-size: 9px;
  padding: 2px 6px;
  gap: 3px;
  background: rgba(0, 0, 0, 0.78);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.yoo-table-thumb-wrap .yoo-page-wp-role .dashicons {
  font-size: 11px;
  width: 11px;
  height: 11px;
  color: rgba(255, 255, 255, 0.95);
}

.yooadmin-pages-page {
  max-width: 1400px;
  margin: 0 auto;
  padding: 24px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
  color: var(--yp-text);
  box-sizing: border-box;
}

.yoo-pages-content-section {
  background: #fff;
  border: 1px solid #dcdcde;
  border-radius: 8px;
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  box-sizing: border-box;
}

/* Remove negative margins since content is now in a section */
.yooadmin-pages-page #yoo-pages-content.yoo-view-table {
  margin-left: 0;
  margin-right: 0;
  padding-left: 0;
  padding-right: 0;
  width: 100%;
  box-sizing: border-box;
}

/* Hero Section */
.yoo-pages-hero {
  background: #fff;
  border: 1px solid #dcdcde;
  border-radius: 8px;
  padding: 20px 24px;
  margin-bottom: 20px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.yoo-pages-hero__body {
  display: flex;
  flex-direction: column;
  gap: 0;
  position: relative;
}

.yoo-pages-hero__top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 0;
  flex-wrap: wrap;
}

.yoo-pages-hero__eyebrow {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  background: #f0f0f1;
  border-radius: 4px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #646970;
  font-weight: 500;
}

.yoo-pages-hero__actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
  flex-wrap: wrap;
}

.yoo-pages-hero__actions .yoo-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: var(--_yp-primary, #eda934);
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.yoo-pages-hero__actions .yoo-button:hover {
  background: color-mix(in srgb, var(--_yp-primary, #eda934) 90%, #000);
  color: #fff !important;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
  transform: translateY(-1px);
}

.yoo-pages-hero__actions .yoo-button:hover * {
  color: #fff !important;
}

.yoo-pages-hero__actions .yoo-button .dashicons {
  font-size: 16px;
  width: 16px;
  height: 16px;
}

/* Add New: keep label + icon white on hover (WP admin link:hover can override) */
.yoo-pages-hero__actions .yoo-button.yoo-button--primary:hover,
.yoo-pages-hero__actions .yoo-button.yoo-button--primary:hover * {
  color: #fff !important;
}

.yoo-pages-hero h1 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  color: #1d2327;
  display: flex;
  align-items: center;
  gap: 8px;
}

.yoo-pages-hero h1 .dashicons {
  font-size: 20px;
  width: 20px;
  height: 20px;
  color: var(--_yp-primary, #eda934);
}

.yoo-pages-search-wrapper {
  position: relative;
  flex: 1 1 auto;
  min-width: 200px;
  max-width: 400px;
}

.yoo-pages-search-wrapper .dashicons {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #8c8f94;
  font-size: 18px;
  width: 18px;
  height: 18px;
  pointer-events: none;
  z-index: 1;
  transition: color 0.2s ease;
}

.yoo-pages-search-input {
  width: 100%;
  padding: 8px 12px 8px 38px !important;
  border: 1px solid #dcdcde !important;
  border-radius: 4px;
  font-size: 14px;
  background: #fff;
  height: 36px;
  box-sizing: border-box;
  transition: all 0.2s ease;
}

.yoo-pages-search-input:hover {
  border-color: #c3c4c7 !important;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.06);
}

.yoo-pages-search-input:focus {
  outline: none !important;
  border-color: var(--_yp-primary, #eda934) !important;
  box-shadow: 0 0 0 3px rgba(238, 180, 78, 0.1), 0 2px 4px rgba(0, 0, 0, 0.06) !important;
}

.yoo-pages-search-input:focus + .dashicons,
.yoo-pages-search-wrapper:focus-within .dashicons {
  color: var(--_yp-primary, #eda934);
}

/* Metrics Toggle Button */
.yoo-pages-metrics-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  margin-top: 12px;
  background: #f6f7f7;
  border: 1px solid #dcdcde;
  border-radius: 4px;
  font-size: 12px;
  color: #646970;
  cursor: pointer;
  transition: all 0.2s ease;
}

.yoo-pages-metrics-toggle:hover {
  background: #e8e8e8;
  border-color: #c3c4c7;
}

.yoo-pages-metrics-toggle .dashicons {
  font-size: 16px;
  width: 16px;
  height: 16px;
  transition: transform 0.2s ease;
}

.yoo-pages-metrics-toggle.is-expanded .dashicons {
  transform: rotate(180deg);
}

/* Metrics */
.yoo-pages-hero__metrics {
  display: none; /* Hidden by default */
  flex-direction: row;
  gap: 16px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid #f0f0f1;
  flex-wrap: wrap;
  animation: slideDown 0.3s ease;
}

.yoo-pages-hero__metrics.is-visible {
  display: flex;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.yoo-pages-metric {
  padding: 12px 16px;
  background: #f6f7f7;
  border-radius: 6px;
  border: 1px solid #e0e0e0;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
  flex: 1 1 auto;
  min-width: 140px;
}

.yoo-pages-metric__icon {
  width: 40px;
  height: 40px;
  border-radius: 6px;
  background: rgba(238, 180, 78, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.yoo-pages-metric__icon .dashicons {
  font-size: 20px;
  width: 20px;
  height: 20px;
  color: var(--_yp-primary, #eda934);
}

.yoo-pages-metric__content {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.yoo-pages-metric__value {
  font-size: 20px;
  font-weight: 700;
  color: #1d2327;
  line-height: 1.2;
}

.yoo-pages-metric__label {
  font-size: 11px;
  font-weight: 500;
  color: #646970;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Toolbar */
.yoo-pages-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

/* View Toggle */
.yoo-view-toggle {
  display: flex;
  align-items: center;
  gap: 4px;
  background: #fff;
  border: 1px solid #dcdcde;
  border-radius: 4px;
  padding: 2px;
}

.yoo-view-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  color: var(--yp-text);
  cursor: pointer;
  border-radius: 3px;
  transition: all 0.15s ease;
  padding: 0;
}

.yoo-view-btn:hover {
  background: #f6f7f7;
  color: #2c3338;
}

.yoo-view-btn.is-active {
  background: var(--_yp-primary, #eda934);
  color: #fff;
}

.yoo-view-btn .dashicons {
  font-size: 18px;
  width: 18px;
  height: 18px;
}

.yoo-pages-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.yoo-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border: 1px solid #dcdcde;
  border-radius: 4px;
  background: #fff;
  color: #2c3338;
  text-decoration: none;
  font-size: 13px;
  transition: all 0.15s ease;
}

.yoo-filter-chip:hover {
  background: #f6f7f7;
  border-color: #8c8f94;
  color: #2c3338;
  text-decoration: none;
}

.yoo-filter-chip.is-active {
  background: var(--_yp-primary, #eda934);
  border-color: var(--_yp-primary, #eda934);
  color: #fff;
}

.yoo-filter-count {
  padding: 2px 6px;
  background: rgba(0, 0, 0, 0.1);
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
}

.yoo-filter-chip.is-active .yoo-filter-count {
  background: rgba(255, 255, 255, 0.3);
}

/* Bulk Actions */
.yoo-bulk-actions-bar {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: #f6f7f7;
  border: 1px solid #dcdcde;
  border-radius: 4px;
  margin-bottom: 16px;
}

.yoo-bulk-actions-bar.show {
  display: flex;
}

.yoo-bulk-actions-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.yoo-checkbox {
  width: 18px;
  height: 18px;
}

.yoo-selected-count {
  font-size: 14px;
  color: var(--yp-text);
}

.yoo-bulk-select {
  padding: 6px 24px 6px 8px;
  border: 1px solid #dcdcde;
  border-radius: 4px;
  font-size: 14px;
  background: #fff;
}

/* Pages Grid */
.yoo-pages-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}

.yoo-page-card {
  position: relative;
  background: #fff;
  border: 1px solid #dcdcde;
  border-radius: 8px;
  overflow: hidden;
  transition: all 0.2s ease;
}

.yoo-page-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

.yoo-page-checkbox {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 10;
  width: 18px;
  height: 18px;
}

.yoo-page-image {
  position: relative;
  width: 100%;
  height: 200px;
  overflow: hidden;
  background: #f0f0f1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.yoo-page-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.yoo-page-image-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #f5f5f5 0%, #e8e8e8 100%);
  color: #a0a0a0;
  gap: 8px;
}

.yoo-page-image-placeholder .dashicons {
  font-size: 48px;
  width: 48px;
  height: 48px;
  color: #c3c4c7;
}

.yoo-page-image-placeholder .yoo-placeholder-text {
  font-size: 12px;
  font-weight: 500;
  color: #8c8f94;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.yoo-page-content {
  padding: 16px;
}

.yoo-page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
  min-width: 0;
}

.yoo-page-title {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.35;
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.yoo-page-title a {
  display: block;
  color: var(--yp-text);
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.yoo-page-title a:hover {
  color: var(--_yp-primary, #eda934);
}

.yoo-page-header .yoo-page-status {
  flex-shrink: 0;
}

.yoo-page-status {
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  white-space: nowrap;
}

.yoo-page-status--publish {
  background: #00a32a;
  color: #fff;
}

.yoo-page-status--draft {
  background: var(--yp-text);
  color: #fff;
}

.yoo-page-status--trash {
  background: #d63638;
  color: #fff;
}

.yoo-page-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 12px;
  font-size: 13px;
  color: var(--yp-text);
}

.yoo-page-meta-item {
  display: flex;
  align-items: center;
  gap: 4px;
}

.yoo-page-meta-item .dashicons {
  font-size: 16px;
  width: 16px;
  height: 16px;
}

.yoo-page-excerpt {
  margin: 0 0 12px 0;
  font-size: 13px;
  color: var(--yp-text);
  line-height: 1.6;
}

.yoo-page-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding-top: 12px;
  border-top: 1px solid #f0f0f1;
}

.yoo-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 8px;
  border: 1px solid #dcdcde;
  border-radius: 4px;
  background: #fff;
  color: #2c3338;
  text-decoration: none !important;
  font-size: 13px;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
  box-shadow: none;
}

.yoo-action-btn:hover {
  background: #f6f7f7;
  border-color: #8c8f94;
  color: var(--_yp-primary, #eda934);
  text-decoration: none !important;
}

.yoo-action-btn.danger {
  color: #d63638;
  border-color: #d63638;
}

.yoo-action-btn.danger:hover {
  background: #d63638;
  color: #fff;
}

.yoo-action-btn .dashicons {
  font-size: 16px;
  width: 16px;
  height: 16px;
}

/* Row actions: no link underline; hover = soft brand tint */
.yooadmin-pages-page .yoo-page-actions .yoo-action-btn {
  text-decoration: none !important;
  box-shadow: none;
}

body.yoo-focus .yooadmin-pages-page .yoo-page-actions a.yoo-action-btn:not(.danger):hover,
body.yoo-focus .yooadmin-pages-page .yoo-page-actions a.yoo-action-btn:not(.danger):focus,
body.yoo-focus .yooadmin-pages-page .yoo-page-actions a.yoo-action-btn:not(.danger):focus-visible,
body.yoo-focus .yooadmin-pages-page .yoo-page-actions button.yoo-action-btn:not(.danger):hover,
body.yoo-focus .yooadmin-pages-page .yoo-page-actions button.yoo-action-btn:not(.danger):focus,
body.yoo-focus .yooadmin-pages-page .yoo-page-actions button.yoo-action-btn:not(.danger):focus-visible {
  text-decoration: none !important;
  outline: none;
  background: color-mix(in srgb, var(--_yp-primary, #eda934) 12%, #fff) !important;
  border-color: var(--_yp-primary, #eda934) !important;
  color: var(--_yp-primary, #eda934) !important;
}

body.yoo-focus .yooadmin-pages-page .yoo-page-actions a.yoo-action-btn.danger:hover,
body.yoo-focus .yooadmin-pages-page .yoo-page-actions a.yoo-action-btn.danger:focus,
body.yoo-focus .yooadmin-pages-page .yoo-page-actions button.yoo-action-btn.danger:hover,
body.yoo-focus .yooadmin-pages-page .yoo-page-actions button.yoo-action-btn.danger:focus {
  text-decoration: none !important;
  outline: none;
}

/* Empty State */
.yoo-pages-empty {
  text-align: center;
  padding: 60px 20px;
  background: #fff;
  border: 1px solid #dcdcde;
  border-radius: 8px;
}

.yoo-empty-illustration {
  margin-bottom: 20px;
}

.yoo-empty-illustration .dashicons {
  font-size: 64px;
  width: 64px;
  height: 64px;
  color: #dcdcde;
}

.yoo-pages-empty h2 {
  margin: 0 0 8px 0;
  font-size: 20px;
  font-weight: 600;
  color: var(--yp-text);
}

.yoo-pages-empty p {
  margin: 0;
  font-size: 14px;
  color: var(--yp-text);
}

/* Pagination */
.yoo-pages-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 24px;
}

.yoo-pagination-link,
.yoo-pagination-prev,
.yoo-pagination-next {
  padding: 8px 12px;
  border: 1px solid #dcdcde;
  border-radius: 4px;
  background: #fff;
  color: #2c3338;
  text-decoration: none;
  font-size: 14px;
  transition: all 0.15s ease;
}

.yoo-pagination-link:hover,
.yoo-pagination-prev:hover,
.yoo-pagination-next:hover {
  background: #f6f7f7;
  border-color: #8c8f94;
  text-decoration: none;
}

.yoo-pagination-current {
  padding: 8px 12px;
  border: 1px solid var(--_yp-primary, #eda934);
  border-radius: 4px;
  background: var(--_yp-primary, #eda934);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
}

/* Table View */
.yoo-pages-table {
  background: #fff;
  border: 1px solid #e5e5e5;
  border-radius: 12px;
  overflow: hidden;
  margin: 0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  width: 100%;
  max-width: 100%;
  display: block;
  box-sizing: border-box;
}

.yoo-pages-table table {
  width: 100%;
  border-collapse: collapse;
  margin: 0;
  padding: 0;
  table-layout: auto;
  border-spacing: 0;
  border-radius: 12px;
  overflow: hidden;
}

.yoo-pages-table .column-title {
  min-width: 200px;
  width: auto;
}

.yoo-pages-table .column-author,
.yoo-pages-table .column-parent,
.yoo-pages-table .column-date {
  width: auto;
  min-width: 120px;
}

.yoo-pages-table thead th {
  background: #fafafa;
  border-bottom: 2px solid #f0f0f1;
  padding: 14px 16px;
  text-align: left;
  font-weight: 600;
  font-size: 12px;
  color: var(--yp-text);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  position: relative;
  margin: 0;
}

.yoo-pages-table thead th:first-child {
  border-top-left-radius: 12px;
}

.yoo-pages-table thead th:last-child {
  border-top-right-radius: 12px;
}

.yoo-pages-table thead th.sortable {
  cursor: pointer;
  user-select: none;
  transition: background-color 0.15s ease;
}

.yoo-pages-table thead th.sortable:hover {
  background: #f5f5f5;
}

.yoo-pages-table thead th .yoo-sort-link {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--yp-text);
  text-decoration: none;
  width: 100%;
}

.yoo-pages-table thead th .yoo-sort-link:hover {
  color: #2c3338;
}

.yoo-pages-table thead th.sortable .sorting-indicator {
  display: inline-block;
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 4px solid #c3c4c7;
  margin-left: 4px;
  opacity: 0.5;
  transition: all 0.15s ease;
}

.yoo-pages-table thead th.sortable.sort-asc .sorting-indicator {
  border-top: none;
  border-bottom: 4px solid var(--_yp-primary, #eda934);
  opacity: 1;
}

.yoo-pages-table thead th.sortable.sort-desc .sorting-indicator {
  border-top: 4px solid var(--_yp-primary, #eda934);
  border-bottom: none;
  opacity: 1;
}

.yoo-pages-table tbody td {
  padding: 14px 16px;
  border-bottom: 1px solid #f5f5f5;
  font-size: 14px;
  color: #2c3338;
  vertical-align: middle;
}

.yoo-pages-table tbody tr {
  transition: background-color 0.15s ease;
}

.yoo-pages-table tbody tr:hover {
  background: #fafafa;
}

.yoo-pages-table tbody tr:last-child td {
  border-bottom: none;
}

.yoo-pages-table tbody tr:last-child td:first-child {
  border-bottom-left-radius: 12px;
}

.yoo-pages-table tbody tr:last-child td:last-child {
  border-bottom-right-radius: 12px;
}

/* Thumbnail Column */
.yoo-pages-table .column-thumbnail {
  width: 60px;
  padding: 10px 16px !important;
}

.yoo-table-thumbnail {
  width: 50px;
  height: 50px;
  border-radius: 6px;
  overflow: hidden;
  background: #f5f5f5;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.yoo-table-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.yoo-table-thumbnail--placeholder {
  background: #f0f0f1;
}

.yoo-table-thumbnail--placeholder .dashicons {
  font-size: 24px;
  width: 24px;
  height: 24px;
  color: #c3c4c7;
}

/* Title Column */
.yoo-pages-table .column-title {
  min-width: 200px;
  max-width: min(520px, 58vw);
  overflow: hidden;
  vertical-align: top;
}

.yoo-pages-table .row-title {
  color: #2c3338;
  text-decoration: none;
  font-weight: 500;
  font-size: 14px;
  line-height: 1.5;
  display: block;
  max-width: 100%;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.yoo-pages-table .row-title:hover {
  color: var(--_yp-primary, #eda934);
}

.yoo-pages-table .row-actions {
  visibility: hidden;
  font-size: 12px;
  margin-top: 4px;
}

.yoo-pages-table tbody tr:hover .row-actions {
  visibility: visible;
}

.yoo-pages-table .row-actions a {
  color: var(--yp-text);
  text-decoration: none;
  margin-right: 8px;
  transition: color 0.15s ease;
}

.yoo-pages-table .row-actions a:hover {
  color: var(--_yp-primary, #eda934);
}

.yoo-pages-table .row-actions span {
  color: #dcdcde;
  margin: 0 4px;
}

.yoo-pages-table .yoo-action-link {
  cursor: pointer;
}

/* Author Column */
.yoo-pages-table .column-author {
  color: var(--yp-text);
  font-size: 13px;
}

/* Parent Column */
.yoo-pages-table .column-parent {
  color: var(--yp-text);
  font-size: 13px;
}

/* Date Column */
.yoo-pages-table .column-date {
  color: var(--yp-text);
  font-size: 13px;
  white-space: nowrap;
}

/* Status Column */
.yoo-pages-table .column-status {
  width: 100px;
  text-align: center;
}

/* Ensure table fills container */
.yoo-pages-table-wrapper {
  width: 100%;
  overflow-x: auto;
}

.yoo-pages-table {
  min-width: 100%;
}

.yoo-pages-table .yoo-page-status {
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  display: inline-block;
  white-space: nowrap;
}

.yoo-pages-table .yoo-page-status--publish {
  background: #d1e7dd;
  color: #0f5132;
}

.yoo-pages-table .yoo-page-status--draft {
  background: #f8d7da;
  color: #842029;
}

.yoo-pages-table .yoo-page-status--trash {
  background: #f8d7da;
  color: #842029;
}

/* Checkbox Column */
.yoo-pages-table .check-column {
  width: 40px;
  padding: 14px 16px !important;
}

.yoo-pages-table .check-column input[type="checkbox"] {
  margin: 0;
}

/* View States */
#yoo-pages-content.yoo-view-table .yoo-pages-grid {
  display: none !important;
}

#yoo-pages-content.yoo-view-table .yoo-pages-table {
  display: block !important;
  width: 100% !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
}

#yoo-pages-content.yoo-view-cards .yoo-pages-grid {
  display: grid !important;
}

#yoo-pages-content.yoo-view-cards .yoo-pages-table {
  display: none !important;
}

/* Ensure no gaps */
#yoo-pages-content {
  width: 100%;
  margin: 0;
  padding: 0;
}

#yoo-pages-content.yoo-view-table {
  display: block;
  width: 100%;
}

/* Image Lightbox */
.yoo-image-lightbox {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.yoo-lightbox-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(4px);
  cursor: pointer;
}

.yoo-lightbox-container {
  position: relative;
  z-index: 1;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  animation: yoo-lightbox-fadein 0.3s ease;
}

@keyframes yoo-lightbox-fadein {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.yoo-lightbox-close {
  position: absolute;
  top: -50px;
  right: 0;
  background: rgba(255, 255, 255, 0.9);
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  z-index: 10;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.yoo-lightbox-close:hover {
  background: #fff;
  transform: scale(1.1);
}

.yoo-lightbox-close .dashicons {
  font-size: 24px;
  width: 24px;
  height: 24px;
  color: #2c3338;
}

.yoo-lightbox-content {
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

.yoo-lightbox-image {
  max-width: 100%;
  max-height: calc(90vh - 60px);
  width: auto;
  height: auto;
  display: block;
  object-fit: contain;
}

.yoo-lightbox-title {
  padding: 16px 24px;
  background: #fff;
  border-top: 1px solid #e5e5e5;
  font-size: 14px;
  font-weight: 600;
  color: #2c3338;
  text-align: center;
}

.yoo-image-lightbox-trigger {
  transition: opacity 0.2s ease;
}

.yoo-image-lightbox-trigger:hover {
  opacity: 0.9;
}

/* Infinite Scroll Loading */
.yoo-loading-more {
  grid-column: 1 / -1;
  text-align: center;
  padding: 32px 20px;
  color: var(--yp-text);
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.yoo-loading-more .spinner {
  float: none;
  margin: 0;
  visibility: visible;
}

.yoo-pages-table .yoo-loading-more {
  display: table-row;
  grid-column: auto;
}

.yoo-pages-table .yoo-loading-more td {
  text-align: center;
  padding: 32px 20px;
  color: var(--yp-text);
  font-size: 14px;
}

/* Pagination - Hidden when using infinite scroll */
.yoo-pages-pagination {
  display: none; /* Hidden by default, shown only if infinite scroll fails */
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 24px;
}

/* Success/Error toasts (same as posts-page) */
.yoo-notice {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  margin: 16px 0;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  position: relative;
}

.yoo-notice.visible {
  opacity: 1;
  transform: translateY(0);
}

.yoo-notice-success {
  background: #d1e7dd;
  border-left: 4px solid #0f5132;
  color: #0f5132;
}

.yoo-notice-error {
  background: #f8d7da;
  border-left: 4px solid #842029;
  color: #842029;
}

.yoo-notice-info {
  background: #cff4fc;
  border-left: 4px solid #055160;
  color: #055160;
}

.yoo-notice-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

.yoo-notice-icon .dashicons {
  font-size: 20px;
  width: 20px;
  height: 20px;
}

.yoo-notice p {
  margin: 0;
  flex: 1;
  font-size: 14px;
  font-weight: 500;
}

.yoo-notice-close {
  background: transparent;
  border: none;
  color: inherit;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.7;
  transition: opacity 0.2s ease;
}

.yoo-notice-close:hover {
  opacity: 1;
}

/* ========== Delete confirmation popup (pages CSS loads without posts rules) ========== */
.yoo-delete-popup-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999999;
  opacity: 0;
  transition: opacity 0.3s ease;
  backdrop-filter: blur(2px);
}

.yoo-delete-popup-overlay.visible {
  opacity: 1;
}

.yoo-delete-popup {
  background: #fff;
  border-radius: 12px;
  padding: 32px;
  max-width: 480px;
  width: 90%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  transform: scale(0.9) translateY(20px);
  transition: transform 0.3s ease, opacity 0.3s ease;
  opacity: 0;
}

.yoo-delete-popup-overlay.visible .yoo-delete-popup {
  transform: scale(1) translateY(0);
  opacity: 1;
}

.yoo-delete-popup-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 20px;
  background: #fff8e5;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.yoo-delete-popup-icon .dashicons {
  font-size: 32px;
  width: 32px;
  height: 32px;
  color: var(--_yp-primary, #eda934);
}

.yoo-delete-popup h3 {
  margin: 0 0 12px 0;
  font-size: 20px;
  font-weight: 600;
  color: var(--yp-text);
  text-align: center;
}

.yoo-delete-popup p {
  margin: 0 0 24px 0;
  font-size: 14px;
  line-height: 1.6;
  color: var(--yp-text);
  text-align: center;
}

.yoo-delete-popup p strong {
  color: var(--yp-text);
  font-weight: 600;
}

.yoo-delete-popup-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.yoo-popup-btn {
  padding: 10px 24px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  min-width: 100px;
}

.yoo-popup-cancel {
  background: #f6f7f7;
  color: var(--yp-text);
}

.yoo-popup-cancel:hover {
  background: #e5e7eb;
  color: var(--yp-text);
}

.yoo-popup-delete {
  background: #d63638;
  color: #fff;
}

.yoo-popup-delete:hover {
  background: #b32d2e;
}

.yoo-popup-delete:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

