/* Concept Dependencies Graph Stylesheet
 * ============================================
 * vis-network tutorial layout with title top center,
 * legend upper left, controls on right
 */

/* ===========================================
   RESET & BASE STYLES
   =========================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    background-color: #f5f5f5;
}

/* ===========================================
   MAIN CONTAINER & NETWORK CANVAS
   =========================================== */
.container {
    position: relative;
    width: 100%;
    height: 100vh;
}

#network {
    width: 100%;
    height: 100%;
    background-color: #f5f5f5;
}

/* ===========================================
   TITLE (Top Center)
   =========================================== */
.title {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 20px;
    font-weight: bold;
    color: #333;
    background-color: rgba(245, 245, 245, 0.95);
    padding: 8px 20px;
    border-radius: 5px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    z-index: 10;
}

/* ===========================================
   LEGEND (Upper Left)
   =========================================== */
.legend {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 12px 15px;
    background-color: rgba(255, 255, 255, 0.95);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    z-index: 10;
    max-width: 200px;
}

.legend-title {
    font-size: 12px;
    font-weight: bold;
    color: #333;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.legend-item {
    display: flex;
    align-items: center;
    margin: 6px 0;
    font-size: 11px;
}

/* Line styles for edge legend */
.legend-line {
    width: 30px;
    height: 3px;
    margin-right: 10px;
    border-radius: 2px;
}

.legend-line.solid {
    background-color: #2E5A8B;
}

.legend-line.dashed {
    background: repeating-linear-gradient(
        90deg,
        #888888 0px,
        #888888 8px,
        transparent 8px,
        transparent 12px
    );
    height: 2px;
}

/* Color swatches for node legend */
.legend-color {
    width: 18px;
    height: 18px;
    border-radius: 4px;
    margin-right: 10px;
    border: 2px solid #333;
}

.color-default { background-color: #4A90D9; border-color: #2E5A8B; }
.color-selected { background-color: #FFB347; border-color: #E69422; }
.color-upstream { background-color: #90EE90; border-color: #228B22; }
.color-downstream { background-color: #FFB6C1; border-color: #DC143C; }

/* ===========================================
   RIGHT PANEL (Controls & Info)
   =========================================== */
.right-panel {
    position: absolute;
    top: 50px;
    right: 10px;
    width: 200px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 10;
}

/* ===========================================
   CONTROLS
   =========================================== */
.controls {
    background-color: rgba(255, 255, 255, 0.95);
    border-radius: 8px;
    padding: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.btn {
    padding: 10px 15px;
    font-size: 13px;
    font-weight: bold;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background-color: #5a6268;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.btn-secondary:active {
    transform: translateY(0);
}

/* ===========================================
   INFO PANEL
   =========================================== */
.info-panel {
    background-color: rgba(255, 255, 255, 0.95);
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    max-height: 350px;
    overflow-y: auto;
}

.info-title {
    font-weight: bold;
    font-size: 15px;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 2px solid #4A90D9;
    color: #333;
}

.info-text {
    font-size: 12px;
    line-height: 1.5;
    color: #555;
}

.info-text p {
    margin-bottom: 8px;
}

.info-text hr {
    margin: 10px 0;
    border: none;
    border-top: 1px solid #ddd;
}

/* ===========================================
   VIS-NETWORK NAVIGATION BUTTONS
   =========================================== */
div.vis-network div.vis-navigation div.vis-button {
    background-color: rgba(255, 255, 255, 0.9);
    border: 1px solid #ccc;
    border-radius: 4px;
}

div.vis-network div.vis-navigation div.vis-button:hover {
    background-color: rgba(74, 144, 217, 0.2);
    border-color: #4A90D9;
}

/* ===========================================
   RESPONSIVE STYLES
   =========================================== */
@media (max-width: 768px) {
    .title {
        font-size: 16px;
        top: 5px;
        padding: 6px 12px;
    }

    .legend {
        padding: 8px 10px;
        max-width: 160px;
    }

    .legend-title {
        font-size: 10px;
    }

    .legend-item {
        font-size: 10px;
        margin: 4px 0;
    }

    .legend-color {
        width: 14px;
        height: 14px;
    }

    .legend-line {
        width: 24px;
    }

    .right-panel {
        width: 170px;
        top: 40px;
    }

    .info-panel {
        padding: 10px;
    }

    .info-title {
        font-size: 13px;
    }

    .info-text {
        font-size: 11px;
    }
}

@media (max-width: 480px) {
    .legend {
        display: none;
    }

    .right-panel {
        width: 150px;
    }

    .btn {
        padding: 8px 10px;
        font-size: 12px;
    }
}
