/* ============================================================================
 * Explore View — Constellation Browser
 * Dark glass card grid for browsing anchor entities
 * ============================================================================ */

/* ── Header ── */
.explore-header {
    padding: 16px 20px 0;
}

.explore-search-row {
    margin-bottom: 12px;
}

.explore-search {
    width: 100%;
    padding: 10px 16px;
    border: 1px solid var(--ffvr-rule, rgba(255, 255, 255, 0.12));
    border-radius: 8px;
    background: var(--ffvr-surface-sunken, rgba(20, 20, 40, 0.6));
    color: var(--ffvr-ink, #e0e0e0);
    font-size: calc(15px * var(--type-scale, 1));
    outline: none;
    transition: border-color 0.2s;
}
.explore-search::placeholder {
    color: var(--ffvr-ink-faint, rgba(255, 255, 255, 0.35));
}
.explore-search:focus {
    border-color: var(--ffvr-accent, rgba(120, 140, 255, 0.5));
}

/* ── Type Tabs ── */
.explore-tabs {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 12px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.explore-tabs::-webkit-scrollbar { display: none; }

.explore-tab {
    flex-shrink: 0;
    padding: 6px 14px;
    border: 1px solid var(--ffvr-rule, rgba(255, 255, 255, 0.1));
    border-radius: 20px;
    background: var(--ffvr-surface-raised, rgba(30, 30, 50, 0.5));
    color: var(--ffvr-ink-muted, rgba(255, 255, 255, 0.6));
    font-size: calc(13px * var(--type-scale, 1));
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.explore-tab:hover {
    background: rgba(60, 60, 100, 0.5);
    color: rgba(255, 255, 255, 0.85);
}
.explore-tab-active {
    background: rgba(100, 120, 255, 0.25);
    border-color: rgba(100, 120, 255, 0.5);
    color: #fff;
}
.explore-tab-icon {
    margin-right: 2px;
}

/* ── Card Grid ── */
.explore-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 14px;
    padding: 0 20px 20px;
    overflow-y: auto;
    flex: 1;
}

/* ── Card ── */
.explore-card {
    background: var(--ffvr-surface-raised, rgba(22, 22, 44, 0.7));
    border: 1px solid var(--ffvr-rule, rgba(255, 255, 255, 0.08));
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}
.explore-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    border-color: var(--ffvr-accent, rgba(100, 120, 255, 0.3));
}

/* ── Thumbnail ── */
.explore-card-thumb-wrap {
    width: 100%;
    aspect-ratio: 1;
    background: var(--ffvr-surface-sunken, rgba(30, 30, 50, 0.5));
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.explore-card-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.explore-card-thumb-circle {
    border-radius: 50%;
    width: 80%;
    height: 80%;
    object-fit: cover;
    border: 2px solid var(--ffvr-accent, rgba(100, 120, 255, 0.3));
}
.explore-card-thumb-glyph {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: calc(48px * var(--type-scale, 1));
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.25), rgba(118, 75, 162, 0.25));
    color: var(--ffvr-ink, #e8e8f0);
}

/* ── Card Body ── */
.explore-card-body {
    padding: 10px 12px 12px;
}
.explore-card-title {
    font-size: calc(14px * var(--type-scale, 1));
    font-weight: 600;
    color: var(--ffvr-ink, #e8e8f0);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}
.explore-card-subtitle {
    font-size: calc(12px * var(--type-scale, 1));
    color: var(--ffvr-ink-muted, rgba(255, 255, 255, 0.45));
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 2px;
    min-height: 16px;
}

/* ── Type Chip ── */
.explore-type-chip {
    display: inline-block;
    margin-top: 6px;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: calc(10px * var(--type-scale, 1));
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}
.explore-type-person  { background: var(--ffvr-surface, rgba(100, 120, 255, 0.2)); color: #8090ff; }
.explore-type-place   { background: var(--ffvr-surface, rgba(255, 160, 60, 0.2));  color: #ffa040; }
.explore-type-event   { background: var(--ffvr-surface, rgba(255, 100, 150, 0.2)); color: #ff6496; }
.explore-type-period  { background: var(--ffvr-surface, rgba(80, 200, 120, 0.2));  color: #50c878; }
.explore-type-cluster { background: var(--ffvr-surface, rgba(180, 120, 255, 0.2)); color: #b478ff; }

/* ── Empty / Loading ── */
.explore-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: var(--ffvr-ink-muted, rgba(255, 255, 255, 0.4));
    font-size: calc(15px * var(--type-scale, 1));
}
.explore-loading {
    grid-column: 1 / -1;
    display: flex;
    justify-content: center;
    padding: 60px 0;
}

/* ── Load More ── */
.explore-load-more {
    display: flex;
    justify-content: center;
    padding: 16px 20px 24px;
}
.explore-load-btn {
    padding: 8px 28px;
    border: 1px solid rgba(100, 120, 255, 0.4);
    border-radius: 20px;
    background: rgba(100, 120, 255, 0.12);
    color: #8090ff;
    font-size: calc(14px * var(--type-scale, 1));
    cursor: pointer;
    transition: all 0.2s;
}
.explore-load-btn:hover {
    background: rgba(100, 120, 255, 0.25);
    border-color: rgba(100, 120, 255, 0.6);
}

/* ── View Container ── */
#view-explore {
    background: rgba(10, 10, 24, 0.95);
}
#view-explore.active {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* ── Responsive ── */
@media (max-width: 767px) {
    .explore-grid {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
        gap: 10px;
        padding: 0 12px 16px;
    }
    .explore-header {
        padding: 12px 12px 0;
    }
}

@media (min-width: 1200px) {
    .explore-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    }
}
