/*
 * Shared "exchange" layout used by marketplace/listing style pages
 * (RWA Token Exchange, Vault, Village, ART INDEX, ...).
 * Provides: a hero banner with stats, and a card grid below.
 * Colors come from the Gallery Terminal tokens in theme.css.
 */

/* ---------- Hero ---------- */
.exchange-hero {
    background: var(--ap-bg);
    border-bottom: 1px solid var(--ap-line);
    padding: calc(var(--ap-header-h) + 72px) 0 56px;
    color: var(--ap-text);
    text-align: left;
}

.exchange-hero h1 {
    font-family: var(--ap-font-display);
    font-weight: 400;
    font-size: clamp(2.4rem, 4.6vw, 3.75rem);
    line-height: 1.05;
    letter-spacing: -0.01em;
    color: #FFFFFF;
    margin-bottom: 14px;
}

/* old pages put a bootstrap icon in front of the title */
.exchange-hero h1 > i.bi {
    font-size: 0.6em;
    color: var(--ap-gold);
    vertical-align: middle;
}

.exchange-hero p {
    color: var(--ap-text-2);
    max-width: 640px;
    margin: 0;
    font-size: 1.075rem;
    line-height: 1.6;
}

.exchange-stats {
    display: flex;
    justify-content: flex-start;
    gap: 48px;
    margin-top: 36px;
    padding-top: 24px;
    border-top: 1px solid var(--ap-line);
    flex-wrap: wrap;
}

.exchange-stats .stat { text-align: left; }

.exchange-stats .stat strong {
    display: block;
    font-size: 1.75rem;
    font-weight: 600;
    color: #FFFFFF;
    font-variant-numeric: tabular-nums;
}

.exchange-stats .stat span {
    font-size: 0.8rem;
    color: var(--ap-muted);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

/* ---------- Body ---------- */
.exchange-body {
    background: var(--ap-bg);
    padding: 56px 0 100px;
}

.exchange-group { margin-bottom: 56px; }

.exchange-group-title {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
}

.exchange-group-title h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #FFFFFF;
    margin: 0;
}

.exchange-group-title h2 > i.bi { color: var(--ap-gold); }

.exchange-group-title .badge-network {
    font-size: 0.75rem;
    padding: 5px 12px;
    border-radius: 999px;
    background: transparent;
    border: 1px solid var(--ap-border-strong);
    color: var(--ap-text-2);
    font-weight: 600;
}

.exchange-empty {
    text-align: center;
    padding: 48px 0;
    color: var(--ap-muted);
    border: 1px dashed var(--ap-border-strong);
    border-radius: var(--ap-radius-lg);
}

/* ---------- Card grid ---------- */
.collection-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
}

.collection-card {
    background: var(--ap-surface);
    border: 1px solid var(--ap-border);
    border-radius: var(--ap-radius-lg);
    overflow: hidden;
    box-shadow: none;
    transition: transform 0.2s ease, border-color 0.2s ease;
    display: flex;
    flex-direction: column;
}

.collection-card:hover {
    transform: translateY(-4px);
    border-color: var(--ap-gold-line);
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.45);
}

.collection-card .cover {
    position: relative;
    height: 110px;
    background: var(--ap-raised);
    border-bottom: 1px solid var(--ap-border);
    background-size: cover;
    background-position: center;
}

.collection-card .avatar {
    position: absolute;
    left: 20px;
    bottom: -28px;
    width: 64px;
    height: 64px;
    border-radius: 12px;
    background: var(--ap-bg);
    border: 1px solid var(--ap-gold);
    outline: 4px solid var(--ap-surface);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    color: var(--ap-gold);
    overflow: hidden;
}

.collection-card .avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.vault-page .collection-card .cover.has-image { height: auto; }

.vault-page .collection-card .cover-img {
    display: block;
    width: 100%;
    height: auto;
}

.vault-page .collection-card .avatar img { object-fit: contain; }

