/* static/css/sandbox_style.css */

:root {
    --bg-deep: #0f0f13;
    --bg-card: #1c1c24;
    --bg-element: #262630;
    --primary: #fa9549;
    --text-main: #f0f0f5;
    --success: #4CAF50;
    --danger: #ff4d4d;
    --info: #5bc0de;
    --pipe: #f39c12;
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg-deep);
    color: var(--text-main);
    margin: 0;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

/* TOP TOOLBAR */
.toolbar {
    background: var(--bg-card);
    height: 65px;
    box-sizing: border-box;
    padding: 0 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
    z-index: 20;
}

.toolbar h2 {
    margin: 0;
    color: var(--primary);
    font-weight: 800;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.toolbar-buttons {
    display: flex;
    gap: 10px;
    align-items: center;
}

button {
    font-family: 'Inter';
    font-weight: 600;
    padding: 10px 16px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: 0.2s;
}

.btn-link {
    background: #262630;
    color: white;
    text-decoration: none;
    display: flex;
    align-items: center;
    padding: 10px 16px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9em;
}

.btn-link:hover {
    background: #333;
}

.btn-action {
    background: rgba(91, 192, 222, 0.1);
    color: var(--info);
    border: 1px solid var(--info);
}

.btn-action:hover {
    background: var(--info);
    color: #111;
}

.btn-calc {
    background: var(--success);
    color: #111;
}

.btn-calc:hover {
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(76, 175, 80, 0.4);
}

select.belt-select {
    background: var(--bg-element);
    color: white;
    border: 1px solid #444;
    border-radius: 8px;
    padding: 10px;
    font-family: 'Inter';
    font-weight: bold;
    outline: none;
    cursor: pointer;
}

select.belt-select:focus {
    border-color: var(--primary);
}

/* MAIN LAYOUT (SIDEBAR + CANVAS) */
.main-layout {
    display: flex;
    flex-grow: 1;
    height: calc(100vh - 65px);
    width: 100%;
    position: relative;
}

/* SIDEBAR STYLING */
.sidebar {
    width: 280px;
    background: var(--bg-card);
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 10;
    box-shadow: 5px 0 20px rgba(0, 0, 0, 0.4);
    box-sizing: border-box;
}

.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-thumb {
    background: #444;
    border-radius: 4px;
}

.sidebar h3 {
    margin: 0 0 15px 0;
    color: var(--text-main);
    font-size: 1.1em;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 10px;
}

.sidebar-category {
    font-size: 0.75em;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 15px;
    margin-bottom: 5px;
}

/* Drag Cursor Styling */
.sidebar-btn {
    background: var(--bg-element);
    color: var(--text-main);
    border: 1px solid transparent;
    padding: 12px 15px;
    border-radius: 8px;
    text-align: left;
    font-size: 0.95em;
    transition: 0.2s;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    cursor: grab;
}

.sidebar-btn:active {
    cursor: grabbing;
}

.sidebar-btn:hover {
    background: #333;
    border-color: var(--primary);
    transform: translateX(5px);
}

.sidebar-btn .hotkey {
    font-size: 0.75em;
    color: #666;
    background: rgba(0, 0, 0, 0.3);
    padding: 2px 6px;
    border-radius: 4px;
}

/* CANVAS */
#sandbox-canvas {
    flex-grow: 1;
    height: 100%;
    background-color: #1a2235;
    background-image: linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 40px 40px;
    cursor: default;
    display: block;
    position: relative;
}

/* RECHTSKLICK MENÜS */
.context-menu {
    position: absolute;
    background: var(--bg-card);
    border: 1px solid var(--primary);
    border-radius: 8px;
    padding: 5px 0;
    display: none;
    z-index: 1000;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
    min-width: 220px;
}

.menu-category {
    font-size: 0.75em;
    color: #888;
    text-transform: uppercase;
    padding: 5px 15px;
    letter-spacing: 1px;
    margin-top: 5px;
}

.menu-item {
    padding: 10px 15px;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: 0.1s;
    justify-content: space-between;
}

.menu-item:hover {
    background: var(--primary);
    color: #111;
}

.shortcut {
    font-size: 0.8em;
    color: #888;
    background: rgba(0, 0, 0, 0.2);
    padding: 2px 6px;
    border-radius: 4px;
}

/* MODALS (Popups) */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.modal-content {
    background: var(--bg-card);
    width: 90%;
    max-width: 600px;
    border-radius: 16px;
    border: 1px solid var(--bg-element);
    overflow: hidden;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.6);
}

.modal-header {
    padding: 20px;
    background: var(--bg-element);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.modal-search {
    width: 100%;
    padding: 12px;
    border-radius: 8px;
    border: 2px solid var(--primary);
    background: var(--bg-deep);
    color: white;
    font-size: 1.1em;
    outline: none;
    box-sizing: border-box;
    font-family: 'Inter';
}

.modal-body {
    max-height: 500px;
    overflow-y: auto;
    padding: 10px;
}

.item-option {
    padding: 12px 15px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    transition: 0.2s;
    border-bottom: 1px solid rgba(255, 255, 255, 0.02);
}

.item-option:hover {
    background: var(--bg-element);
    color: var(--primary);
    padding-left: 20px;
}

/* BLUEPRINT MANAGER */
.bp-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 15px;
}

.bp-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-deep);
    padding: 12px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: 0.2s;
}

.bp-item:hover {
    border-color: rgba(255, 255, 255, 0.2);
}

