/*
 * GANITSUTRAM
 * A Living Knowledge Ecosystem for Mathematical Discovery
 *
 * "यथा शिखा मयूराणां नागानां मणयो यथा
 *  तद्वद् वेदाङ्गशास्त्राणां गणितं मूर्ध्नि वर्तते"
 *
 * As the crest of a peacock, as the gem on the hood
 * of a cobra — so stands mathematics at the crown
 * of all knowledge.
 *                                       — Brahmagupta
 *                                         628 CE · Brahmasphutasiddhanta
 *
 * Creator:   Jawahar R. Mallah
 * Email:     jawahar@aitdl.com
 * GitHub:    https://github.com/jawahar-mallah
 * Websites:  https://ganitsutram.com
 *            https://aitdl.com
 *
 * Then:  628 CE · Brahmasphutasiddhanta
 * Now:   8 March MMXXVI · Vikram Samvat 2082
 *
 * Copyright © 2026 Jawahar R. Mallah · AITDL | GANITSUTRAM
 *
 * Developer Note:
 * If you intend to reuse this code, please respect
 * the creator and the work behind it.
 */
/*
Project: GanitSūtram
Author: Jawahar R Mallah
Company: AITDL | aitdl.com

Date:
Vikram Samvat: VS 2082
Gregorian: 2026-03-07

Purpose: Knowledge Map specific styles.
         Force-directed graph and interactive UI elements.
*/

/* ─── HERO SECTION ─────────────────────────────────────────── */
.gs-map-hero {
    padding: 8rem 0 4rem;
    text-align: center;
}

.gs-sanskrit-line {
    font-family: var(--font-ancient);
    color: var(--accent-secondary);
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
    letter-spacing: 0.1em;
}

/* ─── GRAPH CONTAINER ──────────────────────────────────────── */
.gs-graph-wrapper {
    position: relative;
    width: 100%;
    min-height: 600px;
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 4rem;
}

#knowledge-graph {
    width: 100%;
    height: 600px;
    cursor: grab;
}

#knowledge-graph:active {
    cursor: grabbing;
}

/* ─── D3 ELEMENTS ─────────────────────────────────────────── */
.gs-node {
    stroke: rgba(0, 0, 0, 0.5);
    stroke-width: 2px;
    cursor: pointer;
    transition: filter 0.2s;
}

.gs-node:hover {
    filter: brightness(1.2) drop-shadow(0 0 5px var(--accent-primary));
}

.gs-link {
    stroke: rgba(255, 255, 255, 0.1);
    stroke-width: 1.5px;
    transition: stroke 0.2s, stroke-width 0.2s;
}

.gs-link.highlighted {
    stroke: var(--accent-primary);
    stroke-width: 2.5px;
    opacity: 1;
}

.gs-node-label {
    font-family: var(--font-main);
    font-size: 12px;
    fill: var(--fg-main);
    pointer-events: none;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

/* ─── TOOLTIP ────────────────────────────────────────────── */
#gs-map-tooltip {
    position: absolute;
    padding: 0.75rem 1rem;
    background: rgba(0, 0, 0, 0.9);
    border: 1px solid var(--accent-secondary);
    border-radius: 4px;
    color: var(--fg-main);
    font-family: var(--font-main);
    font-size: 0.8rem;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s;
    z-index: 100;
}

.gs-tooltip-group {
    display: block;
    font-size: 0.7rem;
    text-transform: uppercase;
    color: var(--accent-secondary);
    margin-bottom: 0.25rem;
}

/* ─── DETAIL PANEL ────────────────────────────────────────── */
.gs-detail-panel {
    position: fixed;
    right: -400px;
    top: 0;
    width: 350px;
    height: 100vh;
    background: var(--bg-deep);
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    padding: 3rem 2rem;
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5);
    transition: right 0.4s ease-out;
    z-index: 1000;
    display: flex;
    flex-direction: column;
}

.gs-detail-panel.active {
    right: 0;
}

.gs-panel-close {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    background: none;
    border: none;
    color: var(--fg-main);
    font-size: 2rem;
    cursor: pointer;
    opacity: 0.5;
    transition: opacity 0.2s;
}

.gs-panel-close:hover {
    opacity: 1;
}

.gs-panel-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-family: var(--font-main);
    margin-bottom: 1.5rem;
    background: rgba(255, 255, 255, 0.1);
}

.gs-panel-title {
    font-family: var(--font-logo);
    font-size: 2rem;
    margin-bottom: 1.5rem;
    color: var(--fg-main);
}

.gs-panel-desc {
    font-family: var(--font-main);
    font-size: 0.95rem;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 2.5rem;
}

/* ─── LEGEND ─────────────────────────────────────────────── */
.gs-map-legend {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.gs-legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-main);
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.6);
}

.gs-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.gs-dot.core {
    background: #ff5500;
}

.gs-dot.vedic {
    background: #ffb300;
}

.gs-dot.engine {
    background: #7c3aed;
}

.gs-dot.foundation {
    background: rgba(255, 255, 255, 0.3);
}

.gs-dot.law {
    background: #0ea5e9;
}

.gs-dot.pattern {
    background: #a855f7;
}

/* Link colour for Vedic panel */
.gs-link-cta {
    color: var(--accent-primary);
    font-size: 0.85rem;
    text-decoration: none;
    border-bottom: 1px solid var(--accent-soft);
}

.gs-link-cta:hover {
    color: var(--accent-secondary);
}

/* ─── RESPONSIVE ─────────────────────────────────────────── */
@media (max-width: 768px) {
    .gs-map-hero {
        padding: 6rem 0 3rem;
    }

    .gs-detail-panel {
        width: 100%;
        right: -100%;
    }
}

@media (max-width: 480px) {
    .gs-map-hero {
        padding: 4rem 0 2rem;
    }

    .gs-map-legend {
        gap: 1rem;
        justify-content: center;
    }

    .gs-legend-item {
        width: 45%;
        justify-content: flex-start;
    }

    .gs-graph-wrapper {
        min-height: 350px;
        margin-bottom: 2rem;
    }

    #knowledge-graph {
        height: 350px;
    }
}

@media (max-width: 600px) {
    .gs-graph-wrapper {
        min-height: 400px;
    }

    #knowledge-graph {
        height: 400px;
    }

    /* Detail panel as Bottom Sheet on mobile */
    .gs-detail-panel {
        top: auto;
        bottom: -100%;
        left: 0;
        right: auto;
        width: 100%;
        height: 60vh;
        border-left: none;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        border-radius: 20px 20px 0 0;
        box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.6);
        transition: bottom 0.4s cubic-bezier(0.16, 1, 0.3, 1);
        padding: 2rem 1.5rem;
    }

    .gs-detail-panel.active {
        bottom: 0;
        right: auto;
        /* override the 768px rule */
    }
}