/* ═══════════════════════════════════════════════════════════════════
   JoyA — Misc Styles (Planet Popup, Theme Toggle, Table helpers)
   ═══════════════════════════════════════════════════════════════════ */

/* ═══════════════════════════════════════════════════════════════════
   Planet Interpretation Popup
   ═══════════════════════════════════════════════════════════════════ */

.planet-popup-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    transition: opacity 0.2s ease;
}

.planet-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1000;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.5rem 2rem;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6);
    animation: popupIn 0.25s ease;
}

@keyframes popupIn {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.92);
    }

    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

.planet-popup.hidden,
.planet-popup-overlay.hidden {
    display: none;
}

.planet-popup__close {
    position: absolute;
    top: 0.75rem;
    right: 1rem;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
    padding: 0;
}

.planet-popup__close:hover {
    color: var(--accent);
}

.planet-popup__header {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 0.75rem;
    padding-right: 2rem;
}

.planet-popup__body {
    font-size: 0.9rem;
    line-height: 1.65;
    color: var(--text-primary);
}

.planet-popup__source {
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
    font-size: 0.7rem;
    color: var(--text-secondary);
    opacity: 0.6;
}

/* Clickable planet rows */
#planets-table tbody tr {
    cursor: pointer;
    transition: background 0.15s ease;
}

#planets-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

/* ═══════════════════════════════════════════════════════════════════
   Theme Toggle Button
   ═══════════════════════════════════════════════════════════════════ */

.theme-toggle {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 24px;
    padding: 0.4rem 1rem 0.4rem 0.7rem;
    display: flex;
    align-items: center;
    gap: 0.45rem;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--text-secondary);
    font-family: var(--font-body);
    font-size: 0.75rem;
}

.theme-toggle:hover {
    background: var(--accent-dim);
    color: var(--accent);
    border-color: var(--accent-glow);
}

.theme-toggle__icon {
    font-size: 1rem;
    transition: transform 0.4s ease;
}

.theme-toggle:hover .theme-toggle__icon {
    transform: rotate(72deg);
}

.theme-toggle__label {
    font-weight: 500;
    letter-spacing: 0.03em;
}

/* Planet table: House vs Pada differentiation */
.house-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.6em;
    padding: 0.15em 0.45em;
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--accent);
    background: rgba(245, 189, 65, 0.1);
    border: 1px solid rgba(245, 189, 65, 0.25);
    border-radius: 5px;
}
.pada-num {
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--text-secondary);
}

/* Shadow planets (Rahu, Ketu) dimmed rows */
.row--shadow {
    opacity: 0.55;
}
.row--shadow:hover {
    opacity: 0.85;
}

/* Advanced analysis disclaimer banner */
.advanced-disclaimer {
    background: rgba(255, 255, 255, 0.03);
    border-left: 3px solid var(--accent);
    padding: 1rem;
    margin-bottom: 1.5rem;
    border-radius: 8px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Inline tab/label icons */
.icon-inline {
    width: 1.2rem;
    height: 1.2rem;
    vertical-align: middle;
    margin-right: 0.4rem;
    filter: brightness(0) invert(1) opacity(0.8);
}

/* ═══════════════════════════════════════════════════════════════════
   Guest Gate — Freemium restrictions for unregistered users
   ═══════════════════════════════════════════════════════════════════ */

/* D9 blur wrapper */
.guest-gate-blur {
    position: relative;
    overflow: hidden;
}
.guest-gate-blur > :not(.guest-gate-overlay) {
    filter: blur(8px);
    pointer-events: none;
    user-select: none;
}

/* Overlay on blurred chart */
.guest-gate-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    background: rgba(0, 0, 0, 0.25);
    border-radius: 12px;
}
.guest-gate-overlay__content {
    text-align: center;
    padding: 1.5rem;
}
.guest-gate-overlay__icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    opacity: 0.9;
}
.guest-gate-overlay__text {
    font-size: 0.85rem;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    font-weight: 500;
    max-width: 220px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.4;
}

/* CTA blocks replacing Planets / Dasha sections */
.guest-gate-cta {
    text-align: center;
    padding: 2.5rem 1.5rem;
    background: rgba(245, 189, 65, 0.03);
    border: 1px solid rgba(245, 189, 65, 0.15);
    border-radius: 12px;
    margin: 1rem 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-md, 1rem);
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}
.guest-gate-cta::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, transparent, var(--accent), #f97316, transparent);
    opacity: 0.8;
}
.guest-gate-cta__icon {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
    opacity: 0.7;
    color: var(--accent);
}
.guest-gate-cta__title {
    font-family: var(--font-heading);
    font-size: 1.6rem;
    font-weight: 600;
    color: var(--accent);
    margin: 0;
}
.guest-gate-cta__desc {
    font-size: 0.95rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0;
    line-height: 1.6;
}

/* Guest gate bullet points */
.guest-gate-features {
    text-align: left;
    margin: 1.5rem auto 1.5rem;
    max-width: 550px;
    line-height: 1.6;
    font-size: 0.95rem;
    color: var(--text-secondary);
    list-style: none;
    padding: 0;
}
.guest-gate-features li {
    margin-bottom: 0.85rem;
    position: relative;
    padding-left: 1.5rem;
}
.guest-gate-features li::before {
    content: '✦';
    position: absolute;
    left: 0;
    color: var(--accent);
    font-size: 0.8rem;
    top: 0.2rem;
}
.guest-gate-features b {
    color: #c4bbae;
    font-weight: 600;
}

/* Register button */
.guest-gate-register-btn {
    min-width: 280px;
    padding: 0.85rem 2.5rem;
    font-size: 1.05rem;
    margin-top: 0.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(245, 189, 65, 0.2);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.guest-gate-register-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(245, 189, 65, 0.4);
}

/* Light theme adjustments */
[data-theme="light"] .guest-gate-overlay {
    background: rgba(255, 255, 255, 0.35);
}
[data-theme="light"] .guest-gate-cta {
    background: rgba(245, 189, 65, 0.04);
    border-color: rgba(245, 189, 65, 0.2);
}