/* Windows 95 Theme Styles */
:root {
    --win95-bg: #c0c0c0;
    --win95-border-raised: #dfdfdf #808080 #808080 #dfdfdf;
    --win95-border-lowered: #808080 #dfdfdf #dfdfdf #808080;
    --win95-blue: #000080;
    --win95-blue-light: #0080ff;
    --win95-font: 'MS Sans Serif', sans-serif;
    --win95-error: #ff0000;
}

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    background: #008080; /* Classic Windows 95 Teal */
    color: black;
    font-family: var(--win95-font);
    overflow: hidden;
    font-size: 11px;
}

#graph {
    width: 100%;
    height: 100%;
}

/* #controls/#backButton Styling jetzt im #sidebar-Block weiter unten */

/* Windows 95 Error Message */
#errorMessage {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--win95-bg);
    border: 2px solid;
    border-color: var(--win95-border-raised);
    color: black;
    padding: 0;
    display: none;
    z-index: 300;
    max-width: 300px;
    box-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    font-size: 11px;
    font-family: var(--win95-font);
}

#errorMessage .win95-titlebar {
    background: linear-gradient(90deg, var(--win95-error), #ff4444);
    color: white;
    padding: 2px 4px;
    font-weight: bold;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 18px;
}

#errorMessage .win95-content {
    padding: 12px;
    background: var(--win95-bg);
    border: 1px solid;
    border-color: var(--win95-border-lowered);
    margin: 2px;
}

/* Windows 95 Loading Indicator */
#loadingIndicator {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--win95-bg);
    border: 2px solid;
    border-color: var(--win95-border-raised);
    padding: 0;
    z-index: 300;
    display: none;
    box-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    text-align: center;
    font-size: 11px;
    font-family: var(--win95-font);
    width: 250px;
}

#loadingIndicator .win95-titlebar {
    background: linear-gradient(90deg, var(--win95-blue), var(--win95-blue-light));
    color: white;
    padding: 2px 4px;
    font-weight: bold;
    height: 18px;
    display: flex;
    align-items: center;
}

#loadingIndicator .win95-content {
    padding: 16px;
    background: var(--win95-bg);
    border: 1px solid;
    border-color: var(--win95-border-lowered);
    margin: 2px;
}

/* Loading spinner */
.spinner {
    border: 2px solid #dfdfdf;
    border-top: 2px solid var(--win95-blue);
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
    margin: 0 auto 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Windows 95 System Font Styling */
em {
    font-style: italic;
    color: #000080;
    font-size: inherit;
}

strong {
    font-weight: bold;
    font-size: inherit;
}

/* Windows 95 Focus Styles */
button:focus {
    outline: 1px dotted black;
    outline-offset: -3px;
}

body, #graph {
    cursor: url("media/Cursor.ico"), auto;
}
#graph {
    cursor: url("media/Cursor.ico"), auto;
}
#ascii-intro {
    cursor: url("media/Cursor.ico"), auto;
}

#connected-nodes-bar {
    position: fixed;
    bottom: 30px;
    left: 0;
    width: 100vw;
    min-height: 0;
    background: transparent;
    border: none;
    box-shadow: none;
    display: flex;
    align-items: center;
    gap: 4px;
    z-index: 1600;
    padding: 4px 10px;
    overflow-x: auto;
    overflow-y: hidden;
    justify-content: center;
    pointer-events: none;
}

#connected-nodes-bar > * {
    pointer-events: auto;
}

/* ─── Node-Type Legend ─────────────────────────────────────────────────────── */
#node-legend {
    position: fixed;
    top: 10px;
    right: 10px;
    z-index: 200;
    background: var(--win95-bg);
    border: 2px solid;
    border-color: var(--win95-border-raised);
    padding: 0;
    box-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    font-size: 11px;
    font-family: var(--win95-font);
    min-width: 130px;
}

#node-legend .win95-titlebar {
    background: linear-gradient(90deg, var(--win95-blue), var(--win95-blue-light));
    color: white;
    padding: 2px 6px;
    font-weight: bold;
    height: 18px;
    display: flex;
    align-items: center;
    font-size: 11px;
}