.collection-card .status-dot {
    position: absolute;
    top: 14px;
    left: 14px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #5B6680;
    box-shadow: 0 0 0 3px rgba(91, 102, 128, 0.25);
}

.collection-card .status-dot.active {
    background: var(--ap-up);
    box-shadow: 0 0 0 3px var(--ap-up-soft);
}

.collection-card .village-badge {
    position: absolute;
    top: 18px;
    right: 18px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    z-index: 1;
}

.collection-card .village-badge-emoji {
    font-size: 1.9rem;
    line-height: 1;
}

.collection-card .village-badge.is-live {
    background: radial-gradient(circle, rgba(217, 178, 111, 0.4), rgba(217, 178, 111, 0.05));
    cursor: pointer;
    animation: village-glow 1.8s ease-in-out infinite;
    transition: transform 0.2s ease;
}

.collection-card .village-badge.is-live:hover { transform: scale(1.15); }

.collection-card .village-badge.is-empty {
    background: rgba(7, 10, 18, 0.7);
    filter: grayscale(1);
    opacity: 0.85;
    cursor: default;
}

.village-page .collection-card .meta-row {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--ap-text);
}

@keyframes village-glow {
    0%, 100% { box-shadow: 0 0 6px 1px rgba(217, 178, 111, 0.45); }
    50% { box-shadow: 0 0 18px 6px rgba(217, 178, 111, 0.85); }
}

.collection-card .card-content {
    padding: 40px 20px 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.collection-card .name {
    font-size: 1.05rem;
    font-weight: 600;
    color: #FFFFFF;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
}

.collection-card .symbol {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--ap-muted);
    letter-spacing: 0.06em;
    margin-bottom: 14px;
}

.collection-card .meta-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--ap-muted);
    margin-bottom: 18px;
    gap: 12px;
}

.collection-card .meta-row a {
    color: var(--ap-text-2);
    text-decoration: none;
    font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
}

.collection-card .meta-row a:hover { color: var(--ap-gold); }

.collection-card .meta-row .value {
    color: #FFFFFF;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.collection-card .input-row {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.collection-card .input-row input {
    flex: 1;
    font-size: 0.85rem;
}

/* ---------- Buttons ---------- */
.btn-view {
    display: inline-block;
    text-align: center;
    padding: 11px 0;
    border-radius: 10px;
    background: transparent;
    color: var(--ap-text);
    border: 1px solid var(--ap-border-strong);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.btn-view:hover {
    background: var(--ap-gold);
    border-color: var(--ap-gold);
    color: var(--ap-gold-ink);
}

.collection-card .btn-view {
    margin-top: auto;
    display: block;
    width: 100%;
}

/* ---------- Art Index trading panel ---------- */
.art-index-section { padding-top: 0; }

.art-index-panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 20px;
    margin-bottom: 56px;
}

@media (max-width: 900px) {
    .art-index-panel { grid-template-columns: 1fr; }
}

.art-index-chart-card,
.art-index-side-card {
    background: var(--ap-surface);
    border: 1px solid var(--ap-border);
    border-radius: var(--ap-radius-lg);
    box-shadow: none;
    padding: 18px 20px;
}

.art-index-toolbar {
    display: flex;
    margin-top: 4px;
    margin-bottom: 20px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--ap-border);
}

