@import url("../../assets/css/fonts.css");

.greeting-hero {
  background:
    radial-gradient(
      circle at 85% 20%,
      rgba(242, 169, 59, 0.2),
      transparent 28%
    ),
    linear-gradient(135deg, #edf3ff, #f7f8fb);
}
.greeting-library {
  padding-top: 42px;
}
.category-table-wrap,
.editor-shell {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.category-table {
  border-collapse: collapse;
  width: 100%;
}
.category-table th,
.category-table td {
  border-bottom: 1px solid var(--line);
  padding: 15px 18px;
  text-align: left;
}
.category-table thead {
  background: var(--ink);
  color: #fff;
}
.category-table tbody tr:last-child th,
.category-table tbody tr:last-child td {
  border-bottom: 0;
}
.category-table tbody th {
  font-family: "Space Grotesk", sans-serif;
}
.category-jump {
  background: none;
  border: 0;
  padding: 0;
}
.gallery-toolbar {
  align-items: end;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: space-between;
  margin: 28px 0 20px;
}
.gallery-toolbar label {
  color: var(--muted);
  display: grid;
  font-size: 0.82rem;
  font-weight: 700;
  gap: 6px;
}
.gallery-toolbar select,
.editor-controls input,
.editor-controls select {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--ink);
  min-height: 42px;
  padding: 8px 12px;
}
#greeting-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(4, 1fr);
  scroll-margin-top: 96px;
}
.greeting-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition:
    box-shadow 0.25s,
    transform 0.25s;
}
.greeting-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-3px);
}
.greeting-image {
  align-items: center;
  aspect-ratio: 16 / 9;
  background: #eef1f6;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: center;
  overflow: hidden;
}
.greeting-image img {
  height: 100%;
  object-fit: contain;
  width: 100%;
}
.greeting-card-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 15px;
}
.greeting-card-body > span {
  color: var(--muted);
  display: block;
  font-size: 0.72rem;
  min-height: 38px;
}
.greeting-card h3 {
  font-size: 1rem;
  margin: 7px 0 13px;
}
.greeting-card-actions {
  display: grid;
  gap: 8px;
  margin-top: auto;
}
.greeting-card .button {
  align-items: center;
  display: inline-flex;
  font-size: 0.82rem;
  gap: 6px;
  justify-content: center;
  padding: 9px 12px;
  width: 100%;
}
.greeting-card-actions .button-soft {
  background: var(--accent);
  color: var(--ink);
}
.greeting-card-actions .button-soft:hover {
  background: #d98d20;
}
.gallery-pager {
  align-items: center;
  display: flex;
  gap: 14px;
  justify-content: center;
  margin: 28px 0 5px;
}
.gallery-pager .button {
  min-width: 105px;
}
#gallery-status,
#page-status {
  color: var(--muted);
  font-size: 0.85rem;
}
.editor-layout {
  align-items: start;
  display: grid;
  gap: 24px;
  grid-template-columns: minmax(0, 1fr) 320px;
  margin-bottom: 80px;
}
.editor-canvas-wrap {
  align-items: center;
  background: #e9edf4;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  min-height: 560px;
  overflow: auto;
  padding: 28px;
}
#card-canvas {
  background-color: #fff;
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
  box-shadow: var(--shadow);
  flex: 0 0 auto;
  margin: auto;
  overflow: hidden;
  position: relative;
}
.editor-element {
  cursor: move;
  position: absolute;
  user-select: none;
}
.editor-element[data-element-type="text"] {
  padding-left: 16px !important;
}
.editor-element.selected {
  outline: 2px solid var(--brand);
  outline-offset: 3px;
}
.editor-element img {
  display: block;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  width: 100%;
}
.editor-element[class*=" shape-"] img {
  object-fit: cover;
}
.editor-element.shape-rounded {
  border-radius: 18px;
  overflow: hidden;
}
.editor-element.shape-circle {
  border-radius: 50%;
  overflow: hidden;
}
.editor-element.shape-diamond {
  clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
  overflow: hidden;
}
.editor-element.shape-triangle {
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
  overflow: hidden;
}
.editor-element.shape-octagon {
  clip-path: polygon(
    30% 0,
    70% 0,
    100% 30%,
    100% 70%,
    70% 100%,
    30% 100%,
    0 70%,
    0 30%
  );
  overflow: hidden;
}
.editor-element.shape-pentagon {
  clip-path: polygon(50% 0, 100% 38%, 81% 100%, 19% 100%, 0 38%);
  overflow: hidden;
}
.editor-element.shape-hexagon {
  clip-path: polygon(25% 0, 75% 0, 100% 50%, 75% 100%, 25% 100%, 0 50%);
  overflow: hidden;
}
.editor-element.shape-heptagon {
  clip-path: polygon(
    50% 0,
    90% 18%,
    100% 62%,
    72% 100%,
    28% 100%,
    0 62%,
    10% 18%
  );
  overflow: hidden;
}
.editor-element.shape-star {
  clip-path: polygon(
    50% 0,
    61% 35%,
    98% 35%,
    68% 57%,
    79% 95%,
    50% 72%,
    21% 95%,
    32% 57%,
    2% 35%,
    39% 35%
  );
  overflow: hidden;
}
.editor-element.shape-heart {
  clip-path: polygon(
    50% 100%,
    5% 43%,
    0 29%,
    8% 10%,
    25% 0,
    42% 5%,
    50% 20%,
    58% 5%,
    75% 0,
    92% 10%,
    100% 29%,
    95% 43%
  );
  overflow: hidden;
}
.editor-element.shape-parallelogram {
  clip-path: polygon(20% 0, 100% 0, 80% 100%, 0 100%);
  overflow: hidden;
}
.editor-element.shape-trapezoid {
  clip-path: polygon(20% 0, 80% 0, 100% 100%, 0 100%);
  overflow: hidden;
}
.editor-element.shape-shield {
  clip-path: polygon(0 0, 100% 0, 100% 65%, 50% 100%, 0 65%);
  overflow: hidden;
}
.editor-element.shape-cross {
  clip-path: polygon(
    35% 0,
    65% 0,
    65% 35%,
    100% 35%,
    100% 65%,
    65% 65%,
    65% 100%,
    35% 100%,
    35% 65%,
    0 65%,
    0 35%,
    35% 35%
  );
  overflow: hidden;
}
.editor-element .resize-handle {
  background: var(--brand);
  border: 2px solid #fff;
  border-radius: 50%;
  bottom: -7px;
  cursor: nwse-resize;
  display: none;
  height: 14px;
  position: absolute;
  right: -7px;
  width: 14px;
}
.editor-element.selected .resize-handle {
  display: block;
}
.editor-controls {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
}
.editor-controls h2 {
  font-size: 1.35rem;
  margin-bottom: 18px;
}
.property-panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
  margin-bottom: 20px;
  padding: 14px;
}
.editor-canvas-wrap > .property-panel {
  align-self: stretch;
  margin: 24px auto 0;
  max-width: 720px;
  width: 100%;
}
.property-panel h3 {
  font-size: 1rem;
  margin-bottom: 14px;
}
.property-panel label {
  display: grid;
  font-size: 0.8rem;
  gap: 5px;
  margin-bottom: 10px;
}
.property-panel input,
.property-panel select,
.property-panel textarea {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 38px;
  padding: 8px;
  width: 100%;
}
.property-panel textarea {
  resize: vertical;
}
.property-panel .button {
  font-size: 0.8rem;
  margin-top: 5px;
  padding: 9px 10px;
}
.format-controls {
  border-top: 1px solid var(--line);
  margin-top: 18px;
  padding-top: 16px;
}
.format-label {
  color: var(--muted);
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  margin-bottom: 8px;
}
.format-buttons {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}
.format-buttons button {
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  cursor: pointer;
  display: flex;
  flex: 1;
  flex-direction: column;
  font-size: 0.72rem;
  gap: 2px;
  justify-content: center;
  min-height: 48px;
}
.format-buttons button > strong,
.format-buttons button > em,
.format-buttons button > u {
  font-size: 1.05rem;
  line-height: 1;
}
.format-buttons button[aria-pressed="true"],
.format-buttons button:hover,
.format-buttons button:focus-visible {
  background: var(--sky);
  border-color: var(--brand);
  color: var(--brand);
}
.property-actions {
  display: grid;
  gap: 7px;
  grid-template-columns: 1fr 1fr;
  margin-top: 12px;
}
.button-danger {
  background: #d94c4c;
  color: #fff;
}
.button-danger:hover {
  background: #b93636;
}
.editor-controls fieldset {
  border: 0;
  display: grid;
  gap: 8px;
  margin: 0 0 18px;
  padding: 0;
}
.editor-controls label {
  font-size: 0.82rem;
  font-weight: 700;
}
.editor-controls #background-color {
  display: block;
  height: 42px;
  padding: 3px;
  width: 100%;
}
.editor-controls input[type="file"] {
  max-width: 100%;
  min-width: 0;
  padding: 8px;
}
.editor-controls .button {
  width: 100%;
}
.editor-row {
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr 1fr;
}
.editor-help {
  color: var(--muted);
  font-size: 0.78rem;
}
@media (max-width: 900px) {
  #greeting-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .editor-layout {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 620px) {
  .category-table th:nth-child(2),
  .category-table td:nth-child(2) {
    display: none;
  }
  #greeting-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .greeting-card-body {
    padding: 11px;
  }
  .editor-canvas-wrap {
    padding: 12px;
    min-height: 360px;
  }
}
