/* Global RESET & Variables */
:root {
    --primary-color: #2563eb;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --bg-color: #f1f5f9;
    --text-color: #1e293b;
    --paper-width: 210mm;
    /* A4 */
    --paper-height: 297mm;
    /* A4 */
}

/* UI Styling (Screen Only) */
body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background: var(--bg-color);
    margin: 0;
    padding: 0;
    min-height: 100vh;
    position: relative;
    /* For Drag Overlay */
}

/* Drag & Drop Highlight */
body.highlight-drop::after {
    content: 'Drop file here to load';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(37, 99, 235, 0.9);
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 2rem;
    font-weight: bold;
    z-index: 9999;
    pointer-events: none;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 20px;
}

header {
    background: white;
    padding: 2rem 0;
    text-align: center;
    border-bottom: 1px solid #e2e8f0;
    margin-bottom: 2rem;
}

header h1 {
    margin: 0;
    color: var(--primary-color);
}

header p {
    color: var(--secondary-color);
    margin-top: 0.5rem;
}

/* Controls Section */
.controls {
    display: grid;
    gap: 1.5rem;
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

textarea {
    width: 100%;
    height: 200px;
    padding: 1rem;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-family: monospace;
    resize: vertical;
    box-sizing: border-box;
    /* Important for width */
}

.actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.1s, opacity 0.2s;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-secondary {
    background: white;
    border: 2px solid #e2e8f0;
    color: var(--text-color);
    display: inline-block;
}

.btn-success {
    background: var(--success-color);
    color: white;
}

.style-selector label {
    font-weight: 600;
    margin-right: 0.5rem;
}

.style-selector select {
    padding: 0.5rem;
    border-radius: 6px;
    border: 1px solid #cbd5e1;
}

/* Preview Area (The Paper) */
.preview-area {
    display: flex;
    justify-content: center;
    margin-bottom: 4rem;
}

.page-content {
    background: white;
    width: var(--paper-width);
    min-height: var(--paper-height);
    padding: 25mm !important;
    /* Standard Margin usually */
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    box-sizing: border-box;
    transition: all 0.3s ease;
    position: relative;
    /* For footer positioning context if needed */
}

/* 
   =========================================
   THEMES (Applied to .page-content) 
   =========================================
*/

/* 1. SIMPLE (Clean, Academic) */
.style-simple {
    font-family: 'Charter', 'Bitstream Charter', serif;
    color: #1a1a1a;
}

.style-simple h1,
.style-simple h2 {
    border-bottom: 1px solid #eee;
    padding-bottom: 0.3em;
}

.style-simple a {
    color: #000;
    text-decoration: underline;
}

/* 2. BROCHURE (Modern, Sans, Colorful) */
.style-brochure {
    font-family: 'Inter', sans-serif;
    border-top: 10px solid var(--primary-color);
}

.style-brochure h1 {
    color: var(--primary-color);
    font-size: 2.5em;
    text-transform: uppercase;
    letter-spacing: -1px;
}

.style-brochure h2 {
    color: var(--secondary-color);
    background: #f8fafc;
    padding: 0.5rem;
    border-left: 5px solid var(--primary-color);
}

.style-brochure blockquote {
    background: #eff6ff;
    padding: 1rem;
    border-radius: 8px;
    border-left: none;
    font-style: italic;
    color: var(--primary-color);
}

.style-brochure img {
    border-radius: 8px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    max-width: 100%;
}

/* 3. PRESENTATION (Slides-ish, Large Text) */
.style-presentation {
    width: var(--paper-height);
    min-height: var(--paper-width);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 14pt;
    background: #1e1e2e;
    color: #cdd6f4;
    padding: 20mm !important;
}

.style-presentation h1 {
    color: #89b4fa;
    border-bottom: 2px solid #89b4fa;
    text-align: center;
}

.style-presentation h2 {
    color: #f9e2af;
    margin-top: 2em;
}

.style-presentation p {
    color: #a6adc8;
}

.style-presentation code {
    background: #313244;
    color: #fab387;
    padding: 0.2em 0.4em;
}



/* PRINT STYLES - The Real Magic */
@media print {
    @page {
        margin: 0;
        /* Forces browser to hide headers/footers in many cases */
    }

    /* Give some margin for browser headers/footers */

    body {
        background: white;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .no-print {
        display: none !important;
    }

    .preview-area {
        margin: 0;
        display: block;
    }

    .page-content {
        width: 100%;
        box-shadow: none;
        margin: 0;
        min-height: auto;
        padding: 2cm !important;
        /* Simulate margins since @page is 0 */
    }

    /* Print Specific Overrides for Presentation */
    .style-presentation {
        background: #1e1e2e !important;
        color: #cdd6f4 !important;
    }
}