/* --- SCHRIFTARTEN --- */
@font-face {
    font-family: 'BSWFont';
    src: url('../assets/font.ttf') format('truetype');
    font-weight: bold;
    font-style: normal;
}

@font-face {
    font-family: 'BSWFontBody';
    src: url('../assets/fontS.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

/* --- VARIABLEN --- */
:root {
    --bsw-violett: rgb(121, 35, 81);
    --bsw-pink: rgb(207, 0, 85);
    --bsw-orange: rgb(238, 116, 2);
    --bsw-yellow: rgb(255, 204, 0); 
    --bg-dark: #121212;
    --panel-bg: #1e1e1e;
    --text-main: #ffffff;
    --input-bg: #2b2b2b;
    --border-col: #444;
}

body {
    font-family: 'BSWFontBody', 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-dark);
    color: var(--text-main);
    margin: 0;
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* --- SIDEBAR --- */
.sidebar {
    width: 400px;
    background: var(--panel-bg);
    padding: 15px;
    overflow-y: auto;
    border-right: 1px solid var(--border-col);
    display: flex;
    flex-direction: column;
    gap: 15px;
    flex-shrink: 0;
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-col);
    padding-bottom: 10px;
    margin-bottom: 5px;
}

.control-group {
    background: #252525;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid #333;
}

.control-group label {
    display: block;
    font-size: 0.75rem;
    text-transform: uppercase;
    color: #bbb;
    margin-bottom: 6px;
    font-weight: bold;
    letter-spacing: 0.5px;
}

.checkbox-row {
    display: flex;
    align-items: center;
    margin-bottom: 5px;
    gap: 10px;
    font-size: 13px;
    color: #ccc;
}
.checkbox-row input { width: auto; margin: 0; }

.hidden { display: none !important; }

input[type="text"], input[type="password"], select, textarea {
    width: 100%;
    background: var(--input-bg);
    border: 1px solid var(--border-col);
    color: white;
    padding: 10px;
    border-radius: 4px;
    box-sizing: border-box;
    font-family: inherit;
    font-size: 14px;
    margin-bottom: 8px;
}
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--bsw-orange);
}

textarea { resize: vertical; min-height: 70px; }

.btn {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    margin-top: 8px;
    transition: all 0.2s;
    text-transform: uppercase;
    font-size: 0.85rem;
    color: white;
}

.btn-primary {
    background: linear-gradient(90deg, var(--bsw-pink), var(--bsw-orange));
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 15px rgba(207,0,85,0.4); }

.btn-secondary { background: #444; border: 1px solid #666; color: #fff; }
.btn-secondary:hover { background: #555; }

/* FIX: Info Button angepasst */
.btn-info { 
    background: transparent; 
    color: #ccc; 
    border: none; 
    width: auto; 
    padding: 5px 10px; 
    font-size: 20px; 
    cursor: pointer;
}
.btn-info:hover { color: var(--bsw-orange); }

.btn-small { padding: 5px 10px; font-size: 0.7rem; width: auto; display: inline-block; margin: 0; }

/* --- PIXABAY GALLERY --- */
.pixabay-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 5px;
    margin-top: 10px;
}
.pix-thumb {
    width: 100%;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: 0.2s;
}
.pix-thumb:hover { transform: scale(1.05); }
.pix-thumb.selected { border-color: var(--bsw-orange); }

/* --- LOGO GRID --- */
.logo-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}
.logo-item {
    width: 50px;
    height: 50px;
    border: 2px solid #555;
    cursor: pointer;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    background-color: #eee;
    border-radius: 6px;
}
.logo-item.active {
    border-color: var(--bsw-orange);
    box-shadow: 0 0 8px rgba(238, 116, 2, 0.6);
}

/* --- PREVIEW STAGE --- */
.main-stage {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #000;
    position: relative;
    overflow: hidden; 
}

.toolbar {
    height: 45px;
    background: #222;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    border-bottom: 1px solid #333;
}

#canvasContainer {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: auto;
    padding: 40px;
}

#printCanvas { 
    background: white; 
    box-shadow: 0 0 60px rgba(0,0,0,0.7); 
    transform-origin: center center;
    transition: transform 0.2s;
    display: flex;
    flex-direction: column;
    overflow: hidden; 
}

/* --- PRINT TEMPLATE STYLES --- */

/* FLYER STYLES (A4/A5) */
.bsw-headline { 
    font-family: 'BSWFont', sans-serif;
    font-weight: bold; 
    text-transform: uppercase; 
    margin: 0;
    transform: skewX(-10deg); 
    transform-origin: bottom left;
    display: block;
    text-align: left;
}

.bsw-subline { 
    font-family: 'BSWFont', sans-serif;
    font-weight: bold; 
    line-height: 1.1; 
    text-align: left;
}

.bsw-body { 
    font-family: 'BSWFontBody', sans-serif;
    font-weight: normal; 
    line-height: 1.4; 
    white-space: pre-line; 
    text-align: left !important;
    width: 100%;
    display: block;
}

/* PLAKAT STYLES (A3/A2) */

.bsw-text-bg {
    background: linear-gradient(90deg, rgba(121,35,81,0.85) 0%, rgba(207,0,85,0.85) 50%, rgba(238,116,2,0.85) 100%);
    box-shadow: 5px 5px 0 rgba(0,0,0,0.2);
    padding: 0.1em 0.4em;
    transform: skewX(-10deg);
    display: inline-block;
    color: white;
}

