/* ==========================================================================
   HAUPT-LAYOUT (Flexbox Spalten)
   ========================================================================== */
.family-layout-row {
    display: flex;
    flex-direction: row;
    width: 100%;
    gap: 20px;
    box-sizing: border-box;
}

/* Linke Spalte */
.family-sidebar {
    width: 25%;
    flex-shrink: 0;
    box-sizing: border-box;
}

/* Rechte Spalte */
.family-main-content {
    width: 75%;
    flex-grow: 1;
    box-sizing: border-box;
}

/* ==========================================================================
   SIDEBAR & INHALTS-CONTAINER (Paddings fixen)
   ========================================================================== */
.family-meta-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding: 10px !important;
}

/* Fix für den rechten Kasten: Erzeugt den Abstand nach rechts und unten */
.family-tree-content-container {
    padding: 10px;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

.family-meta-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.family-meta-label {
    font-size: 0.85rem;
    color: var(--text-main);
    font-variant: small-caps;
    letter-spacing: 0.5px;
	font-weight: 600;
}

.family-meta-value, .family-meta-desc  {
    font-size: 0.8rem;
    color: var(--text-main);
}



/* ==========================================================================
   STAMMBAUM (Root-Header & Tree)
   ========================================================================== */


/* Baum-Äste und Führungslinien */
.family-tree-wrapper ul {
    list-style: none;
    margin: 0;
    position: relative;
}

.family-tree-wrapper ul::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 0;
    bottom: 0;
    width: 1px;
    background: var(--border-color);
}

.family-tree-wrapper > ul::before {
    display: none;
}

.family-tree-wrapper li {
    margin: 0;
    padding: 8px 0 0 12px;
    position: relative;
}

.family-tree-wrapper li::before {
    content: '';
    position: absolute;
    left: -16px;
    top: 24px;
    width: 20px;
    height: 1px;
    background: var(--border-color);
}

/* Ordner / Unterfamilie Kopfzeile */
.tree-folder-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--tabs-header-activecol);
    border: 1px solid var(--border-color);
    padding: 10px 14px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    color: var(--primary-color);
    transition: background 0.2s, border-color 0.2s;
    user-select: none;
}

.tree-folder-toggle:hover {
    background: var(--tabs-header-hovercol);
    border-color: var(--light-color);
}

.tree-folder-toggle .folder-icon {
    font-size: 1.1rem;
    transition: transform 0.2s;
}

/* Spiele-Kacheln */
.tree-games-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
    margin-bottom: 12px;
}

.tree-game-node {
    display: flex;
    align-items: center;
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 8px 12px;
    gap: 15px;
    transition: transform 0.15s, border-color 0.15s;
    text-decoration: none;
	margin-left:35px;
}

.tree-game-node:hover {
    border-color: var(--primary-color);
    transform: translateX(2px);
}

.tree-game-thumb {
    width: 50px;
    height: 50px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.tree-game-thumb img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    padding: 2px;
}

.tree-game-info {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.tree-game-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tree-game-meta {
    font-size: 0.75rem;
    color: var(--light-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

.tree-game-rating {
    color: var(--gold-color);
}


.tree-btn-edit{
	opacity: 0.5; 
}
.tree-btn-edit:hover{
	opacity: 1; 
}

/* Entfernt den waagerechten Strich für alle Listenelemente der allerersten Ebene im Hauptbaum */
.family-tree-wrapper > ul > li::before {
    display: none !important;
}

/* 1. Stell sicher, dass die allererste Liste ihr normales Padding behält */
.family-tree-wrapper > ul {
    padding-left: 24px !important;
}

/* 2. Ziehe NUR das oberste Inhaltselement (Ebene 1) um genau diesen Abstand nach links */
.family-tree-wrapper > ul > li {
    margin-left: -24px;
    padding-left: 0;
}

/* 3. Korrektur für die vertikale Hauptlinie der darunterliegenden Ebenen */
.family-tree-wrapper > ul > li > ul::before {
    left: 20px; /* Rückt die vertikale Linie der zweiten Ebene an die perfekte Position */
}

/* ==========================================================================
   SIDEBAR TREE NAVIGATOR
   ========================================================================== */
.sidebar-tree-container {
    padding: 12px 15px;
    font-size: 0.85rem;
}

.sidebar-tree-container ul {
    list-style: none;
    padding-left: 14px;
    margin: 4px 0;
    position: relative;
}

/* Vertikale Verbindungslinien für den Mini-Baum */
.sidebar-tree-container ul::before {
    content: '';
    position: absolute;
    left: 2px;
    top: 0;
    bottom: 0;
    width: 1px;
    background: var(--border-color);
}

.sidebar-tree-container li {
    margin: 6px 0;
    position: relative;
}

/* Horizontale kleine Abzweige-Linie */
.sidebar-tree-container li::before {
    content: '';
    position: absolute;
    left: -12px;
    top: 10px;
    width: 8px;
    height: 1px;
    background: var(--border-color);
}

/* Die anklickbaren Text-Knoten */
.sidebar-tree-node {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--light-color);
    text-decoration: none;
    padding: 2px 6px;
    border-radius: 3px;
    transition: color 0.15s ease, background 0.15s ease;
}

.sidebar-tree-node i {
    font-size: 0.8rem;
    color: #888;
}

/* Hover-Effekt ohne Unterstreichung */
.sidebar-tree-node:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.05);
    text-decoration: none !important;
}

