/* ==========================================================================
   MovieScriptOnline - Main Stylesheet
   Colors: White, Blue, Black
   ========================================================================== */

:root {
    --color-white: #FFFFFF;
    --color-blue: #23528b;
    --color-black: #000000;
}

body, html {
    margin: 0;
    padding: 0;
    font-family: Arial, sans-serif;
    background-color: #FFFFFF;
    color: #000000;
    overflow-x: hidden;
}

/* ==========================================================================
   Header & Navigation
   ========================================================================== */

header {
    background-color: #000000 !important;
    color: #FFFFFF;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid var(--color-blue);
}

.hamburger {
    font-size: 24px;
    cursor: pointer;
    color: #FFFFFF;
    background: none;
    border: none;
}

/* Logo Styling */
header .logo a {
    text-decoration: none;
    display: flex;
    align-items: center;
}

.header-logo {
    max-height: 50px;
    width: auto;
    display: block;
}

/* ==========================================================================
   Sidebar Menu (Hamburger)
   ========================================================================== */

.sidebar {
    height: 100%;
    width: 250px;
    position: fixed;
    z-index: 1000;
    top: 0;
    left: -250px;
    background-color: #000000;
    color: #FFFFFF;
    overflow-x: hidden;
    transition: 0.3s;
    padding-top: 60px;
    border-right: 2px solid var(--color-blue);
}

.sidebar.open {
    left: 0;
}

.sidebar a {
    padding: 15px 20px;
    text-decoration: none;
    font-size: 18px;
    color: #FFFFFF;
    display: block;
    transition: 0.2s;
    border-bottom: 1px solid #222222;
}

.sidebar a:hover {
    background-color: var(--color-blue);
}

.close-btn {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 30px;
    cursor: pointer;
    border: none;
    background: none;
    color: #FFFFFF;
}

.close-btn:hover {
    color: var(--color-blue);
}

/* ==========================================================================
   Main Content Area
   ========================================================================== */

.content-wrapper {
    width: 90%;
    margin: 30px auto;
    min-height: 70vh;
}

.content-wrapper h1, 
.content-wrapper h2, 
.content-wrapper h3 {
    color: #000000;
}

.content-wrapper a {
    color: var(--color-blue);
    text-decoration: none;
}

.content-wrapper a:hover {
    text-decoration: underline;
}

/* ==========================================================================
   Forms, Buttons & Alerts (Login, Register & Admin)
   ========================================================================== */

.form-container {
    max-width: 400px;
    margin: 0 auto;
    background: #f9f9f9;
    padding: 20px;
    border: 1px solid #ddd;
    border-top: 3px solid var(--color-blue);
}

