/* ==========================================================================
   AuraJournal Core Application Stylesheet
   Pure CSS-Variable Design System & Modern UI Components
   Absolutely NO Hardcoded Colors
   ========================================================================== */

/* 1. Global Reset & Variables
   ========================================================================== */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    margin: 0;
    padding: 0;
    width: 100%;
    min-height: 100vh;
    background-color: var(--bg);
    scroll-behavior: smooth;
}

body {
    margin: 0;
    padding: 0;
    width: 100%;
    min-height: 100vh;
    background-color: transparent;
    color: var(--text);
    font-family: var(--font-main), system-ui, -apple-system, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    position: relative;
    z-index: 1;
}

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

a:hover {
    color: var(--primary-hover);
}

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

::-webkit-scrollbar-track {
    background: var(--bg);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: var(--radius);
}

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

/* 2. Global Utilities & Micro-Animations
   ========================================================================== */
.text-danger { color: var(--danger) !important; }
.text-muted { color: var(--muted) !important; }
.text-primary { color: var(--primary) !important; }

.d-none { display: none !important; }
.d-flex { display: flex !important; }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.6rem 1.2rem;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: var(--radius);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: inherit;
}

.btn-primary {
    background: var(--primary);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--surface);
    color: var(--text);
    border-color: var(--border);
}

.btn-secondary:hover {
    background: var(--card);
}

.btn-danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    border-color: rgba(239, 68, 68, 0.2);
}

.btn-danger:hover {
    background: var(--danger);
    color: #ffffff;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* Cards & Shells */
.card-glass {
    background: radial-gradient(at 0% 0%, rgba(129, 140, 248, 0.04) 0px, transparent 50%), rgba(11, 15, 25, 0.7);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 2rem;
}

/* 3. Global Toast Notifications
   ========================================================================== */
#toastContainer {
    position: fixed;
    top: 2rem;
    right: 2rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-width: 380px;
    width: 100%;
}

.toast {
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    padding: 1rem 1.25rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    animation: slideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    transform-origin: top right;
}

.toast-body {
    font-size: 0.9rem;
    font-weight: 500;
}

.toast-close {
    background: none;
    border: none;
    color: var(--muted);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0;
}

.toast-close:hover {
    color: var(--text);
}

.toast.success { border-left: 4px solid var(--primary); }
.toast.error { border-left: 4px solid var(--danger); }

@keyframes slideIn {
    from { opacity: 0; transform: translateY(-10px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes fadeOut {
    from { opacity: 1; transform: scale(1); }
    to { opacity: 0; transform: scale(0.9); }
}

/* 4. App Shell (Dashboard) Grid Layout
   ========================================================================== */
.app-container {
    display: grid;
    grid-template-columns: 280px 1fr;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
}

/* Sidebar Styling */
.app-sidebar {
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    position: relative;
    z-index: 100;
}

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

.brand-link {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.5px;
}

.brand-accent {
    color: var(--primary);
}

.sidebar-close {
    background: none;
    border: none;
    color: var(--muted);
    font-size: 1.8rem;
    cursor: pointer;
    display: none;
}

.sidebar-user {
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-bottom: 1px solid var(--border);
}

.user-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--primary);
    color: #ffffff;
    display: grid;
    place-content: center;
    font-weight: 700;
    font-size: 1.1rem;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.user-avatar.image-avatar {
    object-fit: cover;
    padding: 0;
    border: 1px solid var(--border);
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-weight: 600;
    font-size: 0.95rem;
}

.user-role {
    font-size: 0.75rem;
    color: var(--muted);
}

.sidebar-nav {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0.9rem;
    color: var(--muted);
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
    cursor: pointer;
    background: none;
    border: none;
    text-align: left;
    width: 100%;
    font-family: inherit;
}

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

.nav-item.active {
    background: rgba(99, 102, 241, 0.08);
    color: var(--primary);
}

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

.nav-item.btn-action {
    background: var(--primary);
    color: #ffffff;
    justify-content: center;
    margin-top: 0.5rem;
    box-shadow: 0 4px 10px rgba(99, 102, 241, 0.2);
}

.nav-item.btn-action:hover {
    background: var(--primary-hover);
    color: #ffffff;
}

.nav-icon {
    width: 18px;
    height: 18px;
}

.nav-divider {
    height: 1px;
    background: var(--border);
    margin: 0.75rem 0;
}

/* Recent Journals Sidebar Box */
.sidebar-journals-box {
    flex: 1;
    overflow-y: auto;
    padding: 0 1.25rem 1.25rem 1.25rem;
    display: flex;
    flex-direction: column;
}

.box-title {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--muted);
    font-weight: 700;
    margin-bottom: 0.75rem;
    display: block;
}

.sidebar-journals-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.sidebar-journals-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 0.75rem;
    border-radius: var(--radius);
    font-size: 0.85rem;
    color: var(--muted);
    cursor: pointer;
    transition: 0.2s;
}

.sidebar-journals-list li:hover, .sidebar-journals-list li.active {
    background: rgba(255,255,255,0.03);
    color: var(--text);
}

