/**
 * CRQC Readiness Benchmark - Dependency Graph Styles
 * Version: 4.0.3
 */

/* ==========================================================================
   Graph Container
   ========================================================================== */

.crqc-graph-wrapper {
    margin: var(--crqc-spacing-md, 16px) 0;
    padding: var(--crqc-spacing-md, 16px);
    background: var(--crqc-bg, #fff);
    border: 1px solid var(--crqc-panel-border, #e6e6e6);
    border-radius: var(--crqc-radius-lg, 8px);
}

.crqc-graph-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--crqc-spacing-sm, 8px);
}

.crqc-graph-title {
    font-weight: 600;
    color: var(--crqc-text, #111);
}

.crqc-graph-title small {
    font-weight: 400;
    color: var(--crqc-muted, #555);
    font-size: 0.85em;
    margin-left: 8px;
}

.crqc-graph-hint {
    font-size: 0.85rem;
    color: var(--crqc-muted, #555);
    margin-top: var(--crqc-spacing-sm, 8px);
}

.crqc-graph-container {
    position: relative;
    width: 100%;
    min-height: 400px;
    background: var(--crqc-subtle, #f7f9fc);
    border-radius: var(--crqc-radius-md, 6px);
    overflow: hidden;
}

/* ==========================================================================
   SVG Graph
   ========================================================================== */

.crqc-dep-graph {
    width: 100%;
    height: auto;
    min-height: 400px;
    display: block;
    color: var(--crqc-text, #111);
}

/* Dark mode adjustments */
.crqc-dark .crqc-dep-graph {
    color: var(--crqc-text, #f2f5fb);
}

.crqc-dark .crqc-graph-container {
    background: var(--crqc-subtle, #151a21);
}

/* ==========================================================================
   Graph Title
   ========================================================================== */

.crqc-graph-title {
    font-size: 16px;
    font-weight: 600;
    fill: currentColor;
}

/* ==========================================================================
   Capability Nodes
   ========================================================================== */

.crqc-node {
    cursor: pointer;
    transition: transform 0.15s ease;
}

.crqc-node:hover {
    transform: scale(1.05);
}

.crqc-node-hitarea {
    cursor: pointer;
}

.crqc-node-circle {
    transition: r 0.3s ease, fill-opacity 0.3s ease;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.crqc-node-ring {
    transition: r 0.3s ease, stroke-opacity 0.3s ease;
}

.crqc-node-value {
    pointer-events: none;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.crqc-node-label {
    pointer-events: none;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    opacity: 0.85;
    transition: opacity 0.15s ease;
}

/* Node States */
.crqc-node-active .crqc-node-circle {
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.25));
}

.crqc-node-active .crqc-node-ring {
    stroke-opacity: 0.8;
    stroke-width: 3;
}

.crqc-node-dimmed {
    opacity: 0.4;
}

.crqc-node-dimmed .crqc-node-label {
    opacity: 0.4;
}

/* Pulse Animation */
.crqc-node-pulse {
    animation: crqc-pulse 0.3s ease-out;
}

@keyframes crqc-pulse {
    0% {
        stroke-opacity: 0.8;
        stroke-width: 4;
    }
    50% {
        stroke-opacity: 1;
        stroke-width: 6;
    }
    100% {
        stroke-opacity: 0.3;
        stroke-width: 2;
    }
}

/* ==========================================================================
   Output Nodes (LQC, LOB, QOT)
   ========================================================================== */

.crqc-output-node {
    transition: transform 0.15s ease;
}

.crqc-output-glow {
    transition: fill-opacity 0.3s ease;
}

.crqc-output-circle {
    filter: drop-shadow(0 3px 8px rgba(0, 0, 0, 0.15));
    transition: r 0.3s ease;
}

.crqc-output-label {
    pointer-events: none;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* Active state */
.crqc-output-active .crqc-output-glow {
    fill-opacity: 0.35;
}

.crqc-output-active .crqc-output-circle {
    stroke-width: 4;
    filter: drop-shadow(0 4px 16px rgba(0, 0, 0, 0.3));
}

/* ==========================================================================
   Edges
   ========================================================================== */

.crqc-edge {
    pointer-events: none;
}

.crqc-edge-path {
    transition: stroke-width 0.3s ease, stroke-opacity 0.3s ease;
}

/* Edge colors by output */
.crqc-edge-lqc {
    stroke: var(--crqc-lqc, #3b82f6);
}

.crqc-edge-lob {
    stroke: var(--crqc-lob, #f97316);
}

.crqc-edge-qot {
    stroke: var(--crqc-qot, #8b5cf6);
}

/* Edge states */
.crqc-edge-active .crqc-edge-path {
    stroke-opacity: 0.9 !important;
    stroke-width: 4 !important;
}

.crqc-edge-dimmed .crqc-edge-path {
    stroke-opacity: 0.1 !important;
}

/* ==========================================================================
   Legend
   ========================================================================== */

.crqc-graph-legend {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.crqc-graph-legend text {
    fill: currentColor;
    opacity: 0.8;
}

/* ==========================================================================
   Focus States
   ========================================================================== */

.crqc-dep-graph:focus {
    outline: 2px solid var(--crqc-accent, #2b5fd9);
    outline-offset: 2px;
}

.crqc-dep-graph:focus-visible {
    outline: 2px solid var(--crqc-accent, #2b5fd9);
    outline-offset: 2px;
}

/* ==========================================================================
   Responsive Adjustments
   ========================================================================== */

@media (max-width: 800px) {
    .crqc-graph-container {
        min-height: 350px;
    }

    .crqc-dep-graph {
        min-height: 350px;
    }

    .crqc-node-label {
        font-size: 10px !important;
    }

    .crqc-node-value {
        font-size: 10px !important;
    }

    .crqc-output-label {
        font-size: 12px !important;
    }
}

@media (max-width: 600px) {
    .crqc-graph-wrapper {
        padding: var(--crqc-spacing-sm, 8px);
    }

    .crqc-graph-container {
        min-height: 300px;
    }

    .crqc-dep-graph {
        min-height: 300px;
    }

    .crqc-graph-legend {
        display: none;
    }
}

/* ==========================================================================
   Reduced Motion
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
    .crqc-node,
    .crqc-node-circle,
    .crqc-node-ring,
    .crqc-edge-path,
    .crqc-output-node,
    .crqc-output-glow,
    .crqc-output-circle {
        transition: none !important;
    }

    .crqc-node-pulse {
        animation: none !important;
    }
}

/* ==========================================================================
   Print Styles
   ========================================================================== */

@media print {
    .crqc-graph-container {
        background: #fff;
        border: 1px solid #ccc;
    }

    .crqc-edge-path {
        stroke-opacity: 0.5 !important;
    }
}
