/* ================================================================
   mac-system.css
   Gemeinsame System-7-Stile für alle Seiten der Forschungsgruppe.
   Authentische Bitmap-Fonts, Pixel-Rendering, Mac-Cursors,
   System-7-Window-Buttons.
   ================================================================ */

/* --- Authentische Mac-Bitmap-Fonts -------------------------------- */
@font-face {
    font-family: "ChicagoFLF";
    src: url("fonts/Chicago-12.woff2") format("woff2");
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: "GenevaPixel";
    src: url("fonts/Geneva-12.woff2") format("woff2");
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: "GenevaPixel";
    src: url("fonts/Geneva-9.woff2") format("woff2");
    font-weight: normal;
    font-style: normal;
    font-display: swap;
    /* kleinere Größen werden über CSS gesteuert */
}
@font-face {
    font-family: "MonacoPixel";
    src: url("fonts/Monaco-12.woff2") format("woff2");
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

/* --- Pixel-Rendering durchgehend ---------------------------------- */
html, body {
    -webkit-font-smoothing: none !important;
    -moz-osx-font-smoothing: unset !important;
    font-smooth: never;
    text-rendering: geometricPrecision;
}
img, svg {
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

/* --- Klassischer Mac-Cursor (1-Bit, 11x16) ------------------------ */
/* Schwarzer Pfeil mit weißer Outline, Hotspot oben-links.            */
:root {
    --mac-cursor-arrow: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='11' height='16' viewBox='0 0 11 16' shape-rendering='crispEdges'><path fill='white' d='M0,0 h2 v1 h-2 z M1,1 h2 v1 h-2 z M1,2 h3 v1 h-3 z M1,3 h4 v1 h-4 z M1,4 h5 v1 h-5 z M1,5 h6 v1 h-6 z M1,6 h7 v1 h-7 z M1,7 h8 v1 h-8 z M1,8 h9 v1 h-9 z M1,9 h10 v1 h-10 z M1,10 h6 v1 h-6 z M5,11 h3 v1 h-3 z M6,12 h3 v1 h-3 z M7,13 h3 v1 h-3 z'/><path fill='black' d='M1,1 h1 v1 h-1 z M1,2 h2 v1 h-2 z M1,3 h3 v1 h-3 z M1,4 h4 v1 h-4 z M1,5 h5 v1 h-5 z M1,6 h6 v1 h-6 z M1,7 h7 v1 h-7 z M1,8 h8 v1 h-8 z M1,9 h6 v1 h-6 z M1,10 h5 v1 h-5 z M3,11 h2 v1 h-2 z M5,11 h1 v3 h-1 z M6,11 h1 v3 h-1 z M7,12 h1 v2 h-1 z M8,13 h1 v1 h-1 z'/></svg>") 1 1, default;

    --mac-cursor-watch: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16' shape-rendering='crispEdges'><rect x='3' y='1' width='10' height='2' fill='black'/><rect x='3' y='13' width='10' height='2' fill='black'/><rect x='2' y='3' width='1' height='10' fill='black'/><rect x='13' y='3' width='1' height='10' fill='black'/><rect x='4' y='3' width='9' height='10' fill='white'/><rect x='7' y='5' width='2' height='4' fill='black'/><rect x='7' y='8' width='4' height='1' fill='black'/></svg>") 8 8, wait;

    --mac-cursor-text: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16' shape-rendering='crispEdges'><rect x='5' y='2' width='6' height='1' fill='black'/><rect x='5' y='13' width='6' height='1' fill='black'/><rect x='6' y='3' width='1' height='1' fill='black'/><rect x='9' y='3' width='1' height='1' fill='black'/><rect x='6' y='12' width='1' height='1' fill='black'/><rect x='9' y='12' width='1' height='1' fill='black'/><rect x='7' y='3' width='2' height='10' fill='black'/></svg>") 8 8, text;
}

/* Cursors überall anwenden */
* { cursor: var(--mac-cursor-arrow) !important; box-sizing: border-box; }
a, button, .mac-menu-item, .mac-dot, .apple-dropdown-item:not(.disabled) {
    cursor: var(--mac-cursor-arrow) !important;
}
input[type="text"], input[type="password"], textarea {
    cursor: var(--mac-cursor-text) !important;
}
body.is-busy, body.is-busy * {
    cursor: var(--mac-cursor-watch) !important;
}

/* --- Schrift-Setup ------------------------------------------------ */
body {
    font-family: "GenevaPixel", "Geneva", "Verdana", sans-serif;
}
.mac-title-text,
.mac-menubar,
h1, h2, h3,
.mac-button,
.about-box h2 {
    font-family: "ChicagoFLF", "Geneva", "Verdana", sans-serif;
    letter-spacing: 0;
}
code, pre, .about-stats, .mono {
    font-family: "MonacoPixel", "Monaco", "Courier New", monospace;
}

/* --- Authentische System-7-Window-Buttons ------------------------- */
/* Klassische Schließbox (links) und Zoom-Box (rechts).               */
.mac-sys7-close,
.mac-sys7-zoom {
    width: 11px;
    height: 11px;
    border: 1px solid var(--mac-black);
    background: var(--mac-white);
    flex-shrink: 0;
    position: relative;
    cursor: var(--mac-cursor-arrow) !important;
}
.mac-sys7-close:active {
    background: var(--mac-black);
}
.mac-sys7-close:active::after {
    content: "";
    position: absolute;
    inset: 2px;
    background: var(--mac-white);
}
.mac-sys7-zoom::before {
    content: "";
    position: absolute;
    top: 1px;
    left: 1px;
    width: 7px;
    height: 7px;
    border: 1px solid var(--mac-black);
    background: var(--mac-white);
}

/* --- Apple-Logo (von index.html zentralisiert) -------------------- */
.apple-logo {
    width: 14px;
    height: 17px;
    fill: var(--mac-black);
    display: block;
    margin-top: -1px;
}
.mac-menu-item:hover .apple-logo { fill: var(--mac-white); }

/* --- Apple-Menü Dropdown ------------------------------------------ */
.apple-menu-wrapper { position: relative; }
.apple-dropdown {
    display: none;
    position: absolute;
    top: 32px;
    left: 0;
    min-width: 200px;
    background: var(--mac-white);
    border: 2px solid var(--mac-black);
    box-shadow: 3px 3px 0 var(--mac-black);
    z-index: 1500;
    padding: 4px 0;
}
.apple-menu-wrapper.open .apple-dropdown { display: block; }
.apple-dropdown-item {
    padding: 4px 14px;
    font-family: "ChicagoFLF", "Geneva", sans-serif;
    font-size: 12px;
    font-weight: normal;
    color: var(--mac-black);
    cursor: var(--mac-cursor-arrow) !important;
    white-space: nowrap;
    text-decoration: none;
    display: block;
}
.apple-dropdown-item:hover {
    background: var(--mac-black);
    color: var(--mac-white);
}
.apple-dropdown-item.disabled {
    color: #999;
    pointer-events: none;
}
.apple-dropdown-sep {
    height: 0;
    border-top: 1px dashed var(--mac-black);
    margin: 4px 8px;
}

/* --- Menü mit Funktion (Special) ---------------------------------- */
.menu-wrapper { position: relative; }
.menu-dropdown {
    display: none;
    position: absolute;
    top: 32px;
    left: 0;
    min-width: 180px;
    background: var(--mac-white);
    border: 2px solid var(--mac-black);
    box-shadow: 3px 3px 0 var(--mac-black);
    z-index: 1500;
    padding: 4px 0;
}
.menu-wrapper.open .menu-dropdown { display: block; }

/* --- Shutdown-Screen --------------------------------------------- */
#shutdownScreen {
    position: fixed;
    inset: 0;
    background: var(--mac-black);
    z-index: 5000;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    color: var(--mac-white);
}
.shutdown-box {
    text-align: center;
    padding: 30px;
}
.shutdown-icon { margin-bottom: 20px; }
.shutdown-text {
    font-family: "ChicagoFLF", "Geneva", sans-serif;
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 24px;
}
.shutdown-restart {
    background: var(--mac-white) !important;
    color: var(--mac-black) !important;
}

/* --- Desktop-Icons ----------------------------------------------- */
.desktop-icon {
    position: absolute;
    width: 64px;
    text-align: center;
    cursor: var(--mac-cursor-arrow) !important;
    user-select: none;
}
.desktop-icon svg {
    display: block;
    margin: 0 auto 4px;
    width: 32px;
    height: 32px;
}
.desktop-icon-label {
    font-family: "GenevaPixel", "Geneva", sans-serif;
    font-size: 10px;
    color: var(--mac-black);
    background: var(--mac-white);
    padding: 0 3px;
    display: inline-block;
    line-height: 1.3;
    border: 1px solid transparent;
}
.desktop-icon.selected .desktop-icon-label {
    background: var(--mac-black);
    color: var(--mac-white);
    border-color: var(--mac-black);
}
.desktop-icon.selected svg path,
.desktop-icon.selected svg rect:not([fill="none"]),
.desktop-icon.selected svg polygon { /* invertieren mit Filter */ }
.desktop-icon.selected svg { filter: invert(1); }

/* Trash-Counter */
.trash-count {
    font-family: "MonacoPixel", monospace;
    font-size: 9px;
    margin-top: 2px;
    color: var(--mac-black);
}

/* --- Modal-Overlay (gemeinsam für alle Seiten) ------------------- */
#loginModal, #aboutModal, #getInfoModal { display: none; }
.mac-modal-overlay {
    position: absolute;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.15);
}
.mac-modal {
    background: var(--mac-white);
    border: 1px solid var(--mac-black);
    box-shadow: 2px 2px 0 var(--mac-black);
    width: 300px;
    max-width: 90vw;
}
.apple-dropdown-item .sound-ind {
    display: inline-block;
    width: 14px;
    text-align: left;
    font-family: "ChicagoFLF", sans-serif;
}

/* --- Get-Info Fenster -------------------------------------------- */
#getInfoModal { display: none; }
.get-info-box {
    width: 360px;
    padding: 16px;
    font-size: 12px;
}
.get-info-row {
    display: grid;
    grid-template-columns: 110px 1fr;
    gap: 4px 10px;
    padding: 4px 0;
    border-bottom: 1px dashed var(--mac-black);
}
.get-info-row:last-of-type { border-bottom: none; }
.get-info-label {
    font-weight: bold;
    color: var(--mac-black);
}
.get-info-icon {
    text-align: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--mac-black);
    margin-bottom: 8px;
}
.get-info-icon h2 {
    font-family: "ChicagoFLF", "Geneva", sans-serif;
    font-size: 14px;
    margin: 8px 0 0 0;
}
