.sydney-pattern-library-modal {
  --border-color: #0000001a;
  --border-color-hover: #0000004d;
  --color-heading: #1D2327;
}

.sydney-pattern-library-modal > div > div {
  height: 100%;
}

.sydney-pattern-library-modal .components-base-control__field {
  margin: 0;
}

.sydney-pattern-library-modal .components-modal__content {
  padding: 0;
}

/* Modal layout */
.sydney-pattern-library-modal-container {
  height: 100%;
}

.sydney-pattern-library-modal-sidebar {
  width: 240px;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100%;
}

.sydney-pattern-library-modal-content {
  flex: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--border-color);
}

.sydney-pattern-library-modal-content h4 {
  color: var(--color-heading);
  font-size: 14px;
  font-weight: 500;
  text-transform: none;
  letter-spacing: normal;
  margin: 0;
}

.sydney-pattern-library-modal-content button[role="combobox"] {
  border-color: #C3C4C7 !important;
  border-radius: 4px;
  padding: 8px 10px;
  height: 36px !important;
  min-width: 120px !important;
}

.sydney-pattern-library-modal-content button[role="combobox"][aria-expanded="true"] ~ span svg {
  transform: rotate(180deg);
}

.sydney-pattern-library-modal-content .components-custom-select-control .components-input-control__backdrop,
.sydney-pattern-library-modal-content .components-custom-select-control .components-flex {
  border-color: #C3C4C7 !important;
  border-radius: 4px;
}

.sydney-pattern-library-modal-content .components-base-control__label {
  display: none;
}

.sydney-pattern-library-modal-content [data-dialog] {
  border: none !important;
}
.sydney-pattern-library-modal-content[data-dialog] .components-custom-select-control__item {
  padding: 16px;
  line-height: 1.1;
}
.sydney-pattern-library-modal-content [data-dialog] [data-active-item] {
  background-color: #F5F5F5;
}

.sydney-pattern-library-modal-content .components-custom-select-control svg {
  stroke: #A7AAAD;
  transition: transform 0.3s ease;
}

.sydney-pattern-library-modal-header {
  padding: 0 28px 0 28px;
  position: sticky;
  height: 80px;
  top: 0;
  background: #fff;
  z-index: 10;
  border-bottom: 1px solid var(--border-color);
}
.sydney-pattern-library-modal-title-container {
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  border-bottom: 1px solid var(--border-color);
  padding: 0 28px;
  width: 100%;
}
.sydney-pattern-library-modal-title {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.sydney-pattern-library-modal-title svg {
  width: 20px;
  height: 20px;
}

.sydney-pattern-library-modal-sidebar-content {
  padding: 28px;
  width: 100%;
}

.sydney-pattern-library-modal-sidebar-content .sydney-pattern-library-modal-search,
.sydney-pattern-library-modal-sidebar-content .components-search-control {
  margin-bottom: 28px;
}
/* Grid container — must be position:relative so the overlay can fill it */
.sydney-pattern-library-modal-grid-container {
  position: relative;
  flex: 1;
  overflow-y: auto;
}

/* Full-area loading overlay — mirrors Extendify's ModalContent pattern */
.sydney-pattern-library-loading-overlay {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.85);
}

/* Spinner — CSS-only, no external dependencies */
.sydney-pattern-library-spinner {
  display: block;
  width: 28px;
  height: 28px;
  border: 3px solid #ddd;
  border-top-color: #007cba;
  border-radius: 50%;
  animation: sydney-pattern-library-spin 0.7s linear infinite;
}

@keyframes sydney-pattern-library-spin {
  to {
    transform: rotate(360deg);
  }
}

.sydney-pattern-library-no-patterns {
  padding: 40px;
}

.sydney-pattern-library-pattern-grid {
  position: relative;
  column-count: 2;
  column-gap: 28px;
  padding: 28px;
  background-color: #fff;
  min-height: 100%;
}
.sydney-pattern-library-pattern-item {
  position: relative;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  overflow: hidden;
  cursor: pointer;
  background: #fff;
  transition: box-shadow 0.15s ease;
  padding: 0;
  width: 100%;
  text-align: left;
  break-inside: avoid;
  margin-bottom: 28px;
  transition: all 0.3s ease;
}
.sydney-pattern-library-pattern-item:hover {
  border-color: var(--border-color-hover);
  outline: none;
}
.sydney-pattern-library-pattern-item:focus {
  box-shadow: 0 12px 24px 0 rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
  outline: none;
}
.sydney-pattern-library-pro-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: #1d2327;
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 2px;
  z-index: 10;
  pointer-events: none;
}
/* Per-card skeleton shown while the BlockPreview iframe is loading */
.sydney-pattern-library-pattern-item {
  min-height: 180px;
}
.sydney-pattern-library-pattern-skeleton {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    #f0f0f0 25%,
    #e4e4e4 50%,
    #f0f0f0 75%
  );
  background-size: 200% 100%;
  animation: sydney-pattern-library-shimmer 1.5s ease-in-out infinite;
  border-radius: 4px;
}

@keyframes sydney-pattern-library-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.sydney-pattern-library-toolbar-btn {
  cursor: pointer;
  height: 36px !important;
  min-width: 36px;
  padding: 0 12px;
  display: flex;
  align-items: center;
}
.sydney-pattern-library-toolbar-btn-text {
  margin-left: 8px;
}
@media (max-width: 1200px) {
  .sydney-pattern-library-pattern-grid {
    column-count: 2;
  }
}
@media (max-width: 782px) {
  .sydney-pattern-library-pattern-grid {
    column-count: 1;
  }
}
@media (max-width: 960px) {
  .sydney-pattern-library-toolbar-btn-text {
    display: none;
  }
}
