/* assets/css/sitemap.css */

/* The Canvas Wrapper */
#sitemap-viewport {
    width: 100%;
    height: 75vh;
    min-height: 600px;
    background-color: #f8f9fa;
    /* Blueprint dot pattern background */
    background-image: radial-gradient(#d1d5db 1px, transparent 1px);
    background-size: 30px 30px;
    overflow: hidden;
    /* Hide overflow so we can drag the canvas */
    position: relative;
    border: 2px solid #dee2e6;
    border-radius: 12px;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.05);
    cursor: grab;
}

#sitemap-viewport:active {
    cursor: grabbing;
}

/* The actual draggable map area */
#sitemap-canvas {
    position: absolute;
    width: 3000px;
    height: 3000px;
    top: 0;
    /* Start centered in the viewport via JS */
    left: 0;
    transform-origin: center center;
    transition: transform 0.1s ease-out;
}

/* SVG Line Layer - Sits behind nodes */
#sitemap-svg-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    /* Let clicks pass through lines to the background/nodes */
    z-index: 1;
}

.map-line {
    stroke: #dc3545;
    stroke-width: 3;
    stroke-linecap: round;
    stroke-dasharray: 8 8;
    animation: dash 30s linear infinite;
    opacity: 0.6;
}

@keyframes dash {
    to {
        stroke-dashoffset: -1000;
    }
}

/* Base Node Styling */
.map-node {
    position: absolute;
    z-index: 10;
    background: white;
    padding: 15px 25px;
    border-radius: 30px;
    font-weight: bold;
    color: #333;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1), 0 0 0 2px white;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    text-align: center;
    min-width: 150px;
    text-decoration: none;
    border: 2px solid #e9ecef;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    /* Natural gentle floating effect */
    animation: floatNode 6s ease-in-out infinite;
}

@keyframes floatNode {
    0% {
        transform: translateY(0px) scale(1);
    }

    50% {
        transform: translateY(-10px) scale(1.02);
    }

    100% {
        transform: translateY(0px) scale(1);
    }
}

/* Hovering over a node */
.map-node:hover {
    transform: translateY(-15px) scale(1.1) !important;
    box-shadow: 0 15px 30px rgba(220, 53, 69, 0.2), 0 0 0 4px #dc3545;
    z-index: 20;
    color: #dc3545;
    border-color: #dc3545;
}

/* The Core "Home" Node */
.node-core {
    background: #dc3545;
    color: white;
    padding: 20px 40px;
    border-radius: 50px;
    font-size: 1.2rem;
    box-shadow: 0 0 0 10px rgba(220, 53, 69, 0.2);
    border: none;
    animation: corePulse 3s infinite;
}

.node-core:hover {
    color: white;
    background: #c82333;
    box-shadow: 0 0 0 20px rgba(220, 53, 69, 0.3);
}

@keyframes corePulse {
    0% {
        box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.4);
    }

    70% {
        box-shadow: 0 0 0 25px rgba(220, 53, 69, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(220, 53, 69, 0);
    }
}

/* Node Icons */
.map-node i {
    font-size: 1.5rem;
    margin-bottom: 5px;
    color: #6c757d;
    transition: color 0.3s;
}

.node-core i {
    color: white;
    font-size: 2rem;
}

.map-node:hover i {
    color: #dc3545;
}

.node-core:hover i {
    color: white;
}

/* Different delay so they don't all float in unison */
.delay-1 {
    animation-delay: 0.5s;
}

.delay-2 {
    animation-delay: 1.2s;
}

.delay-3 {
    animation-delay: 2.1s;
}

.delay-4 {
    animation-delay: 3.4s;
}

.delay-5 {
    animation-delay: 4.8s;
}

/* Subcategory Nodes */
.node-sub {
    font-size: 0.9rem;
    padding: 10px 15px;
    min-width: 120px;
    border-radius: 15px;
    border: 1px solid #dee2e6;
    background: #fff;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.node-sub i {
    font-size: 1.2rem;
}

/* Category Image Wrappers */
.node-image-wrapper {
    width: 60px;
    height: 60px;
    margin: 0 auto 10px auto;
    border-radius: 50%;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    border: 2px solid #fff;
    background-color: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
}

.node-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.node-sub-image-wrapper {
    width: 40px;
    height: 40px;
    margin: 0 auto 8px auto;
    border-radius: 50%;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    border: 2px solid #fff;
    background-color: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
}

.node-sub-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}