.art-index-select {
    appearance: none;
    -webkit-appearance: none;
    border: 1px solid var(--ap-border-strong);
    background: var(--ap-bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23AEB8CC' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 14px center;
    color: #FFFFFF;
    font-size: 0.95rem;
    font-weight: 600;
    padding: 11px 40px 11px 18px;
    border-radius: 999px;
    cursor: pointer;
    transition: border-color 0.15s ease;
}

.art-index-select:hover,
.art-index-select:focus {
    outline: none;
    border-color: var(--ap-gold);
}

.art-index-select option { background: var(--ap-surface); color: var(--ap-text); }

.art-index-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.art-index-tab {
    border: 1px solid transparent;
    background: transparent;
    color: var(--ap-text-2);
    font-size: 0.82rem;
    font-weight: 500;
    padding: 6px 14px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.art-index-tab:hover { color: #FFFFFF; }

.art-index-tab.active {
    background: var(--ap-raised);
    border-color: var(--ap-border-strong);
    color: #FFFFFF;
}

.art-index-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}

.art-index-title {
    font-size: 1rem;
    font-weight: 600;
    color: #FFFFFF;
}

.art-index-title span {
    font-weight: 500;
    color: var(--ap-muted);
}

.art-index-price {
    display: flex;
    align-items: baseline;
    gap: 10px;
}

.art-index-price #artIndexPrice {
    font-size: 1.4rem;
    font-weight: 600;
    color: #FFFFFF;
    font-variant-numeric: tabular-nums;
}

.art-index-change {
    font-size: 0.85rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.art-index-change.up { color: var(--ap-up); }
.art-index-change.down { color: var(--ap-down); }

.art-index-chart-wrap {
    position: relative;
    height: 320px;
    margin-bottom: 12px;
}

.art-index-chart-wrap canvas {
    width: 100%;
    height: 100%;
    display: block;
}

.art-index-tooltip {
    position: absolute;
    top: 8px;
    left: 8px;
    background: var(--ap-raised);
    border: 1px solid var(--ap-border-strong);
    color: var(--ap-text);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 0.78rem;
    line-height: 1.5;
    pointer-events: none;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.art-index-tooltip .row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
}

.art-index-tooltip .row span:first-child { color: var(--ap-muted); }

/* Index summary (side card) */
.index-summary {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 16px;
}

.index-summary-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.index-summary-tag {
    align-self: flex-start;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    padding: 4px 12px;
    border-radius: 999px;
    background: transparent;
    border: 1px solid var(--ap-gold-line);
    color: var(--ap-gold);
}

.index-summary-row p {
    margin: 0;
    font-size: 0.85rem;
    line-height: 1.6;
    color: var(--ap-text-2);
}

/* ---------- Order book ---------- */
.orderbook-title {
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ap-muted);
    margin-bottom: 10px;
}

.orderbook-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.72rem;
    color: var(--ap-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0 2px 6px;
    border-bottom: 1px solid var(--ap-border);
}

.orderbook-row {
    position: relative;
    display: flex;
    justify-content: space-between;
    font-size: 0.82rem;
    padding: 3px 6px;
    font-variant-numeric: tabular-nums;
    border-radius: 4px;
    overflow: hidden;
    color: var(--ap-text);
}

.orderbook-row .depth {
    position: absolute;
    top: 0;
    bottom: 0;
    right: 0;
    z-index: 0;
}

.orderbook-row .price,
.orderbook-row .size {
    position: relative;
    z-index: 1;
}

.orderbook-asks .orderbook-row .price { color: var(--ap-down); }
.orderbook-asks .orderbook-row .depth { background: var(--ap-down-soft); }
.orderbook-bids .orderbook-row .price { color: var(--ap-up); }
.orderbook-bids .orderbook-row .depth { background: var(--ap-up-soft); }

.orderbook-spread {
    text-align: center;
    font-size: 0.75rem;
    color: var(--ap-muted);
    padding: 6px 0;
    border-top: 1px dashed var(--ap-border);
    border-bottom: 1px dashed var(--ap-border);
    margin: 2px 0;
}

.trade-buttons {
    display: flex;
    gap: 10px;
    margin-top: 16px;
}

.btn-buy,
.btn-sell {
    flex: 1;
    border: none;
    border-radius: 10px;
    padding: 12px 0;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    transition: filter 0.15s ease;
}

.btn-buy { background: var(--ap-up); color: var(--ap-up-ink); }
.btn-sell { background: var(--ap-down); color: var(--ap-down-ink); }

.btn-buy:hover,
.btn-sell:hover { filter: brightness(1.08); }

/* ---------- Index info (ART100 / ARTE) ---------- */
.index-info-section { padding-top: 12px; }

.index-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    row-gap: 24px;
    column-gap: 20px;
}

