/* Styles for PC Music network visualization */
@import url('https://fonts.googleapis.com/css2?family=Open+Sans:wght@400;600&display=swap');

/* Color variables for node categories */
:root {
    /* Custom palette */
    --pc-user: #7300FF;
    --pc-person: #0000FF;
    --pc-group: #FF783F;
    --pc-label: #D745A8;
    --bg-start: #ffffff;
    --bg-end: #ffffff;
}

/* Global page styling */
body {
    font-family: 'Open Sans', sans-serif;
    background: #f1f1f1;
    color: #222222;
    margin: 0;
    padding: 0;
    overflow: hidden;
    height: 100vh;
    width: 100vw;
    touch-action: none;
}

/* Main container for the SVG graph */
        #graph {
            width: 100%;
            height: 100%;
            position: absolute;
            top: 0%;
            left: 0%;
        }

/* Node circle styling */
        .node {
            cursor: pointer;
            transition: opacity 0.3s ease;
        }

/* Text labels attached to nodes */
        .node-label {
            font-size: 10px;
            pointer-events: none;
            font-weight: 600;
            fill: #000;
            stroke: #fff;
            stroke-width: 2px;
            paint-order: stroke fill;
            text-shadow: none;
            transition: opacity 0.3s ease;
        }

/* Lines connecting nodes */
        .link {
            stroke: #000;
            stroke-opacity: 0.05;
            transition: stroke-opacity 0.3s ease;
        }

/* Animated ring around a selected node */
        .node-ring {
            fill: none;
            stroke-width: 2px;
            stroke-dasharray: 10;
            animation: pulse 2s infinite;
            opacity: 0;
            pointer-events: none;
            filter: drop-shadow(0 0 6px currentColor);
        }

        @keyframes pulse {
            0% {
                stroke-width: 2px;
                stroke-opacity: 1;
                transform: scale(1);
                filter: drop-shadow(0 0 6px currentColor);
            }

            50% {
                stroke-width: 3px;
                stroke-opacity: 0.6;
                transform: scale(1.2);
                filter: drop-shadow(0 0 12px currentColor);
            }

            100% {
                stroke-width: 2px;
                stroke-opacity: 1;
                transform: scale(1);
                filter: drop-shadow(0 0 6px currentColor);
            }
        }

/* Gradient beam used when nodes connect */
        .beam {
            stroke-dasharray: 10;
            stroke-dashoffset: 100;
            stroke-linecap: flat;
            stroke-width: 2px;
        }

        .beam-active {
            animation: dash 3s linear infinite;
        }

        @keyframes dash {
            to {
                stroke-dashoffset: 0;
            }
        }

        /* Desktop panel (right side) */
/* Side panel shown on desktop screens */
        .info-panel-desktop {
            position: fixed;
            top: 0;
            right: -400px;
            width: 400px;
            height: 100vh;
            background: rgba(255, 255, 255, 0.95);
            backdrop-filter: blur(10px);
            border-left: 1px solid #e5e7eb;
            padding: 20px;
            color: #000;
            transition: right 0.3s ease;
            overflow-y: auto;
            z-index: 1000;
            box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
            display: none;
        }

        .info-content {
            display: flex;
            flex-direction: column;
            gap: 8px;
        }

        .info-panel-desktop.active {
            right: 0;
        }

        /* Mobile panel (bottom sheet) */
/* Bottom sheet panel used on mobile */
        .info-panel-mobile {
            position: fixed;
            bottom: -100%;
            left: 0;
            width: 100%;
            max-height: calc(100vh - 120px);
            background: rgba(255, 255, 255, 0.95);
            backdrop-filter: blur(10px);
            border-top: 1px solid #e5e7eb;
            border-radius: 20px 20px 0 0;
            padding: 20px;
            color: #000;
            transition: bottom 0.3s ease;
            overflow-y: auto;
            z-index: 1000;
            box-shadow: 0 -5px 15px rgba(0, 0, 0, 0.1);
            display: none;
        }

        .info-panel-mobile.active {
            bottom: 0;
        }

/* Image displayed in the info panel */
        .node-image {
            width: 120px;
            height: 120px;
            object-fit: cover;
            border-radius: 10px;
            margin-right: 15px;
            float: left;
        }

/* Small label showing the node category */
        .node-type {
            display: inline-block;
            padding: 4px 10px;
            border-radius: 20px;
            font-size: 12px;
            font-weight: 600;
            margin-bottom: 10px;
        }

        .type-person {
            background-color: var(--pc-person);
            color: white;
        }

        .type-group {
            background-color: var(--pc-group);
            color: white;
        }

        .type-label {
            background-color: var(--pc-label);
            color: black;
        }