.sidebar-journals-list li.active {
    background: var(--card);
    font-weight: 500;
}

.sidebar-journals-list .journal-title-span {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-journals-list .journal-del-btn {
    opacity: 0;
    background: none;
    border: none;
    color: var(--muted);
    cursor: pointer;
    font-size: 1rem;
    padding: 0 0.25rem;
}

.sidebar-journals-list li:hover .journal-del-btn {
    opacity: 1;
}

.sidebar-journals-list li .journal-del-btn:hover {
    color: var(--danger);
}

.loading-placeholder {
    font-style: italic;
    color: var(--muted);
    font-size: 0.8rem;
    text-align: center;
    padding: 1rem 0;
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(0,0,0,0.1);
}

.footer-btn {
    background: none;
    border: none;
    color: var(--muted);
    cursor: pointer;
    padding: 0.4rem;
    border-radius: 8px;
}

.footer-btn:hover {
    color: var(--text);
    background: rgba(255,255,255,0.03);
}

.footer-icon {
    width: 20px;
    height: 20px;
}

/* Sidebar responsive settings */
.mobile-sidebar-toggle {
    position: fixed;
    top: 0.75rem;
    left: 0.75rem;
    z-index: 150;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    display: none;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow);
    cursor: pointer;
    backdrop-filter: blur(12px);
    transition: all 0.2s ease;
}

.app-main {
    height: 100%;
    overflow-y: auto;
    position: relative;
    background-color: var(--bg);
}

@media (max-width: 900px) {
    .app-container {
        grid-template-columns: 1fr;
    }
    
    .app-sidebar {
        position: fixed;
        top: 0;
        left: -280px;
        width: 280px;
        transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    }
    
    .app-sidebar.open {
        transform: translateX(280px);
    }
    
    .sidebar-close {
        display: block;
    }
    
    .mobile-sidebar-toggle {
        display: flex;
    }
}

/* 5. Dashboard Editor Layout Panel
   ========================================================================== */
.editor-panel {
    display: grid;
    grid-template-columns: 1fr 300px;
    height: 100%;
    overflow: hidden;
}

.editor-workspace {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    padding: 1.5rem 2.5rem;
}

@media (max-width: 1200px) {
    .editor-panel {
        grid-template-columns: 1fr;
    }
    
    .editor-workspace {
        padding: 1rem 1.5rem;
    }
}

/* Workspace Header Actions */
.workspace-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.journal-title-input {
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text);
    padding: 0.2rem 0;
    width: 100%;
    font-family: var(--font-main), sans-serif;
}

.journal-title-input:focus {
    outline: none;
    border-color: var(--border);
}

.actions-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* Autosave Indicator */
.autosave-indicator {
    font-size: 0.8rem;
    color: var(--muted);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.pulse-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--muted);
}

.pulse-dot.saving {
    background: var(--primary);
    animation: pulse 1s infinite alternate;
}

.pulse-dot.saved {
    background: var(--primary);
}

@keyframes pulse {
    from { opacity: 0.4; }
    to { opacity: 1; }
}

/* Quill Editor Styling Overrides */
.quill-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.01);
}

/* Quill Custom Themes Override (Vanilla CSS only) */
.ql-toolbar.ql-snow {
    border: none !important;
    border-bottom: 1px solid var(--border) !important;
    background: var(--surface) !important;
    padding: 0.75rem !important;
}

.ql-container.ql-snow {
    border: none !important;
    flex: 1;
    overflow-y: auto;
    font-family: 'Inter', sans-serif !important;
    font-size: 1.05rem !important;
}

.ql-editor {
    color: var(--text) !important;
    padding: 2rem !important;
    line-height: 1.7 !important;
}

.ql-editor.ql-blank::before {
    color: var(--muted) !important;
    left: 2rem !important;
    font-style: normal !important;
}

.ql-snow .ql-stroke {
    stroke: var(--text) !important;
}
.ql-snow .ql-fill {
    fill: var(--text) !important;
}
.ql-snow .ql-picker {
    color: var(--text) !important;
}
.ql-snow .ql-picker-options {
    background-color: var(--surface) !important;
    border-color: var(--border) !important;
}

/* Sidebar Panel: AI toolbox & Versions */
.editor-sidebar {
    background: var(--surface);
    border-left: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow-y: auto;
    padding: 1.5rem;
    gap: 1.5rem;
}

@media (max-width: 1200px) {
    .editor-sidebar {
        display: none; /* Can toggle via script, or loaded below */
    }
}

.sidebar-section {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.section-title {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--muted);
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.5rem;
}

/* AI toolbox buttons */
.ai-toolbox-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.5rem;
}

.btn-ai {
    background: rgba(99, 102, 241, 0.08);
    color: var(--text);
    border: 1px solid rgba(99, 102, 241, 0.2);
    justify-content: flex-start;
    padding: 0.55rem 0.75rem;
    font-size: 0.85rem;
    font-weight: 500;
}

.btn-ai:hover {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
}

.btn-ai svg {
    width: 16px;
    height: 16px;
    color: var(--primary);
}

.btn-ai:hover svg {
    color: #ffffff;
}

