/* AI Desktop v15 - macOS-like showcase with mobile mode, i18n-ready */

:root {
    --win-bg: rgba(28,28,31,0.72);
    --win-border: rgba(255,255,255,0.18);
    --text-main: #fff;
    --text-dim: rgba(255,255,255,0.6);
    --menu-height: 28px;
    --dock-radius: 16px;
    --dock-icon-size: 56px;
    --dock-height: 96px;
    --desktop-padding-bottom: 140px; /* Platz für Dock */
    --shadow-window: 0 40px 80px rgba(0,0,0,0.8);
    --shadow-dock: 0 30px 60px rgba(0,0,0,0.8);
    --radius-window: 12px;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background-color: #000;
    color: var(--text-main);
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
                 Roboto, "Helvetica Neue", sans-serif;
    height: 100%;
    overflow: hidden;
    user-select: none;
}

/* Desktop wallpaper */
.wallpaper {
    position: fixed;
    inset: 0;
    background-image:
        radial-gradient(circle at 20% 30%, rgba(255,80,120,0.55) 0%, rgba(0,0,0,0) 60%),
        radial-gradient(circle at 70% 40%, rgba(80,120,255,0.45) 0%, rgba(0,0,0,0) 60%),
        radial-gradient(circle at 40% 70%, rgba(255,180,80,0.35) 0%, rgba(0,0,0,0) 60%),
        radial-gradient(circle at 80% 80%, rgba(120,255,200,0.28) 0%, rgba(0,0,0,0) 60%),
        radial-gradient(circle at 10% 90%, rgba(200,80,255,0.28) 0%, rgba(0,0,0,0) 60%),
        linear-gradient(135deg,#0a0b1f 0%,#000 60%);
    background-size: cover;
    background-position: center;
    filter: saturate(140%) brightness(0.9);
    z-index: 0;
}

/* Top menubar */
.menubar {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--menu-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 10px;
    color: var(--text-main);
    font-size: 12px;
    line-height: 1;
    font-weight: 400;
    background: rgba(0,0,0,0.25);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid rgba(255,255,255,0.15);
    z-index: 100000;
}
.menubar-left, .menubar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}
.apple {
    font-size: 14px;
    font-weight: 600;
}
.menu-item {
    color: var(--text-main);
    text-shadow: 0 2px 4px rgba(0,0,0,0.8);
    cursor: default;
}
.menu-item.menu-bold {
    font-weight: 600;
}
.menu-item.small {
    font-size: 12px;
    font-variant-numeric: tabular-nums;
}

/* Desktop area */
.desktop {
    position: fixed;
    left: 0; right: 0;
    top: var(--menu-height);
    bottom: 0;
    padding-bottom: var(--desktop-padding-bottom);
    overflow: visible;
    z-index: 1;
}

/* Dock */
.dock {
    position: fixed;
    left: 50%;
    bottom: 24px;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.22);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-radius: var(--dock-radius);
    border: 1px solid rgba(255,255,255,0.15);
    box-shadow: var(--shadow-dock);
    padding: 8px 12px;
    display: flex;
    align-items: flex-end;
    gap: 12px;
    z-index: 100001;
}

/* Dock icon */
.dock-icon {
    position: relative;
    width: var(--dock-icon-size);
    height: var(--dock-icon-size);
    border-radius: 14px;
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.2);
    box-shadow: 0 12px 24px rgba(0,0,0,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    text-shadow: 0 2px 4px rgba(0,0,0,0.8);
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
    transition: transform .12s, box-shadow .12s;
}
.dock-icon:hover {
    transform: translateY(-4px) scale(1.07);
    box-shadow: 0 18px 28px rgba(0,0,0,0.9);
}
.dock-label {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
    background: rgba(0,0,0,0.7);
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 11px;
    line-height: 1.2;
    color: #fff;
    box-shadow: 0 12px 24px rgba(0,0,0,0.8);
    border: 1px solid rgba(255,255,255,0.2);
    opacity: 0;
    pointer-events: none;
    transition: opacity .12s;
}
.dock-icon:hover .dock-label { opacity: 1; }

/* App window */
.window {
    position: absolute;
    background: var(--win-bg);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-radius: var(--radius-window);
    border: 1px solid var(--win-border);
    box-shadow: var(--shadow-window);
    overflow: hidden;
    min-width: 260px;
    min-height: 180px;
    resize: both;
    /* Auto-fit to viewport: keep windows inside screen */
    max-width: calc(100vw - 40px);
    max-height: calc(
        100vh - var(--menu-height) - var(--desktop-padding-bottom) - 40px
    );
    display: flex;
    flex-direction: column;
    z-index: 2;
}

.window.active {
    box-shadow: 0 50px 100px rgba(0,0,0,0.95);
    border-color: rgba(80,160,255,0.6);
}

/* Title bar */
.titlebar {
    height: 28px;
    flex-shrink: 0;
    background: rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    padding: 0 8px;
    cursor: move;
    user-select: none;
    font-size: 12px;
    line-height: 1;
    color: var(--text-main);
    text-shadow: 0 1px 2px rgba(0,0,0,0.8);
}
.titlebar-left {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-right: 8px;
}
.win-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 1px solid rgba(0,0,0,0.5);
    cursor: pointer;
}
.win-close { background:#ff5f57; border-color:#e0443e; }
.win-min   { background:#febc2e; border-color:#dea123; }
.win-max   { background:#28c840; border-color:#1aab29; }

.title-text {
    font-weight: 500;
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
    cursor: default;
}

/* Body */
.window-body {
    flex: 1;
    background: rgba(0,0,0,0.5);
    display: flex;
    overflow: hidden;
}
.window-iframe {
    width: 100%;
    height: 100%;
    border: 0;
    background: #000;
    color-scheme: dark;
}

/* Maximized */
.window.maximized {
    border-radius: 0;
    left: 0 !important;
    top: var(--menu-height) !important;
    width: 100% !important;
    height: calc(100% - var(--menu-height) - var(--desktop-padding-bottom)) !important;
}

/* Mobile mode */
@media (max-width: 768px) {
    :root {
        --dock-height: 64px;
        --desktop-padding-bottom: var(--dock-height);
    }

    .dock {
        bottom: 8px;
        left: 50%;
        transform: translateX(-50%);
        flex-wrap: wrap;
        gap: 8px;
        padding: 6px 10px;
        min-height: var(--dock-height);
        height: auto;
    }

    .dock-icon {
        width: 44px;
        height: 44px;
        border-radius: 10px;
        font-size: 22px;
    }

    .desktop {
        top: var(--menu-height);
        padding-bottom: var(--dock-height);
    }

    .window {
        border-radius: 0;
        left: 0 !important;
        top: var(--menu-height) !important;
        width: 100% !important;
        height: calc(100% - var(--menu-height) - var(--dock-height)) !important;
        resize: none;
    }

    .titlebar {
        cursor: default;
    }
}

.dock-icon.no-hover:hover{transform:none;}

.desktop{position:relative;}


/* --- quiet OCR leftover text: match background & ignore clicks --- */
#desc.muted{
  color: transparent !important;   /* no visual noise under rounded controls */
  pointer-events: none !important; /* don't intercept clicks */
  user-select: none !important;    /* don't allow selection glow */
  text-shadow: none !important;
}


/* Fullscreen window (green dot default) */
.window:fullscreen, .window:-webkit-full-screen {
    left: 0 !important;
    top: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}
