/* Base Resets & Variables */
:root {
    --primary: #1a73e8;
    --primary-hover: #1557b0;
    --primary-container: #e8f0fe;
    --on-primary: #ffffff;
    --on-primary-container: #041e49;
    --secondary: #5f6368;
    --secondary-container: #e8eaed;
    --on-secondary: #ffffff;
    --on-secondary-container: #1f1f1f;
    --tertiary: #188038;
    --tertiary-container: #ceead6;
    --on-tertiary: #ffffff;
    --error: #d93025;
    --error-container: #fce8e6;
    --on-error: #ffffff;
    --on-error-container: #410e0b;
    --surface: #ffffff;
    --surface-dim: #f8f9fa;
    --surface-bright: #ffffff;
    --surface-variant: #f1f3f4;
    --surface-container-lowest: #ffffff;
    --surface-container-low: #f8f9fa;
    --surface-container: #f0f1f3;
    --surface-container-high: #e8eaed;
    --surface-container-highest: #e0e3e7;
    --background: #f8f9fa;
    --on-surface: #202124;
    --on-surface-variant: #5f6368;
    --outline: #dadce0;
    --outline-variant: #c4c7cc;
    --text-primary: #202124;
    --text-secondary: #5f6368;
    --border: #dadce0;
    --state-hover-opacity: 0.08;
    --state-focus-opacity: 0.12;
    --state-pressed-opacity: 0.16;
    --state-dragged-opacity: 0.08;
    --elevation-0: none;
    --elevation-1: 0 1px 2px 0 rgba(60, 64, 67, 0.3), 0 1px 3px 1px rgba(60, 64, 67, 0.15);
    --elevation-2: 0 1px 3px 0 rgba(60, 64, 67, 0.3), 0 4px 8px 3px rgba(60, 64, 67, 0.15);
    --elevation-3: 0 2px 6px 2px rgba(60, 64, 67, 0.15), 0 1px 2px 0 rgba(60, 64, 67, 0.3);
    --elevation-4: 0 4px 8px 3px rgba(60, 64, 67, 0.15), 0 2px 4px 0 rgba(60, 64, 67, 0.3);
    --elevation-5: 0 8px 12px 6px rgba(60, 64, 67, 0.15), 0 4px 4px 0 rgba(60, 64, 67, 0.3);
    --shadow-sm: var(--elevation-1);
    --shadow-md: var(--elevation-2);
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    --spacing-2xl: 40px;
    --spacing-3xl: 48px;
    --radius-xs: 2px;
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 9999px;
    --display-font: 'Outfit', sans-serif;
    --display-size: 3.5rem;
    --display-weight: 800;
    --display-line: 1.2;
    --headline-font: 'Outfit', sans-serif;
    --headline-size: 2.2rem;
    --headline-weight: 700;
    --headline-line: 1.3;
    --title-font: 'Outfit', sans-serif;
    --title-size: 1.25rem;
    --title-weight: 600;
    --title-line: 1.4;
    --body-font: 'Inter', sans-serif;
    --body-size: 1rem;
    --body-weight: 400;
    --body-line: 1.6;
    --body-small-size: 0.875rem;
    --body-small-weight: 400;
    --body-small-line: 1.5;
    --label-size: 0.75rem;
    --label-weight: 500;
    --label-line: 1.4;
    --transition: all 0.2s ease;
    --transition-spring: all 0.3s cubic-bezier(0.25, 0.1, 0.25, 1);
    --transition-slow: all 0.3s ease;
}

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

/* MD3 Typography Utility Classes */
.md-display-large {
    font-size: 3.5rem;
    font-weight: 400;
    line-height: 1.2;
    font-family: var(--display-font);
}

.md-headline-medium {
    font-size: 2rem;
    font-weight: 400;
    line-height: 1.3;
    font-family: var(--headline-font);
}

.md-title-large {
    font-size: 1.375rem;
    font-weight: 400;
    line-height: 1.4;
    font-family: var(--title-font);
}

.md-title-medium {
    font-size: 1rem;
    font-weight: 500;
    line-height: 1.5;
    font-family: var(--title-font);
}

.md-body-large {
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
    font-family: var(--body-font);
}

.md-body-medium {
    font-size: 0.875rem;
    font-weight: 400;
    line-height: 1.5;
    font-family: var(--body-font);
}

.md-body-small {
    font-size: 0.75rem;
    font-weight: 400;
    line-height: 1.5;
    font-family: var(--body-font);
}

.md-label-large {
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.5;
    font-family: var(--body-font);
    letter-spacing: 0.01em;
}

.md-label-medium {
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1.5;
    font-family: var(--body-font);
    letter-spacing: 0.01em;
}

body {
    font-family: 'Inter', sans-serif;
    color: var(--text-primary);
    background: var(--background);
    overflow-x: hidden;
    height: 100vh;
}

#app {
    position: relative;
    width: 100vw;
    height: 100vh;
}

/* SPA Views Routing Display */
.view {
    display: none;
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    overflow-y: auto;
}

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

/* Helpers */
.hidden {
    display: none !important;
}