/* Hervorhebung der aktuell aufgerufenen Familie */
.sidebar-tree-node.is-active {
    color: var(--primary-color);
    font-weight: 600;
    background: rgba(255, 140, 0, 0.08);
}

.sidebar-tree-node.is-active i {
    color: var(--primary-color);
}

/* ==========================================================================
   INTERAKTIVE ZUSTÄNDE & RESPONSIVE BREAKPOINTS
   ========================================================================== */
.folder-collapsed + ul,
.folder-collapsed + .tree-games-list {
    display: none !important;
}

.folder-collapsed .fa-chevron-down {
    transform: rotate(-90deg);
}

/* Verhindert die Text-Unterstreichung beim Hovern über die Spiele-Knoten im Baum */
.tree-game-node:hover,
.tree-game-node:hover .tree-game-title {
    text-decoration: none !important;
}




/* Startseiten Config */

.sortable-dashboard {
    list-style-type: none;
    margin: 0;
    padding: 0;
    width: 100%;
}

.sortable-dashboard li {
    background: var(--box-bg);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    margin-bottom: 6px;
    padding: 6px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    cursor: grab;
	user-select: none;
}
.sortable-dashboard .title {
    flex-grow: 1;      /* Nimmt den gesamten freien Platz ein */
}
.sortable-dashboard li:active {
    cursor: grabbing;
}
.sortable-dashboard li.ui-sortable-helper {
    border-color: var(--primary-color); /* Goldener Rand beim Verschieben */
    box-shadow: 0 5px 15px rgba(0,0,0,0.5);
}

.sortable-dashboard .handle {
	flex-shrink: 0;    /* Verhindert, dass die Icons gequetscht werden */
    width: 30px;
    text-align: center;
}
.sortable-dashboard .ui-state-highlight {
    background: var(--box-bg) !important;
    opacity: 0.4 !important;                   /* Macht die Box halbtransparent */
    border: 1px dashed var(--border-color) !important;
    height: 30px !important;
    margin-bottom: 6px !important;
    border-radius: 4px !important;
    visibility: visible !important;
}


.family-addon-container {
	padding: 6px 10px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background-color: var(--input-bg);
}
.family-addon-wrapper {
    position: relative;
    display: flex;
    width: 100%;
    align-items: center;
}
.family-addon-list {
    margin-top: 8px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.family-addon-row {
    display: flex;
    align-items: center;
    background: var(--button-bg-color);
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 0.8rem;
    border: 1px solid var(--border-color);
    margin-left: 20px;
}
.family-addon-row i.fa-square-plus {
    margin-right: 10px;
    color: var(--secondary-color);
    font-size: 0.8rem;
}

.family-addon-row .family-addon-name {
    flex-grow: 1;
}

ul.good_ul {
    list-style: none;
    padding: 0;
    margin: 0 0 0 10px;
}

@media screen and (max-width: 992px) {
    .family-layout-row {
        flex-direction: column;
        gap: 25px;
    }

    .family-sidebar,
    .family-main-content {
        width: 100%;
    }
}