@import url('https://fonts.googleapis.com/css2?family=Courier+Prime:ital,wght@0,400;0,700;1,400;1,700&family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
    --bg-dark: #0a0c10;
    --bg-card: rgba(18, 22, 30, 0.7);
    --border-color: rgba(255, 255, 255, 0.08);
    --accent-orange: #ff7b00;
    --accent-glow: rgba(255, 123, 0, 0.15);
    --text-primary: #f0f3f8;
    --text-secondary: #8b949e;
    --text-muted: #484f58;
    --font-ui: 'Outfit', sans-serif;
    --font-script: 'Courier Prime', Courier, monospace;
}

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

body {
    background-color: var(--bg-dark);
    background-image: 
        radial-gradient(at 0% 0%, rgba(255, 123, 0, 0.05) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(0, 80, 255, 0.03) 0px, transparent 50%);
    color: var(--text-primary);
    font-family: var(--font-ui);
    height: 100vh;
    overflow: hidden;
    display: flex;
}

/* Sidebar Styling */
.sidebar {
    width: 320px;
    height: 100vh;
    background: rgba(10, 12, 16, 0.85);
    border-right: 1px solid var(--border-color);
    backdrop-filter: blur(12px);
    display: flex;
    flex-direction: column;
    z-index: 10;
}

.sidebar-header {
    padding: 24px;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.sidebar-header .subtitle {
    font-size: 0.8rem;
    color: var(--accent-orange);
    margin-top: 4px;
    font-weight: 500;
    letter-spacing: 0.5px;
}

.nav-menu {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow-y: auto;
    flex-grow: 1;
}

.nav-item {
    padding: 12px 16px;
    border-radius: 8px;
    color: var(--text-secondary);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid transparent;
}

.nav-item:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.03);
}

.nav-item.active {
    color: var(--text-primary);
    background: rgba(255, 123, 0, 0.08);
    border-color: rgba(255, 123, 0, 0.2);
    box-shadow: 0 4px 20px var(--accent-glow);
}

.scene-list-header {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 700;
    letter-spacing: 1px;
    margin: 16px 0 8px 16px;
}

.scene-item {
    padding: 10px 16px 10px 32px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    border-left: 2px solid transparent;
}

.scene-item:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.02);
}

.scene-item.active {
    color: var(--accent-orange);
    border-left-color: var(--accent-orange);
    background: rgba(255, 123, 0, 0.03);
    font-weight: 600;
}

/* Main Content Area */
.main-content {
    flex-grow: 1;
    height: 100vh;
    overflow-y: auto;
    padding: 40px;
    display: flex;
    justify-content: center;
}

.container {
    width: 100%;
    max-width: 850px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Glass Card */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 40px;
    backdrop-filter: blur(20px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Standard Screenplay layout rules inside Reader */
.screenplay-container {
    background: #ffffff;
    color: #111111;
    font-family: var(--font-script);
    font-size: 12pt;
    line-height: 1.15;
    padding: 60px 50px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    max-width: 100%;
    overflow-x: auto;
}

.screenplay-container .scene-header {
    text-transform: uppercase;
    font-weight: bold;
    margin-top: 24px;
    margin-bottom: 16px;
}

.screenplay-container .action {
    margin-bottom: 16px;
    text-align: justify;
    line-height: 1.3;
}

.screenplay-container .character {
    text-align: center;
    width: 60%;
    margin-left: 20%;
    margin-top: 16px;
    margin-bottom: 2px;
    text-transform: uppercase;
}

.screenplay-container .parenthetical {
    text-align: center;
    width: 50%;
    margin-left: 25%;
    margin-bottom: 2px;
}

.screenplay-container .dialogue {
    width: 60%;
    margin-left: 20%;
    margin-bottom: 16px;
    line-height: 1.25;
}

.screenplay-container .transition {
    text-align: right;
    width: 90%;
    margin-top: 16px;
    margin-bottom: 16px;
    text-transform: uppercase;
}

/* Markdown formatting in standard cards */
.card h1 {
    font-size: 2rem;
    margin-bottom: 16px;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 8px;
}

.card h2 {
    font-size: 1.5rem;
    margin-top: 24px;
    margin-bottom: 12px;
    color: var(--accent-orange);
}

.card h3 {
    font-size: 1.2rem;
    margin-top: 18px;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.card p {
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 16px;
    color: var(--text-secondary);
}

.card li {
    font-size: 0.95rem;
    line-height: 1.6;
    margin-left: 24px;
    margin-bottom: 8px;
    color: var(--text-secondary);
}

.card code {
    background: rgba(255, 255, 255, 0.05);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.9em;
    color: #ff9d00;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 123, 0, 0.3);
}

/* Responsive */
@media (max-width: 768px) {
    body {
        flex-direction: column;
    }
    .sidebar {
        width: 100%;
        height: auto;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }
    .main-content {
        padding: 20px;
    }
    .screenplay-container {
        padding: 30px 20px;
    }
}
