/* --- 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: 380px;
    background: var(--panel-bg);
    padding: 15px;
    overflow-y: auto;
    border-right: 1px solid var(--border-col);
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex-shrink: 0;
}

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

.control-group label {
    display: block;
    font-size: 0.7rem;
    text-transform: uppercase;
    color: #bbb;
    margin-bottom: 5px;
    font-weight: bold;
}

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

.hidden { display: none !important; }

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

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

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--bsw-orange);
}

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

.btn-primary {
    background: linear-gradient(90deg, var(--bsw-pink), var(--bsw-orange));
}
.btn-primary:hover { transform: translateY(-1px); }

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

.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.65rem; width: auto; margin: 0; }

/* --- GALLERY --- */
.pixabay-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
    margin-top: 8px;
}
.pix-thumb {
    width: 100%;
    height: 50px;
    object-fit: cover;
    border-radius: 3px;
    cursor: pointer;
    border: 2px solid transparent;
}
.pix-thumb.selected { border-color: var(--bsw-orange); }

.logo-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}
.logo-item {
    width: 40px;
    height: 40px;
    border: 2px solid #555;
    cursor: pointer;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    background-color: #eee;
    border-radius: 4px;
}
.logo-item.active { border-color: var(--bsw-orange); }

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

.toolbar {
    height: 40px;
    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: 30px;
}

#printCanvas { 
    background: white; 
    box-shadow: 0 0 40px rgba(0,0,0,0.5); 
    transform-origin: center center;
    transition: transform 0.2s;
    overflow: hidden;
}

/* =====================================================
   NEWSPAPER PRINT DESIGN - A4 210x297mm
   ===================================================== */

.newspaper-page {
    width: 210mm;
    height: 297mm;
    background: #fff;
    font-family: 'Times New Roman', Times, serif;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

/* --- MASTHEAD / KOPF --- */
.np-masthead {
    border-bottom: 3px solid #000;
    padding: 8mm 12mm 4mm 12mm;
    text-align: center;
}

.np-paper-name {
    font-family: 'BSWFont', 'Franklin Gothic', 'Impact', sans-serif;
    font-size: 72pt;
    font-weight: 900;
    line-height: 1;
    letter-spacing: -2px;
    margin: 0;
}

.np-motto {
    font-size: 10pt;
    font-style: italic;
    color: #666;
    margin-top: 2mm;
}

.np-date-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 9pt;
    color: #333;
    border-top: 1px solid #000;
    border-bottom: 1px solid #000;
    padding: 2mm 0;
    margin-top: 3mm;
}

/* --- CONTENT AREA --- */
.np-content {
    flex: 1;
    display: flex;
    padding: 6mm 12mm;
    gap: 6mm;
}

.np-main-col {
    flex: 2.5;
    display: flex;
    flex-direction: column;
}

.np-sidebar {
    flex: 1;
    border-left: 1px solid #ccc;
    padding-left: 6mm;
    display: flex;
    flex-direction: column;
    gap: 5mm;
}

/* --- HAUPTARTIKEL --- */
.np-main-article {
    border-bottom: 1px solid #ddd;
    padding-bottom: 5mm;
    margin-bottom: 5mm;
}

.np-headline-main {
    font-family: 'BSWFont', 'Franklin Gothic', sans-serif;
    font-size: 32pt;
    font-weight: 900;
    line-height: 1.05;
    margin: 0 0 3mm 0;
    letter-spacing: -1px;
}

.np-subhead {
    font-size: 12pt;
    font-style: italic;
    color: #444;
    margin-bottom: 3mm;
    padding-bottom: 2mm;
    border-bottom: 1px solid #eee;
}

.np-image-wrapper {
    width: 100%;
    margin-bottom: 4mm;
}

.np-image-wrapper img {
    width: 100%;
    height: auto;
    display: block;
}

