/* ------------------------------------------------------------------ *
 * Werkzeugkasten – Design angelehnt an CDE / Solaris (Motif)
 *   - lila-graue Oberflaeche
 *   - abgeschraegte 3D-Raender (Bevel): hell oben/links, dunkel unten/rechts
 * ------------------------------------------------------------------ */

:root {
    --face:        #b7b7c9;  /* Grundflaeche, lila-grau            */
    --face-light:  #c6c6d6;  /* Kacheln / Panels                   */
    --bevel-hi:    #e6e6f0;  /* Lichtkante                         */
    --bevel-lo:    #6e6e84;  /* Schattenkante                      */
    --bevel-lo2:   #4c4c60;  /* tiefere Schattenkante              */
    --title:       #5b5b7e;  /* Titelleiste                        */
    --title-hi:    #7a7aa0;
    --ink:         #1d1d28;  /* Text                               */
    --ink-soft:    #3a3a4c;
}

* { box-sizing: border-box; }

html { overflow-y: scroll; }
html, body {
    margin: 0;
    min-height: 100%;
}

body {
    background-color: var(--face);
    /* wiederholendes Muster hinter dem Fenster */
    background-image: url('../pattern.png');
    background-repeat: repeat;
    font-family: "Bitstream Vera Sans", Verdana, Geneva, "DejaVu Sans", sans-serif;
    color: var(--ink);
    padding: 24px;
}

/* --- Fensterrahmen --------------------------------------------------- */
.window {
    max-width: 980px;
    margin: 0 auto;
    background: var(--face);
    border-top: 2px solid var(--bevel-hi);
    border-left: 2px solid var(--bevel-hi);
    border-right: 2px solid var(--bevel-lo2);
    border-bottom: 2px solid var(--bevel-lo2);
    box-shadow: 3px 3px 0 rgba(0,0,0,.25);
}

/* --- Titelleiste ----------------------------------------------------- */
.titlebar {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 36px;        /* gleiche Höhe wie die Tool-Titelzeilen */
    padding: 5px 7px;
    background: linear-gradient(var(--title-hi), var(--title));
    color: #fff;
    border-top: 2px solid var(--bevel-hi);
    border-left: 2px solid var(--bevel-hi);
    border-right: 2px solid var(--bevel-lo2);
    border-bottom: 2px solid var(--bevel-lo2);
    margin: 3px;
}
.tb-title {
    flex: 1;
    font-weight: bold;
    letter-spacing: .5px;
    text-shadow: 1px 1px 0 rgba(0,0,0,.4);
}
.tb-btn, .tb-square {
    display: inline-block;
    width: 16px; height: 16px;
    background: var(--face-light);
    border-top: 2px solid var(--bevel-hi);
    border-left: 2px solid var(--bevel-hi);
    border-right: 2px solid var(--bevel-lo);
    border-bottom: 2px solid var(--bevel-lo);
}
.tb-square { cursor: pointer; }
.tb-square:active {
    border-top: 2px solid var(--bevel-lo);
    border-left: 2px solid var(--bevel-lo);
    border-right: 2px solid var(--bevel-hi);
    border-bottom: 2px solid var(--bevel-hi);
}
.tb-btns { display: flex; gap: 4px; }

/* Konfetti-Knöpfe in der Titelleiste */
.confetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 90; }
.tb-square.active {
    background: var(--title-hi);
    border-top: 2px solid var(--bevel-lo);
    border-left: 2px solid var(--bevel-lo);
    border-right: 2px solid var(--bevel-hi);
    border-bottom: 2px solid var(--bevel-hi);
}

/* --- Arbeitsflaeche (eingelassen) ----------------------------------- */
.workspace {
    margin: 3px;
    padding: 16px;
    background: var(--face);
    /* inset bevel */
    border-top: 2px solid var(--bevel-lo);
    border-left: 2px solid var(--bevel-lo);
    border-right: 2px solid var(--bevel-hi);
    border-bottom: 2px solid var(--bevel-hi);
}

/* --- Breadcrumb ------------------------------------------------------ */
.breadcrumb {
    font-size: 13px;
    margin-bottom: 16px;
    color: var(--ink-soft);
}
.breadcrumb a { color: var(--title); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb .sep { margin: 0 6px; color: var(--bevel-lo); }
.breadcrumb .here { font-weight: bold; }

/* --- Kachelraster ---------------------------------------------------- */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 16px;
}

.tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 16px 10px 12px;
    text-decoration: none;
    color: var(--ink);
    background: var(--face-light);
    border-top: 2px solid var(--bevel-hi);
    border-left: 2px solid var(--bevel-hi);
    border-right: 2px solid var(--bevel-lo);
    border-bottom: 2px solid var(--bevel-lo);
    cursor: pointer;
}
.tile:hover { background: #cfcfdd; }
.tile:active {
    /* gedrueckt: Bevel umkehren */
    border-top: 2px solid var(--bevel-lo);
    border-left: 2px solid var(--bevel-lo);
    border-right: 2px solid var(--bevel-hi);
    border-bottom: 2px solid var(--bevel-hi);
    padding: 17px 9px 11px 11px;
}

.tile .icon {
    width: 64px; height: 64px;
    display: flex; align-items: center; justify-content: center;
}
.tile .icon img {
    max-width: 100%; max-height: 100%;
    image-rendering: -webkit-optimize-contrast;
}
.tile .label {
    text-align: center;
    font-size: 13px;
    line-height: 1.25;
    word-break: break-word;
}

/* Kategorien optisch leicht abheben */
.tile.folder .label { font-weight: bold; }
.tile.up .label { color: var(--ink-soft); }

.empty {
    grid-column: 1 / -1;
    color: var(--ink-soft);
    font-size: 14px;
}
.empty code {
    background: var(--face-light);
    padding: 1px 5px;
    border: 1px solid var(--bevel-lo);
}

/* --- Footer (Datenschutz / Impressum) ------------------------------- */
.footer {
    max-width: 980px;
    margin: 16px auto 0;
    text-align: center;
    font-size: 13px;
    color: #777787;
}
.footer a {
    color: #777787;
    text-decoration: none;
    margin: 0 4px;
    transition: color .15s;
}
.footer a:hover { color: #4c4c60; text-decoration: none; }