@media (max-width: 900px) {
    .index-info-grid { grid-template-columns: 1fr; }
}

.index-info-card {
    background: var(--ap-surface);
    border: 1px solid var(--ap-border);
    border-radius: var(--ap-radius-lg);
    box-shadow: none;
    padding: 24px 24px 28px;
}

.index-info-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--ap-border);
}

.index-info-head h3 {
    font-family: var(--ap-font-display);
    font-size: 1.6rem;
    font-weight: 400;
    color: #FFFFFF;
    margin: 0;
}

.index-info-tag {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    padding: 4px 12px;
    border-radius: 999px;
    background: transparent;
    border: 1px solid var(--ap-gold-line);
    color: var(--ap-gold);
}

.index-info-cols {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

@media (max-width: 640px) {
    .index-info-cols { grid-template-columns: 1fr; }
}

.index-info-col h4 {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--ap-muted);
    margin: 16px 0 8px;
}

.index-info-col h4:first-child { margin-top: 0; }

.index-tree {
    list-style: none;
    margin: 0;
    padding: 0;
    font-size: 0.85rem;
}

.index-tree li {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    color: var(--ap-text-2);
    padding: 3px 0;
    font-variant-numeric: tabular-nums;
}

.index-tree li span {
    color: #FFFFFF;
    font-weight: 600;
    font-family: inherit;
}

.index-info-note {
    font-size: 0.78rem;
    color: var(--ap-muted);
    margin-top: 4px;
}

.index-info-text {
    font-size: 0.875rem;
    color: var(--ap-text-2);
    line-height: 1.6;
    margin: 0;
}

.index-metric-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    color: var(--ap-muted);
    padding: 8px 0;
    border-bottom: 1px dashed var(--ap-border);
}

.index-metric-row strong {
    color: #FFFFFF;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

/* ---------- Vision / Mission section ---------- */
.vision-section {
    padding-top: 12px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.vision-block {
    width: 100%;
    background: var(--ap-surface);
    border: 1px solid var(--ap-border);
    border-radius: var(--ap-radius-lg);
    box-shadow: none;
    padding: 40px 32px;
    text-align: left;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.vision-block-dark {
    grid-column: 1 / -1;
    background: var(--ap-bg-2);
    color: var(--ap-text);
}

.vision-section-title {
    font-family: var(--ap-font-display);
    font-size: clamp(1.8rem, 3vw, 2.4rem);
    font-weight: 400;
    color: #FFFFFF;
    margin: 0 0 24px;
    text-align: left;
}

.vision-quote-stats {
    display: flex;
    justify-content: flex-start;
    gap: 56px;
    flex-wrap: wrap;
}

.vision-quote-stat { text-align: left; }

.vision-quote-stat strong {
    display: block;
    font-size: clamp(2rem, 3.4vw, 2.6rem);
    font-weight: 600;
    color: var(--ap-gold);
    font-variant-numeric: tabular-nums;
}

.vision-quote-stat span {
    font-size: 0.95rem;
    color: var(--ap-muted);
    letter-spacing: 0.02em;
}

.vision-card-highlight {
    font-family: var(--ap-font-display);
    font-style: italic;
    font-size: clamp(1.5rem, 2.4vw, 1.9rem);
    font-weight: 400;
    color: var(--ap-gold);
    margin: 0 0 16px;
    text-align: left;
}

.vision-block p {
    color: var(--ap-text-2);
    font-size: 1.05rem;
    line-height: 1.7;
    margin: 0 0 8px;
    max-width: 640px;
    text-align: left;
}

.vision-block p:last-child { margin-bottom: 0; }