#node-legend .win95-content {
    padding: 6px 10px;
    background: var(--win95-bg);
    border: 1px solid;
    border-color: var(--win95-border-lowered);
    margin: 2px;
}

#node-legend .legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 2px 0;
    font-size: 11px;
    white-space: nowrap;
}

#node-legend .legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
    border: 1px solid rgba(0,0,0,0.25);
}

    #connected-nodes-bar button {
        font-family: var(--win95-font, 'MS Sans Serif', Arial, sans-serif) !important;
        font-size: 11px !important;
        padding: 2px 10px !important;
        margin: 0 4px 0 0 !important;
        border-width: 2px !important;
        border-style: solid !important;
        border-top-color: #fff !important;
        border-left-color: #fff !important;
        border-bottom-color: #808080 !important;
        border-right-color: #808080 !important;
        border-radius: 0 !important;
        background: #ece9d8 !important;
        color: #000 !important;
        min-width: 0 !important;
        min-height: 22px !important;
        max-width: 180px !important;
        box-shadow: none !important;
        outline: none !important;
        font-weight: normal !important;
        display: inline-block !important;
        transition: none !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        line-height: 1.2 !important;
    }

        #connected-nodes-bar button:active {
            border-top-color: #808080 !important;
            border-left-color: #808080 !important;
            border-bottom-color: #fff !important;
            border-right-color: #fff !important;
            background: #d4d0c8 !important;
        }
        #connected-nodes-bar button:focus {
            outline: 1px dotted #000;
            outline-offset: -4px;
        }

@media (max-width: 600px) {
    #connected-nodes-bar button {
        font-size: 12px !important;
        padding: 3px 8px !important;
        max-width: 40vw !important;
    }
}

/* ─── Sidebar (ausklappbar) ───────────────────────────────────────────────── */
#sidebar {
    position: fixed;
    top: 10px;
    left: 10px;
    z-index: 200;
    background: var(--win95-bg);
    border: 2px solid;
    border-color: var(--win95-border-raised);
    padding: 2px;
    box-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    font-family: var(--win95-font);
    font-size: 11px;
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 120px;
}

#sidebar .sidebar-title {
    background: linear-gradient(90deg, var(--win95-blue), var(--win95-blue-light));
    color: white;
    font-weight: bold;
    padding: 3px 6px;
    border: none;
    font-family: var(--win95-font);
    font-size: 11px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 6px;
    text-align: left;
    user-select: none;
}

#sidebar .sidebar-title:hover {
    filter: brightness(1.1);
}

#sidebar .sidebar-toggle-icon {
    display: inline-block;
    transition: transform 0.15s ease;
    font-size: 10px;
}

#sidebar:not(.collapsed) .sidebar-toggle-icon {
    transform: rotate(90deg);
}

.sidebar-items {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding-top: 3px;
}

#sidebar.collapsed .sidebar-items {
    display: none;
}

#sidebar .sidebar-btn {
    background: var(--win95-bg);
    border: 2px solid;
    border-color: var(--win95-border-raised);
    color: black;
    padding: 4px 8px;
    cursor: pointer;
    font-family: var(--win95-font);
    font-size: 11px;
    text-align: left;
    min-height: 22px;
    box-shadow: 1px 1px 0 rgba(0,0,0,0.4);
}

#sidebar .sidebar-btn:hover {
    background: #d4d0c8;
}

#sidebar .sidebar-btn:active,
#sidebar .sidebar-btn.active {
    border-color: var(--win95-border-lowered);
    box-shadow: inset 1px 1px 0 rgba(0,0,0,0.4);
}

#sidebar #backButton {
    /* übernimmt sidebar-btn-Styling, eigene Positionierung deaktivieren */
    position: static;
    top: auto;
    left: auto;
    min-height: 22px;
    padding: 4px 8px;
    font-size: 11px;
}

