/* Author: NOIR-VIZUALS */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root { 
    --bg-page: #0E0E0E; 
    --bg-card: #141414;
    --text-main: #EAEAEA; 
    --text-muted: #666666;
    --border: #222222; 
    --accent: #FFFFFF; 
    --hover: #1A1A1A;
    --gold-text: #F2C94C;
    --gold-glow: rgba(242, 201, 76, 0.5);
    
    --owner-color: #a8b3c9;
    --owner-glow: rgba(168, 179, 201, 0.5);
    
    --radius: 16px;
    --btn-radius: 10px;
    --input-radius: 12px;
}

body { margin: 0; padding: 0; background-color: var(--bg-page); color: var(--text-main); font-family: 'Inter', system-ui, sans-serif; display: flex; flex-direction: column; height: 100vh; overflow: hidden; }
body.settings-page { overflow-y: auto !important; height: auto; min-height: 100vh; }

/* STATE MACHINE */
html.is-lobby #lobby-view { display: block !important; }
html:not(.is-lobby) #lobby-view { display: none !important; }

html.is-lobby .editor-card textarea, html.is-lobby .editor-card #viewer, html.is-lobby .editor-toolbar, html.is-lobby #reaction-bar, html.is-lobby .banner-wrapper, html.is-lobby #writer-profile-card, html.is-lobby #in-this-room-container, html.is-lobby #room-stats-card, html.is-lobby #interaction-box, html.is-lobby #trophy-container, html.is-lobby #live-prompts-container, html.is-lobby .reader-controls, html.is-lobby #goal-tracker-container, html.is-lobby #top-quotes-container { display: none !important; }

html:not(.is-writer):not(.is-lobby) #editor { display: none !important; }
html:not(.is-writer):not(.is-lobby) #viewer { display: block !important; }

html:not(.is-writer).is-editing-admin #editor { display: block !important; }
html:not(.is-writer).is-editing-admin #viewer { display: none !important; }

html.is-writer #editor { display: block !important; }
html.is-writer #viewer { display: none !important; }
html.is-writer .reader-controls { display: none !important; }

html.is-writer.is-previewing #editor { display: none !important; }
html.is-writer.is-previewing #viewer { display: block !important; }

html.is-lobby .room-only { display: none !important; }
html.is-room .lobby-only { display: none !important; }

textarea:disabled { opacity: 0.5; cursor: wait; }

/* PREMIUM AD-FREE OVERRIDE */
html.no-ads .ad-space { display: none !important; }

/* ZEN MODE VOOR SCHRIJVER EN LEZER */
.topbar, #sidebar-left, #sidebar-right, .editor-toolbar, #reaction-bar, .banner-wrapper { transition: opacity 0.5s ease-in-out; opacity: 1; }
html.zen-mode .topbar, html.zen-mode #sidebar-left, html.zen-mode #sidebar-right, html.zen-mode .editor-toolbar, html.zen-mode #reaction-bar, html.zen-mode .banner-wrapper { opacity: 0 !important; pointer-events: none !important; }
.editor-card { transition: background-color 0.5s ease, border-color 0.5s ease, box-shadow 0.5s ease, transform 0.5s ease; }
html.zen-mode .editor-card { box-shadow: none; border-color: transparent; background-color: transparent; transform: translateY(-80px); }
html.zen-mode #editor, html.zen-mode #viewer { text-align: center; max-width: 800px; margin: 0 auto; align-self: center; }