.plakat-h1 {
    font-family: 'BSWFont', sans-serif;
    font-weight: bold;
    text-transform: uppercase;
    line-height: 1.1;
    margin-bottom: 0.2em;
    transform: skewX(-10deg); 
    transform-origin: bottom left;
    text-shadow: 2px 2px 10px rgba(0,0,0,0.6);
    display: inline-block;
}

.plakat-h2 {
    font-family: 'BSWFont', sans-serif;
    font-weight: bold;
    text-transform: uppercase;
    line-height: 1.2;
    margin-bottom: 0.15em;
    display: inline;
    -webkit-box-decoration-break: clone;
    box-decoration-break: clone;
}

.plakat-stoerer {
    font-family: 'BSWFont', sans-serif;
    font-weight: bold;
    text-transform: uppercase;
    background-color: var(--bsw-yellow);
    color: #000;
    padding: 0.2em 0.5em;
    display: inline-block;
    transform: skewX(-10deg) rotate(-2deg);
    box-shadow: 4px 4px 0 rgba(0,0,0,0.3);
    margin-top: 0.3em;
}

.bsw-footer {
    width: 100%; 
    font-size: 6pt !important;
    color: #555; 
    border-top: 1px solid #ddd; 
    padding-top: 4px;
    font-family: 'BSWFontBody', sans-serif;
    text-align: left;
}

.plakat-footer-overlay {
    font-family: 'BSWFontBody', sans-serif;
    font-size: 8pt;
    color: white;
    text-shadow: 1px 1px 3px black, 0 0 1em black;
    opacity: 0.9;
    text-align: center;
    width: 100%;
}

.bsw-gradient-bar {
    background: linear-gradient(90deg, rgba(121,35,81,1) 0%, rgba(207,0,85,1) 50%, rgba(238,116,2,1) 100%);
    clip-path: polygon(0 0, 100% 0, 100% 85%, 0% 100%);
    z-index: 10;
}

.logo-container {
    position: absolute;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
}
.logo-container.bg-white {
    background: white;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2); 
    padding: 5mm;
}
.logo-container.bg-none {
    background: transparent;
    padding: 0;
    filter: drop-shadow(0 0 15px rgba(255,255,255,0.9));
}

.logo-container img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain; 
}

/* Positioning Classes */
/* FIX: transform-origin sorgt dafür, dass das Logo beim Zoomen in der Ecke bleibt */
.pos-tr { 
    top: 0; 
    right: 0; 
    border-bottom-left-radius: 40px; 
    transform-origin: top right; 
}

.pos-tl { 
    top: 0; 
    left: 0; 
    border-bottom-right-radius: 40px; 
    transform-origin: top left; 
}

.pos-br { 
    bottom: 0; 
    right: 0; 
    border-top-left-radius: 40px; 
    transform-origin: bottom right; 
}

.pos-bl { 
    bottom: 0; 
    left: 0; 
    border-top-right-radius: 40px; 
    transform-origin: bottom left; 
}

/* MODAL & TABS */
#loadingOverlay { position: fixed; top:0; left:0; width:100%; height:100%; background:rgba(0,0,0,0.85); color:white; display:none; align-items:center; justify-content:center; flex-direction:column; z-index:9999; backdrop-filter: blur(5px); }
.modal { display:none; position:fixed; top:0; left:0; width:100%; height:100%; background:rgba(0,0,0,0.9); z-index:2000; padding:20px; box-sizing:border-box; }
.modal-content { max-width:600px; margin:50px auto; background:#222; padding:30px; border-radius:12px; border:1px solid #444; max-height: 85vh; overflow-y: auto; }
.close-modal { float:right; font-size:24px; cursor:pointer; }

.tab-nav { display:flex; gap:10px; margin-bottom:20px; border-bottom:1px solid #444; padding-bottom:10px; }
.tab-btn { background:none; border:none; color:#888; font-size:16px; cursor:pointer; padding:5px 10px; font-weight:bold; }
.tab-btn.active { color:var(--bsw-orange); border-bottom:2px solid var(--bsw-orange); }
.tab-content { display:none; line-height:1.6; color:#ddd; font-size:14px; }
.tab-content.active { display:block; }
.tab-content h3 { color:white; margin-top:0; }
.tab-content a { color: var(--bsw-orange); }

/* --- HIER ENDE DES ALTEN CSS ANFÜGEN ODER ERSETZEN --- */
/* Füge diese Klassen am Ende deiner style.css hinzu */

/* INTERACTIVE IMAGE STYLES */
.img-wrapper {
    width: 100%;
    height: 100%;
    overflow: hidden;
    position: relative;
    background-color: #eee; /* Fallback */
}

.draggable-img {
    position: absolute;
    top: 0;
    left: 0;
    transform-origin: 0 0; /* Wichtig für präzises Zoomen/Verschieben */
    cursor: grab;
    user-select: none;
    pointer-events: auto; /* Erlaubt Maus-Events */
}

.draggable-img:active {
    cursor: grabbing;
}

/* LOGO CUSTOMIZATION */
.logo-container {
    /* Basis-Stile bleiben, aber Padding/Border werden nun inline gesetzt */
    transition: padding 0.2s, background-color 0.2s;
    cursor: grab; 
    overflow: visible; /* Damit man den Rahmen sieht */
}
.logo-container:active {
    cursor: grabbing;
}
.logo-container img {
    pointer-events: none; /* Das Event geht an den Container */
    user-select: none;
}