/* Version History list */
.versions-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.version-item {
    padding: 0.6rem 0.75rem;
    border-radius: var(--radius);
    background: rgba(255,255,255,0.02);
    border: 1px solid var(--border);
    cursor: pointer;
    font-size: 0.8rem;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    transition: 0.2s;
}

.version-item:hover {
    background: var(--card);
    border-color: var(--muted);
}

.version-time {
    font-weight: 600;
    color: var(--text);
}

.version-preview {
    color: var(--muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 6. Dialog Modal Styles
   ========================================================================== */
dialog {
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 0;
    max-width: 500px;
    width: 90%;
    overflow: hidden;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    margin: 0;
}

/* Styling backdrop blur */
dialog::backdrop {
    background-color: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(4px);
    animation: fadeInBackdrop 0.25s ease forwards;
}

@keyframes fadeInBackdrop {
    from { opacity: 0; }
    to { opacity: 1; }
}

.dialog-content {
    padding: 1.75rem;
}

.dialog-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.75rem;
}

.dialog-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
}

.dialog-close-btn {
    background: none;
    border: none;
    color: var(--muted);
    font-size: 1.8rem;
    cursor: pointer;
    line-height: 1;
    padding: 0;
}

.dialog-close-btn:hover {
    color: var(--text);
}

.dialog-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

/* 7. Public Pages (Explore & Slug) Styling
   ========================================================================== */

/* Navbar */
.public-nav {
    background: rgba(30, 41, 59, 0.25);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.public-logo {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.5px;
}

/* Landing/Explore Hero Section */
.explore-hero {
    max-width: 800px;
    margin: 4rem auto 3rem auto;
    text-align: center;
    padding: 0 1.5rem;
}

.explore-hero h1 {
    font-size: 3rem;
    font-weight: 800;
    letter-spacing: -1.5px;
    line-height: 1.1;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, #ffffff 0%, var(--primary) 50%, #a78bfa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: fadeInGlow 1.2s ease-out forwards;
}

@media (max-width: 600px) {
    .explore-hero h1 { font-size: 2.2rem; }
}

.explore-hero p {
    font-size: 1.15rem;
    color: var(--muted);
    margin-bottom: 2rem;
}

/* Search bar */
.search-container {
    max-width: 550px;
    margin: 0 auto 3.5rem auto;
    position: relative;
    padding: 0 1.5rem;
}

.search-input {
    width: 100%;
    padding: 1rem 1.5rem;
    border-radius: 99px;
    background: rgba(255,255,255,0.02);
    border: 1px solid var(--border);
    color: var(--text);
    font-size: 1rem;
    box-shadow: var(--shadow);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15);
    background: var(--surface);
}

/* Public Cards Grid */
.public-grid {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem 4rem 2rem;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 1.5rem;
}

.journal-card {
    background: rgba(17, 24, 39, 0.55);
    backdrop-filter: blur(8px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 220px;
    box-shadow: var(--shadow);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    overflow: hidden;
}

.journal-card .card-body {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.card-cover-thumb {
    width: 100%;
    height: 160px;
    object-fit: cover;
    display: block;
    border-bottom: 1px solid var(--border);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.journal-card:hover .card-cover-thumb {
    transform: scale(1.04);
}

.card-cover-wrapper {
    overflow: hidden;
    position: relative;
}

.journal-card:hover {
    transform: translateY(-4px) scale(1.005);
    border-color: rgba(129, 140, 248, 0.45);
    box-shadow: 0 20px 40px -15px rgba(0,0,0,0.8), 0 0 30px -5px rgba(99, 102, 241, 0.15);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.featured-badge {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    border: 1px solid rgba(99, 102, 241, 0.2);
}

.card-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0 0 0.75rem 0;
    color: var(--text);
}

.card-excerpt {
    color: var(--muted);
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 1.25rem;
    flex: 1;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

.card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid var(--border);
    padding-top: 0.75rem;
    font-size: 0.8rem;
    color: var(--muted);
}

.author-badge {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.author-circle {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--border);
    display: grid;
    place-content: center;
    font-weight: 700;
    font-size: 0.7rem;
    color: var(--text);
}

/* Public Article Slugs View */
.public-article-wrapper {
    max-width: 780px;
    margin: 0 auto;
    padding: 0 2rem 4rem 2rem;
}

/* Chronicle Cover Image Hero */
.chronicle-cover-hero {
    width: 100%;
    max-height: 420px;
    overflow: hidden;
    position: relative;
    margin-bottom: 0;
}

.chronicle-cover-hero img {
    width: 100%;
    height: 420px;
    object-fit: cover;
    display: block;
}

.chronicle-cover-hero::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 120px;
    background: linear-gradient(to top, var(--bg), transparent);
    pointer-events: none;
}

.btn-back-nav {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--muted);
    margin-bottom: 2rem;
}

.btn-back-nav:hover {
    color: var(--text);
}

.article-header {
    margin-bottom: 2.5rem;
}

.article-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: var(--muted);
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
}

