/* CSS Design System - Rich & Premium Aesthetics */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&family=Outfit:wght@400;700;900&display=swap');

:root {
    /* Color Palette - Titanium Dark */
    --bg-main: #020617;
    --bg-card: #0f172a;
    --bg-sidebar: #010413;
    --accent-primary: #06b6d4; /* Cyan 500 */
    --accent-glow: rgba(6, 182, 212, 0.4);
    --accent-secondary: #8b5cf6; /* Violet 500 */
    --text-primary: #f8fafc;
    --text-dim: #94a3b8;
    --glass-bg: rgba(15, 23, 42, 0.6);
    --glass-border: rgba(255, 255, 255, 0.08);
    --danger: #ef4444;
    
    /* Layout */
    --sidebar-width: 280px;
    --header-height: 70px;
    --radius-lg: 1.25rem;
    --radius-md: 0.75rem;
    
    /* Shadows */
    --shadow-premium: 0 20px 50px rgba(0,0,0,0.5);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
    -webkit-font-smoothing: antialiased;
}

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    overflow: hidden;
    height: 100vh;
}

/* Glassmorphism Base */
.glass {
    background: var(--glass-bg);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
}

.premium-shadow {
    box-shadow: var(--shadow-premium);
}

/* Scrollbar Customization */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

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

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-primary);
}

/* Layout */
#app {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

header {
    height: var(--header-height);
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--glass-border);
    z-index: 100;
}

.brand {
    font-family: 'Outfit', sans-serif;
    font-weight: 900;
    font-size: 1.6rem;
    letter-spacing: -0.5px;
    color: #fff;
    text-shadow: 0 0 10px rgba(6, 182, 212, 0.5);
    cursor: default;
}

main {
    display: flex;
    flex: 1;
    overflow: hidden;
}

aside {
    width: var(--sidebar-width);
    border-right: 1px solid var(--glass-border);
    background: var(--bg-sidebar);
    display: flex;
    flex-direction: column;
    z-index: 90;
}

.sidebar-header {
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--glass-border);
}

.scene-list {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.scene-item {
    padding: 1rem 1.2rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid transparent;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    position: relative;
    overflow: hidden;
}

.scene-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--accent-primary);
    transform: scaleY(0);
    transition: var(--transition);
}

.scene-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.scene-item.active {
    background: rgba(6, 182, 212, 0.1);
    border-color: rgba(6, 182, 212, 0.2);
    color: var(--accent-primary);
}

.scene-item.active::before {
    transform: scaleY(1);
}

/* Mode Switcher */
.mode-switcher {
    padding: 4px;
    display: flex;
    gap: 4px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.03);
}

.mode-switcher .btn {
    padding: 0.5rem 1.2rem;
    font-size: 0.8rem;
    border: none;
    background: transparent;
}

.mode-switcher .btn.active {
    background: var(--accent-primary);
    color: var(--bg-main);
}

/* Buttons */
.btn {
    padding: 0.7rem 1.4rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--glass-border);
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.6rem;
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-primary);
}

.btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

.btn-primary {
    background: var(--accent-primary);
    border: none;
    color: var(--bg-main);
    box-shadow: 0 4px 15px var(--accent-glow);
}

.btn-primary:hover {
    color: white;
    box-shadow: 0 8px 25px var(--accent-glow);
}

.btn-icon {
    width: 38px;
    height: 38px;
    padding: 0;
    justify-content: center;
    border-radius: 12px;
}

/* Controls Bar */
.controls-bar {
    position: absolute;
    top: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.8rem 2.5rem;
    border-radius: 100px;
    display: flex;
    gap: 2rem;
    align-items: center;
    z-index: 50;
    box-shadow: 0 20px 40px rgba(0,0,0,0.4);
}

/* Sections visibility */
.view-section {
    display: none;
    flex: 1;
    height: 100%;
    position: relative;
    overflow: hidden;
}

.view-section.active {
    display: flex;
    flex-direction: column;
}

/* Editor Specific */
.editor-view {
    background: #020617; /* Same as main bg */
}

.editor-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 3rem 2rem;
}

.editor-header {
    max-width: 900px;
    margin: 0 auto 3rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.editor-container {
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.editor-block {
    background: var(--bg-card);
    padding: 2rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--glass-border);
    display: flex;
    gap: 2rem;
    transition: var(--transition);
}

.editor-block:hover {
    border-color: var(--accent-primary);
    transform: translateX(8px);
}

.editor-block input.char-input {
    border: none;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--accent-primary);
    font-size: 0.75rem;
    letter-spacing: 2px;
    outline: none;
    background: transparent;
    width: 200px;
    margin-bottom: 0.5rem;
}

.editor-block textarea.text-input {
    border: none;
    font-size: 1.25rem;
    font-weight: 500;
    color: var(--text-primary);
    resize: none;
    outline: none;
    background: transparent;
    width: 100%;
    line-height: 1.4;
}

.add-block-placeholder {
    width: 100%;
    padding: 2.5rem;
    border: 2px dashed rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg);
    background: transparent;
    color: var(--text-dim);
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
}

.add-block-placeholder:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    background: rgba(6, 182, 212, 0.05);
}

.modal-content {
    width: 100%;
    max-width: 700px;
    padding: 3rem;
    border-radius: 2rem;
    border: 1px solid var(--glass-border);
    background: var(--bg-card);
}

.modal-content h2 {
    font-family: 'Outfit', sans-serif;
    font-size: 2rem;
    font-weight: 900;
    margin-bottom: 1.5rem;
    background: linear-gradient(to right, #fff, var(--accent-primary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

textarea#import-textarea {
    width: 100%;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    color: white;
    font-size: 1rem;
    line-height: 1.6;
    outline: none;
    transition: var(--transition);
}

textarea#import-textarea:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 20px rgba(6, 182, 212, 0.1);
}

/* Utilities */
.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

.v-divider {
    width: 1px;
    height: 30px;
    background: var(--glass-border);
}

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

.editor-block {
    animation: fadeIn 0.4s ease-out forwards;
}

/* Prompter Specific */
.prompter-view {
    background: #000;
}

.prompter-container {
    height: 100%;
    overflow-y: auto;
    padding: 45vh 15% 100vh;
    scroll-behavior: smooth;
    position: relative;
    z-index: 10;
}

.prompter-container .block {
    margin-bottom: 15rem; /* Space between blocks */
    transition: var(--transition);
}

.prompter-container .character {
    font-family: 'Outfit', sans-serif;
    margin-bottom: 2rem;
    letter-spacing: 4px;
    font-weight: 900;
    text-transform: uppercase;
}

.prompter-container .text {
    line-height: 1.1;
    font-weight: 700;
}

/* Reading Line */
.reading-line {
    position: fixed;
    top: 50%;
    left: 0;
    right: 0;
    height: 180px;
    background: linear-gradient(
        to bottom,
        rgba(6, 182, 212, 0.05) 0%,
        rgba(6, 182, 212, 0.1) 50%,
        rgba(6, 182, 212, 0.05) 100%
    );
    border-top: 1px solid rgba(6, 182, 212, 0.2);
    border-bottom: 1px solid rgba(6, 182, 212, 0.2);
    pointer-events: none;
    transform: translateY(-50%);
    z-index: 20;
}