.np-image-caption {
    font-size: 8pt;
    color: #666;
    font-style: italic;
    margin-top: 1mm;
}

.np-lead {
    font-size: 11pt;
    font-weight: bold;
    line-height: 1.4;
    margin-bottom: 3mm;
    color: #222;
}

.np-body {
    font-size: 10pt;
    line-height: 1.45;
    text-align: justify;
    column-count: 2;
    column-gap: 5mm;
}

/* --- UNTERE ARTIKEL --- */
.np-bottom-row {
    display: flex;
    gap: 5mm;
}

.np-article-box {
    flex: 1;
    padding-top: 4mm;
    border-top: 2px solid #000;
}

.np-headline-small {
    font-family: 'BSWFont', 'Franklin Gothic', sans-serif;
    font-size: 14pt;
    font-weight: bold;
    line-height: 1.15;
    margin: 0 0 2mm 0;
}

.np-text-small {
    font-size: 9pt;
    line-height: 1.4;
    text-align: justify;
}

/* --- SIDEBAR ARTIKEL --- */
.np-side-article {
    padding-bottom: 4mm;
    border-bottom: 1px solid #ddd;
}

.np-side-article:last-child {
    border-bottom: none;
}

.np-headline-side {
    font-family: 'BSWFont', sans-serif;
    font-size: 11pt;
    font-weight: bold;
    line-height: 1.2;
    margin: 0 0 2mm 0;
}

.np-text-side {
    font-size: 8pt;
    line-height: 1.4;
}

/* --- LOGO --- */
.np-logo {
    position: absolute;
    bottom: 8mm;
    right: 8mm;
    width: 35mm;
    height: auto;
    opacity: 0.7;
}

/* =====================================================
   STYLE VARIATIONS
   ===================================================== */

/* BILD-STIL (Boulevard) */
.style-bild .np-paper-name {
    color: #cc0000;
    font-size: 80pt;
}
.style-bild .np-headline-main {
    color: #cc0000;
    font-size: 36pt;
}
.style-bild .np-body {
    column-count: 1;
    font-size: 11pt;
}
.style-bild .np-masthead {
    background: #fee;
}

/* SPIEGEL-STIL (Magazin) */
.style-spiegel .np-paper-name {
    font-family: 'Times New Roman', serif;
    font-size: 48pt;
    font-weight: normal;
    letter-spacing: 8px;
    text-transform: uppercase;
}
.style-spiegel .np-masthead {
    border-bottom: 4px solid #e64415;
}
.style-spiegel .np-headline-main {
    font-family: 'Times New Roman', serif;
    font-size: 28pt;
    text-transform: none;
}
.style-spiegel .np-headline-small {
    font-family: 'Times New Roman', serif;
    text-transform: none;
}

/* FAZ-STIL (seriös) */
.style-faz .np-paper-name {
    font-family: 'Times New Roman', serif;
    font-size: 36pt;
    font-weight: normal;
    letter-spacing: 2px;
}
.style-faz .np-masthead {
    border-bottom: 1px solid #000;
}
.style-faz .np-headline-main {
    font-family: 'Times New Roman', serif;
    font-size: 24pt;
    text-transform: none;
}
.style-faz .np-body {
    column-count: 2;
}

/* BUNTE-STIL (Klatsch) */
.style-bunte .np-paper-name {
    font-size: 60pt;
    background: linear-gradient(135deg, #e91e63, #9c27b0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.style-bunte .np-headline-main {
    color: #e91e63;
}
.style-bunte .np-body {
    column-count: 1;
    font-size: 11pt;
}

/* OVERLAY */
#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; 
}

.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:550px; 
    margin:40px auto; 
    background:#222; 
    padding:25px; 
    border-radius:10px; 
    border:1px solid #444; 
}

.close-modal { 
    float:right; 
    font-size:24px; 
    cursor:pointer; 
    color:#888;
}

@media (max-width: 900px) {
    .sidebar { width: 320px; }
}