/* Temporary CSS for Phase 1 Testing Layouts */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem;
    height: 64px;
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255, 255, 255, 0.68);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border-bottom: 1px solid rgba(218, 220, 224, 0.4);
    transition: box-shadow 0.3s ease, background 0.3s ease, border-color 0.3s ease;
}

.navbar-scrolled {
    box-shadow: var(--elevation-2);
    background: rgba(255, 255, 255, 0.82);
    border-bottom-color: transparent;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--primary);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-link {
    text-decoration: none;
    color: var(--text-secondary);
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-sm);
    transition: background 0.2s ease, color 0.2s ease;
    position: relative;
    overflow: hidden;
    min-height: 48px;
    display: inline-flex;
    align-items: center;
}

.nav-link:hover {
    background: rgba(60, 64, 67, 0.08);
    color: var(--text-primary);
}

.nav-link:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.nav-link:active {
    background: rgba(60, 64, 67, 0.16);
}

.btn {
    padding: 0 1.5rem;
    height: 40px;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    font-weight: 500;
    font-size: 0.875rem;
    font-family: var(--body-font);
    cursor: pointer;
    transition: box-shadow 0.2s ease, background 0.2s ease, transform 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    position: relative;
    overflow: hidden;
}

.btn:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.btn:active {
    transform: scale(0.98);
}

.btn-text {
    background: transparent;
    color: var(--primary);
    padding: 0 0.75rem;
    height: 40px;
}

.btn-text:hover {
    background: rgba(26, 115, 232, 0.08);
}

.btn-text:active {
    background: rgba(26, 115, 232, 0.16);
}

.btn-primary {
    background: var(--primary);
    color: var(--on-primary);
    box-shadow: var(--elevation-1);
}

.btn-primary:hover {
    background: var(--primary-hover);
    box-shadow: var(--elevation-3);
}

.btn-primary:active {
    box-shadow: var(--elevation-1);
}

.btn-secondary {
    background: transparent;
    border: 1px solid var(--outline);
    color: var(--primary);
}

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

.btn-secondary:active {
    background: rgba(26, 115, 232, 0.16);
}

.btn-full {
    width: 100%;
}

.onboarding-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 4rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.hero {
    text-align: center;
    margin-bottom: 4rem;
}

.hero-title {
    font-family: 'Outfit', sans-serif;
    font-size: 3.5rem;
    line-height: 1.2;
    font-weight: 800;
    margin-bottom: 1.5rem;
}

.hero-subtitle {
    font-family: 'Playfair Display', serif;
    font-size: clamp(1.15rem, 3.5vw, 1.65rem);
    font-weight: 500;
    font-style: italic;
    color: var(--text-secondary);
    max-width: 800px;
    margin: 0 auto 2rem;
    line-height: 1.5;
}

.hero-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.hero-actions .btn-primary {
    position: relative;
    z-index: 1;
    isolation: isolate;
    overflow: visible;
}

.hero-actions .btn-primary::before {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: inherit;
    background: linear-gradient(90deg, #4285f4, #ea4335, #fbbc04, #34a853, #4285f4);
    background-size: 300% 100%;
    animation: google-glow 3s linear infinite;
    z-index: -1;
    filter: blur(6px);
    opacity: 0.6;
    transition: opacity 0.3s ease, filter 0.3s ease;
}

.hero-actions .btn-primary:hover::before {
    opacity: 1;
    filter: blur(10px);
}

@keyframes google-glow {
    0% { background-position: 0% 50%; }
    100% { background-position: 300% 50%; }
}

/* Login Card Temporary styling */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    width: 100vw;
    background: transparent;
    z-index: 1;
    position: relative;
}

.login-card {
    background: var(--surface);
    padding: 3rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    width: 100%;
    max-width: 420px;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.login-card h2 {
    font-family: 'Outfit', sans-serif;
    margin-top: 1rem;
}

.input-group {
    position: relative;
    margin-bottom: 1.5rem;
    text-align: left;
}

.input-group input {
    width: 100%;
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    outline: none;
    background: transparent;
}

.input-group label {
    position: absolute;
    left: 1rem;
    top: 1rem;
    color: var(--text-secondary);
    transition: var(--transition);
    pointer-events: none;
    z-index: 2;
}

.input-group input:focus~label,
.input-group input:not(:placeholder-shown)~label {
    top: -0.5rem;
    left: 0.8rem;
    font-size: 0.75rem;
    background: var(--surface);
    padding: 0 0.3rem;
    color: var(--primary);
}

/* Editor Temporary styling for phase 1 */
#editor-view.active {
    display: flex;
    flex-direction: row;
    overflow: hidden;
}

.sidebar {
    width: 280px;
    min-width: 0;
    flex-shrink: 0;
    background: var(--surface-variant);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    border-radius: 0 20px 20px 0;
    height: 100%;
    transition: width 0.3s ease;
    overflow: hidden;
    position: relative;
    z-index: 50;
}

.sidebar.collapsed {
    width: 0;
    border-right: none;
}

.sidebar.collapsed~.editor-main .document-meta {
    padding-left: 3.5rem;
}

.editor-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    background: var(--surface);
    overflow: hidden;
}

