/* --- FONTS --- */
@font-face {
    font-family: 'BSW_Sans';
    src: url('../assets/font.ttf') format('truetype');
    font-weight: normal; font-style: normal; font-display: swap;
}
@font-face {
    font-family: 'BSW_Serif';
    src: url('../assets/fontS.ttf') format('truetype');
    font-weight: normal; font-style: normal; font-display: swap;
}

:root {
    --bsw-violett: #792351;
    --bsw-pink: #cf0055;
    --bsw-orange: #ee7402;
    --bsw-yellow: #ffcc00;
    --bg-dark: #1e1e1e;
    --sidebar-bg: #121212;
    --text-col: #eeeeee;
    --input-bg: #2b2b2b;
    --border-col: #333;
}

html, body {
    height: 100%; /* WICHTIG: 100% statt 100vh verhindert Probleme mit Taskleisten */
    width: 100%;
    margin: 0; padding: 0;
    overflow: hidden;
    background-color: var(--bg-dark);
    color: var(--text-col);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* UTILS */
.hidden { display: none !important; }
.flex-row { display: flex; align-items: center; }
.gap-10 { gap: 10px; }
.space-between { justify-content: space-between; }
.material-symbols-outlined { vertical-align: middle; }

/* LAYOUT GRID */
.desktop-container {
    display: flex;
    height: 100%; /* Bezieht sich auf html/body height */
    width: 100%;
}

/* SIDEBAR */
.sidebar {
    width: 400px;
    flex-shrink: 0;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border-col);
    overflow-y: auto;
    padding: 20px;
    /* Extra Padding unten, damit man auf kleinen Screens bis zum Ende scrollen kann */
    padding-bottom: 80px; 
    box-shadow: 2px 0 10px rgba(0,0,0,0.5);
    z-index: 10;
}

