/**
 * Bengal SSG - Graph Minimap Component Styles
 *
 * Styles for the embedded graph minimap (similar to Obsidian's minimap).
 * Designed to be compact and fit in sidebars or small containers.
 */

/* Minimap Container */
.graph-minimap {
    width: 100%;
    min-height: 250px;
    position: relative;
}

.graph-minimap-container {
    position: relative;
    width: 100%;
    height: 100%;
    border: 1px solid var(--color-border, #e0e0e0);
    border-radius: 8px;
    overflow: hidden;
    background: var(--color-bg-primary, #ffffff);
    transition: border-color 0.2s ease, background-color 0.2s ease;
}

[data-theme="dark"] .graph-minimap-container {
    background: var(--color-bg-primary, #1a1a1a);
}

/* Minimap SVG */
.graph-minimap-container svg {
    width: 100%;
    height: 100%;
    display: block;
}

/* Ensure container is visible (class-based approach to reduce inline style churn) */
.graph-minimap-container.graph-visible {
    display: block;
    opacity: 1;
    visibility: visible;
}

/* Ensure SVG is visible (class-based approach) */
.graph-minimap-container svg.graph-svg-visible {
    display: block;
    opacity: 1;
    visibility: visible;
}

/* Minimap Links */
.graph-minimap-link {
    stroke: var(--color-border-light, rgba(0, 0, 0, 0.1));
    stroke-width: 0.5px;
    opacity: 0.6;
    transition: opacity 0.2s ease, stroke-width 0.2s ease;
}

.graph-minimap-link-highlighted {
    stroke: var(--color-accent, #ff9800);
    stroke-width: 1px;
    opacity: 0.8;
}

/* Minimap Nodes */
.graph-minimap-node {
    cursor: pointer;
    stroke: var(--color-border, rgba(0, 0, 0, 0.2));
    stroke-width: 0.5px;
    transition: stroke 0.2s ease, stroke-width 0.2s ease, opacity 0.2s ease;
}

.graph-minimap-node:hover {
    stroke: var(--color-primary, #2196f3);
    stroke-width: 1.5px;
    opacity: 1;
}

.graph-minimap-node-highlighted {
    stroke: var(--color-accent, #ff9800);
    stroke-width: 1.5px;
    opacity: 1;
}

/* Expand Button */
.graph-minimap-expand {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-bg-elevated, var(--color-bg-secondary, #f5f5f5));
    border: 1px solid var(--color-border, #e0e0e0);
    border-radius: 6px;
    cursor: pointer;
    color: var(--color-text-secondary, #757575);
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
    z-index: 10;
}

.graph-minimap-expand:hover {
    background: var(--color-bg-tertiary, #eeeeee);
    border-color: var(--color-primary, #2196f3);
    color: var(--color-primary, #2196f3);
    transform: scale(1.05);
}

.graph-minimap-expand svg {
    width: 18px;
    height: 18px;
}

/* Tooltip */
.graph-minimap-tooltip {
    position: absolute;
    background: var(--color-bg-elevated, var(--color-bg-secondary, #f5f5f5));
    border: 1px solid var(--color-border, #e0e0e0);
    border-radius: 6px;
    padding: 8px 12px;
    pointer-events: none;
    font-size: 12px;
    max-width: 200px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.graph-minimap-tooltip-title {
    font-weight: 600;
    color: var(--color-text-primary, #212121);
    margin-bottom: 4px;
    line-height: 1.3;
}

.graph-minimap-tooltip-meta {
    font-size: 11px;
    color: var(--color-text-secondary, #757575);
    line-height: 1.4;
}

/* Error State */
.graph-minimap-error {
    padding: 16px;
    text-align: center;
    color: var(--color-text-secondary, #757575);
    font-size: 13px;
}

/* Section Header (for Obsidian-style integration) */
.graph-minimap-section-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--color-border, #e0e0e0);
    font-size: 14px;
    font-weight: 500;
    color: var(--color-text-primary, #212121);
}

.graph-minimap-section-header-icon {
    display: flex;
    align-items: center;
    color: var(--color-text-secondary, #757575);
}

.graph-minimap-section-header-icon svg {
    width: 20px;
    height: 20px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .graph-minimap {
        min-height: 200px;
    }

    .graph-minimap-expand {
        width: 28px;
        height: 28px;
    }

    .graph-minimap-expand svg {
        width: 16px;
        height: 16px;
    }
}