.article-title {
    font-size: 2.8rem;
    font-weight: 800;
    letter-spacing: -1px;
    line-height: 1.15;
    margin: 0;
    color: var(--text);
}

@media (max-width: 600px) {
    .article-title { font-size: 2.1rem; }
}

.article-content {
    font-size: 1.15rem;
    line-height: 1.8;
    color: var(--text);
}

.article-content p {
    margin-bottom: 1.5rem;
}

.article-content blockquote {
    border-left: 4px solid var(--primary);
    padding-left: 1.5rem;
    margin: 2rem 0;
    font-style: italic;
    color: var(--muted);
}

/* Quote Card Overlay Feature */
.quote-card-trigger {
    margin-top: 3rem;
    border-top: 1px solid var(--border);
    padding-top: 2rem;
    text-align: center;
}

.quote-dialog {
    max-width: 600px;
    background: transparent;
    border: none;
    box-shadow: none;
    overflow: visible;
}

.quote-canvas-card {
    background: linear-gradient(135deg, #1e1b4b, #311042);
    border: 2px solid var(--border);
    border-radius: 20px;
    padding: 3rem;
    text-align: center;
    position: relative;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.8);
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 350px;
}

.quote-canvas-text {
    font-size: 1.8rem;
    font-weight: 700;
    line-height: 1.4;
    color: #ffffff;
    margin-bottom: 1.5rem;
    letter-spacing: -0.5px;
    font-family: var(--font-main), sans-serif;
}

.quote-canvas-author {
    font-size: 1.1rem;
    color: #a78bfa;
    font-weight: 500;
}

.quote-canvas-close {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    background: none;
    border: none;
    color: rgba(255,255,255,0.4);
    font-size: 2rem;
    cursor: pointer;
}

.quote-canvas-close:hover {
    color: #ffffff;
}

/* 8. Authentication (Login/Register) View Styling
   ========================================================================== */
.auth-wrapper {
    display: grid;
    place-content: center;
    min-height: 100vh;
    padding: 2rem 1rem;
    background-image: 
        radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.12) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(239, 68, 68, 0.05) 0px, transparent 50%);
}

.auth-container {
    width: 100%;
    max-width: 440px;
}

.auth-logo {
    text-align: center;
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 2rem;
    letter-spacing: -1px;
}

.auth-card {
    background: rgba(30, 41, 59, 0.45);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2.5rem;
    box-shadow: var(--shadow);
}

.auth-title {
    font-size: 1.4rem;
    font-weight: 700;
    margin-top: 0;
    margin-bottom: 1.5rem;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--muted);
    margin-bottom: 0.5rem;
}

.form-group input, .form-group textarea, .form-group select {
    width: 100%;
    padding: 0.7rem 0.9rem;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.15);
    border: 1px solid var(--border);
    color: var(--text);
    font-size: 0.95rem;
    font-family: inherit;
}

.form-group input:focus, .form-group textarea:focus, .form-group select:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(0, 0, 0, 0.25);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.form-help {
    font-size: 0.75rem;
    color: var(--muted);
    margin-top: 0.35rem;
    display: block;
}

.auth-footer {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.85rem;
    color: var(--muted);
}

/* 9. Admin Dashboard Styling
   ========================================================================== */
.admin-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 3rem 2rem;
}

.admin-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 3rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 1.25rem;
}

.admin-header h1 {
    font-size: 2.2rem;
    font-weight: 800;
    letter-spacing: -1px;
    margin: 0;
}

.admin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
}

.stat-val {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1.1;
    margin-bottom: 0.25rem;
}

.stat-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--muted);
    font-weight: 600;
}

/* Admin Tabs */
.admin-tabs {
    display: flex;
    gap: 0.5rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 2rem;
    overflow-x: auto;
    padding-bottom: 1px;
}

.tab-btn {
    background: none;
    border: none;
    color: var(--muted);
    font-weight: 600;
    font-size: 0.95rem;
    padding: 0.75rem 1.25rem;
    cursor: pointer;
    position: relative;
}

.tab-btn:hover {
    color: var(--text);
}

.tab-btn.active {
    color: var(--primary);
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Admin Tables */
.table-responsive {
    overflow-x: auto;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 2rem;
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.9rem;
}

th {
    background: rgba(0,0,0,0.15);
    border-bottom: 1px solid var(--border);
    padding: 1rem 1.25rem;
    font-weight: 600;
    color: var(--text);
}

td {
    border-bottom: 1px solid var(--border);
    padding: 1rem 1.25rem;
    color: var(--muted);
}

tr:last-child td {
    border-bottom: none;
}

tr:hover td {
    color: var(--text);
    background: rgba(255,255,255,0.01);
}

.badge-role {
    background: var(--border);
    color: var(--text);
    font-size: 0.75rem;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-weight: 600;
}

.badge-role.admin {
    background: rgba(99, 102, 241, 0.15);
    color: var(--primary);
    border: 1px solid rgba(99, 102, 241, 0.3);
}

/* Theme Editor Settings Layout */
.theme-editor-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

@media (max-width: 900px) {
    .theme-editor-grid {
        grid-template-columns: 1fr;
    }
}

.variable-control-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.variable-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.02);
    padding-bottom: 0.75rem;
}

