@import url('theme_new.css');
@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600;700&family=Poppins:wght@400;500;600&display=swap');

* { box-sizing: border-box; }

html, body {
    background: var(--bg) !important;
    color: var(--text);
    font-family: var(--font-body);
    scroll-snap-type: none !important;
    overflow-x: hidden;
}
a { color: inherit; }

.background_image { display: none !important; }

/* ---------- Logo (used in the sidebar and the header icon badge) ---------- */
.rh-logo { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.rh-logo-icon {
    width: 42px; height: 42px;
    border-radius: 50%;
    background: var(--accent-gradient-diagonal);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.rh-logo-icon img { width: 20px; height: 20px; filter: brightness(0) invert(1); display: block; }
.rh-logo-text strong { display: block; font-family: var(--font-display); font-size: 15px; letter-spacing: .5px; color: var(--text); }
.rh-logo-text span { display: block; font-size: 10px; letter-spacing: 2px; color: var(--text-muted); margin-top: 1px; }

/* ---------- App shell: left sidebar + main column ---------- */
.rh-app { display: flex; align-items: stretch; min-height: 100vh; }

.rh-app-sidebar {
    width: 240px;
    flex-shrink: 0;
    background: var(--bg-elevated);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 24px 18px;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}
.rh-app-sidebar .rh-logo { margin-bottom: 32px; padding: 0 6px; }
.rh-app-nav { display: flex; flex-direction: column; gap: 4px; flex: 1; min-height: 0; }
.rh-app-nav a {
    display: flex; align-items: center; gap: 12px;
    padding: 11px 14px;
    border-radius: var(--radius-md);
    color: var(--text-muted);
    text-decoration: none;
    font-family: var(--font-display);
    font-size: 13px;
    font-weight: 600;
}
.rh-app-nav a svg { width: 18px; height: 18px; flex-shrink: 0; stroke: currentColor; fill: none; }
.rh-app-nav a:hover { background: var(--surface); color: var(--text); }
.rh-app-nav a.active { background: rgba(139, 92, 246, 0.16); color: var(--text); border: 1px solid var(--border-strong); }

.rh-app-user-card {
    margin-top: 20px;
    padding: 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}
.rh-app-user-card img { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; border: 2px solid var(--border-strong); }
.rh-app-user-card .name { font-family: var(--font-display); font-size: 13px; font-weight: 700; color: var(--text); }
.rh-app-user-card .role { font-size: 11px; color: var(--text-muted); }

.rh-app-main { flex: 1; min-width: 0; }

/* ---------- Top header inside main column ---------- */
.rh-app-header {
    display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px;
    padding: 24px 32px;
    border-bottom: 1px solid var(--border);
}
.rh-app-header .rh-app-title { display: flex; align-items: center; gap: 14px; }
.rh-app-title .icon-badge {
    width: 42px; height: 42px; border-radius: 50%;
    background: var(--accent-gradient-diagonal);
    display: flex; align-items: center; justify-content: center;
}
.rh-app-title .icon-badge svg { width: 20px; height: 20px; stroke: #fff; fill: none; }
.rh-app-title h1 { font-family: var(--font-display); font-size: 19px; margin: 0; letter-spacing: 1px; text-transform: uppercase; color: var(--text); }
.rh-app-title span { display: block; font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.rh-app-header-actions { display: flex; align-items: center; gap: 12px; }
.rh-app-search {
    display: flex; align-items: center; gap: 8px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    padding: 9px 16px;
    min-width: 220px;
}
.rh-app-search img { width: 14px; height: 14px; opacity: .6; }
.rh-app-search input { background: none; border: none; outline: none; color: var(--text); font-size: 13px; width: 100%; font-family: var(--font-body); }
.rh-back-home {
    text-decoration: none;
    color: var(--text-muted);
    font-family: var(--font-display);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1px;
    border: 1px solid var(--border-strong);
    padding: 9px 16px;
    border-radius: var(--radius-pill);
}
.rh-back-home:hover { color: var(--text); border-color: var(--accent-purple); }
.rh-signin {
    border: 1px solid var(--border-strong);
    color: var(--text);
    text-decoration: none;
    padding: 9px 20px;
    border-radius: var(--radius-pill);
    font-family: var(--font-display);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1.5px;
    transition: border-color .2s ease, background .2s ease;
}
.rh-signin:hover { border-color: var(--accent-purple); background: rgba(139, 92, 246, .12); }

/* ---------- Solar map row: filters + 3D stage + stats ---------- */
.rh-solar-row { display: flex; align-items: stretch; border-bottom: 1px solid var(--border); }

.rh-sidebar {
    width: 260px;
    flex-shrink: 0;
    padding: 24px 20px;
    border-right: 1px solid var(--border);
}
.rh-tab-row { display: flex; gap: 6px; margin-bottom: 20px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-pill); padding: 4px; }
.rh-tab-row button {
    flex: 1; background: none; border: none; color: var(--text-muted); cursor: pointer;
    padding: 7px 10px; border-radius: var(--radius-pill);
    font-family: var(--font-display); font-size: 11px; font-weight: 700; letter-spacing: .5px;
}
.rh-tab-row button.active { background: var(--accent-gradient); color: #fff; }

.rh-planet-list { list-style: none; margin: 0 0 26px; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.rh-planet-list a {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 10px;
    border-radius: var(--radius-md);
    text-decoration: none;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 600;
}
.rh-planet-list a img { width: 22px; height: 22px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.rh-planet-list a .pname { flex: 1; }
.rh-planet-list a .pcount { font-size: 11px; color: var(--text-faint); font-weight: 500; }
.rh-planet-list a:hover { background: var(--surface); color: var(--text); }
.rh-planet-list a.active { background: rgba(139, 92, 246, 0.16); border: 1px solid var(--border-strong); color: var(--text); }

.rh-sidebar h4 {
    font-family: var(--font-display);
    font-size: 11px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--text-faint);
    margin: 0 0 14px;
}
.rh-price-slider { margin-bottom: 26px; }
.rh-price-slider input[type="range"] { width: 100%; accent-color: var(--accent-purple); margin: 10px 0 6px; }
.rh-price-slider .rh-price-labels { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-faint); }
.rh-sidebar select {
    width: 100%;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: var(--radius-md);
    padding: 10px 12px;
    font-family: var(--font-body);
    font-size: 13px;
}
.rh-sidebar select option { background: var(--bg-elevated); }

/* ---------- 3D stage ---------- */
.rh-3d-stage {
    flex: 1;
    position: relative;
    min-height: 560px;
    overflow: hidden;
    background:
        radial-gradient(ellipse 700px 500px at 50% 45%, rgba(79, 124, 255, 0.10), transparent 65%),
        url('/images/backgrounds/subtle_stars.png') repeat;
}
.rh-3d-stage canvas { display: block; width: 100%; height: 100%; cursor: grab; }
.rh-planet-tooltip {
    position: absolute;
    pointer-events: none;
    background: rgba(5, 6, 13, 0.85);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-md);
    padding: 8px 14px;
    font-family: var(--font-display);
    font-size: 12px;
    color: var(--text);
    letter-spacing: .5px;
    transform: translate(-50%, -130%);
    white-space: nowrap;
    opacity: 0;
    transition: opacity .15s ease;
    z-index: 20;
}
.rh-planet-tooltip .count { color: var(--text-muted); font-weight: 500; }
.rh-planet-tooltip.visible { opacity: 1; }
.rh-planet-tooltip.has-photo {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px;
    white-space: normal;
}
.rh-tooltip-photo {
    width: 54px;
    height: 54px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
    border: 1px solid var(--border-strong);
}
.rh-tooltip-text { padding-right: 8px; }

.rh-back-orbit {
    position: absolute;
    left: 20px; top: 20px;
    z-index: 15;
    background: var(--surface-strong);
    border: 1px solid var(--border-strong);
    color: var(--text);
    padding: 9px 18px;
    border-radius: var(--radius-pill);
    font-family: var(--font-display);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .5px;
    cursor: pointer;
    display: none;
}
.rh-back-orbit:hover { background: var(--accent-gradient); border-color: transparent; }
.rh-back-orbit.visible { display: block; }

.rh-focus-label {
    position: absolute;
    left: 50%; top: 20px;
    transform: translateX(-50%);
    z-index: 15;
    background: rgba(5, 6, 13, 0.75);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-pill);
    padding: 8px 20px;
    font-family: var(--font-display);
    font-size: 12px;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--text);
    display: none;
}
.rh-focus-label.visible { display: block; }
.rh-focus-label .count { color: var(--text-muted); text-transform: none; letter-spacing: normal; margin-left: 6px; }

.rh-zoom-controls {
    position: absolute;
    right: 20px; bottom: 20px;
    display: flex; flex-direction: column; gap: 8px;
    z-index: 10;
}
.rh-zoom-controls button {
    width: 38px; height: 38px;
    border-radius: 50%;
    background: var(--surface-strong);
    border: 1px solid var(--border-strong);
    color: var(--text);
    font-size: 16px;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
}
.rh-zoom-controls button:hover { background: var(--accent-gradient); border-color: transparent; }

/* ---------- Stats panel ---------- */
.rh-stats-panel { width: 260px; flex-shrink: 0; padding: 24px 20px; border-left: 1px solid var(--border); }
.rh-stats-total { margin-bottom: 22px; }
.rh-stats-total .label { font-family: var(--font-display); font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--text-faint); margin-bottom: 6px; }
.rh-stats-total .value { font-family: var(--font-display); font-size: 30px; font-weight: 700; color: var(--text); }
.rh-stats-legend { list-style: none; margin: 0 0 30px; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.rh-stats-legend li { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--text-muted); }
.rh-stats-legend .dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.rh-stats-legend .n { margin-left: auto; color: var(--text); font-weight: 600; }
.rh-trending h4 { font-family: var(--font-display); font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--text-faint); margin: 0 0 14px; }
.rh-trending-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.rh-trending-list li { display: flex; align-items: center; gap: 10px; }
.rh-trending-list .trend-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent-blue); flex-shrink: 0; }
.rh-trending-list .city { font-size: 13px; color: var(--text); font-weight: 600; display: block; }
.rh-trending-list .count { font-size: 11px; color: var(--text-muted); }