.editor-navbar {
    display: flex;
    flex-direction: column;
    border-bottom: 1px solid var(--border);
    background: #f8f9fa;
    padding: 0.75rem 2rem;
    border-radius: 0 0 16px 16px;
}

.document-meta {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    margin-bottom: 0.5rem;
}

.note-title-field {
    font-family: 'Outfit', sans-serif;
    font-size: 1.6rem;
    font-weight: 600;
    border: none;
    background: transparent;
    outline: none;
    flex: 1;
}

.note-title-field:disabled {
    color: var(--text-secondary);
}

.canvas-workspace {
    flex: 1;
    overflow-y: auto;
    background: #f8f9fa;
    padding: 2.5rem 3rem;
    display: flex;
    justify-content: center;
}

.paper-canvas {
    background: var(--surface);
    width: min(100%, 960px);
    min-height: 1358px;
    height: auto;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.05);
    padding: 4.5rem 5rem;
    border-radius: 16px;
    position: relative;
}

.editor-content-area {
    width: 100%;
    height: 100%;
    outline: none;
    font-size: 1.1rem;
    line-height: 1.6;
}

.editor-content-area[contenteditable="false"] {
    cursor: not-allowed;
    opacity: 0.6;
}

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

.sidebar-actions {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
}

.nav-section-title {
    font-size: 0.75rem;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.folders-list,
.uncategorized-list {
    margin-bottom: 1.5rem;
}

.folder-item {
    margin-bottom: 0.5rem;
}

.folder-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem;
    cursor: pointer;
    font-weight: 600;
    border-radius: 14px;
}

.folder-header:hover {
    background: rgba(0, 0, 0, 0.05);
}

.notes-list {
    margin-left: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    margin-top: 0.2rem;
}

.note-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.6rem;
    cursor: pointer;
    border-radius: 14px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.note-item:hover,
.note-item.active {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-primary);
}

.note-item.active {
    background: var(--primary-container);
    color: var(--primary);
    font-weight: 500;
}

.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 0 0 20px 0;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

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

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

.user-status {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-card {
    background: var(--surface);
    padding: 2rem;
    border-radius: var(--radius-lg);
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

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

/* Custom Dialog Additions */
.dialog-card {
    max-width: 400px;
}

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

/* @ Block Menu Popover */
.at-menu {
    position: absolute;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    width: 250px;
    z-index: 500;
    max-height: 280px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.at-menu-header {
    font-size: 0.75rem;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--text-secondary);
    padding: 0.6rem 0.8rem;
    border-bottom: 1px solid var(--border);
}

.at-menu-item {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.6rem 0.8rem;
    background: transparent;
    border: none;
    cursor: pointer;
    text-align: left;
    width: 100%;
    font-family: inherit;
    transition: var(--transition);
}

.at-menu-item:hover,
.at-menu-item.active {
    background: var(--primary-container);
    color: var(--primary);
}

.at-menu-item .material-symbols-outlined {
    font-size: 20px;
    color: var(--text-secondary);
}

.at-menu-item:hover .material-symbols-outlined,
.at-menu-item.active .material-symbols-outlined {
    color: var(--primary);
}

.at-menu-item .item-text {
    display: flex;
    flex-direction: column;
}

.at-menu-item .item-title {
    font-size: 0.85rem;
    font-weight: 600;
}

.at-menu-item .item-desc {
    font-size: 0.7rem;
    color: var(--text-secondary);
}

/* Custom Editor Blocks Formatting */
.editor-content-area h1 {
    font-family: 'Outfit', sans-serif;
    font-size: 2.2rem;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.editor-content-area h2 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.6rem;
    margin-top: 1.2rem;
    margin-bottom: 0.4rem;
    font-weight: 600;
}

.editor-content-area p {
    margin-bottom: 0.8rem;
}

.editor-content-area ul {
    margin-left: 1.5rem;
    margin-bottom: 0.8rem;
}

.editor-content-area li {
    margin-bottom: 0.3rem;
}

.editor-content-area hr {
    border: 0;
    border-top: 2px solid var(--border);
    margin: 1.5rem 0;
}

.editor-content-area .callout-box {
    background: #f1f3f4;
    border-left: 4px solid var(--primary);
    padding: 1rem;
    border-radius: var(--radius-sm);
    margin: 1rem 0;
    display: flex;
    gap: 0.8rem;
    align-items: flex-start;
}

/* ==========================================
   BRAND & ICON CLASSES
   ========================================== */

.brand-icon {
    font-size: 1.5rem;
    color: var(--primary);
}

.brand-name {
    font-family: var(--title-font);
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--primary);
    letter-spacing: 0.02em;
}

.avatar-icon {
    font-size: 2rem;
    color: var(--primary);
}

/* ==========================================
   BUTTON VARIANTS
   ========================================== */

.btn-outline {
    background: transparent;
    border-color: var(--outline);
    color: var(--text-primary);
}

.btn-outline:hover {
    background: var(--surface-variant);
}

.btn-small {
    padding: 0.35rem 0.75rem;
    font-size: 0.85rem;
}

.btn-large {
    height: 56px;
    padding: 0 2.5rem;
    font-size: 1.1rem;
    border-radius: var(--radius-xl);
    letter-spacing: 0.01em;
}

.hero-actions .btn-large {
    height: 60px;
    padding: 0 3rem;
    font-size: 1.15rem;
    border-radius: var(--radius-xl);
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease, background 0.2s ease;
}

.hero-actions .btn-large:hover {
    transform: scale(1.08);
}

.icon-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--radius-full);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
    min-width: 48px;
    min-height: 48px;
    position: relative;
    overflow: hidden;
}