.variable-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.variable-info {
    display: flex;
    flex-direction: column;
}

.variable-name {
    font-weight: 600;
    font-size: 0.9rem;
}

.variable-desc {
    font-size: 0.75rem;
    color: var(--muted);
}

.variable-input-wrap {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.color-input-preview {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    border: 1px solid var(--border);
    padding: 0;
    cursor: pointer;
    background: none;
}

.text-input-var {
    width: 110px;
    font-family: monospace;
    font-size: 0.8rem;
    padding: 0.4rem 0.6rem;
}

@keyframes fadeInGlow {
    from {
        opacity: 0;
        transform: translateY(15px);
        filter: drop-shadow(0 0 0px rgba(99, 102, 241, 0));
    }
    to {
        opacity: 1;
        transform: translateY(0);
        filter: drop-shadow(0 0 25px rgba(99, 102, 241, 0.25));
    }
}

@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-4px); }
    100% { transform: translateY(0px); }
}

/* ==========================================================================
   AuraJournal Celestial Upgrades Styles
   ========================================================================== */

/* Theme Picker panel floating card */
.theme-picker-panel {
    position: absolute;
    bottom: 4.5rem;
    left: 1.25rem;
    width: 200px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.75rem;
    box-shadow: var(--shadow);
    backdrop-filter: blur(12px);
    display: none;
    flex-direction: column;
    gap: 0.5rem;
    z-index: 1000;
    animation: slideUpFade 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.theme-picker-panel.open {
    display: flex;
}

.theme-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: none;
    border: none;
    color: var(--text);
    padding: 0.5rem 0.75rem;
    text-align: left;
    border-radius: 8px;
    cursor: pointer;
    font-family: var(--font-main);
    font-size: 0.85rem;
    transition: all 0.2s ease;
}

.theme-option:hover {
    background: rgba(255, 255, 255, 0.05);
    transform: translateX(3px);
}

.theme-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 1.5px solid rgba(255,255,255,0.2);
}

