:root {
    --bg: #121212;
    --panel-bg: #1e1e1e;
    --border: #333333;
    --text-primary: #cccccc;
    --text-secondary: #888888;
    --accent: #ffffff;
    --accent-bg: #333333;
    --prompter-font-size: 2rem;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg);
    color: var(--text-primary);
    height: 100vh;
    overflow: hidden; /* Prevent body scroll, everything scrolls internally */
    display: flex;
    flex-direction: column;
}

.container {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* Minimalist Header */
.sticky-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 1rem;
    background: var(--panel-bg);
    border-bottom: 1px solid var(--border);
    gap: 1rem;
    z-index: 100;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.header-title h1 {
    font-size: 1.2rem;
    font-weight: 600;
}

.header-title h1 a {
    color: var(--text-primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

.header-title h1 a:hover {
    color: rgb(244, 144, 44);
    text-shadow: 0 0 10px rgba(244, 144, 44, 0.6);
}

.controls-section {
    flex: 1;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 1rem;
}

.row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
}

.control-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    white-space: nowrap;
}

select, input[type="range"] {
    padding: 0.3rem 0.5rem;
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--text-primary);
    border-radius: 4px;
    font-family: 'Inter', sans-serif;
    outline: none;
    font-size: 0.85rem;
}

select:focus, input[type="range"]:focus {
    border-color: var(--text-secondary);
}

.button-row {
    display: flex;
    gap: 0.5rem;
}

.btn {
    padding: 0.4rem 0.8rem;
    background: #000000;
    border: 1px solid #333333;
    color: #ffffff;
    border-radius: 4px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}

.btn:hover {
    background: #111111;
    border-color: #555555;
}

.btn:active {
    background: rgb(244, 144, 44);
    border-color: rgb(44, 144, 244);
}

.btn.primary {
    background: #000000;
    color: #ffffff;
    border: 1px solid #333333;
}

.btn.primary:hover {
    background: #111111;
}

.btn.primary:active {
    background: rgb(244, 144, 44);
    border-color: rgb(44, 144, 244);
}

.btn.running {
    background: rgb(44, 144, 244) !important;
    border-color: rgb(44, 144, 244) !important;
    color: #ffffff;
}

/* Main Content Area */
.content-area {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* TOC Sidebar */
#toc-sidebar {
    width: 250px;
    background: var(--panel-bg);
    border-right: 1px solid var(--border);
    padding: 1rem;
    overflow-y: auto;
}

#toc-sidebar h3 {
    margin-bottom: 1rem;
    font-size: 1rem;
    color: var(--text-primary);
    font-weight: normal;
    text-transform: uppercase;
    letter-spacing: 1px;
}

#toc-list {
    list-style: none;
}

#toc-list li {
    margin-bottom: 0.5rem;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

#toc-list li:hover {
    color: var(--text-primary);
}

#toc-list li.toc-active {
    color: rgb(244, 144, 44);
    text-shadow: 0 0 10px rgba(244, 144, 44, 0.6);
    font-weight: 600;
}

/* Reader Area */
.reader-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    height: 100%;
}

textarea {
    flex: 1;
    width: 100%;
    background: var(--bg);
    border: none;
    padding: 2rem;
    color: var(--text-primary);
    font-size: 1.1rem;
    line-height: 1.5;
    font-family: 'Inter', sans-serif;
    resize: none;
    outline: none;
}

/* Teleprompter Mode */
#prompter-view {
    flex: 1;
    width: 100%;
    background: var(--bg);
    padding: 2rem 4rem;
    color: var(--text-primary);
    font-size: var(--prompter-font-size);
    line-height: 1.6;
    font-family: 'Inter', sans-serif;
    overflow-y: auto;
}

.prompter-line {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    border-left: 2px solid transparent;
}

.heading-line {
    color: var(--text-primary);
}

.heading-line.active {
    color: rgb(244, 144, 44) !important;
    text-shadow: 0 0 12px rgba(244, 144, 44, 0.7);
}

.prompter-line:hover {
    background: var(--panel-bg);
}

.prompter-line.active {
    background: #2a2a2a;
    border-left: 2px solid var(--text-primary);
}

.line-number {
    color: var(--border);
    font-size: 0.5em;
    min-width: 2rem;
    text-align: right;
    user-select: none;
    padding-top: 0.4rem;
}

.line-text {
    flex: 1;
}

.highlight {
    background: var(--text-primary);
    color: var(--bg);
}

.line-action {
    display: flex;
    align-items: center;
    padding-left: 1rem;
}

.line-action input[type="checkbox"] {
    width: 1.5rem;
    height: 1.5rem;
    cursor: pointer;
    accent-color: var(--text-primary);
}

/* Modal */
.modal {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background: rgba(0,0,0,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}
.modal-content {
    background: var(--panel-bg);
    width: 80%;
    max-width: 800px;
    height: 80vh;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    border: 1px solid var(--border);
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}
#notes-output {
    flex: 1;
    margin-bottom: 1rem;
    background: var(--bg);
    border: 1px solid var(--border);
    padding: 1rem;
    color: var(--text-primary);
    font-size: 1rem;
    resize: none;
    outline: none;
}