.icon-btn:hover {
    background: rgba(60, 64, 67, 0.08);
    color: var(--text-primary);
}

.icon-btn:active {
    transform: scale(0.92);
}

.text-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    transition: var(--transition);
}

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

/* ==========================================
   TOOLBAR CLASSES
   ========================================== */

.toolbar-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0;
    flex-wrap: wrap;
}

.toolbar-section {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.toolbar-divider {
    width: 1px;
    height: 28px;
    background: var(--outline);
    margin: 0 0.3rem;
}

.toolbar-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0.5rem 0.65rem;
    border-radius: 14px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    position: relative;
    height: 40px;
}

.toolbar-btn:hover {
    background: var(--surface-variant);
    color: var(--text-primary);
}

.toolbar-btn:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.toolbar-btn.active {
    background: var(--primary-container);
    color: var(--primary);
}

.toolbar-btn .material-symbols-outlined {
    font-size: 22px;
}

.toolbar-select {
    padding: 0.45rem 0.7rem;
    border: 1px solid var(--outline);
    border-radius: 14px;
    font-family: inherit;
    font-size: 0.9rem;
    background: var(--surface);
    color: var(--text-primary);
    cursor: pointer;
    outline: none;
    max-width: 180px;
    height: 40px;
}

.toolbar-select:hover {
    border-color: var(--primary);
}

.toolbar-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-container);
}

.select-wrapper {
    display: inline-flex;
    align-items: center;
}

.toolbar-size-select {
    width: 95px;
    max-width: 95px;
    text-align: center;
}

/* ==========================================
   ONBOARDING / FEATURES
   ========================================== */

.gradient-text {
    background: linear-gradient(135deg, var(--primary) 0%, #9334e6 50%, #e84393 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.features-section {
    width: 100%;
    max-width: 1100px;
    margin: 2rem auto;
    padding: 2rem 0;
}

.section-title {
    font-family: var(--headline-font);
    font-size: 2rem;
    font-weight: var(--headline-weight);
    text-align: center;
    margin-bottom: 2.5rem;
    color: var(--text-primary);
}

.features-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--spacing-lg);
    padding: 0 var(--spacing-md);
}

.feature-card {
    flex: 1 1 280px;
    max-width: 340px;
    background: var(--surface);
    border: 1px solid var(--outline);
    border-radius: var(--radius-xl);
    padding: var(--spacing-xl) var(--spacing-lg);
    text-align: left;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.4s ease-out, transform 0.4s ease-out, box-shadow 0.3s ease, border-color 0.3s ease;
    box-shadow: var(--elevation-1);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.feature-card.revealed {
    opacity: 1;
    transform: translateY(0);
}

.feature-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--elevation-3);
    border-color: var(--primary);
}

@media (prefers-reduced-motion: reduce) {
    .feature-card {
        opacity: 1;
        transform: none;
        transition: none;
    }
}

.feature-icon {
    font-size: 1.5rem;
    color: var(--primary);
    background: var(--primary-container);
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--spacing-xs);
}

.feature-card h3 {
    font-family: 'Playfair Display', serif;
    font-size: 1.2rem;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.feature-card p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.feature-card code {
    font-family: 'Space Mono', monospace;
    font-size: 0.85em;
    background: var(--surface-variant);
    padding: 0.1em 0.4em;
    border-radius: var(--radius-xs);
    color: var(--primary);
}

/* ==========================================
   FOOTER
   ========================================== */

.footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-md) var(--spacing-xl);
    border-top: 1px solid var(--border);
    background: var(--surface);
    margin-top: auto;
}

.footer-left {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.footer-left .md-body-small {
    font-size: 0.85rem;
}

.footer-right {
    display: flex;
    gap: var(--spacing-md);
    align-items: center;
}

.footer-link {
    font-size: 0.85rem;
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
}

.footer-link:hover {
    text-decoration: underline;
    color: var(--primary-hover);
}

/* ==========================================
   LOGIN PAGE SPECIFIC
   ========================================== */

.outline-glow {
    position: absolute;
    inset: -2px;
    border-radius: var(--radius-sm);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.input-group input:focus~.outline-glow,
.input-group input:not(:placeholder-shown)~.outline-glow {
    opacity: 1;
}

.divider-text {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin: 0.5rem 0;
}

.divider-text::before,
.divider-text::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--outline);
}

.login-footer {
    margin-top: var(--spacing-sm);
    display: flex;
    justify-content: center;
}

/* ==========================================
   SIDEBAR SPECIFIC
   ========================================== */

.sidebar-tags {
    padding: var(--spacing-sm) var(--spacing-md);
    border-top: 1px solid var(--border);
}

.tags-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 0.25rem 0;
}