/* READER CONTROLS */
.reader-controls { position: fixed; bottom: 30px; left: 30px; display: flex; gap: 10px; z-index: 100; transition: 0.3s; }
.reader-ctrl-btn { background: rgba(20,20,20,0.8); backdrop-filter: blur(10px); border: 1px solid var(--border); color: var(--text-muted); font-size: 12px; padding: 10px 16px; border-radius: 20px; cursor: pointer; transition: 0.3s; }
.reader-ctrl-btn:hover { color: var(--text-main); border-color: #555; }
.reader-ctrl-btn.active { color: #f43f5e; border-color: #f43f5e; }
html.zen-mode .reader-controls { opacity: 0.2; }
html.zen-mode .reader-controls:hover { opacity: 1; }

/* CARET & TEXT */
@keyframes blink-caret { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }
#viewer { --custom-caret: #f43f5e; position: relative; transition: all 1s ease; }
#viewer:empty::after { content: ''; display: inline-block; width: 10px; height: 1.1em; background-color: var(--custom-caret); vertical-align: baseline; animation: blink-caret 1s step-end infinite; }
#viewer > *:last-child::after { content: ''; display: inline-block; width: 10px; height: 1.1em; background-color: var(--custom-caret); vertical-align: baseline; margin-left: 4px; animation: blink-caret 1s step-end infinite; }
#editor { caret-shape: block; transition: all 1s ease; }
textarea, #viewer, #reader-content { width: 100%; height: 100%; border: none; resize: none; outline: none; font-size: 18px; line-height: 1.8; background-color: transparent; color: #717171 !important; font-family: 'Georgia', serif !important; overflow-wrap: break-word; }
#viewer p { margin-top: 0; margin-bottom: 1.5em; }

/* BURN ANIMATION CLASS */
.burn-animation { animation: burn-away 3s forwards ease-in-out; pointer-events: none; }
@keyframes burn-away {
    0% { filter: blur(0px) brightness(1); opacity: 1; transform: translateY(0); color: var(--text-main); }
    40% { filter: blur(2px) brightness(1.5); color: #f59e0b; }
    70% { filter: blur(5px) brightness(0.5); color: #444; transform: translateY(-10px); opacity: 0.8; }
    100% { filter: blur(10px); opacity: 0; transform: translateY(-20px); }
}

/* TOP QUOTES UI */
::selection { background: rgba(244, 63, 94, 0.3); color: var(--text-main); }
.quote-tooltip { position: absolute; display: none; background: var(--text-main); color: var(--bg-page); border: none; padding: 8px 14px; border-radius: var(--btn-radius); font-size: 12px; font-weight: bold; cursor: pointer; z-index: 1000; box-shadow: 0 4px 12px rgba(0,0,0,0.5); transform: translate(-50%, -100%); margin-top: -10px; transition: transform 0.1s; }
.quote-tooltip:hover { transform: translate(-50%, -100%) scale(1.05); }
.quote-tooltip::after { content: ''; position: absolute; top: 100%; left: 50%; transform: translateX(-50%); border-width: 6px; border-style: solid; border-color: var(--text-main) transparent transparent transparent; }
.quote-card { background: rgba(255,255,255,0.03); border-left: 3px solid var(--gold-text); padding: 14px; border-radius: 0 var(--btn-radius) var(--btn-radius) 0; margin-bottom: 10px; font-style: italic; font-family: 'Georgia', serif; font-size: 13px; color: var(--text-main); position: relative; line-height: 1.5;}
.quote-meta { display: block; font-size: 10px; color: var(--text-muted); font-family: 'Inter', sans-serif; font-style: normal; margin-top: 8px; font-weight: 600;}

/* AANGEPAST: Quote Action Bar Styling */
.quote-action-bar { display: flex; gap: 8px; margin-top: 10px; align-items: center; }
.quote-action-btn { background: transparent; border: 1px solid var(--border); color: var(--text-muted); border-radius: 12px; font-size: 10px; padding: 4px 8px; cursor: pointer; transition: 0.2s; display: inline-flex; align-items: center; gap: 4px; }
.quote-action-btn:hover { background: var(--hover); color: var(--text-main); border-color: #555; }
.quote-action-btn.delete-btn { color: #f43f5e; margin-left: auto; border-color: rgba(244,63,94,0.3); }
.quote-action-btn.delete-btn:hover { background: #f43f5e; color: #fff; }

/* PARTICLES */
#dynamic-bg { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; z-index: 0; pointer-events: none; overflow: hidden; opacity: 1; }
.typing-heat-particle { position: absolute; width: 60vw; height: 60vw; transform: translate(-50%, -50%); opacity: 0; animation: heat-fade 4s ease-out forwards; mix-blend-mode: screen; filter: blur(50px) brightness(1.2); }
@keyframes heat-fade { 0% { opacity: 0; transform: translate(-50%, -50%) scale(0.8); } 30% { opacity: 0.15; transform: translate(-50%, -50%) scale(1); } 100% { opacity: 0; transform: translate(-50%, -50%) scale(1.2); } }

/* GLOBALE SCROLLBARS STRAK EN DONKER MAKEN */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #333; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: #555; }
* { scrollbar-width: thin; scrollbar-color: #333 transparent; box-sizing: border-box; }

/* ROLES GLOW EFFECTS */
.owner-name { color: var(--owner-color); font-weight: 700; display: inline-block; text-shadow: 0 0 8px var(--owner-glow); animation: owner-breathe 3s ease-in-out infinite; }
@keyframes owner-breathe { 0%, 100% { text-shadow: 0 0 6px var(--owner-glow); } 50% { text-shadow: 0 0 15px rgba(168, 179, 201, 0.8); } }

.admin-name { color: #3b82f6; font-weight: 700; display: inline-block; text-shadow: 0 0 8px rgba(59, 130, 246, 0.4); animation: blue-breathe 3s ease-in-out infinite; }
@keyframes blue-breathe { 0%, 100% { text-shadow: 0 0 6px rgba(59, 130, 246, 0.4); } 50% { text-shadow: 0 0 15px rgba(59, 130, 246, 0.7); } }

/* ONLINE DOT ACHTER DE NAAM */
.status-dot-inline { display: inline-block; width: 6px; height: 6px; border-radius: 50%; margin-left: 6px; vertical-align: middle; }
.status-dot-inline.online { background-color: #10b981; box-shadow: 0 0 6px #10b981; }
.status-dot-inline.offline { background-color: #555; }
.lb-status-dot { display: none !important; }

/* UI LAYOUT & HEADER */
.topbar { display: grid; grid-template-columns: 1fr minmax(200px, 350px) 1fr; align-items: center; padding: 0 40px; height: 60px; border-bottom: 1px solid var(--border); background: var(--bg-card); z-index: 1000; position: relative; flex-shrink: 0; }
.logo { width: 140px !important; height: 40px !important; display: flex; align-items: center; font-weight: 800; font-size: 20px; text-decoration: none; color: var(--text-main); overflow: hidden; justify-self: flex-start; letter-spacing: -0.5px; }

.search-container { position: relative; width: 100%; margin: 0 auto; }
.header-right { display: flex; align-items: center; justify-content: flex-end; gap: 2px; position: relative; }
.badge-icon { margin-left: 4px; font-size: 13px; }
.fi { margin-left: 6px; border-radius: 2px; }

#find-writers-input { width: 100%; background: var(--bg-page); color: var(--text-main); border: 1px solid var(--border); padding: 12px 14px; border-radius: var(--input-radius); font-size: 13px; outline: none; transition: border 0.2s; font-family: 'Inter', sans-serif; cursor: text; white-space: nowrap; overflow: hidden; }
#find-writers-input:empty:before { content: attr(placeholder); color: var(--text-muted); pointer-events: none; }
#find-writers-input:focus { border-color: var(--text-muted); }
#search-results { position: absolute; top: calc(100% + 4px); left: 0; width: 100%; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); max-height: 300px; overflow-y: auto; display: none; box-shadow: 0 10px 20px rgba(0,0,0,0.5); z-index: 1000; }
.search-item { padding: 12px 16px; cursor: pointer; border-bottom: 1px solid var(--border); font-size: 13px; display: flex; justify-content: space-between; }
.search-item:hover { background: var(--hover); }

/* MODERN BUTTONS */
.btn { background: var(--bg-card); border: 1px solid var(--border); font-family: inherit; font-size: 13px; font-weight: 500; color: var(--text-main); cursor: pointer; padding: 10px 16px; border-radius: var(--btn-radius); transition: all 0.15s ease; display: inline-flex; align-items: center; justify-content: center; }
.btn:hover { background: var(--hover); }
.btn-primary { background: var(--accent); color: var(--bg-page); border-color: var(--accent); }
.btn-primary:hover { opacity: 0.85; background: var(--accent); }

.icon-btn { padding: 6px; font-size: 16px; border-color: transparent; background: transparent; color: var(--text-main); }

.btn-dark { background: #141414; border: 1px solid #333; color: var(--text-muted); }
.btn-dark:hover { background: #1A1A1A; color: var(--text-main); border-color: #555; }
.btn-dark.active { background: #222; color: var(--text-main); border-color: #666; }

.fixed-w-btn { width: 120px !important; text-align: center; justify-content: center; padding: 10px 0; white-space: nowrap; flex-shrink: 0; }

.layout-grid { display: grid; grid-template-columns: 240px 1fr 240px; flex-grow: 1; max-width: 1400px; margin: 0 auto; width: 100%; overflow: hidden; padding: 20px; gap: 20px; position: relative; z-index: 10; }

#sidebar-right { display: flex; flex-direction: column; gap: 20px; position: relative; z-index: 50; }
#sidebar-left { display: flex; flex-direction: column; gap: 20px; position: relative; z-index: 50; }
.sidebar { overflow-y: auto; display: flex; flex-direction: column; gap: 20px; position: relative; z-index: 50; }

.sidebar-section { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; position: relative; z-index: 50; }
.fixed-box { min-height: 180px; display: flex; flex-direction: column; justify-content: flex-start; }
.sidebar-section h4 { margin: 0 0 14px 0; font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }

/* MAX-HEIGHT EN OVERFLOW VOOR DE LEADERBOARDS */
#premium-leaderboard, #likes-leaderboard { max-height: 400px; overflow-y: auto; padding-right: 5px; }
#following-list, #followers-list { max-height: 550px; overflow-y: auto; padding-right: 5px; }

/* ADVERTENTIE BLOKKEN */
.ad-space { position: relative; z-index: 50; width: 100%; height: 250px; background: repeating-linear-gradient(45deg, var(--bg-page), var(--bg-page) 10px, var(--bg-card) 10px, var(--bg-card) 20px); border: 1px dashed var(--text-muted); border-radius: var(--radius); display: flex; align-items: center; justify-content: center; color: var(--text-muted); font-size: 11px; text-transform: uppercase; letter-spacing: 1px; flex-shrink: 0; }

.trophy-box { display: flex; justify-content: center; gap: 10px; font-size: 13px; padding: 5px; border: none; background: transparent; }

.leaderboard-list { list-style: none; padding: 0; margin: 0; font-size: 13px; }
.leaderboard-list li { margin-bottom: 12px; display: flex; justify-content: space-between; align-items: center; width: 100%; }
.lb-user-container { display: flex; align-items: center; cursor: pointer; color: var(--text-main); }
.lb-user-container:hover { text-decoration: underline; }

.main-column { display: flex; flex-direction: column; gap: 15px; position: relative; z-index: 10; min-width: 0; }
.banner-wrapper { position: relative; width: 100%; aspect-ratio: 4 / 1; border-radius: var(--radius); flex-shrink: 0; z-index: 1; }
.room-banner { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background-size: cover; background-position: center; border-radius: var(--radius); border: 1px solid var(--border); z-index: 2; }

.banner-glow { 
    position: absolute; top: 0; left: 0; width: 100%; height: 100%; 
    background-size: cover; background-position: center; 
    filter: blur(50px) saturate(200%); opacity: 0.5; z-index: -1; 
    animation: breathe-glow 8s ease-in-out infinite alternate; 
    border-radius: var(--radius); display: none; pointer-events: none; 
}
@keyframes breathe-glow { 
    0% { opacity: 0.3; filter: blur(40px) saturate(150%); transform: scale(1.02) translateY(5px); } 
    100% { opacity: 0.5; filter: blur(60px) saturate(200%); transform: scale(1.08) translateY(10px); } 
}

/* TOOLBAR WEERGAVE */
.editor-toolbar { position: relative; z-index: 50; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 14px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; flex-shrink: 0; }
html:not(.is-writer):not(.is-admin) .editor-toolbar { display: none !important; }

.editor-toolbar select { margin: 0; padding: 8px 10px; font-size: 12px; border: 1px solid var(--border); border-radius: var(--btn-radius); background: var(--bg-page); color: var(--text-main); outline: none; cursor: pointer; flex-shrink: 0; }
.toolbar-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* WORD GOAL TRACKER STYLING */
.goal-progress-bg { width: 100%; height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; margin-top: 6px; }
.goal-progress-fill { width: 0%; height: 100%; background: var(--gold-text); transition: width 0.3s ease, background-color 0.3s ease; box-shadow: 0 0 8px var(--gold-glow); }
.goal-progress-fill.success { background: #10b981; box-shadow: 0 0 8px #10b981; }

.editor-card { position: relative; z-index: 50; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 40px 60px; flex-grow: 1; overflow-y: auto; display: flex; flex-direction: column; }

.hero-section { text-align: center; padding: 40px 0; border-bottom: 1px solid var(--border); margin-bottom: 20px; }
.hero-section h1 { font-size: 32px; font-weight: 700; margin: 0 0 10px 0; letter-spacing: -1px; color: var(--text-main); }
.hero-section p { color: var(--text-muted); font-size: 15px; max-width: 500px; margin: 0 auto 20px auto; line-height: 1.5; }
.global-stats { font-size: 12px; color: var(--text-muted); margin-top: 20px; background: var(--bg-page); padding: 10px 18px; border-radius: var(--btn-radius); display: inline-block; }

.pulse-item { padding: 14px 18px; border: 1px solid var(--border); margin-bottom: 10px; border-radius: var(--radius); display: flex; justify-content: space-between; cursor: pointer; background: var(--bg-card); transition: border 0.1s; }

#reaction-bar { position: fixed; bottom: 30px; right: 30px; display: flex; gap: 6px; background: var(--bg-card); padding: 8px; border-radius: var(--radius); border: 1px solid var(--border); box-shadow: 0 10px 30px rgba(0,0,0,0.5); z-index: 100; }
.reaction-btn { background: var(--bg-page); border: 1px solid var(--border); font-size: 18px; cursor: pointer; border-radius: var(--btn-radius); padding: 8px 12px; transition: 0.1s; }
.floating-reaction { position: fixed; bottom: 80px; font-size: 24px; pointer-events: none; animation: floatUp 2s ease-out forwards; z-index: 99; }
@keyframes floatUp { 0% { opacity: 1; transform: translateY(0); } 100% { opacity: 0; transform: translateY(-100px); } }

/* ADMIN REVIEW OVERLAY (BLUR) */
.admin-review-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: rgba(14,14,14,0.85); backdrop-filter: blur(8px); z-index: 100; display: none; flex-direction: column; align-items: center; justify-content: center; text-align: center; border-radius: var(--radius); opacity: 0; transition: opacity 0.5s ease; color: var(--text-main); }
.admin-review-overlay.active { display: flex; opacity: 1; }
.admin-review-icon { font-size: 36px; margin-bottom: 15px; animation: pulse-red 2s infinite; }

/* BANNED OVERLAY (JAIL) */
.banned-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: var(--bg-card); z-index: 200; display: none; flex-direction: column; align-items: center; justify-content: center; text-align: center; border-radius: var(--radius); color: var(--text-main); }
.banned-overlay.active { display: flex; }
.banned-icon { font-size: 48px; margin-bottom: 15px; color: #f43f5e; }

/* NIEUW: LIGHTBOX MODAL VOOR BANNERS */
.lightroom-modal { display: none; position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background: rgba(0, 0, 0, 0.9); z-index: 3000; align-items: center; justify-content: center; }
.lightroom-modal.active { display: flex; }
.lightroom-img { max-width: 90vw; max-height: 80vh; border-radius: 8px; border: 1px solid var(--border); box-shadow: 0 20px 50px rgba(0,0,0,0.8); }
.lightroom-close { position: absolute; top: 30px; right: 40px; background: transparent; border: none; color: #fff; font-size: 30px; cursor: pointer; }

/* MODALS */
.modal-overlay { display: none; position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background: rgba(0, 0, 0, 0.7); backdrop-filter: blur(5px); z-index: 150; }

.modal { 
    display: none; position: fixed !important; top: 50% !important; left: 50% !important; transform: translate(-50%, -50%) !important;
    background: var(--bg-card); border: 1px solid var(--border); box-shadow: 0 20px 50px rgba(0,0,0,0.8); 
    border-radius: var(--radius); z-index: 200; padding: 24px; margin: 0 !important; right: auto !important; bottom: auto !important;
}
.modal input[type="text"], .modal input[type="number"], .modal input[type="password"], .modal select, .modal textarea { width: 100%; padding: 12px 14px; margin-bottom: 14px; border: 1px solid var(--border); background: var(--bg-page); color: var(--text-main); border-radius: var(--input-radius); font-size: 13px; outline: none; }

/* DROPDOWN MENUS */
.dropdown-menu {
    display: none; position: absolute; top: calc(100% + 15px); right: 0; 
    width: 320px; background: rgba(20, 20, 20, 0.85); backdrop-filter: blur(15px);
    border: 1px solid var(--border); border-radius: var(--radius); 
    box-shadow: 0 20px 40px rgba(0,0,0,0.9); z-index: 1000; padding: 0; overflow: hidden;
}
.dropdown-header { padding: 15px 20px; border-bottom: 1px solid var(--border); font-weight: 600; font-size: 14px; }
.dropdown-list { list-style: none; margin: 0; padding: 0; max-height: 350px; overflow-y: auto; }
.dropdown-list li { padding: 15px 20px; border-bottom: 1px solid var(--border); font-size: 13px; cursor: pointer; transition: background 0.2s; }
.dropdown-list li:hover { background: rgba(255,255,255,0.05); }

.menu-list { list-style: none; padding: 0; margin: 0; }
.menu-item { padding: 12px 14px; cursor: pointer; font-size: 13px; font-weight: 500; border-radius: var(--btn-radius); margin-bottom: 4px; color: var(--text-main); }
.menu-item:hover { background: var(--hover); }

.notif-badge { position: absolute; top: -5px; right: -5px; background: var(--accent); color: var(--bg-page); border-radius: 50%; padding: 2px 6px; font-size: 10px; font-weight: bold; pointer-events: none; border: 2px solid var(--bg-card); }

@media (max-width: 1100px) { .layout-grid { grid-template-columns: 1fr 240px !important; } #sidebar-left { display: none !important; } }
@media (max-width: 800px) { .layout-grid { grid-template-columns: 1fr !important; } #sidebar-right { display: none !important; } .editor-card { padding: 20px; } .topbar { display: flex; justify-content: space-between; padding: 0 20px; } .search-container { display: none; } }

/* POLL */
.poll-question { font-weight: 600; margin-bottom: 12px; font-size: 13px; }
.poll-option-btn { position: relative; width: 100%; background: var(--bg-page); border: 1px solid var(--border); border-radius: var(--btn-radius); margin-bottom: 8px; cursor: pointer; overflow: hidden; display: block; text-align: left; padding: 0; }
.poll-option-btn:hover { border-color: var(--text-muted); }
.poll-fill { position: absolute; top: 0; left: 0; height: 100%; background: var(--hover); z-index: 1; transition: width 0.3s ease; }
.poll-text-wrapper { position: relative; z-index: 2; padding: 10px 14px; display: flex; justify-content: space-between; font-size: 12px; color: var(--text-main); }
.poll-meta { font-size: 10px; color: var(--text-muted); text-align: right; margin-top: 8px; }

/* LIBRARY CARDS */
.library-grid { display: flex; flex-direction: column; gap: 10px; padding: 20px; max-height: 60vh; overflow-y: auto; }
.library-card { background: var(--bg-page); border: 1px solid var(--border); border-radius: var(--radius); padding: 15px; cursor: pointer; transition: transform 0.2s, border-color 0.2s; position: relative; display: flex; flex-direction: column; gap: 8px; }
.library-card:hover { transform: translateY(-2px); border-color: #444; }
.lib-card-header { display: flex; justify-content: space-between; align-items: flex-start; }
.lib-card-title { font-weight: 700; font-size: 15px; color: var(--text-main); margin: 0; }
.lib-card-meta { display: flex; gap: 10px; font-size: 11px; color: var(--text-muted); align-items: center; }
.read-badge { background: rgba(255,255,255,0.1); padding: 2px 6px; border-radius: 4px; font-weight: 600; color: #fff; }
.pin-icon { color: var(--gold-text); font-size: 14px; }
.pin-btn { background: transparent; border: none; font-size: 14px; cursor: pointer; opacity: 0.5; padding: 0; }
.pin-btn:hover { opacity: 1; }
.pin-btn.active { opacity: 1; color: var(--gold-text); }
.lib-card-actions { display: flex; justify-content: flex-end; margin-top: 5px; }

/* CHAT BUBBLES & TYPING */
.chat-history { flex-grow: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 10px; background: var(--bg-page); border-bottom: 1px solid var(--border); border-top: 1px solid var(--border); min-height: 300px; max-height: 400px;}
.pm-bubble { max-width: 75%; padding: 10px 14px; border-radius: 18px; font-size: 13px; line-height: 1.4; }
.pm-sent { align-self: flex-end; background: var(--accent); color: var(--bg-page); border-bottom-right-radius: 4px; }
.pm-received { align-self: flex-start; background: var(--bg-card); border: 1px solid var(--border); border-bottom-left-radius: 4px; color: var(--text-main); }
.chat-input-area { display: flex; gap: 10px; padding: 15px; background: var(--bg-card); }
.chat-input-area input { margin: 0; flex-grow: 1; border-radius: 20px; padding: 10px 15px; }
.chat-input-area button { border-radius: 20px; padding: 10px 20px; }

.typing-indicator { align-self: flex-start; background: transparent; color: var(--text-muted); font-size: 11px; padding: 0 5px; font-style: italic; display: none; }
.typing-dots span { display: inline-block; width: 4px; height: 4px; background: var(--text-muted); border-radius: 50%; margin: 0 1px; animation: bounce 1.4s infinite ease-in-out both; }
.typing-dots span:nth-child(1) { animation-delay: -0.32s; }
.typing-dots span:nth-child(2) { animation-delay: -0.16s; }
@keyframes bounce { 0%, 80%, 100% { transform: scale(0); } 40% { transform: scale(1); } }

/* QUEUED TOAST NOTIFICATIE MET NIEUWE REPORT KNOP */
#toast-container { position: fixed; top: 80px; left: 50%; transform: translateX(-50%); z-index: 2000; pointer-events: none; display: flex; flex-direction: column; gap: 10px; }
.prompt-toast { background: rgba(20, 20, 20, 0.95); backdrop-filter: blur(10px); border: 1px solid #333; border-radius: var(--radius); padding: 15px 20px; color: var(--text-main); font-size: 13px; min-width: 300px; max-width: 350px; box-shadow: 0 10px 30px rgba(0,0,0,0.8); pointer-events: auto; animation: toast-in-out 0.4s forwards ease-in-out; }
.toast-header { font-size: 10px; color: var(--gold-text); text-transform: uppercase; font-weight: bold; margin-bottom: 8px; display: block; }
#toast-report-btn { color: #f43f5e; border-color: rgba(244, 63, 94, 0.3); }
#toast-report-btn:hover { background: #f43f5e; color: #fff; }
@keyframes toast-in-out { 
    0% { opacity: 0; transform: translateY(-20px); } 
    100% { opacity: 1; transform: translateY(0); } 
}

.live-viewer-badge { display: flex; align-items: center; gap: 6px; background: rgba(244, 63, 94, 0.1); padding: 4px 8px; border-radius: 12px; border: 1px solid rgba(244, 63, 94, 0.3); color: #f43f5e; font-weight: bold; font-size: 11px; }
.pulse-dot { width: 6px; height: 6px; background-color: #f43f5e; border-radius: 50%; animation: pulse-red 1.5s infinite; }
@keyframes pulse-red { 0% { box-shadow: 0 0 0 0 rgba(244, 63, 94, 0.7); } 70% { box-shadow: 0 0 0 4px rgba(244, 63, 94, 0); } 100% { box-shadow: 0 0 0 0 rgba(244, 63, 94, 0); } }
