/* ============================================================
   Showcase Layout
   ============================================================ */

.smi-showcase-layout {
  width: 100%;
}

.showcase-container {
  width: 100%;
}

.showcase-empty {
  padding: 2rem;
  text-align: center;
  color: var(--internal-grey-text-color);
  font-style: italic;
}

.showcase-add-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 1.25rem;
  padding: 0.5rem 1rem;
  border: 2px dashed var(--theme-tertiary-text-color);
  border-radius: 8px;
  background: transparent;
  color: var(--internal-grey-text-color);
  font-size: 0.9rem;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}

.showcase-add-btn:hover {
  border-color: var(--theme-main-color);
  background: var(--theme-main-color);
  color: var(--theme-button-text-color);
}

/* ============================================================
   Cards Grid
   ============================================================ */

.showcase-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}

/* ============================================================
   Individual Card
   ============================================================ */

.showcase-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--theme-tertiary-text-color);
  border-radius: 10px;
  overflow: hidden;
  background: var(--internal-main-background-color);
  transition: box-shadow 0.2s;
}

.showcase-card:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

/* Header */

.showcase-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--theme-tertiary-text-color);
  background: var(--internal-panel-bg-color, rgba(127,127,127,0.06));
  min-height: 2.25rem;
}

.showcase-card-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--internal-main-text-color);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.showcase-card-actions {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex-shrink: 0;
}

.showcase-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  padding: 0;
  border: none;
  border-radius: 5px;
  background: transparent;
  color: var(--internal-grey-text-color);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.showcase-action-btn:hover {
  background: var(--internal-hover-light-block-color);
  color: var(--internal-main-text-color);
}

/* Preview */

.showcase-card-preview {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  min-height: 120px;
  color: var(--internal-main-text-color);
}

/* Toolbar */

.showcase-card-toolbar {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.75rem;
  border-top: 1px solid var(--theme-tertiary-text-color);
  background: var(--internal-panel-bg-color, rgba(127,127,127,0.06));
  flex-wrap: wrap;
}

.showcase-toolbar-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.3rem 0.65rem;
  border: 1px solid var(--theme-tertiary-text-color);
  border-radius: 5px;
  background: transparent;
  color: var(--internal-grey-text-color);
  font-size: 0.8rem;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  white-space: nowrap;
}

.showcase-toolbar-btn:hover {
  background: var(--internal-hover-light-block-color);
  color: var(--internal-main-text-color);
  border-color: var(--internal-icon-border-color, #555);
}

.showcase-toolbar-btn.showcase-btn-active {
  background: var(--theme-main-color);
  color: var(--theme-button-text-color);
  border-color: var(--theme-main-color);
}

.showcase-toolbar-btn.showcase-btn-copied {
  background: var(--theme-main-color);
  color: var(--theme-button-text-color);
  border-color: var(--theme-main-color);
  opacity: 0.8;
}

/* ============================================================
   Code Panel
   ============================================================ */

.showcase-code-panel {
  border-top: 1px solid var(--theme-tertiary-text-color);
  background: var(--theme-secondary-background-color);
}

.showcase-code-section + .showcase-code-section {
  border-top: 1px solid var(--theme-tertiary-text-color);
}

.showcase-code-label {
  padding: 0.35rem 0.75rem;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--internal-grey-text-color);
  background: var(--internal-panel-bg-color, rgba(127,127,127,0.06));
}

.showcase-code-block {
  margin: 0;
  padding: 0.75rem;
  overflow-x: auto;
  font-family: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
  font-size: 0.8rem;
  line-height: 1.6;
  color: var(--internal-main-text-color);
  white-space: pre;
}

/* ============================================================
   Modal
   ============================================================ */

.showcase-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.showcase-modal {
  background: var(--internal-main-background-color);
  border-radius: 12px;
  padding: 1.5rem;
  width: 100%;
  max-width: 680px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  border: 1px solid var(--theme-tertiary-text-color);
}

.showcase-modal-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--internal-main-text-color);
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--theme-tertiary-text-color);
}

.showcase-modal-section-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--internal-grey-text-color);
  padding: 0.25rem 0;
  border-bottom: 1px solid var(--theme-tertiary-text-color);
  margin-bottom: -0.25rem;
}

.showcase-modal-field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.showcase-modal-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--internal-grey-text-color);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.showcase-modal-input,
.showcase-modal-textarea {
  width: 100%;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--theme-tertiary-text-color);
  border-radius: 7px;
  background: var(--internal-base-block-color);
  color: var(--internal-main-text-color);
  font-size: 0.9rem;
  transition: border-color 0.2s;
  box-sizing: border-box;
}

.showcase-modal-input::placeholder,
.showcase-modal-textarea::placeholder {
  color: var(--internal-grey-text-color);
  opacity: 0.55;
}

.showcase-modal-input:focus,
.showcase-modal-textarea:focus {
  outline: none;
  border-color: var(--theme-main-color);
}

.showcase-modal-textarea {
  font-family: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
  font-size: 0.82rem;
  resize: vertical;
}

.showcase-modal-buttons {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--theme-tertiary-text-color);
}

.showcase-modal-delete {
  margin-right: auto;
  padding: 0.5rem 1rem;
  border: 1px solid var(--internal-grey-text-color);
  border-radius: 7px;
  background: transparent;
  color: var(--internal-grey-text-color);
  font-size: 0.9rem;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}

.showcase-modal-delete:hover {
  border-color: #e74c3c;
  color: #e74c3c;
}

.showcase-modal-cancel {
  padding: 0.5rem 1rem;
  border: 1px solid var(--theme-tertiary-text-color);
  border-radius: 7px;
  background: transparent;
  color: var(--internal-grey-text-color);
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.15s;
}

.showcase-modal-cancel:hover {
  background: var(--internal-hover-light-block-color);
}

.showcase-modal-save {
  padding: 0.5rem 1.25rem;
  border: none;
  border-radius: 7px;
  background: var(--theme-main-color);
  color: var(--theme-button-text-color);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
}

.showcase-modal-save:hover {
  opacity: 0.88;
}