/* Buttons linking to related nodes or users */
        .connection-button {
            display: flex;
            align-items: center;
            width: 100%;
            padding: 8px;
            margin: 5px 0;
            border-radius: 12px;
            font-size: 14px;
            font-weight: 600;
            background: rgba(0, 0, 0, 0.05);
            border: none;
            color: #000;
            text-align: left;
            cursor: pointer;
            transition: transform 0.2s ease, background 0.2s ease;
        }

        .connection-button:hover {
            background: rgba(0, 0, 0, 0.1);
            transform: scale(1.03);
        }

        .connection-user {
            background: rgba(115, 0, 255, 0.1);
        }

        .connection-person {
            background: rgba(0, 0, 255, 0.1);
        }

        .connection-group {
            background: rgba(255, 120, 63, 0.1);
        }

        .connection-label {
            background: rgba(215, 69, 168, 0.1);
        }

        .connection-type {
            margin-left: auto;
            padding: 2px 8px;
            border-radius: 10px;
            font-size: 10px;
            font-weight: 600;
            background: rgba(0, 0, 0, 0.15);
        }

        .connection-avatar {
            width: 40px;
            height: 40px;
            border-radius: 50%;
            margin-right: 10px;
            object-fit: cover;
            border: 2px solid rgba(255, 255, 255, 0.3);
        }

/* Link button styled for SoundCloud URLs */
        .soundcloud-link {
            display: inline-flex;
            align-items: center;
            padding: 6px 10px;
            background: #ff7700;
            color: white;
            border-radius: 12px;
            text-decoration: none;
            margin-top: 0;
            font-weight: 600;
            transition: transform 0.2s ease, background 0.2s ease;
        }

        .soundcloud-link:hover {
            background: #ff8800;
            transform: scale(1.05);
        }

/* Generic link button used for websites */
        .website-link {
            display: inline-flex;
            align-items: center;
            padding: 6px 10px;
            background: rgba(0, 0, 255, 0.5);
            color: white;
            border-radius: 12px;
            text-decoration: none;
            margin-top: 0;
            font-weight: 600;
            transition: transform 0.2s ease, background 0.2s ease;
        }

        .website-link:hover {
            background: rgba(0, 0, 255, 1);
            transform: scale(1.05);
        }

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

        .soundcloud-icon {
            margin-right: 5px;
        }

/* Heading displayed at the top of the page */
        .page-title {
            position: absolute;
            top: 20px;
            left: 50%;
            transform: translateX(-50%);
            font-size: 2rem;
            letter-spacing: 0.05em;
            text-transform: uppercase;
            color: var(--pc-person);
            z-index: 100;
            /* text-shadow: 0 0 8px var(--pc-person); */
            font-weight: 900;
        }

/* Positioning for the search field */
        .search-container {
            position: absolute;
            top: 20px;
            left: 20px;
            z-index: 100;
            width: 250px;
        }

/* Input element used for searching */
        .search-input {
            width: 100%;
            padding: 4px 10px;
            border-radius: 10px;
            border: none;
            background: rgba(0, 0, 0, 0.05);
            backdrop-filter: blur(5px);
            color: #000;
            font-family: 'Open Sans', sans-serif;
        }

        .search-input::placeholder {
            color: rgba(0, 0, 0, 0.5);
        }

/* Key explaining color coding for nodes */
        .legend {
            position: absolute;
            bottom: 20px;
            left: 20px;
            background: rgba(0, 0, 0, 0.05);
            backdrop-filter: blur(5px);
            border-radius: 10px;
            padding: 10px;
            display: flex;
            flex-direction: column;
            gap: 5px;
            z-index: 100;
            color: #000;
        }

        .legend-item {
            display: flex;
            align-items: center;
            gap: 8px;
            font-size: 12px;
        }

        .legend-color {
            width: 12px;
            height: 12px;
            border-radius: 50%;
        }

        .filters {
            position: absolute;
            top: 60px;
            left: 20px;
            right: auto;
            z-index: 100;
            display: flex;
            gap: 6px;
        }

/* Buttons used to filter the graph */
        .filter-button {
            padding: 4px 10px;
            border-radius: 10px;
            border: none;
            background: rgba(0, 0, 0, 0.05);
            color: #000;
            font-family: 'Open Sans', sans-serif;
            font-size: 12px;
            cursor: pointer;
            transition: all 0.2s ease;
        }

        .filter-button.active {
            background: var(--pc-user);
            color: #fff;
        }

        .controls {
            position: absolute;
            bottom: 20px;
            left: 50%;
            transform: translateX(-50%);
            z-index: 100;
            display: flex;
            flex-direction: row;
            gap: 10px;
            background: rgba(0, 0, 0, 0.05);
            backdrop-filter: blur(5px);
            border-radius: 30px;
            padding: 10px 15px;
        }

