/* graph.css — Shared styles for all graph pages */

body.graph-page {
    overflow: hidden;
    height: 100vh;
}

.graph-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.graph-container canvas {
    display: block;
    width: 100%;
    height: 100%;
}

.graph-page .sticky-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 200;
    background: rgba(10, 10, 10, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

/* Controls bar */
.graph-controls {
    position: fixed;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 0.5rem;
    z-index: 150;
    background: rgba(10, 10, 10, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid #333;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
}

.graph-controls button {
    background: transparent;
    border: 1px solid #333;
    color: #888;
    padding: 0.35rem 0.65rem;
    font-family: inherit;
    font-size: 0.8rem;
    cursor: pointer;
    border-radius: 3px;
    transition: all 0.2s;
}

.graph-controls button:hover {
    border-color: #88c0d0;
    color: #88c0d0;
}

.graph-controls button.active {
    border-color: #88c0d0;
    color: #88c0d0;
    background: rgba(136, 192, 208, 0.1);
}

/* Stats */
.graph-stats {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 150;
    font-size: 0.75rem;
    color: #666;
    text-align: right;
    line-height: 1.5;
}

/* Hint */
.graph-hint {
    position: fixed;
    top: 4.5rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 150;
    font-size: 0.8rem;
    color: #555;
    transition: opacity 0.5s;
    pointer-events: none;
    white-space: nowrap;
}

/* View toggle */
.view-toggle {
    position: fixed;
    top: 4rem;
    right: 1.5rem;
    z-index: 150;
}

.view-toggle a {
    font-size: 0.8rem;
    color: #666;
    text-decoration: none;
    border: 1px solid #333;
    padding: 0.35rem 0.65rem;
    border-radius: 3px;
    transition: all 0.2s;
    display: inline-block;
    margin-left: 0.4rem;
}

.view-toggle a:hover {
    color: #88c0d0;
    border-color: #88c0d0;
}

/* Tooltip */
.graph-tooltip {
    position: fixed;
    z-index: 300;
    background: rgba(13, 13, 13, 0.95);
    border: 1px solid #333;
    padding: 0.75rem 1rem;
    border-radius: 4px;
    max-width: 360px;
    font-size: 0.85rem;
    color: #e0e0e0;
    line-height: 1.5;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.graph-tooltip.visible {
    opacity: 1;
}

.tooltip-id {
    color: #88c0d0;
    font-size: 0.75rem;
    margin-bottom: 0.35rem;
}

.tooltip-text {
    /* default text */
}

.tooltip-date {
    color: #666;
    font-size: 0.75rem;
    margin-top: 0.35rem;
}

.tooltip-category {
    display: inline-block;
    font-size: 0.65rem;
    padding: 0.15rem 0.4rem;
    border-radius: 3px;
    margin-bottom: 0.35rem;
    color: #e0e0e0;
    opacity: 0.8;
}

/* Side panel */
.graph-panel {
    position: fixed;
    right: -420px;
    top: 0;
    width: 400px;
    max-width: 90vw;
    height: 100vh;
    z-index: 250;
    background: rgba(10, 10, 10, 0.95);
    border-left: 1px solid #333;
    padding: 5rem 1.5rem 2rem;
    overflow-y: auto;
    overflow-x: hidden;
    box-sizing: border-box;
    transition: right 0.3s ease;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.graph-panel.open {
    right: 0;
}

.panel-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: transparent;
    border: 1px solid #333;
    color: #888;
    width: 30px;
    height: 30px;
    cursor: pointer;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 3px;
    transition: all 0.2s;
}

.panel-close:hover {
    border-color: #88c0d0;
    color: #88c0d0;
}

.panel-id {
    color: #88c0d0;
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
}

.panel-date {
    color: #666;
    font-size: 0.8rem;
    margin-bottom: 1.25rem;
}

.panel-text {
    font-size: 0.95rem;
    line-height: 1.7;
    color: #e0e0e0;
    margin-bottom: 1.5rem;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* removed duplicate - merged into .graph-panel above */

.panel-connections {
    border-top: 1px solid #333;
    padding-top: 1rem;
    margin-bottom: 1rem;
}

.panel-connections h3 {
    color: #666;
    font-size: 0.8rem;
    text-transform: lowercase;
    font-weight: 400;
    margin-bottom: 0.75rem;
}

.panel-conn-item {
    font-size: 0.8rem;
    color: #999;
    padding: 0.35rem 0;
    border-bottom: 1px solid rgba(51, 51, 51, 0.5);
    cursor: pointer;
    transition: color 0.2s;
    line-height: 1.4;
}

.panel-conn-item:hover {
    color: #88c0d0;
}

.panel-conn-item:last-child {
    border-bottom: none;
}

.panel-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.panel-actions button,
.panel-actions a {
    background: transparent;
    border: 1px solid #333;
    color: #888;
    padding: 0.4rem 0.75rem;
    font-family: inherit;
    font-size: 0.8rem;
    cursor: pointer;
    border-radius: 3px;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.panel-actions button:hover,
.panel-actions a:hover {
    border-color: #88c0d0;
    color: #88c0d0;
}

/* Category badge */
.panel-category {
    display: inline-block;
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
    border-radius: 3px;
    margin-bottom: 0.75rem;
    color: #e0e0e0;
}

.panel-path {
    color: #555;
    font-size: 0.7rem;
    margin-bottom: 1rem;
    word-break: break-all;
}

/* Sidebar */
.graph-sidebar {
    position: fixed;
    top: 4rem;
    left: 1rem;
    z-index: 180;
    width: 220px;
    transition: transform 0.3s ease;
}

.graph-sidebar.collapsed .sidebar-content {
    display: none;
}

.sidebar-toggle {
    background: rgba(10, 10, 10, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid #333;
    color: #888;
    width: 28px;
    height: 28px;
    cursor: pointer;
    font-size: 0.8rem;
    font-family: inherit;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.5rem;
    transition: all 0.2s;
}

.sidebar-toggle:hover {
    border-color: #88c0d0;
    color: #88c0d0;
}

.sidebar-content {
    background: rgba(10, 10, 10, 0.9);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid #222;
    border-radius: 6px;
    padding: 1rem;
}

.sidebar-section {
    margin-bottom: 1rem;
}

.sidebar-section:last-child {
    margin-bottom: 0;
}

.sidebar-title {
    font-size: 0.7rem;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0.5rem;
}

.sidebar-search {
    width: 100%;
    background: #111;
    border: 1px solid #333;
    color: #e0e0e0;
    padding: 0.4rem 0.6rem;
    font-family: inherit;
    font-size: 0.8rem;
    border-radius: 3px;
    outline: none;
    transition: border-color 0.2s;
}

.sidebar-search:focus {
    border-color: #88c0d0;
}

.sidebar-search::placeholder {
    color: #555;
}

.sidebar-search-count {
    font-size: 0.7rem;
    color: #555;
    margin-top: 0.3rem;
}

.legend-items {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: #999;
    cursor: pointer;
    padding: 0.2rem 0.3rem;
    border-radius: 3px;
    transition: all 0.15s;
    user-select: none;
}

.legend-item:hover {
    background: rgba(255, 255, 255, 0.03);
    color: #e0e0e0;
}

.legend-item.active {
    color: #e0e0e0;
    background: rgba(255, 255, 255, 0.05);
}

.legend-item.dimmed {
    opacity: 0.35;
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.legend-count {
    color: #555;
    font-size: 0.7rem;
    margin-left: auto;
}

.sidebar-help {
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 0.75rem;
    color: #666;
    line-height: 1.7;
}

.sidebar-help b {
    color: #999;
    font-weight: 500;
}

/* Responsive */
@media (max-width: 600px) {
    .graph-sidebar {
        top: auto;
        bottom: 4rem;
        left: 0.5rem;
        width: 200px;
    }
    .graph-sidebar .sidebar-content {
        display: none;
    }
    .graph-sidebar.collapsed .sidebar-content {
        display: none;
    }
}
    .graph-controls {
        bottom: 1rem;
        padding: 0.4rem 0.5rem;
        gap: 0.3rem;
    }
    .graph-controls button {
        font-size: 0.7rem;
        padding: 0.3rem 0.5rem;
    }
    .graph-stats {
        display: none;
    }
    .graph-hint {
        font-size: 0.7rem;
        top: 4rem;
    }
    .view-toggle {
        top: 3.5rem;
        right: 1rem;
    }
    .graph-panel {
        width: 100vw;
        max-width: 100vw;
        right: -100vw;
    }
    .graph-tooltip {
        max-width: 280px;
        font-size: 0.8rem;
    }
}
