/* ============================================== */
/* 1. Layout-Anpassungen (col-md-8)              */
/* ============================================== */
/* Stellt sicher, dass die col-md-8 das volle Maß nutzt */
.col-md-8 {
    padding-left: 0 !important;
    padding-right: 0 !important;
}

#scroll-wrapper {
    /* Setzt eine maximale Höhe, nach der Scrollen beginnt */
    max-height: 600px; 
    /* Aktiviert Scrollbars bei Überlauf */
    overflow: auto; 
    /* Zentrierung */
    margin: 20px auto; 
}

/* Zwingt den Container, sich wie ein zentrierbarer Block zu verhalten */
#container {
    border: 2px solid #333; /* Fügt einen schwarzen Rand hinzu */
    background-color: #fff; /* Setzt den Hintergrund auf Weiß */
    min-width: 100px; 
    display: inline-block; 
    margin: 20px auto; 
}


/* ============================================== */
/* 2. Allgemeine Styles                           */
/* ============================================== */
body {
    font-family: Arial, sans-serif;
    text-align: center;
    background-color: #f0f0f0;
    padding: 20px;
}

.navbar {
    border-bottom: 2px solid #444;
    box-shadow: 0 2px 5px rgba(0,0,0,0.4);
}

/* ============================================== */
/* 3. Item-Sidebar (Gruppierung & Selektoren)    */
/* ============================================== */

/* --- Haupt-Container für die gesamte Sidebar-Liste --- */
/* NEU: Flex-Direction column für die Kategorien (Header, dann Items) */
.item-container {
    display: flex;
    flex-direction: column; /* Wichtig: Stapelt Header und Item-Blöcke */
    max-height: 400px; 
    overflow-y: auto;
    padding: 5px;
    gap: 0; /* Kein Gap hier, da die Trennung durch HR/Header erfolgt */
}

/* Stil für den Kategorie-Header */
.category-header {
    margin-top: 15px;
    margin-bottom: 5px;
    padding-bottom: 3px;
    border-bottom: 2px solid #eee;
    font-size: 1.05rem;
    font-weight: 600;
}

/* NEU: Wrapper für die Items innerhalb einer Kategorie. 
   Dieser muss die Eigenschaft haben, dass Items nebeneinander liegen. */
.category-items-wrapper {
    display: flex;
    flex-wrap: wrap; /* Items liegen nebeneinander, wenn Platz ist */
    gap: 8px; /* Abstand zwischen den Items */
    justify-content: flex-start;
    padding-top: 5px;
}

/* --- Einzelnes Item --- */
.item-selector {
    width: 70px; 
    height: 80px;
    /* Der Rand und die Farbe werden jetzt vom JavaScript gesetzt! */
    /* border: 1px solid #ddd;  <- Wird von JS überschrieben */
    border-radius: 8px;
    background-color: #f9f9f9;
    transition: all 0.2s ease;
    cursor: grab;
    flex-shrink: 0;
}

.item-selector:hover {
    background-color: #eef2ff;
    transform: scale(1.05);
    /* border-color: #007bff; <- Wird von JS/Kategorie-Farbe gesteuert */
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.2);
}

/* --- Bild --- */
.item-selector img {
    width: 36px;
    height: 36px;
    margin-top: 6px;
    object-fit: contain;
    display: block; /* Muss explizit gesetzt werden */
    margin: 0 auto 5px auto;
}

/* --- Text --- */
.item-selector p {
    font-size: 11px;
    margin-top: 4px;
    color: #333;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
}