/* GuideFlow3D interactive components (result cards, 3D viewer window, carousels).
   Layout rules carried over from the original page, restyled for the CoPE/CrossOver design. */

.x-row {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: nowrap;
}

.x-column {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: nowrap;
    flex-direction: column;
}

.x-center-text {
    margin: 16px 32px;
    text-align: center;
}

.x-left-align {
    display: flex;
    align-items: center;
    justify-content: left;
    flex-wrap: nowrap;
}

.x-right-align {
    display: flex;
    align-items: center;
    justify-content: right;
    flex-wrap: nowrap;
}

.x-flex-spacer {
    flex: 1;
}

.x-labels {
    position: absolute;
    top: 8px;
    right: 6px;
    display: flex;
    align-items: center;
    justify-content: left;
    flex-direction: row-reverse;
}

.x-label {
    height: 20px;
    padding: 0px 6px;
    margin: 0px 2px;
    color: white;
    font-size: 12px;
    font-weight: 600;
    background: #9B7D6E;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.x-button {
    height: 40px;
    padding: 0px 14px;
    background: #6B8598;
    color: white;
    border-radius: 8px;
    box-shadow: 0px 2px 8px rgba(107, 133, 152, 0.2);
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.x-button.small {
    height: 32px;
    padding: 0px 12px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
}

.x-button:hover {
    background: #C9A94D;
    transform: translateY(-2px);
    box-shadow: 0px 4px 12px rgba(201, 169, 77, 0.3);
}

.x-card {
    position: relative;
    margin: 8px;
    padding: 16px;
    border-radius: 12px;
    background: white;
    box-shadow: 0px 2px 8px rgba(107, 133, 152, 0.12);
    border: 1px solid rgba(107, 133, 152, 0.08);
    transition: all 0.2s ease;
}

.x-card.clickable {
    cursor: pointer;
}

.x-card.clickable:hover {
    box-shadow: 0px 4px 16px rgba(107, 133, 152, 0.2);
    transform: translateY(-2px);
    border-color: rgba(201, 169, 77, 0.3);
}

.x-card .caption {
    margin: 8px 0px;
    height: 80px;
    display: flex;
    align-items: start;
    justify-content: center;
}

.x-handwriting {
    width: 100%;
    font-family: 'Segoe Print';
    font-size: 12px;
    font-weight: 600;
    line-height: 1.5;
    color: black;
    text-align: justify;
}

.x-image-prompt {
    height: calc(100% - 2px);
    aspect-ratio: 1/1;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid black;
}

.x-image-prompt img {
    max-width: 100%;
    max-height: 100%;
}


/* ---- Restyle to match the page ----------------------------------------- */
.x-card {
  margin: 8px;
  padding: 14px;
  border-radius: var(--radius);
  background: #fff;
  border: 1px solid var(--border);
  box-shadow: 0 1px 2px rgba(20, 20, 19, 0.05);
}
.x-card.clickable:hover {
  border-color: var(--fg-muted);
  box-shadow: 0 4px 16px rgba(20, 20, 19, 0.10);
  transform: translateY(-2px);
}
.x-card video { width: 100%; height: 100%; object-fit: contain; display: block; }
.x-labels { position: absolute; top: 10px; right: 10px; z-index: 1; display: flex; gap: 4px; }
.x-label {
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-family: var(--serif);
  font-size: 0.72rem;
  font-weight: 600;
}
.x-handwriting { color: var(--fg); }
.x-image-prompt { border: 1px solid var(--border); border-radius: 4px; overflow: hidden; background: #fff; }
.x-section-title.small {
  margin: 8px 0 4px;
  padding-left: 0;
  border-left: 0;
  font-family: var(--serif);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-muted);
}
.x-section-title.small .x-gradient-font { color: inherit; }

/* Carousel navigation: arrows + dots like the CrossOver results carousel */
.x-carousel-nav {
  height: auto;
  margin-top: 10px;
  justify-content: center;
  gap: 14px;
}
.x-carousel-switch {
  width: 36px;
  height: 36px;
  margin: 0;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--fg);
  box-shadow: none;
  font-size: 0.75rem;
}
.x-carousel-switch:hover {
  background: var(--bg);
  border-color: var(--fg-muted);
  transform: none;
  box-shadow: none;
}
.x-carousel-page {
  width: 9px;
  height: 9px;
  margin: 0 4px;
  background: var(--rule);
}
.x-carousel-page.x-carousel-page-active {
  width: 22px;
  height: 9px;
  background: var(--fg);
}

/* 3D viewer window */
#fullscreen { backdrop-filter: blur(8px); background: rgba(250, 249, 245, 0.55); }
#fullscreen #window {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 12px 40px rgba(20, 20, 19, 0.18);
  font-family: var(--serif);
}
#fullscreen #window #close:hover { color: var(--accent); }
.modelviewer-panel-prompt { box-shadow: none; border: 1px solid var(--border); border-radius: var(--radius); }
.modelviewer-panel-button {
  font-family: var(--serif);
  background: #fff;
  color: var(--fg);
  border: 1px solid var(--border);
  box-shadow: none;
}
.modelviewer-panel-button:hover { transform: none; box-shadow: none; border-color: var(--fg-muted); }
.modelviewer-panel-button.checked,
.modelviewer-panel-button.enabled { background: var(--fg); border-color: var(--fg); color: var(--bg); }

/* Results grid on small screens: 2 per row, then 1 */
@media (max-width: 900px) {
  .x-carousel-slider-item { flex-basis: 50% !important; }
}
@media (max-width: 520px) {
  .x-carousel-slider-item { flex-basis: 100% !important; }
  .x-card .caption { height: auto; min-height: 48px; }
}
