/* Export feature — selection UI, action bar, modal */

/* SELECT GROUP (help + select buttons) */
.select-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

/* HELP BUTTON */
.help-btn {
  width: 28px;
  height: 28px;
  border: 1px solid var(--g2);
  border-radius: 5px;
  background: none;
  color: var(--g4);
  font-family: var(--font-m);
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.12s;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.help-btn:hover {
  border-color: var(--g3);
  color: var(--black);
}

/* SELECT WRAP + HINT */
.select-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex-shrink: 0;
}
.select-hint {
  font-family: var(--font-m);
  font-size: 9px;
  color: var(--g3);
  letter-spacing: 0.06em;
  white-space: nowrap;
}

/* SELECT TOGGLE BUTTON */
.select-toggle {
  position: relative;
  padding: 0 14px;
  height: 28px;
  font-family: var(--font-m);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.06em;
  border: 1px solid var(--g2);
  border-radius: 5px;
  background: none;
  color: var(--g5);
  cursor: pointer;
  transition: all 0.12s;
  white-space: nowrap;
}

.select-toggle::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 7px);
  right: 0;
  background: var(--black);
  color: var(--white);
  font-family: var(--font-m);
  font-size: 9px;
  letter-spacing: 0.05em;
  white-space: nowrap;
  padding: 5px 9px;
  border-radius: 4px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s;
}

.select-toggle:hover::after {
  opacity: 1;
}

.select-toggle.active::after {
  display: none;
}

.select-toggle:hover {
  border-color: var(--g3);
  color: var(--black);
}

.select-toggle.active {
  background: var(--black);
  color: var(--white);
  border-color: var(--black);
}

/* CARD SELECTION STATE */
.select-check {
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 3;
  width: 18px;
  height: 18px;
  background: var(--black);
  color: var(--white);
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-family: var(--font-m);
  font-weight: 500;
  pointer-events: none;
}

.card.selected .select-check {
  display: flex;
}

.card.selected {
  border-color: var(--black);
  box-shadow: 0 0 0 2px var(--black);
}

/* ACTION BAR */
.export-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 400;
  background: var(--black);
  color: var(--white);
  padding: 14px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.export-bar.hidden {
  display: none;
}

.export-bar-count {
  font-family: var(--font-m);
  font-size: 11px;
  color: #aaa;
}

.export-bar-actions {
  display: flex;
  gap: 8px;
}

.export-bar-actions button {
  padding: 7px 16px;
  font-family: var(--font-m);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.06em;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.12s;
}

.export-bar-actions button:first-child {
  background: none;
  border: 1px solid #444;
  color: #aaa;
}

.export-bar-actions button:first-child:hover {
  border-color: #888;
  color: var(--white);
}

.export-bar-actions .export-bar-primary {
  background: var(--white);
  border: 1px solid var(--white);
  color: var(--black);
}

.export-bar-actions .export-bar-primary:hover {
  background: #e8e8e6;
}

/* MODAL */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-backdrop.hidden {
  display: none;
}

.modal-box {
  background: var(--white);
  border-radius: 10px;
  padding: 24px;
  max-width: 700px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.modal-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.modal-title {
  font-family: var(--font-h);
  font-size: 14px;
  font-weight: 700;
}

.modal-close {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--g2);
  border-radius: 5px;
  background: none;
  cursor: pointer;
  font-size: 13px;
  color: var(--g5);
  transition: all 0.12s;
}

.modal-close:hover {
  background: var(--g1);
}

/* RATIO PICKER */
.ratio-picker {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.ratio-btn {
  padding: 6px 14px;
  font-family: var(--font-m);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.04em;
  border: 1px solid var(--g2);
  border-radius: 4px;
  background: none;
  color: var(--g5);
  cursor: pointer;
  transition: all 0.12s;
}

.ratio-btn:hover {
  border-color: var(--g3);
  color: var(--black);
}

.ratio-btn.active {
  background: var(--black);
  color: var(--white);
  border-color: var(--black);
}

/* EXPORT OPTIONS (checkboxes) */
.export-options {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 12px;
}

.export-option {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-m);
  font-size: 10px;
  letter-spacing: 0.04em;
  color: var(--g5);
  cursor: pointer;
  user-select: none;
}

.export-option input[type="checkbox"] {
  accent-color: var(--black);
  width: 13px;
  height: 13px;
  cursor: pointer;
  flex-shrink: 0;
}

/* CANVAS PREVIEW */
.canvas-wrap {
  width: 100%;
  margin-bottom: 16px;
  background: var(--g1);
  border-radius: 6px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  max-height: calc(90vh - 220px);
}

.canvas-wrap canvas {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: calc(90vh - 220px);
  display: block;
}

/* VIDEO MODAL */
.video-modal-box {
  max-width: 800px;
}

.video-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 6px;
  overflow: hidden;
  background: #000;
}

.video-wrap iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* DOWNLOAD BUTTON */
.download-btn {
  width: 100%;
  padding: 11px;
  background: var(--black);
  color: var(--white);
  border: none;
  border-radius: 5px;
  font-family: var(--font-m);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: background 0.12s;
}

.download-btn:hover {
  background: #2a2a2a;
}

[data-theme="dark"] .export-bar {
  background: #1c1c1a;
  color: #efefed;
}

[data-theme="dark"] .export-bar-actions .export-bar-primary {
  background: #efefed;
  border-color: #efefed;
  color: #111110;
}

[data-theme="dark"] .export-bar-actions .export-bar-primary:hover {
  background: #d0d0cc;
}

@media (max-width: 600px) {
  .export-bar {
    padding: 12px 14px;
  }

  .ratio-picker {
    flex-wrap: wrap;
  }
}