.tag-chip {
    font-size: 11px;
    padding: 0.2rem 0.5rem;
    background: #e8f0fe;
    color: #1a73e8;
    border-radius: 12px;
    cursor: pointer;
    margin: 2px;
    display: inline-block;
    font-weight: 500;
    transition: var(--transition);
}

.tag-chip:hover {
    background: var(--primary);
    color: var(--on-primary);
}

/* ==========================================
   EDITOR - FLOATING TOOLBAR
   ========================================== */

.floating-toolbar {
    position: absolute;
    background: var(--surface);
    border: 1px solid var(--outline);
    border-radius: var(--radius-md);
    box-shadow: var(--elevation-3);
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 4px;
    z-index: 800;
    opacity: 0;
    transform: translateY(4px) scale(0.95);
    transition: opacity 0.15s ease, transform 0.15s ease;
    pointer-events: none;
}

.floating-toolbar.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.floating-toolbar::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: var(--outline);
}

.float-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0.3rem;
    border-radius: var(--radius-xs);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.float-btn:hover {
    background: var(--surface-variant);
    color: var(--text-primary);
}

.float-btn .material-symbols-outlined {
    font-size: 18px;
}

/* ==========================================
   EDITOR - SAVE STATUS
   ========================================== */

.save-status {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    padding: 0.4rem 1rem;
    border-radius: 16px;
    background: var(--surface-variant);
}


/* ==========================================
   EDITOR - FOOTER TAGS
   ========================================== */

.editor-footer {
    border-top: 1px solid var(--border);
    background: var(--surface);
    padding: 0.5rem var(--spacing-md);
    border-radius: 16px 16px 0 0;
}

.note-tags-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.note-tags-list {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: center;
}

.note-tag-item {
    font-size: 11px;
    padding: 0.2rem 0.5rem;
    background: #f1f3f4;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    font-weight: 500;
}

.remove-tag-btn {
    font-size: 12px;
    cursor: pointer;
    color: var(--text-secondary);
    transition: var(--transition);
}

.remove-tag-btn:hover {
    color: var(--error);
}

.add-tag-field {
    border: none;
    background: transparent;
    outline: none;
    font-family: inherit;
    font-size: 0.85rem;
    color: var(--text-primary);
    min-width: 80px;
    padding: 0.2rem 0;
}

.add-tag-field:disabled {
    color: var(--text-secondary);
    cursor: not-allowed;
}

.add-tag-field::placeholder {
    color: var(--text-secondary);
}

/* ==========================================
   MODAL / DIALOG
   ========================================== */

.modal-body {
    margin: var(--spacing-sm) 0;
}

.modal-body h4 {
    font-family: var(--title-font);
    font-size: 1rem;
    margin-top: var(--spacing-md);
    margin-bottom: var(--spacing-xs);
}

.modal-body p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: var(--spacing-sm);
}

.modal-body ul {
    list-style: disc;
    padding-left: var(--spacing-lg);
    font-size: 0.9rem;
    line-height: 1.8;
}

/* ==========================================
   SIDEBAR EXPAND BUTTON (when collapsed)
   ========================================== */

#sidebar-expand-btn {
    position: fixed;
    top: 0.5rem;
    left: 0.5rem;
    z-index: 100;
    background: var(--surface);
    border: 1px solid var(--outline);
    border-radius: var(--radius-md);
    box-shadow: var(--elevation-1);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

#sidebar-expand-btn.hidden {
    opacity: 0;
    transform: scale(0.8);
    pointer-events: none;
}

/* ==========================================
   NOTE ITEM DELETE BUTTON
   ========================================== */

.delete-note-btn {
    margin-left: auto;
    font-size: 16px;
    display: none;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
}

.delete-note-btn:hover {
    color: var(--error);
}

.delete-note-btn.visible {
    display: inline-flex;
}

/* Folder header action buttons */
.folder-header .add-note-to-folder-btn {
    margin-left: auto;
    font-size: 18px;
    cursor: pointer;
    color: var(--text-secondary);
    transition: var(--transition);
}

.folder-header .add-note-to-folder-btn:hover {
    color: var(--primary);
}

.folder-header .delete-folder-btn {
    font-size: 18px;
    cursor: pointer;
    color: var(--text-secondary);
    transition: var(--transition);
}

.folder-header .delete-folder-btn:hover {
    color: var(--error);
}

/* ==========================================
   TAGS EMPTY STATE
   ========================================== */

.tags-empty-state {
    font-size: 12px;
    color: var(--text-secondary);
    padding: 0.5rem 0;
}

/* ==========================================
   CALLOUT BOX CHILDREN
   ========================================== */

.callout-icon {
    color: var(--primary);
}

.callout-content {
    flex: 1;
}

/* ==========================================
   PHASE 4: CANVAS WAVE BACKGROUND
   ========================================== */

#onboarding-view {
    position: relative;
}

#login-view {
    position: relative;
    background: var(--background);
}

#onboarding-wave-canvas,
#login-wave-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 0;
    pointer-events: auto;
}

#onboarding-view>*:not(canvas) {
    position: relative;
    z-index: 1;
}

#login-view .login-container {
    position: relative;
    z-index: 1;
}

