/* Transitive Dependency & Hop Count Finder - vis-network MicroSim
 * ===============================================================
 * Full-height network canvas with absolute-positioned overlays.
 * Overlays are SIBLINGS of #network (vis-network erases #network innerHTML).
 */

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

body {
    font-family: Arial, Helvetica, sans-serif;
    background-color: aliceblue;
}

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

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

/* ===========================================
   TITLE (Top Center)
   =========================================== */
.title {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 18px;
    font-weight: bold;
    color: black;
    background-color: rgba(240, 248, 255, 0.85);
    padding: 4px 12px;
    border-radius: 6px;
    white-space: nowrap;
    z-index: 10;
}

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

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

.legend-color {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    margin-right: 6px;
    border: 2px solid #333;
}

.color-blue { background-color: #90caf9; }
.color-gold { background-color: #ffca28; }

/* ===========================================
   RIGHT PANEL (Controls & Info)
   =========================================== */
.right-panel {
    position: absolute;
    top: 46px;
    right: 10px;
    width: 250px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 10;
    max-height: calc(100vh - 56px);
    overflow-y: auto;
}

.controls {
    display: flex;
    flex-direction: column;
    gap: 6px;
    background-color: rgba(255, 255, 255, 0.97);
    padding: 12px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.ctrl-label {
    font-size: 12px;
    font-weight: bold;
    color: #444;
    margin-top: 2px;
}

.controls select {
    font-size: 13px;
    padding: 6px 8px;
    border: 1px solid #bbb;
    border-radius: 6px;
    background-color: #fff;
    color: #222;
    cursor: pointer;
}

.controls select:focus {
    outline: 2px solid #2196f3;
    border-color: #2196f3;
}

.btn-row {
    display: flex;
    gap: 8px;
    margin-top: 6px;
}

.btn {
    padding: 8px 14px;
    font-size: 13px;
    font-weight: bold;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    flex: 1;
}

.btn-primary {
    background-color: #2196f3;
    color: white;
}

.btn-primary:hover {
    background-color: #1976d2;
}

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

.btn-secondary:hover {
    background-color: #616161;
}

/* ===========================================
   INFOBOX (Result)
   =========================================== */
.infobox {
    background-color: rgba(255, 255, 255, 0.97);
    border-radius: 8px;
    padding: 12px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border-left: 4px solid #2196f3;
}

.infobox.result-direct { border-left-color: #43a047; }
.infobox.result-transitive { border-left-color: #f5a623; }
.infobox.result-none { border-left-color: #e53935; }

.info-title {
    font-weight: bold;
    font-size: 12px;
    color: #1976d2;
    margin-bottom: 5px;
}

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

.info-text .hop-badge {
    display: inline-block;
    background-color: #ffca28;
    color: #5d4037;
    font-weight: bold;
    padding: 1px 8px;
    border-radius: 10px;
    margin-left: 2px;
}

/* ===========================================
   STATUS / HELP
   =========================================== */
.status-panel {
    background-color: rgba(255, 255, 255, 0.97);
    border-radius: 8px;
    padding: 10px 12px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.status-title {
    font-weight: bold;
    font-size: 12px;
    color: #333;
    margin-bottom: 5px;
}

.status-text {
    font-size: 11px;
    line-height: 1.5;
    color: #444;
}

/* ===========================================
   RESPONSIVE (stack below 700px)
   =========================================== */
@media (max-width: 700px) {
    .container {
        height: auto;
        min-height: 100vh;
    }

    #network {
        height: 320px;
    }

    .right-panel {
        position: static;
        width: auto;
        max-height: none;
        margin: 8px;
        overflow-y: visible;
    }

    .title {
        font-size: 15px;
    }
}
