/* Learning Dependency Network 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: 220px;
}

.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;
}

/* Shape styles for node legend */
.legend-shape {
    width: 20px;
    height: 20px;
    margin-right: 10px;
    border-width: 3px;
    border-style: solid;
}

/* Foundation - Gray circle */
.shape-foundation {
    background-color: #e0e0e0;
    border-color: #9e9e9e;
    border-radius: 50%;
}

/* Prerequisite - Light blue rectangle */
.shape-prerequisite {
    background-color: #4facfe;
    border-color: #2196f3;
    border-radius: 3px;
}

/* Target - Green hexagon (approximated with clipped shape) */
.shape-target {
    background-color: #4caf50;
    border-color: #388e3c;
    border-radius: 3px;
    clip-path: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%);
    width: 24px;
    height: 22px;
}

/* Advanced - Purple diamond */
.shape-advanced {
    background-color: #9c27b0;
    border-color: #7b1fa2;
    transform: rotate(45deg);
    width: 16px;
    height: 16px;
    margin-left: 2px;
    margin-right: 12px;
}

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

.legend-line.solid {
    background-color: #2196f3;
}

.legend-line.dashed {
    background: repeating-linear-gradient(
        90deg,
        #9c27b0 0px,
        #9c27b0 8px,
        transparent 8px,
        transparent 13px
    );
    height: 3px;
}

/* ===========================================
   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 #4caf50;
    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(76, 175, 80, 0.2);
    border-color: #4caf50;
}

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

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

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

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

    .legend-shape {
        width: 16px;
        height: 16px;
    }

    .shape-target {
        width: 20px;
        height: 18px;
    }

    .shape-advanced {
        width: 12px;
        height: 12px;
    }

    .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;
    }
}