.admin-container {
    margin: 0 auto;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.form-group input, 
.form-group textarea {
    width: 100%;
    padding: 10px;
    box-sizing: border-box;
    border: 1px solid #ccc;
}

/* Button Fixes for Links acting as Buttons */
.btn, a.btn {
    background-color: var(--color-blue);
    color: #FFFFFF !important; /* Erzwingt die weisse Schrift */
    padding: 10px 15px;
    border: none;
    cursor: pointer;
    width: 100%;
    font-size: 16px;
    text-decoration: none !important; /* Verhindert unterstrichene Links */
    display: inline-block;
    text-align: center;
    box-sizing: border-box;
}

.btn:hover, a.btn:hover {
    background-color: #000000;
    color: #FFFFFF !important;
}

.alert {
    padding: 10px;
    margin-bottom: 15px;
    color: white;
}

.alert-error { background-color: #d9534f; }
.alert-success { background-color: #5cb85c; }

/* ==========================================================================
   Footer
   ========================================================================== */

footer {
    background-color: #000000;
    color: #FFFFFF;
    text-align: center;
    padding: 30px 20px;
    margin-top: 40px;
    border-top: 2px solid var(--color-blue);
}

.footer-links {
    margin-bottom: 15px;
}

.footer-links a {
    color: #FFFFFF !important;
    text-decoration: none;
    margin: 0 15px;
    font-size: 14px;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: var(--color-blue) !important;
}

.footer-copyright {
    font-size: 12px;
    color: #888888;
}

/* ==========================================================================
   Responsive / Mobile Adaptations
   ========================================================================== */

@media screen and (max-width: 768px) {
    .content-wrapper {
        width: 95%;
    }
    
    .header-logo {
        max-height: 40px;
    }
    
    .footer-links a {
        display: block;
        margin: 10px 0;
    }
}

/* Tables for Admin & Dashboard */
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}
.data-table th, .data-table td {
    border: 1px solid #ddd;
    padding: 10px;
    text-align: left;
}
.data-table th {
    background-color: #f2f2f2;
    color: #000;
}
.data-table tr:hover {
    background-color: #f9f9f9;
}

/* ==========================================================================
   Movie Script Editor, Read Mode & Print Styles
   ========================================================================== */

/* Write Mode (Block Editor) */
.script-block { border: 2px solid transparent; padding: 10px; position: relative; margin-bottom: 5px; border-radius: 4px; transition: all 0.2s; }
.script-block.active { border: 2px solid var(--color-blue); background-color: #f4f9ff; }
.block-controls { display: none; position: absolute; right: 5px; top: -15px; background: #fff; border: 1px solid #ccc; border-radius: 4px; padding: 2px; box-shadow: 0 2px 5px rgba(0,0,0,0.1); z-index: 10; }
.script-block:hover .block-controls, .script-block.active .block-controls { display: flex; gap: 2px; }
.block-controls button { background: none; border: none; cursor: pointer; padding: 4px 8px; font-weight: bold; font-size: 14px; }
.block-controls button:hover { background: #eee; }
.block-text { width: 100%; box-sizing: border-box; border: 1px dashed transparent; background: transparent; resize: none; overflow: hidden; font-family: 'Courier New', Courier, monospace; font-size: 15px; padding: 5px; }
.block-text:focus { outline: none; border-bottom: 1px dashed var(--color-blue); }
.script-block:hover .block-text { border: 1px dashed #ccc; }

/* Read Mode (Hollywood Standard) */
.scene-heading { font-weight: bold; margin-top: 30px; margin-bottom: 15px; text-transform: uppercase; }
.dialogue-block { margin-bottom: 15px; margin-left: 20%; width: 60%; position: relative; }
.character-name { text-align: center; font-weight: bold; margin-bottom: 5px; text-transform: uppercase; }
.dialogue-text { text-align: left; }
.action-block { margin-bottom: 15px; font-style: italic; width: 100%; position: relative; }
.highlighted-text { border-radius: 3px; padding: 2px 4px; }

/* Comments System */
.comment-wrapper { margin-top: 5px; margin-bottom: 15px; border-left: 3px solid #ff9800; padding-left: 10px; font-family: Arial, sans-serif; font-size: 13px; background: #fff8e1; padding: 10px; border-radius: 4px; }
.comment-item { margin-bottom: 5px; border-bottom: 1px solid #ffe082; padding-bottom: 5px; display: flex; justify-content: space-between; align-items: flex-start; }
.comment-item:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.comment-btn { position: absolute; right: -30px; top: 0; background: none; border: none; font-size: 18px; cursor: pointer; opacity: 0.3; transition: opacity 0.2s; }
.dialogue-block:hover .comment-btn, .action-block:hover .comment-btn { opacity: 1; }
.comment-form { display: none; margin-top: 5px; font-family: Arial, sans-serif; display: flex; gap: 5px; align-items: center; }

/* Screen Layout für das Deckblatt */
@media screen {
    .title-page { border-bottom: 1px dashed #ccc; padding-bottom: 50px; margin-bottom: 50px; text-align: center; }
    .title-bottom { margin-top: 50px; text-align: left; }
}

/* Print Mode (Zwingend exakte Skalierung und A4 Ränder) */
@media print {
    header, footer, .sidebar, .no-print, .comment-wrapper, .comment-btn, .comment-form { display: none !important; }
    body, html, main, .content-wrapper { background: white !important; width: 100% !important; max-width: 100% !important; margin: 0 !important; padding: 0 !important; }
    #script_page { width: 100% !important; max-width: 100% !important; margin: 0 !important; padding: 0 !important; border: none !important; box-shadow: none !important; font-size: 12pt !important; }
    .action-block, .dialogue-text, .scene-heading { white-space: pre-wrap !important; word-wrap: break-word !important; overflow-wrap: break-word !important; max-width: 100% !important; }
    .highlighted-text { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }
    .title-page { page-break-after: always; break-after: page; height: 100vh; display: flex; flex-direction: column; justify-content: center; position: relative; text-align: center; }
    .title-bottom { position: absolute; bottom: 2cm; left: 0; text-align: left; }
    @page { size: A4; margin-top: 2.54cm; margin-bottom: 2.54cm; margin-left: 3.81cm; margin-right: 2.54cm; }
}