/* ==========================================
   PHASE 4: ENHANCED INPUT GLOW EFFECTS
   ========================================== */

.input-group .outline-glow {
    position: absolute;
    inset: -3px;
    border-radius: 6px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -1;
}

.input-group input:focus~.outline-glow {
    opacity: 1;
    background: linear-gradient(90deg, #4285f4, #ea4335, #fbbc04, #34a853, #4285f4);
    background-size: 300% 100%;
    animation: glow-slide 2.5s linear infinite;
    filter: blur(3px);
}

.input-group input:hover~.outline-glow {
    opacity: 0.5;
    background: linear-gradient(90deg, #4285f4, #ea4335, #fbbc04, #34a853);
    background-size: 300% 100%;
    animation: glow-slide 3s linear infinite;
    filter: blur(2px);
}

.input-group input:focus:hover~.outline-glow {
    opacity: 1;
    filter: blur(4px);
}

@keyframes glow-slide {
    0% {
        background-position: 0% 50%;
    }

    100% {
        background-position: 300% 50%;
    }
}

/* Input transition smoothness */
.input-group input {
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
    position: relative;
    z-index: 1;
}

.input-group input:focus {
    border-color: transparent;
    box-shadow: 0 0 0 2px rgba(26, 115, 232, 0.15);
}

/* ==========================================
   PHASE 4: AUTOSAVE STATUS ANIMATIONS
   ========================================== */

.save-status.saving {
    background: #e8f0fe;
    color: var(--primary);
}

.save-status.saved {
    background: #e6f4ea;
    color: var(--tertiary);
}


/* ==========================================
   PHASE 4: MOBILE-RESPONSIVE ADJUSTMENTS
   ========================================== */

@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        height: 100%;
        z-index: 200;
        width: 280px;
        transform: translateX(0);
        transition: transform 0.3s ease, width 0.3s ease;
        box-shadow: var(--elevation-4);
    }

    .sidebar.collapsed {
        transform: translateX(-100%);
        width: 280px;
        border-right: none;
    }

    .sidebar.collapsed~.editor-main .document-meta {
        padding-left: 3.5rem;
    }

    #sidebar-expand-btn {
        display: flex !important;
        z-index: 150;
    }

    .editor-navbar {
        padding: 0.5rem 1rem;
    }

    .note-title-field {
        font-size: 1.1rem;
        max-width: 160px;
    }

    .canvas-workspace {
        padding: 0.5rem;
    }

    .paper-canvas {
        padding: 1.25rem;
        min-height: 600px;
    }

    .toolbar-wrapper {
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
        padding: 0.25rem 0;
    }

    .toolbar-wrapper::-webkit-scrollbar {
        height: 2px;
    }

    .toolbar-wrapper::-webkit-scrollbar-thumb {
        background: var(--outline);
        border-radius: 2px;
    }

    .toolbar-select {
        max-width: 110px;
        font-size: 0.75rem;
    }

    .toolbar-size-select {
        width: 75px;
        max-width: 75px;
    }

    .toolbar-btn {
        padding: 0.4rem 0.5rem;
    }

    .editor-content-area {
        font-size: 1rem;
    }

    .login-card {
        padding: 1.5rem;
        margin: 0 1rem;
        max-width: 100%;
    }

    /* Mobile overlay when sidebar is open */
    .sidebar-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.3);
        z-index: 199;
    }

    .sidebar-overlay.active {
        display: block;
    }

    .hero-title {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .features-grid {
        grid-template-columns: 1fr;
    }

    .footer {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }

    .save-status {
        font-size: 0.7rem;
        padding: 0.2rem 0.5rem;
    }

    .note-tags-container {
        gap: 0.3rem;
    }

    .add-tag-field {
        min-width: 60px;
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .paper-canvas {
        padding: 0.75rem;
        min-height: 500px;
    }

    .navbar {
        padding: 0 1rem;
        height: 56px;
    }

    .nav-links {
        gap: 0.75rem;
    }

    .nav-links .nav-link {
        display: none;
    }

    .onboarding-content {
        padding: 2rem 1rem;
    }

    .login-card {
        padding: 1.25rem;
    }

    .document-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }

    .floating-toolbar {
        padding: 2px;
        gap: 1px;
    }
}

/* Sidebar overlay element in DOM */
#sidebar-overlay {
    display: none;
}

@media (max-width: 768px) {
    #sidebar-overlay.active {
        display: block;
    }
}

/* ================================================== */
/* PAGED EDITOR STYLES (Material Design 3) */
/* ================================================== */

/* Main Paged Editor Container */
.paged-editor-main {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 80px);
    background: var(--surface-dim);
    padding: var(--spacing-lg);
    gap: var(--spacing-md);
    overflow-y: auto;
}

/* Pages Container */
.pages-container {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xl);
    align-items: center;
    flex: 1;
    overflow-y: auto;
    padding-bottom: var(--spacing-xl);
}

/* Single Page (MD3 Paper Aesthetic) */
.md-page {
    width: 210mm;
    height: 297mm;
    background: var(--surface);
    box-shadow: var(--shadow-md);
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    padding: 20mm 15mm;
    gap: var(--spacing-md);
    page-break-after: always;
    page-break-inside: avoid;
    position: relative;
    overflow: hidden;
}