.sidebar-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 20px; padding-bottom: 20px;
    border-bottom: 1px solid var(--border-col);
}
.sidebar-logo { height: 35px; }
.icon-btn-small { background:none; border:1px solid #444; color:#ccc; border-radius:4px; padding:5px; cursor:pointer; }
.icon-btn-small:hover { background: #333; }

.control-group {
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
}
.control-group h4 { margin: 0 0 10px 0; color: var(--bsw-orange); font-size: 0.95rem; text-transform: uppercase; letter-spacing: 0.5px; }

/* CANVAS AREA - FIX: ABSOLUTE POSITIONING */
.canvas-area {
    flex: 1;
    position: relative; /* Wichtig für absolute Positionierung des Kindes */
    background: #000;
    overflow: hidden;
    background-image: 
        linear-gradient(45deg, #111 25%, transparent 25%), 
        linear-gradient(-45deg, #111 25%, transparent 25%), 
        linear-gradient(45deg, transparent 75%, #111 75%), 
        linear-gradient(-45deg, transparent 75%, #111 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
}

#canvasWrapper {
    position: absolute;
    top: 50%;
    left: 50%;
    /* Transform wird im JS gesetzt: translate(-50%, -50%) scale(...) */
    box-shadow: 0 0 50px rgba(0,0,0,0.8);
    background: white; 
}
#shareCanvas { width: 100%; height: 100%; overflow: hidden; position: relative; }

/* INPUTS & SLIDERS */
label { display: block; font-size: 0.8rem; color: #888; margin-bottom: 4px; margin-top:8px; }
input[type=range] { width: 100%; cursor: pointer; height: 5px; background: #444; outline: none; -webkit-appearance: none; margin: 10px 0; border-radius:3px; }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 15px; height: 15px; background: var(--bsw-orange); border-radius: 50%; cursor: pointer; }

textarea, input[type="text"], input[type="password"], select {
    width: 100%; background: var(--input-bg); border: 1px solid #444; color: white;
    padding: 8px; border-radius: 4px; font-size: 0.9rem; box-sizing: border-box;
    margin-bottom: 8px; font-family: inherit;
}
textarea { resize: vertical; }

.highlight-control label { color: var(--bsw-pink); font-weight: bold; }

/* BUTTONS */
.btn { width: 100%; padding: 10px; border: none; border-radius: 4px; font-weight: bold; cursor: pointer; text-transform: uppercase; font-size: 0.9rem; margin-top: 5px; }
.btn-primary { background: var(--bsw-orange); color: white; }
.btn-primary:hover { background: #d36600; }
.btn-secondary { background: #444; color: #ccc; }
.btn-magic { background: linear-gradient(90deg, var(--bsw-pink), var(--bsw-orange)); color: white; }
.btn-small { width: auto; padding: 5px 10px; font-size: 0.8rem; }
.btn-mic { width:40px; background:#444; color:white; border:none; border-radius:4px; cursor:pointer; }
.btn-mic.recording { background: red; animation: pulse 1s infinite; }

/* PILLS */
.pill-select { display: flex; gap: 5px; flex-wrap: wrap; margin-bottom: 10px; }
.pill { flex: 1; background: #333; border: 1px solid #444; color: #aaa; padding: 6px; border-radius: 4px; cursor: pointer; font-size: 0.8rem; text-align: center; }
.pill.active { background: var(--bsw-pink); color: white; border-color: var(--bsw-pink); }

/* GALLERY GRID */
.gallery-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; max-height: 160px; overflow-y: auto; margin-bottom: 10px; padding-right:5px; }
.gallery-scroll { display: flex; overflow-x: auto; gap: 5px; margin-bottom:10px; }
.gallery-item { width: 100%; aspect-ratio: 1; border-radius: 4px; object-fit: cover; cursor: pointer; border: 2px solid transparent; background: #000; }
.gallery-scroll .gallery-item { width: 60px; height: 60px; flex-shrink: 0; }
.gallery-item.selected { border-color: var(--bsw-orange); }

/* SWITCH & MODAL */
.switch { position: relative; display: inline-block; width: 34px; height: 20px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #ccc; transition: .4s; }
.slider:before { position: absolute; content: ""; height: 12px; width: 12px; left: 4px; bottom: 4px; background-color: white; transition: .4s; }
input:checked + .slider { background-color: var(--bsw-orange); }
input:checked + .slider:before { transform: translateX(14px); }
.slider.round { border-radius: 24px; }
.slider.round:before { border-radius: 50%; }

.modal { display: none; position: fixed; z-index: 2000; left: 0; top: 0; width: 100%; height: 100%; background-color: rgba(0,0,0,0.8); backdrop-filter: blur(5px); }
.modal-content { background-color: #222; margin: 10% auto; padding: 30px; border: 1px solid #555; width: 400px; border-radius: 8px; box-shadow: 0 10px 40px rgba(0,0,0,0.5); }
.close-modal { float:right; font-size:28px; cursor:pointer; }
.spinner { border: 4px solid rgba(255,255,255,0.3); border-radius: 50%; border-top: 4px solid var(--bsw-orange); width: 40px; height: 40px; animation: spin 1s linear infinite; margin-bottom: 10px; }
#loadingOverlay { position: fixed; display: none; top:0; left:0; width:100%; height:100%; background:rgba(0,0,0,0.8); z-index:9999; flex-direction:column; align-items:center; justify-content:center; }
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
@keyframes pulse { 0% { opacity:1; } 50% { opacity:0.5; } 100% { opacity:1; } }

/* CANVAS TEXT ELEMENTS */
.bsw-text-container {
    position: absolute; display: flex; align-items: center; justify-content: center; overflow: hidden;
    background: linear-gradient(90deg, rgba(121,35,81,0.95) 0%, rgba(207,0,85,0.95) 50%, rgba(238,116,2,0.95) 100%);
    z-index: 10;
}
.bsw-headline-text {
    color: white; text-shadow: 1px 1px 3px rgba(0,0,0,0.6);
    text-transform: none; line-height: 1.2; font-weight: bold; text-align: center;
    width: 100%; word-wrap: break-word; margin: 0;
    display: block; 
}
.bsw-stoerer {
    position: absolute; background: var(--bsw-yellow); color: black;
    text-transform: none; box-shadow: 3px 3px 5px rgba(0,0,0,0.4); z-index: 20;
    text-align: center; font-weight: bold;
    display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.logo-wrapper { position: absolute; z-index: 30; display: flex; align-items: center; justify-content: center; }