.sidebar-separator {
    height: 1px;
    background: #808080;
    border-bottom: 1px solid #dfdfdf;
    margin: 3px 2px;
}

/* ─── Win95 Window (Contact / Links / Impressum) ──────────────────────────── */
.win95-window {
    position: fixed;
    top: 100px;
    left: 160px;
    background: var(--win95-bg);
    border: 2px solid;
    border-color: var(--win95-border-raised);
    box-shadow: 2px 2px 4px rgba(0,0,0,0.4);
    font-family: var(--win95-font);
    font-size: 11px;
    color: black;
    min-width: 280px;
    max-width: 90vw;
    z-index: 400;
}

.win95-window-titlebar {
    background: linear-gradient(90deg, var(--win95-blue), var(--win95-blue-light));
    color: white;
    font-weight: bold;
    padding: 2px 4px;
    height: 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: move;
    user-select: none;
}

.win95-window-close {
    background: var(--win95-bg);
    border: 2px solid;
    border-color: var(--win95-border-raised);
    color: black;
    width: 18px;
    height: 16px;
    padding: 0;
    font-size: 10px;
    line-height: 1;
    cursor: pointer;
    font-family: var(--win95-font);
    display: flex;
    align-items: center;
    justify-content: center;
}

.win95-window-close:active {
    border-color: var(--win95-border-lowered);
}

.win95-window-content {
    padding: 12px;
    background: var(--win95-bg);
    border: 1px solid;
    border-color: var(--win95-border-lowered);
    margin: 2px;
    max-height: 60vh;
    overflow-y: auto;
}

.win95-window-content p {
    margin: 0 0 8px 0;
}

.win95-window-content ul {
    margin: 0;
    padding-left: 18px;
}

.win95-window-content a {
    color: var(--win95-blue);
}

/* ─── Taskbar (Win95-Stil) ────────────────────────────────────────────────── */
#taskbar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 30px;
    box-sizing: border-box;
    background: var(--win95-bg);
    border-top: 2px solid #dfdfdf;
    z-index: 1500;
    display: flex;
    align-items: center;
    padding: 3px 4px;
    gap: 3px;
    font-family: var(--win95-font);
    font-size: 11px;
    box-shadow: 0 -1px 0 #808080 inset;
}

#taskbar .taskbar-items {
    display: flex;
    gap: 3px;
    flex: 1 1 auto;
    overflow-x: auto;
    overflow-y: hidden;
    align-items: center;
    min-width: 0;
}

#taskbar .taskbar-btn {
    background: var(--win95-bg);
    border: 2px solid;
    border-color: var(--win95-border-raised);
    color: black;
    padding: 2px 12px;
    min-height: 22px;
    max-width: 180px;
    font-family: var(--win95-font);
    font-size: 11px;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: left;
    flex-shrink: 0;
}

#taskbar .taskbar-btn:hover {
    background: #d4d0c8;
}

#taskbar .taskbar-btn.active {
    border-color: var(--win95-border-lowered);
    background: #d4d0c8;
    box-shadow: inset 1px 1px 0 rgba(0,0,0,0.25);
}

/* ─── Mobile ──────────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
    #sidebar {
        top: 10px;
        left: 10px;
        right: auto;
        bottom: auto;
        min-width: 130px;
        max-width: 70vw;
        padding: 3px;
        max-height: calc(100vh - 80px);
    }

    #sidebar .sidebar-title {
        padding: 6px 10px;
        font-size: 13px;
    }

    #sidebar .sidebar-items {
        max-height: 70vh;
        overflow-y: auto;
    }

    #sidebar .sidebar-btn {
        font-size: 13px;
        padding: 8px 10px;
        min-height: 34px;
    }

    .win95-window {
        left: 5vw;
        right: 5vw;
        top: 10vh;
        min-width: unset;
        max-width: 90vw;
    }

    #taskbar {
        height: 34px;
    }

    #taskbar .taskbar-btn {
        font-size: 13px;
        min-height: 26px;
        padding: 3px 10px;
    }

    #connected-nodes-bar {
        bottom: 34px !important;
    }
}