/* Page Header */
.md-page-header {
    border-bottom: 1px solid var(--border);
    padding-bottom: var(--spacing-md);
    min-height: 30mm;
    display: flex;
    align-items: center;
    justify-content: flex-start;
}

.md-page-header-text {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.md-page-header-text.md-title-level-1 {
    font-size: 1.5rem;
    color: var(--text-primary);
    font-weight: 600;
}

.md-page-header-text.md-title-level-2 {
    font-size: 1.25rem;
    color: var(--text-primary);
    font-weight: 500;
}

.md-page-header-text.md-title-level-3 {
    font-size: 1rem;
    color: var(--text-secondary);
    font-weight: 400;
}

/* Page Body (Editable Content) */
.md-page-body {
    flex: 1;
    overflow-y: auto;
    padding: var(--spacing-md) 0;
    font-size: 1.1rem;
    line-height: 1.6;
    color: var(--text-primary);
}

.md-page-body [contenteditable] {
    outline: none;
    cursor: text;
}

.md-page-body [contenteditable]:focus {
    background: rgba(26, 115, 232, 0.02);
    border-radius: var(--radius-sm);
}

/* Page Footer */
.md-page-footer {
    border-top: 1px solid var(--border);
    padding-top: var(--spacing-md);
    min-height: 10mm;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    color: var(--text-secondary);
}

.md-page-number {
    font-size: 0.875rem;
    font-weight: 500;
}

.md-autoscale-warning {
    font-size: 0.75rem;
    color: #5f6368;
    background: #fef7e0;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    margin-top: 0.25rem;
    display: inline-block;
}

/* Pagination Controls */
.pagination-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-lg);
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    position: sticky;
    bottom: 0;
    z-index: 100;
}

.md-page-controls {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    width: 100%;
    justify-content: center;
}

.md-page-indicator {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    background: var(--surface-variant);
    padding: 0 var(--spacing-md);
    border-radius: var(--radius-md);
    height: 40px;
}

.md-page-input {
    width: 50px;
    padding: var(--spacing-sm);
    border: none;
    background: transparent;
    text-align: center;
    font-weight: 500;
    color: var(--text-primary);
    font-size: 1rem;
}

.md-page-input:focus {
    outline: none;
}

.md-page-label {
    color: var(--text-secondary);
    white-space: nowrap;
}

/* Paged Editor Toolbar */
.paged-editor-toolbar {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md) var(--spacing-lg);
    flex-wrap: wrap;
}

.toolbar-title {
    margin: 0;
    color: var(--text-primary);
    flex-shrink: 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .md-page {
        width: 100%;
        max-width: 100%;
        height: auto;
        min-height: 500px;
        padding: var(--spacing-lg) var(--spacing-md);
    }
    
    .pages-container {
        padding: var(--spacing-md);
    }
    
    .paged-editor-toolbar {
        flex-wrap: wrap;
    }
    
    .pagination-controls {
        flex-wrap: wrap;
    }
    
    .md-page-controls {
        flex-wrap: wrap;
    }
}

/* Print Styles */
@media print {
    .paged-editor-toolbar,
    .pagination-controls,
    .pages-container {
        display: none;
    }
    
    #print-container,
    .print-container {
        display: block !important;
        margin: 0;
        padding: 0;
    }
    
    #print-container .md-page,
    .print-container .md-page,
    .md-page.print-preview {
        width: 100%;
        height: auto;
        min-height: 0;
        box-shadow: none;
        page-break-after: always;
        break-after: page;
        margin: 0;
        padding: 20mm 15mm;
        border: none;
        border-radius: 0;
        background: white;
    }
    
    #print-container .md-page:last-child,
    .print-container .md-page:last-child,
    .md-page.print-preview:last-child {
        page-break-after: avoid;
        break-after: avoid;
    }
    
    #print-container .md-page-header,
    .print-container .md-page-header,
    #print-container .md-page-footer,
    .print-container .md-page-footer {
        display: block;
    }
    
    #print-container .md-page-body,
    .print-container .md-page-body {
        overflow: visible;
        max-height: none;
    }
}

/* ==========================================
   SCROLLBAR STYLING
   ========================================== */

::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

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

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

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

/* ==========================================
   DARK MODE THEME
   ========================================== */

[data-theme="dark"] {
    --primary: #8ab4f8;
    --primary-hover: #aecbfa;
    --primary-container: #004a77;
    --on-primary: #003258;
    --on-primary-container: #d3e3fd;
    --secondary: #bdc1c6;
    --secondary-container: #3c4043;
    --on-secondary: #303134;
    --on-secondary-container: #e8eaed;
    --tertiary: #81c995;
    --tertiary-container: #0d652d;
    --on-tertiary: #003919;
    --error: #f28b82;
    --error-container: #8c1d18;
    --on-error: #601410;
    --on-error-container: #f9dedc;
    --surface: #1e1e1e;
    --surface-dim: #141414;
    --surface-bright: #2d2d2d;
    --surface-variant: #2d2d2d;
    --surface-container-lowest: #0e0e0e;
    --surface-container-low: #1a1a1a;
    --surface-container: #232323;
    --surface-container-high: #2d2d2d;
    --surface-container-highest: #383838;
    --background: #121212;
    --on-surface: #e8eaed;
    --on-surface-variant: #bdc1c6;
    --outline: #5f6368;
    --outline-variant: #444746;
    --text-primary: #e8eaed;
    --text-secondary: #9aa0a6;
    --border: #3c4043;
}