.bp-item button {
    padding: 6px 12px;
    font-size: 0.85em;
}

/* STATS PANEL */
#stats-panel {
    position: absolute;
    bottom: 20px;
    right: 20px;
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8);
    display: none;
    width: 300px;
    z-index: 100;
}

#stats-panel h3 {
    margin-top: 0;
    color: var(--success);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 10px;
    display: flex;
    justify-content: space-between;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 0.95em;
}

/* DIVERSES */
#autosave-indicator {
    position: absolute;
    top: 15px;
    right: 30px;
    color: var(--text-muted);
    font-size: 0.8em;
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
    opacity: 0;
    transition: opacity 0.5s;
}

.dot {
    height: 8px;
    width: 8px;
    background-color: var(--success);
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 8px var(--success);
}

.settings-label {
    display: block;
    margin-bottom: 10px;
    font-weight: 500;
    color: var(--text-muted);
}

.settings-input {
    background: var(--bg-deep);
    border: 1px solid #555;
    color: white;
    padding: 8px;
    border-radius: 6px;
    font-family: 'Inter';
    font-size: 1em;
    width: 100%;
    box-sizing: border-box;
    margin-top: 5px;
}

input[type=range] {
    width: 100%;
    cursor: pointer;
    accent-color: var(--primary);
}

.vis-manipulation {
    display: none !important;
}

/* static/css/sandbox_style.css (Ganz unten einfügen) */

/* Das Styling für das Hover-Popup (Tooltip) */
div.vis-tooltip {
    position: absolute;
    visibility: hidden;
    padding: 12px 15px;
    white-space: nowrap;
    font-family: 'Inter', sans-serif;
    font-size: 0.95em;
    color: var(--text-main);
    background-color: var(--bg-card);
    border: 1px solid var(--primary);
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
    pointer-events: none;
    /* Verhindert Flackern der Maus */
    z-index: 3000;
}

/* --- ZOOM STEUERUNG --- */
.zoom-controls {
    position: absolute;
    bottom: 25px;
    left: calc(280px + 50%);
    /* Zentriert im Zeichenfeld (neben der Sidebar) */
    transform: translateX(-50%);
    display: flex;
    gap: 5px;
    background: var(--bg-card);
    padding: 6px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
    z-index: 100;
}

.zoom-btn {
    background: var(--bg-element);
    color: var(--text-main);
    border: none;
    border-radius: 8px;
    width: 40px;
    height: 40px;
    font-size: 1.2em;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: 0.2s;
}

.zoom-btn:hover {
    background: var(--primary);
    color: #111;
    transform: translateY(-2px);
}

.dropdown {
    position: relative;
    display: inline-block;
    height: 100%;
}

.dropdown-btn {
    background: var(--bg-element);
    border: 1px solid #444;
    color: white;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 1.2em;
    font-weight: bold;
    cursor: pointer;
    transition: 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
}

.dropdown-btn:hover {
    background: #323240;
    border-color: var(--info);
}

.dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    top: 115%;
    background-color: var(--bg-card);
    min-width: 260px;
    box-shadow: 0px 15px 30px rgba(0, 0, 0, 0.8);
    z-index: 2000;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 15px;
    flex-direction: column;
    gap: 12px;
}

.dropdown-content.show {
    display: flex;
}

.dropdown-content label,
.dropdown-content select,
.dropdown-content button {
    width: 100%;
    box-sizing: border-box;
    margin: 0;
}

.dropdown-divider {
    border: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    margin: 4px 0;
}

.ficsit-footer {
        margin-top: auto;
        /*padding: 40px 20px;*/
        background: var(--bg-card);
        border-top: 1px solid rgba(255,255,255,0.05);
        text-align: center;
        width: 100%;
        box-sizing: border-box;
    }
    .footer-links {
        display: flex;
        justify-content: center;
        align-items: center;
        gap: 25px;
        margin-bottom: 15px;
        flex-wrap: wrap;
    }
    .footer-links a {
        color: var(--text-muted);
        text-decoration: none;
        font-weight: 600;
        font-size: 0.9em;
        transition: 0.2s;
        display: flex;
        align-items: center;
        gap: 8px;
    }
    .footer-links a:hover {
        color: var(--primary);
    }
    .footer-divider {
        color: var(--bg-element);
        font-weight: 300;
    }
    .footer-copy {
        color: var(--text-muted);
        font-size: 0.8em;
        opacity: 0.5;
        letter-spacing: 0.5px;
    }
    /* --- NEU: ETAGEN (MULTI-FLOOR) SYSTEM --- */
.floor-selector { 
    position: absolute; 
    right: 20px; 
    top: 20px; 
    display: flex; 
    flex-direction: column; 
    gap: 10px; 
    z-index: 1000; 
    background: var(--bg-element); 
    padding: 10px; 
    border-radius: 12px; 
    border: 1px solid rgba(255,255,255,0.1); 
    box-shadow: 0 10px 30px rgba(0,0,0,0.5); 
}
.floor-btn { 
    background: var(--bg-card); 
    color: var(--text-muted); 
    border: 1px solid transparent; 
    border-radius: 8px; 
    width: 45px; 
    height: 45px; 
    font-weight: bold; 
    cursor: pointer; 
    transition: 0.2s; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    font-size: 1.1em; 
}
.floor-btn:hover { background: #323240; color: #fff; }
.floor-btn.active { background: var(--primary); color: #111; border-color: #d35400; box-shadow: 0 0 15px rgba(250, 149, 73, 0.4); }