/* ---------- Explore popular locations ---------- */
.rh-locations {
    padding: 70px 48px;
    border-top: 1px solid var(--border);
}
.rh-locations h2 {
    font-family: var(--font-display);
    font-size: 12px;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--text-faint);
    margin: 0 0 24px;
}
.rh-location-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
}
.rh-location-card {
    text-decoration: none;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    text-align: center;
    transition: transform .2s ease, border-color .2s ease;
}
.rh-location-card:hover { transform: translateY(-4px); border-color: var(--border-strong); }
.rh-location-card img { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; margin-bottom: 14px; }
.rh-location-card .name { font-family: var(--font-display); font-size: 13px; font-weight: 700; letter-spacing: 1px; color: var(--text); text-transform: uppercase; }
.rh-location-card .count { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

.rh-info-banner {
    margin: 0 48px 60px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 18px 24px;
    color: var(--text-muted);
    font-size: 13px;
    display: flex; align-items: center; gap: 12px;
}

/* ---------- Planetary Map drill-down ---------- */
.rh-planetary-map { padding: 70px 48px; border-top: 1px solid var(--border); }
.rh-planetary-header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px; margin-bottom: 28px; }
.rh-planetary-header h2 { font-family: var(--font-display); font-size: 22px; color: var(--text); margin: 0; }
.rh-planetary-header h2 span { background: var(--accent-gradient); -webkit-background-clip: text; background-clip: text; color: transparent; }
.rh-planetary-header p { color: var(--text-muted); font-size: 13px; margin: 4px 0 0; }
.rh-state-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 18px; }
.rh-state-card {
    text-decoration: none;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 18px 20px;
    transition: transform .2s ease, border-color .2s ease;
}
.rh-state-card:hover { transform: translateY(-3px); border-color: var(--border-strong); }
.rh-state-card .name { font-family: var(--font-display); font-size: 14px; font-weight: 700; color: var(--text); margin-bottom: 6px; }
.rh-state-card .count { font-size: 12px; color: var(--text-muted); }
.rh-state-empty { color: var(--text-muted); font-size: 14px; }

.rh-footer {
    background: var(--bg-elevated);
    border-top: 1px solid var(--border);
    padding: 40px 48px;
}
.rh-footer-top {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 24px;
}
.rh-footer-links { display: flex; flex-wrap: wrap; gap: 20px; }
.rh-footer-links a, .rh-footer-social a {
    color: var(--text-muted);
    text-decoration: none;
    font-family: var(--font-display);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
}
.rh-footer-links a:hover, .rh-footer-social a:hover { color: var(--text); }
.rh-footer-social { display: flex; flex-wrap: wrap; gap: 20px; padding-top: 20px; border-top: 1px solid var(--border); }
.rh-footer-social span { color: var(--text-faint); font-size: 12px; }

@media (max-width: 1100px) {
    .rh-app-sidebar { display: none; }
    .rh-solar-row { flex-direction: column; }
    .rh-sidebar, .rh-stats-panel { width: 100%; border: none; border-bottom: 1px solid var(--border); }
    .rh-3d-stage { min-height: 420px; }
}