[data-theme="dark"] body {
    color-scheme: dark;
}

[data-theme="dark"] .login-card {
    background: var(--surface);
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .input-group input {
    color: var(--text-primary);
    border-color: var(--border);
}

[data-theme="dark"] .input-group input:focus~label,
[data-theme="dark"] .input-group input:not(:placeholder-shown)~label {
    background: var(--surface);
    color: var(--primary);
}

[data-theme="dark"] .feature-card {
    background: var(--surface-bright);
    border-color: var(--border);
}

[data-theme="dark"] .feature-card:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .editor-navbar {
    background: var(--surface-dim);
}

[data-theme="dark"] .canvas-workspace {
    background: var(--background);
}

[data-theme="dark"] .paper-canvas {
    background: var(--surface);
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .note-title-field {
    color: var(--text-primary);
}

[data-theme="dark"] .note-title-field:disabled {
    color: var(--text-secondary);
}

[data-theme="dark"] .editor-content-area .callout-box {
    background: var(--surface-container);
    border-left-color: var(--primary);
}

[data-theme="dark"] .tag-chip {
    background: var(--primary-container);
    color: var(--primary);
}

[data-theme="dark"] .note-tag-item {
    background: var(--surface-container);
    color: var(--text-primary);
}

[data-theme="dark"] .add-tag-field {
    color: var(--text-primary);
}

[data-theme="dark"] .toolbar-select {
    background: var(--surface-container);
    color: var(--text-primary);
    border-color: var(--border);
}

[data-theme="dark"] .navbar {
    background: rgba(30, 30, 30, 0.68);
    border-bottom-color: rgba(60, 64, 67, 0.4);
}

[data-theme="dark"] .navbar-scrolled {
    background: rgba(30, 30, 30, 0.82);
    border-bottom-color: transparent;
}

[data-theme="dark"] .nav-link:hover {
    background: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .nav-link:active {
    background: rgba(255, 255, 255, 0.16);
}

[data-theme="dark"] .footer {
    background: var(--surface);
    border-top-color: var(--border);
}

[data-theme="dark"] .save-status {
    background: var(--surface-container);
}

[data-theme="dark"] .save-status.saving {
    background: var(--primary-container);
    color: var(--primary);
}

[data-theme="dark"] .save-status.saved {
    background: var(--tertiary-container);
    color: var(--tertiary);
}

[data-theme="dark"] .save-as-btn {
    color: var(--text-secondary);
}

[data-theme="dark"] .save-as-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
}

[data-theme="dark"] .modal-overlay {
    background: rgba(0, 0, 0, 0.7);
}

[data-theme="dark"] .modal-card {
    background: var(--surface-bright);
}

[data-theme="dark"] .at-menu {
    background: var(--surface-bright);
    border-color: var(--border);
}

[data-theme="dark"] .at-menu-item:hover,
[data-theme="dark"] .at-menu-item.active {
    background: var(--primary-container);
    color: var(--primary);
}

[data-theme="dark"] .floating-toolbar {
    background: var(--surface-bright);
    border-color: var(--border);
}

[data-theme="dark"] .sidebar {
    background: var(--surface-dim);
    border-right-color: var(--border);
}

[data-theme="dark"] .folder-header:hover {
    background: rgba(255, 255, 255, 0.06);
}

[data-theme="dark"] .note-item:hover {
    background: rgba(255, 255, 255, 0.06);
}

[data-theme="dark"] .note-item.active {
    background: var(--primary-container);
    color: var(--primary);
}

[data-theme="dark"] .icon-btn:hover {
    background: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .btn-text:hover {
    background: rgba(138, 180, 248, 0.08);
    color: var(--text-primary);
}

[data-theme="dark"] .btn-secondary {
    background: transparent;
    border-color: var(--outline);
    color: var(--primary);
}

[data-theme="dark"] .btn-secondary:hover {
    background: rgba(138, 180, 248, 0.08);
}

[data-theme="dark"] .divider-text::before,
[data-theme="dark"] .divider-text::after {
    background: var(--border);
}

[data-theme="dark"] #sidebar-expand-btn {
    background: var(--surface-bright);
    border-color: var(--border);
}

[data-theme="dark"] .gradient-text {
    background: linear-gradient(135deg, #8ab4f8 0%, #c58af9 50%, #f48fb1 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

[data-theme="dark"] .md-autoscale-warning {
    color: #e8eaed;
    background: #332a00;
}

/* Dark mode theme toggle icon swap */
[data-theme="dark"] .theme-toggle-icon::after {
    content: 'light_mode';
}

[data-theme="dark"] ::-webkit-scrollbar-thumb {
    background: var(--outline);
}

[data-theme="dark"] ::-webkit-scrollbar-thumb:hover {
    background: var(--outline-variant);
}