/* Zoom and center control buttons */
        .control-button {
            width: 40px;
            height: 40px;
            border-radius: 50%;
            border: none;
            background: rgba(0, 0, 0, 0.05);
            color: #000;
            font-size: 20px;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            transition: all 0.2s ease;
        }

        .control-button:hover {
            background: rgba(0, 0, 0, 0.1);
            transform: scale(1.1);
        }

/* Grid layout for metadata numbers */
        .metadata-grid {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 10px;
            margin: 10px 0;
            clear: both;
        }

        .metadata-item {
            background: rgba(0, 0, 0, 0.05);
            padding: 8px;
            border-radius: 12px;
            text-align: center;
        }

        .metadata-value {
            font-size: 18px;
            font-weight: 700;
            margin-bottom: 4px;
        }

        .metadata-label {
            font-size: 12px;
            opacity: 0.7;
        }

/* X button for closing info panels */
        .close-button {
            position: absolute;
            top: 15px;
            right: 15px;
            background: none;
            border: none;
            color: #000;
            font-size: 28px;
            font-weight: 600;
            cursor: pointer;
        }

/* Drag indicator bar for mobile sheet */
        .handle-bar {
            width: 40px;
            height: 5px;
            background: rgba(255, 255, 255, 0.3);
            border-radius: 3px;
            margin: 0 auto 15px;
        }


        .connections-grid {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 8px;
            margin-top: 10px;
        }

        .panel-header {
            display: flex;
            align-items: flex-start;
            margin-bottom: 15px;
        }

        .panel-header-text {
            flex: 1;
        }

/* Small popup shown on hover */
        .tooltip {
            position: absolute;
            padding: 2px 6px;
            background: rgba(0, 0, 0, 0.8);
            color: #fff;
            border-radius: 2px;
            pointer-events: none;
            font-size: 10px;
            z-index: 1000;
            opacity: 0;
            transition: opacity 0.3s;
            backdrop-filter: blur(5px);
            border: 1px solid rgba(0, 0, 0, 0.1);
        }

/* Desktop specific adjustments */
        @media (min-width: 769px) {
            .info-panel-desktop {
                display: block;
            }

            .info-panel-mobile {
                display: none;
            }

            /* Adjust graph area when panel is open */
            .graph-container.panel-open {
                width: calc(100% - 380px);
            }

            .controls {
                top: 50%;
                left: 20px;
                bottom: auto;
                transform: translateY(-50%);
                flex-direction: column;
            }
        }
/* Tablet and small screen tweaks */

        @media (max-width: 768px) {
            .info-panel-desktop {
                display: none;
            }

            .info-panel-mobile {
                display: block;
                max-height: calc(100vh - 120px);
            }

            .page-title {
                display: none;
            }

            body.info-open .search-container,
            body.info-open .filters,
            body.info-open .controls,
            body.info-open .legend {
                display: none;
            }

            .search-container {
                width: calc(100% - 40px);
                top: 10px;
            }


            .filters {
                top: 50px;
                right: auto;
                left: 20px;
                flex-wrap: wrap;
                width: calc(100% - 40px);
                gap: 15px;
            }

            .filter-button {
                flex: 1;
                min-width: 60px;
                text-align: center;
                padding: 6px 8px;
                font-size: 12px;
                margin-bottom: 6px;
            }

            .controls {
                bottom:10px;
                width: calc(100% - 40px);
                padding: 8px 12px;
            }

            .control-button {
                width: 36px;
                height: 36px;
                font-size: 16px;
            }

            .legend {
                bottom: 80px;
                left: 10px;
                flex-direction: row;
                flex-wrap: wrap;
                justify-content: center;
                padding: 5px;
            }

            .legend-item {
                margin: 5px;
            }

            .node-label {
                opacity: 100;
            }

            .connections-grid {
                grid-template-columns: 1fr;
            }

            .metadata-grid {
                grid-template-columns: 1fr 1fr;
            }
/* Very small screen overrides */
        }

        @media (max-width: 480px) {
            .search-container {
                width: calc(100% - 20px);
                left: 10px;
            }

            .filters {
                left: 10px;
                width: calc(100% - 20px);
                gap: 12px;
            }

            .filter-button {
                padding: 5px;
                font-size: 11px;
                margin-bottom: 6px;
            }

            .legend {
                display: none;
            }

            .connections-grid {
                grid-template-columns: 1fr;
            }

            .controls {
                padding: 8px 12px;
            }

            .control-button {
                width: 36px;
                height: 36px;
                font-size: 16px;
            }

            .info-panel-mobile {
                max-height: calc(100vh - 100px);
            }
        }
