/* Customizer v2 — three-panel layout */

.cv2-shell {
  display: grid;
  gap: 16px;
  padding: 16px;
  max-width: 1600px;
  margin: 0 auto;
  grid-template-columns: 1fr;
}

@media (min-width: 992px) {
  .cv2-shell {
    grid-template-columns: 300px minmax(0, 1fr) 300px;
    align-items: start;
  }
  .cv2-shell.cv2-shell-empty {
    grid-template-columns: minmax(0, 1fr);
  }
}

.cv2-panel {
  background: rgba(14, 97, 12, 0.6);
  border-radius: 12px;
  padding: 16px;
  color: #fff;
}

.cv2-panel-title {
  font-size: 22px;
  margin: 0 0 12px;
  text-align: center;
}

@media (min-width: 992px) {
  .cv2-nfts,
  .cv2-overlays {
    position: sticky;
    top: 16px;
    max-height: calc(100vh - 32px);
    display: flex;
    flex-direction: column;
  }
}

/* Buttons */
.cv2-btn {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 8px;
  padding: 8px 14px;
  font-family: inherit;
  font-size: 16px;
  cursor: pointer;
  transition: background 0.15s ease;
}
.cv2-btn:hover { background: rgba(255, 255, 255, 0.3); }
.cv2-btn-primary {
  background: #4C933F;
  border-color: #fff;
}
.cv2-btn-primary:hover { background: #5fb14f; }
.cv2-btn-danger {
  background: rgba(180, 40, 40, 0.6);
  border-color: rgba(255, 255, 255, 0.6);
}
.cv2-btn-danger:hover { background: rgba(200, 50, 50, 0.8); }

/* Wallet empty state — shown in the center panel */
.cv2-wallet-empty {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 40px 20px;
  max-width: 480px;
  margin: 0 auto;
  text-align: center;
}
.cv2-wallet-empty .cv2-btn-primary { align-self: center; padding: 10px 24px; }
.cv2-wallet-empty input,
.cv2-modal-content input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-family: inherit;
  font-size: 16px;
}
.cv2-wallet-empty input::placeholder,
.cv2-modal-content input::placeholder { color: rgba(255, 255, 255, 0.6); }

.cv2-error {
  color: #ffb4b4;
  font-size: 14px;
  min-height: 18px;
}

/* NFT panel — loaded state */
.cv2-nfts-loaded {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
}
.cv2-nft-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  overflow-y: auto;
  padding: 4px;
  flex: 1;
  min-height: 200px;
  max-height: 60vh;
}
@media (min-width: 992px) {
  .cv2-nft-grid { max-height: none; }
}
.cv2-nft-card {
  position: relative;
  cursor: pointer;
  border: 2px solid transparent;
  border-radius: 8px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.3);
  padding-top: 100%; /* square via padding hack — reliable for <canvas> */
}
.cv2-nft-card:hover { border-color: rgba(255, 255, 255, 0.5); }
.cv2-nft-card-active { border-color: #fff; }
.cv2-nft-card canvas,
.cv2-nft-card img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}
.cv2-nft-card-label {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 13px;
  padding: 2px 6px;
  text-align: center;
}
.cv2-status {
  font-size: 14px;
  margin: 8px 0;
  min-height: 18px;
}
.cv2-panel-footer {
  display: flex;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
}
.cv2-panel-footer .cv2-btn { flex: 1; }

/* Preview panel */
.cv2-preview {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.cv2-toolbar {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  justify-content: center;
  flex-wrap: wrap;
}
.cv2-canvas-wrap {
  position: relative;
  width: 100%;
  max-width: 640px;
  aspect-ratio: 1 / 1;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 12px;
  overflow: hidden;
}
#cv2-canvas {
  width: 100%;
  height: 100%;
  display: block;
}
.cv2-canvas-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.7);
  font-size: 18px;
  pointer-events: none;
}
.cv2-canvas-spinner {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.4);
}

/* Overlay panel */
.cv2-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 12px;
}
.cv2-tab {
  flex: 1;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 8px;
  padding: 6px 10px;
  font-family: inherit;
  font-size: 15px;
  cursor: pointer;
}
.cv2-tab:hover { background: rgba(255, 255, 255, 0.2); }
.cv2-tab-active {
  background: rgba(255, 255, 255, 0.3);
  border-color: #fff;
}

.cv2-overlay-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  overflow-y: auto;
  padding: 4px;
  max-height: 60vh;
}
@media (min-width: 992px) {
  .cv2-overlay-grid { max-height: calc(100vh - 200px); }
}
.cv2-overlay-card {
  position: relative;
  cursor: pointer;
  border: 2px solid transparent;
  border-radius: 8px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.3);
  padding-top: 100%;
}
.cv2-overlay-card:hover { border-color: rgba(255, 255, 255, 0.5); }
.cv2-overlay-card-active { border-color: #fff; }
.cv2-overlay-card-active::after {
  content: '✓';
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #4C933F;
  color: #fff;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cv2-overlay-card img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  background-color: rgba(255, 255, 255, 0.08);
}
/* Accessory thumbnails — zoom 2x anchored to bottom-left so the
   accessory content fills more of the card. */
.cv2-overlay-card-accessory img {
  transform: scale(2);
  transform-origin: left bottom;
  object-position: left bottom;
}
.cv2-overlay-card-label {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 11px;
  padding: 2px 4px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  z-index: 1;
}

/* Roasts tab */
.cv2-roasts {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 4px;
}
.cv2-roasts textarea {
  width: 100%;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-family: inherit;
  font-size: 16px;
  resize: vertical;
  min-height: 80px;
}
.cv2-roasts textarea::placeholder { color: rgba(255, 255, 255, 0.6); }

/* Modal */
.cv2-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
.cv2-modal-content {
  background: #4C933F;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 12px;
  padding: 24px;
  width: min(420px, 90vw);
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.cv2-modal-content h3 { margin: 0 0 8px; }
.cv2-modal-close {
  position: absolute;
  top: 8px;
  right: 14px;
  cursor: pointer;
  font-size: 28px;
  line-height: 1;
}