.theme-dot.midnight { background: #818cf8; }
.theme-dot.light { background: #6366f1; border-color: rgba(0,0,0,0.1); }
.theme-dot.pink { background: #f472b6; }
.theme-dot.emerald { background: #10b981; }
.theme-dot.amethyst { background: #c084fc; }

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

/* Quote card rendering updates */
.quote-capture-area {
    background: linear-gradient(135deg, #180d28, #300f3c, #110e2b);
    border: 2px solid var(--border);
    border-radius: 20px;
    padding: 3.5rem 2.5rem;
    text-align: center;
    position: relative;
    overflow: hidden;
    min-height: 280px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    box-shadow: var(--shadow);
}

.quote-capture-area::before {
    content: '';
    position: absolute;
    top: -20%;
    left: -20%;
    width: 60%;
    height: 60%;
    background: radial-gradient(circle, rgba(129, 140, 248, 0.15) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.quote-capture-area::after {
    content: '';
    position: absolute;
    bottom: -20%;
    right: -20%;
    width: 60%;
    height: 60%;
    background: radial-gradient(circle, rgba(244, 114, 182, 0.12) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.quote-watermark {
    position: absolute;
    bottom: 1.25rem;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.72rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.3);
    letter-spacing: 3px;
    text-transform: uppercase;
    font-family: var(--font-main);
}

.quote-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 1.5rem;
}

/* Editor Cosmic Spark buttons & transitions */
.btn-spark-glow {
    position: relative;
    overflow: hidden;
}

.btn-spark-glow::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent 45%,
        rgba(255, 255, 255, 0.15) 50%,
        transparent 55%
    );
    transform: rotate(45deg);
    transition: all 0.3s;
    opacity: 0;
}

.btn-spark-glow:hover::after {
    animation: shine 1.5s ease infinite;
    opacity: 1;
}

@keyframes shine {
    0% { transform: translate(-30%, -30%) rotate(45deg); }
    100% { transform: translate(30%, 30%) rotate(45deg); }
}

/* Voice dictation visual indicator */
.btn-voice-dictate.active {
    background: rgba(244, 63, 94, 0.1) !important;
    color: #f43f5e !important;
    border-color: #f43f5e !important;
}

/* Constellation SVG layout styling */
.mood-constellation-container svg {
    filter: drop-shadow(0 0 6px rgba(129, 140, 248, 0.15));
    transition: filter 0.3s ease;
}

.mood-constellation-container:hover svg {
    filter: drop-shadow(0 0 10px rgba(129, 140, 248, 0.3));
}

#moodConstellationSvg circle {
    transition: transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275), r 0.2s ease;
}

#moodConstellationSvg g:hover circle:first-of-type {
    transform: scale(1.3);
    opacity: 0.3;
}

#moodConstellationSvg g:hover circle:last-of-type {
    r: 2.5;
    fill: #ffffff !important;
}

/* Custom styles for public theme selector */
.theme-select {
    background: rgba(255, 255, 255, 0.03);
    color: var(--text);
    border: 1px solid var(--border);
    padding: 0.45rem 2.2rem 0.45rem 0.75rem;
    border-radius: var(--radius);
    font-size: 0.82rem;
    cursor: pointer;
    font-weight: 600;
    font-family: var(--font-main);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.3s ease, color 0.3s ease;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2.5' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 0.75rem;
    backdrop-filter: blur(10px);
}

.theme-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

/* Smooth Transitions for Premium Theme Shifting */
body, .app-sidebar, .editor-sidebar, .card-glass, .public-nav, .theme-option, .btn, .stat-card, .theme-select, .form-group input, .form-group select, .form-group textarea, .sidebar-journals-box, .quill-wrapper {
    transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease, transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Mobile responsive layout overrides */
@media (max-width: 900px) {
    .workspace-header {
        padding-left: 3.5rem; /* Make room for floating menu button at top-left */
    }
}

@media (max-width: 600px) {
    .nav-container {
        padding: 0.75rem 1rem;
        gap: 0.5rem;
    }
    
    .public-logo {
        font-size: 1.15rem;
    }
    
    .theme-select {
        padding: 0.35rem 1.8rem 0.35rem 0.5rem;
        font-size: 0.75rem;
        background-position: right 0.45rem center;
        background-size: 0.65rem;
        max-width: 95px;
    }
    
    .public-nav .btn {
        padding: 0.35rem 0.75rem !important;
        font-size: 0.75rem !important;
    }
    
    /* Hide 'Get Started' on mobile when not logged in to fit logo & theme selector cleanly */
    .nav-btn-signup {
        display: none !important;
    }
    
    .workspace-header {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
        margin-bottom: 1rem;
        padding-left: 3.5rem;
    }
    
    .journal-title-input {
        font-size: 1.45rem;
    }
    
    .actions-row {
        width: 100%;
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
        justify-content: space-between;
        align-items: center;
    }
    
    .autosave-indicator {
        font-size: 0.75rem;
    }
    
    .editor-tools-row {
        padding: 0.5rem !important;
        gap: 0.4rem !important;
    }
    
    .editor-tools-row .btn {
        padding: 0.35rem 0.5rem !important;
        font-size: 0.7rem !important;
        gap: 0.25rem !important;
    }
    
    .editor-tools-row select {
        padding: 0.3rem 0.4rem !important;
        font-size: 0.7rem !important;
    }
}

@media (max-width: 480px) {
    .auth-card {
        padding: 1.5rem;
    }
}

/* Interactive Onboarding CSS Styles */
.onboarding-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(3, 7, 18, 0.6);
    backdrop-filter: blur(4px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    animation: fadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.onboarding-card {
    background: linear-gradient(135deg, #0b0f19 0%, #111827 100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 30px 60px -15px rgba(0, 0, 0, 0.8), 0 0 50px 0 rgba(129, 140, 248, 0.05);
    border-radius: var(--radius);
    padding: 2.5rem;
    max-width: 460px;
    width: 90%;
    position: relative;
    text-align: center;
    overflow: hidden;
    transform: translateY(20px);
    animation: slideUpIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.onboarding-stars {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(1px 1px at 20px 30px, #ffffff, rgba(0,0,0,0)),
        radial-gradient(1px 1px at 75px 120px, #ffffff, rgba(0,0,0,0)),
        radial-gradient(1.5px 1.5px at 150px 60px, rgba(255,255,255,0.8), rgba(0,0,0,0)),
        radial-gradient(1px 1px at 220px 180px, #ffffff, rgba(0,0,0,0)),
        radial-gradient(2px 2px at 350px 40px, rgba(129,140,248,0.5), rgba(0,0,0,0));
    opacity: 0.4;
    pointer-events: none;
}

.onboarding-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: rgba(129, 140, 248, 0.1);
    color: var(--primary);
    border: 1px solid rgba(129, 140, 248, 0.2);
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 1.25rem;
}

.onboarding-title {
    font-size: 1.35rem;
    font-weight: 700;
    margin: 0 0 0.75rem 0;
    color: #ffffff;
    line-height: 1.3;
}

.onboarding-desc {
    font-size: 0.9rem;
    color: var(--muted);
    line-height: 1.6;
    margin: 0 0 2rem 0;
}

.onboarding-progress {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.progress-step {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    transition: all 0.3s ease;
}

.progress-step.active {
    background: var(--primary);
    box-shadow: 0 0 8px var(--primary);
    width: 24px;
    border-radius: 4px;
}

.onboarding-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.onboarding-highlight {
    position: relative;
    z-index: 10001 !important;
    box-shadow: 0 0 0 9999px rgba(3, 7, 18, 0.65), 0 0 15px 3px var(--primary) !important;
    pointer-events: auto !important;
    transition: box-shadow 0.3s ease !important;
}

.onboarding-tooltip {
    position: absolute;
    background: linear-gradient(135deg, #0b0f19 0%, #111827 100%);
    border: 1px solid var(--primary);
    border-radius: var(--radius);
    padding: 1.25rem;
    width: 280px;
    z-index: 10002;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 15px rgba(129, 140, 248, 0.2);
    text-align: left;
    transform: scale(0.9);
    opacity: 0;
    animation: zoomIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.onboarding-tooltip-arrow {
    position: absolute;
    width: 0;
    height: 0;
    border-style: solid;
}

.onboarding-tooltip-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 0.5rem;
}

.onboarding-tooltip-text {
    font-size: 0.82rem;
    color: var(--muted);
    line-height: 1.5;
    margin-bottom: 1rem;
}

.onboarding-tooltip-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

@keyframes slideUpIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes zoomIn {
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

/* ==========================================================================
   7. Web Speech TTS Word Highlighting
   ========================================================================== */
.tts-word {
    transition: background 0.15s ease, color 0.15s ease, text-shadow 0.15s ease;
    border-radius: 4px;
    padding: 0 2px;
}

.tts-word.active {
    background: rgba(99, 102, 241, 0.25);
    color: var(--primary);
    text-shadow: 0 0 8px rgba(99, 102, 241, 0.4);
    font-weight: 600;
}

/* Floating Audio Player Deck */
.tts-player-container {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(120px);
    opacity: 0;
    z-index: 10000;
    width: 92%;
    max-width: 600px;
    background: radial-gradient(at 0% 0%, rgba(129, 140, 248, 0.08) 0px, transparent 50%), rgba(19, 29, 49, 0.85);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    backdrop-filter: blur(20px);
    padding: 0.75rem 1.25rem;
    box-shadow: var(--shadow), 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 25px rgba(99, 102, 241, 0.2);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s ease;
}

.tts-player-container.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.tts-player-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tts-btn {
    background: none;
    border: none;
    color: var(--text);
    cursor: pointer;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: grid;
    place-content: center;
    transition: all 0.2s ease;
    border: 1px solid rgba(255,255,255,0.05);
}

.tts-btn:hover {
    background: rgba(255,255,255,0.05);
    color: var(--primary);
    border-color: var(--border);
}

.tts-btn.play-pause-btn {
    background: var(--primary);
    color: #ffffff;
    border: none;
    box-shadow: 0 4px 10px rgba(99, 102, 241, 0.3);
}

.tts-btn.play-pause-btn:hover {
    background: var(--primary-hover);
    color: #ffffff;
}

.tts-select {
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    padding: 0.4rem 0.6rem;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
    outline: none;
}

.tts-select:focus {
    border-color: var(--primary);
}

.tts-voice-select {
    max-width: 150px;
}

.tts-close-btn {
    color: var(--muted);
    font-size: 1.4rem;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.2rem 0.5rem;
    transition: 0.2s;
}

.tts-close-btn:hover {
    color: var(--danger);
}

/* Custom ElevenLabs HTML5 Audio Player Layout & Visuals */
.tts-player-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* Premium Visualizer */
.tts-visualizer-container {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    width: 24px;
    height: 18px;
    margin-left: 0.25rem;
}

.tts-bar {
    width: 3px;
    height: 3px;
    background-color: var(--primary);
    border-radius: 1px;
    transition: height 0.2s ease;
}

.tts-visualizer-container.playing .bar1 {
    animation: bounce 0.8s ease infinite alternate;
}
.tts-visualizer-container.playing .bar2 {
    animation: bounce 0.5s ease infinite alternate 0.15s;
}
.tts-visualizer-container.playing .bar3 {
    animation: bounce 0.9s ease infinite alternate 0.05s;
}
.tts-visualizer-container.playing .bar4 {
    animation: bounce 0.6s ease infinite alternate 0.2s;
}

@keyframes bounce {
    0% {
        height: 3px;
    }
    100% {
        height: 18px;
    }
}

/* Timeline */
.tts-timeline-wrapper {
    position: relative;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    cursor: pointer;
    overflow: hidden;
}

.tts-timeline-wrapper:hover {
    background: rgba(255, 255, 255, 0.15);
}

.tts-timeline-wrapper:hover #ttsProgressBar {
    background: var(--primary-hover);
}

/* Volume Slider */
#ttsVolumeSlider {
    -webkit-appearance: none;
    appearance: none;
    background: rgba(255, 255, 255, 0.2);
    height: 4px;
    border-radius: 2px;
    outline: none;
    cursor: pointer;
    width: 60px;
}

#ttsVolumeSlider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    transition: transform 0.1s ease;
}

#ttsVolumeSlider::-webkit-slider-thumb:hover {
    transform: scale(1.3);
}

@media (max-width: 600px) {
    .tts-player-container {
        flex-direction: column;
        padding: 1rem;
        gap: 0.75rem;
        bottom: 1rem;
    }
    
    .tts-player-controls {
        width: 100%;
        justify-content: center;
    }
    
    .tts-voice-select {
        max-width: 100%;
        flex: 1;
    }
}

/* ==========================================================================
   8. AuraSound Focus Soundscape Mixer
   ========================================================================== */
.focus-mixer-card {
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.focus-mixer-row {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.focus-mixer-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    font-weight: 600;
}

.focus-mixer-label {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    color: var(--text);
}

.focus-mixer-val {
    color: var(--muted);
}

.focus-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 4px;
    border-radius: 999px;
    background: var(--border);
    outline: none;
    transition: background 0.3s;
}

.focus-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    transition: transform 0.1s ease, background 0.2s ease;
    box-shadow: 0 0 8px rgba(99,102,241,0.5);
}

.focus-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    background: var(--primary-hover);
}

/* Dancing Equalizer animation */
.equalizer-container {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 16px;
    width: 25px;
}

.equalizer-bar {
    width: 3px;
    height: 3px;
    background: var(--primary);
    border-radius: 2px;
    transition: height 0.25s ease;
}

@keyframes dance1 { 0%, 100% { height: 3px; } 50% { height: 14px; } }
@keyframes dance2 { 0%, 100% { height: 5px; } 50% { height: 11px; } }
@keyframes dance3 { 0%, 100% { height: 2px; } 50% { height: 15px; } }

.equalizer-container.playing .equalizer-bar:nth-child(1) { animation: dance1 0.8s cubic-bezier(0.4, 0, 0.2, 1) infinite; }
.equalizer-container.playing .equalizer-bar:nth-child(2) { animation: dance2 0.5s cubic-bezier(0.4, 0, 0.2, 1) infinite; }
.equalizer-container.playing .equalizer-bar:nth-child(3) { animation: dance3 0.7s cubic-bezier(0.4, 0, 0.2, 1) infinite; }

/* ==========================================================================
   9. Cosmic Elements Grid visual enhancements
   ========================================================================== */
.element-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 0.2rem 0.5rem;
    border-radius: 999px;
    letter-spacing: 0.5px;
    border: 1px solid transparent;
    user-select: none;
}

.element-badge.fire {
    background: rgba(239, 68, 68, 0.08);
    color: #ef4444;
    border-color: rgba(239, 68, 68, 0.15);
}
.element-badge.water {
    background: rgba(59, 130, 246, 0.08);
    color: #3b82f6;
    border-color: rgba(59, 130, 246, 0.15);
}
.element-badge.air {
    background: rgba(14, 165, 233, 0.08);
    color: #0ea5e9;
    border-color: rgba(14, 165, 233, 0.15);
}
.element-badge.earth {
    background: rgba(16, 185, 129, 0.08);
    color: #10b981;
    border-color: rgba(16, 185, 129, 0.15);
}
.element-badge.aether {
    background: rgba(168, 85, 247, 0.08);
    color: #a855f7;
    border-color: rgba(168, 85, 247, 0.15);
}

/* Left-accent borders on cards depending on active element */
.journal-card.el-fire { border-left: 4px solid #ef4444 !important; }
.journal-card.el-water { border-left: 4px solid #3b82f6 !important; }
.journal-card.el-air { border-left: 4px solid #0ea5e9 !important; }
.journal-card.el-earth { border-left: 4px solid #10b981 !important; }
.journal-card.el-aether { border-left: 4px solid #a855f7 !important; }

/* Tags row layout styling */
.card-tags-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.65rem;
}

.tag-pill {
    background: rgba(255,255,255,0.02);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 0.15rem 0.45rem;
    font-size: 0.72rem;
    color: var(--muted);
    font-weight: 500;
}

/* Explore filtering buttons */
.filter-pills-row {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 2rem;
}

.pill-btn {
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    padding: 0.4rem 1rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
}

.pill-btn:hover {
    background: rgba(255,255,255,0.02);
    border-color: var(--muted);
}

.pill-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #ffffff;
    box-shadow: 0 4px 10px rgba(99, 102, 241, 0.2);
}

/* ==========================================================================
   10. Scroll-driven Orbital Reading Progress Bar & Social Share Styling
   ========================================================================== */
.reading-progress-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: transparent;
    z-index: 9999;
    pointer-events: none;
}

.reading-progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(to right, var(--primary), var(--primary-hover));
    box-shadow: 0 0 8px var(--primary);
    position: relative;
    transition: width 0.1s ease-out;
}

.reading-progress-node {
    position: absolute;
    right: -4px;
    top: 50%;
    transform: translateY(-50%);
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 0 8px #ffffff, 0 0 16px var(--primary);
}

.btn-share {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.twitter-btn:hover {
    color: #1da1f2 !important;
    border-color: rgba(29, 161, 242, 0.5) !important;
    background: rgba(29, 161, 242, 0.08) !important;
    box-shadow: 0 0 10px rgba(29, 161, 242, 0.15) !important;
}

.facebook-btn:hover {
    color: #1877f2 !important;
    border-color: rgba(24, 119, 242, 0.5) !important;
    background: rgba(24, 119, 242, 0.08) !important;
    box-shadow: 0 0 10px rgba(24, 119, 242, 0.15) !important;
}

.copy-link-btn:hover {
    color: var(--primary) !important;
    border-color: rgba(129, 140, 248, 0.5) !important;
    background: rgba(129, 140, 248, 0.08) !important;
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.15) !important;
}

.copy-link-btn.copied {
    background: rgba(16, 185, 129, 0.12) !important;
    border-color: #10b981 !important;
    color: #10b981 !important;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.25) !important;
}


