:root {
    --a4notes-bg-primary: #000000;
    --a4notes-bg-secondary: #0a0a0a;
    --a4notes-bg-tertiary: #1a1a1a;
    --a4notes-bg-glass: rgba(26, 26, 26, 0.8);
    --a4notes-text-primary: #ffffff;
    --a4notes-text-secondary: #8e8e93;
    --a4notes-border: rgba(255, 255, 255, 0.1);
    --a4notes-accent: #fe00ca;
    --a4notes-accent-hover: #cc00a0;
    --a4notes-accent-glow: rgba(254, 0, 202, 0.5);
    --a4notes-success: #30d158;
    --a4notes-success-glow: rgba(48, 209, 88, 0.5);
    --a4notes-sidebar-width: 320px;
    --a4notes-border-radius: 16px;
    --a4notes-border-radius-lg: 24px;
    --a4notes-transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --a4notes-transition-normal: 0.5s cubic-bezier(0.33, 1, 0.68, 1);
    --a4notes-transition-slow: 0.8s cubic-bezier(0.33, 1, 0.68, 1);
    --a4notes-spring: 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    --a4notes-shadow-sm: 0 2px 12px rgba(0, 0, 0, 0.3);
    --a4notes-shadow-md: 0 8px 32px rgba(0, 0, 0, 0.4);
    --a4notes-shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.5);
    --a4notes-shadow-glow: 0 0 40px var(--a4notes-accent-glow);
    --a4notes-editor-light-bg: #f5f6fb;
    --a4notes-editor-light-surface: rgba(255, 255, 255, 0.92);
    --a4notes-editor-light-surface-strong: rgba(255, 255, 255, 0.98);
    --a4notes-editor-light-text: #151515;
    --a4notes-editor-light-muted: #616161;
    --a4notes-editor-light-border: rgba(0, 0, 0, 0.08);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Montserrat Alternates', -apple-system, BlinkMacSystemFont, sans-serif;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

body {
    background-color: var(--a4notes-bg-primary);
    color: var(--a4notes-text-primary);
    overflow: hidden;
    cursor: default;
}

input,
textarea {
    caret-color: var(--a4notes-accent);
}

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

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

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    transition: background var(--a4notes-transition-normal);
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(254, 0, 202, 0.6);
}

::-webkit-scrollbar-thumb:active {
    background: var(--a4notes-accent);
}

.a4notes-welcome-screen {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    background: #000000;
    overflow: hidden;
    width: 100vw;
    height: 100vh;
    min-height: 100vh;
}

.a4notes-install-btn {
    position: absolute;
    top: 20px;
    left: 20px;
    width: 42px;
    height: 42px;
    padding: 0;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--a4notes-border);
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--a4notes-spring);
    backdrop-filter: blur(10px);
    z-index: 10;
}

.a4notes-install-btn:hover {
    background: var(--a4notes-accent);
    border-color: var(--a4notes-accent);
    transform: scale(1.15) rotate(10deg);
    box-shadow: 0 8px 25px var(--a4notes-accent-glow);
}

.a4notes-install-btn:active {
    transform: scale(0.95) rotate(5deg);
}

.a4notes-install-btn svg {
    width: 20px;
    height: 20px;
    color: var(--a4notes-text-primary);
    transition: all var(--a4notes-transition-normal);
}

.a4notes-install-btn:hover svg {
    color: #ffffff;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.a4notes-install-btn.a4notes-hidden {
    display: none;
}

.a4notes-welcome-screen::before {
    content: '';
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(circle at 25% 30%, rgba(254, 0, 202, 0.48) 0%, rgba(254, 0, 202, 0) 60%),
        radial-gradient(circle at 78% 65%, rgba(0, 160, 255, 0.38) 0%, rgba(0, 160, 255, 0) 62%),
        radial-gradient(circle at 50% 50%, rgba(254, 0, 202, 0.3) 0%, transparent 72%);
    animation: a4notes-bg-breathe 6s ease-in-out infinite;
    will-change: transform, opacity;
    filter: saturate(130%);
}

.a4notes-welcome-screen::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(from 0deg, transparent 0deg, rgba(254, 0, 202, 0.15) 70deg, transparent 180deg);
    animation: a4notes-bg-rotate 20s linear infinite;
    will-change: transform;
    opacity: 0.9;
}

@keyframes a4notes-bg-breathe {
    0%, 100% {
        transform: scale(1);
        opacity: 0.5;
    }
    50% {
        transform: scale(1.3);
        opacity: 0.8;
    }
}

@keyframes a4notes-bg-rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.a4notes-welcome-content {
    text-align: center;
    padding: 50px;
    max-width: 480px;
    width: 100%;
    animation: a4notes-welcome-enter 1.2s var(--a4notes-spring);
    transform-origin: center;
    position: relative;
    z-index: 1;
}

@keyframes a4notes-welcome-enter {
    0% {
        opacity: 0;
        transform: scale(0.8) translateY(50px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.a4notes-welcome-icon {
    width: 90px;
    height: 90px;
    background: linear-gradient(135deg, var(--a4notes-accent) 0%, var(--a4notes-accent-hover) 100%);
    border-radius: 28px;
    margin: 0 auto 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--a4notes-shadow-lg), var(--a4notes-shadow-glow);
    animation: a4notes-icon-float 4s ease-in-out infinite;
    position: relative;
    overflow: hidden;
}

@keyframes a4notes-icon-float {
    0%, 100% {
        transform: translateY(0px) rotate(-2deg);
        box-shadow: var(--a4notes-shadow-lg), 0 0 40px var(--a4notes-accent-glow);
    }
    50% {
        transform: translateY(-20px) rotate(2deg);
        box-shadow: var(--a4notes-shadow-lg), 0 0 80px var(--a4notes-accent-glow);
    }
}

.a4notes-welcome-icon svg {
    width: 50px;
    height: 50px;
    color: #ffffff;
    position: relative;
    z-index: 1;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}

.a4notes-welcome-content h1 {
    font-size: 72px;
    font-weight: 900;
    margin-bottom: 25px;
    letter-spacing: -3px;
    background: linear-gradient(135deg, #ffffff 0%, #999999 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: a4notes-title-shimmer 4s ease-in-out infinite;
    background-size: 200% 200%;
}

@keyframes a4notes-title-shimmer {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.a4notes-encrypted-indicator {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--a4notes-success);
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 35px;
    padding: 10px 20px;
    background: rgba(48, 209, 88, 0.1);
    border: 1px solid rgba(48, 209, 88, 0.3);
    border-radius: 20px;
    animation: a4notes-indicator-pulse 2.5s ease-in-out infinite;
    backdrop-filter: blur(10px);
}

@keyframes a4notes-indicator-pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(48, 209, 88, 0.7);
    }
    50% {
        transform: scale(1.03);
        box-shadow: 0 0 0 10px rgba(48, 209, 88, 0);
    }
}

.a4notes-encrypted-indicator svg {
    width: 20px;
    height: 20px;
}

.a4notes-welcome-content input {
    width: 100%;
    padding: 20px 26px;
    background: var(--a4notes-bg-glass);
    border: 1.5px solid var(--a4notes-border);
    border-radius: 35px;
    color: var(--a4notes-text-primary);
    font-size: 17px;
    font-family: inherit;
    margin-bottom: 20px;
    transition: all var(--a4notes-transition-slow);
    outline: none;
    backdrop-filter: blur(20px);
}

.a4notes-welcome-content input:focus {
    border-color: var(--a4notes-accent);
    transform: scale(1.02);
    box-shadow: 0 0 40px var(--a4notes-accent-glow);
    background: rgba(26, 26, 26, 0.95);
}

.a4notes-welcome-content input::placeholder {
    color: var(--a4notes-text-secondary);
}

.a4notes-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: auto;
    min-width: 220px;
    max-width: 320px;
    margin: 0 auto;
    padding: 18px 36px;
    background: linear-gradient(135deg, var(--a4notes-accent) 0%, var(--a4notes-accent-hover) 100%);
    color: #ffffff;
    border: none;
    border-radius: 17px;
    font-size: 17px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--a4notes-spring);
    position: relative;
    overflow: hidden;
    box-shadow: var(--a4notes-shadow-md), 0 0 0 0 rgba(254, 0, 202, 0.5);
    animation: a4notes-btn-pulse 2.5s ease-in-out infinite;
}

@keyframes a4notes-btn-pulse {
    0%, 100% {
        box-shadow: var(--a4notes-shadow-md), 0 0 0 0 rgba(254, 0, 202, 0.5);
    }
    50% {
        box-shadow: var(--a4notes-shadow-md), 0 0 0 8px rgba(254, 0, 202, 0);
    }
}

.a4notes-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2) 0%, transparent 100%);
    opacity: 0;
    transition: opacity var(--a4notes-transition-normal);
}

.a4notes-btn::after {
    content: '';
    position: absolute;
    inset: -4px;
    background: linear-gradient(45deg, var(--a4notes-accent), var(--a4notes-accent-hover), var(--a4notes-accent));
    background-size: 300% 300%;
    z-index: -1;
    filter: blur(15px);
    opacity: 0;
    transition: opacity 0.4s ease;
    animation: a4notes-btn-glow 3s ease-in-out infinite;
}

@keyframes a4notes-btn-glow {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.a4notes-btn:hover {
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 20px 50px var(--a4notes-accent-glow), 0 0 0 12px rgba(254, 0, 202, 0);
}

.a4notes-btn:hover::before {
    opacity: 1;
}

.a4notes-btn:hover::after {
    opacity: 0.8;
}

.a4notes-btn:active {
    transform: translateY(-2px) scale(1.00);
}

.a4notes-welcome-hint {
    color: var(--a4notes-text-secondary);
    font-size: 14px;
    line-height: 1.8;
    margin-top: 30px;
    animation: a4notes-fade-in-up 1.5s var(--a4notes-transition-normal);
    white-space: nowrap;
}

.a4notes-copyright {
    color: var(--a4notes-text-secondary);
    font-size: 12px;
    margin-top: 40px;
    animation: a4notes-fade-in-up 2s var(--a4notes-transition-normal);
}

.a4notes-copyright a,
.a4notes-sidebar-footer a {
    color: inherit;
    text-decoration: none;
    border-bottom: none;
}

.a4notes-sidebar-footer a:hover,
.a4notes-sidebar-footer a:focus,
.a4notes-copyright a:hover,
.a4notes-copyright a:focus {
    text-decoration: none;
}

@keyframes a4notes-fade-in-up {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.a4notes-app-container {
    display: none;
    height: 100vh;
    opacity: 0;
    animation: a4notes-app-enter 0.8s var(--a4notes-spring) forwards;
}

.a4notes-app-container.a4notes-fade-out {
    opacity: 0 !important;
    transition: opacity 0.35s ease-out;
}

@keyframes a4notes-app-enter {
    0% {
        opacity: 0;
        filter: blur(20px);
    }
    100% {
        opacity: 1;
        filter: blur(0);
    }
}

.a4notes-app-container:not(.a4notes-hidden) {
    display: flex;
}

.a4notes-resize-handle {
    width: 1px;
    background: var(--a4notes-border);
    cursor: col-resize;
    transition: all var(--a4notes-transition-normal);
    position: relative;
}

.a4notes-resize-handle::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 60px;
    background: transparent;
    border-radius: 10px;
    transition: all var(--a4notes-transition-normal);
}

.a4notes-resize-handle:hover {
    width: 3px;
    background: var(--a4notes-accent);
    box-shadow: 0 0 20px var(--a4notes-accent-glow);
}

.a4notes-resize-handle:hover::before {
    background: rgba(254, 0, 202, 0.2);
    backdrop-filter: blur(10px);
}

.a4notes-sidebar {
    width: var(--a4notes-sidebar-width);
    min-width: 250px;
    max-width: 800px;
    flex-shrink: 0;
    flex-grow: 0;
    background: var(--a4notes-bg-glass);
    backdrop-filter: blur(40px) saturate(180%);
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--a4notes-border);
    animation: a4notes-slide-in-left 0.6s var(--a4notes-spring);
}

@keyframes a4notes-slide-in-left {
    0% {
        opacity: 0;
        transform: translateX(-100px);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

.a4notes-sidebar-header {
    padding: 28px;
    border-bottom: 1px solid var(--a4notes-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(20px);
    animation: a4notes-header-slide 0.8s var(--a4notes-spring);
}

@keyframes a4notes-header-slide {
    0% {
        opacity: 0;
        transform: translateY(-30px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.a4notes-sidebar-header h2 {
    font-size: 26px;
    font-weight: 900;
    letter-spacing: -1.5px;
    background: linear-gradient(135deg, var(--a4notes-accent), var(--a4notes-accent-hover));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: a4notes-text-glow 3s ease-in-out infinite;
    cursor: pointer;
    transition: all var(--a4notes-transition-normal);
    user-select: none;
}

.a4notes-sidebar-header h2:hover {
    transform: scale(1.05);
    filter: drop-shadow(0 0 15px var(--a4notes-accent-glow));
}

.a4notes-sidebar-header h2:active {
    transform: scale(0.95);
}

@keyframes a4notes-text-glow {
    0%, 100% { filter: drop-shadow(0 0 5px var(--a4notes-accent-glow)); }
    50% { filter: drop-shadow(0 0 15px var(--a4notes-accent-glow)); }
}

.a4notes-header-actions {
    display: flex;
    gap: 10px;
}

.a4notes-btn-icon {
    width: 42px;
    height: 42px;
    padding: 0;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--a4notes-border);
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--a4notes-spring);
    backdrop-filter: blur(10px);
}

.a4notes-btn-icon:hover {
    background: var(--a4notes-accent);
    border-color: var(--a4notes-accent);
    transform: scale(1.15) rotate(10deg);
    box-shadow: 0 8px 25px var(--a4notes-accent-glow);
}

.a4notes-btn-icon:active {
    transform: scale(0.95) rotate(5deg);
}

.a4notes-btn-icon svg {
    width: 20px;
    height: 20px;
    color: var(--a4notes-text-primary);
    transition: all var(--a4notes-transition-normal);
}

.a4notes-btn-icon:hover svg {
    color: #ffffff;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.a4notes-search-box {
    padding: 20px 25px;
    border-bottom: 1px solid var(--a4notes-border);
    display: none;
    animation: a4notes-search-expand 0.5s var(--a4notes-spring);
    background: rgba(0, 0, 0, 0.2);
}

@keyframes a4notes-search-expand {
    0% {
        opacity: 0;
        max-height: 0;
        transform: scaleY(0);
    }
    100% {
        opacity: 1;
        max-height: 100px;
        transform: scaleY(1);
    }
}

.a4notes-search-box.a4notes-active {
    display: block;
}

.a4notes-search-box input {
    width: 100%;
    padding: 16px 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 1.5px solid var(--a4notes-border);
    border-radius: 12px;
    color: var(--a4notes-text-primary);
    font-size: 15px;
    font-family: inherit;
    transition: all var(--a4notes-spring);
    outline: none;
    backdrop-filter: blur(10px);
}

.a4notes-search-box input:focus {
    border-color: var(--a4notes-accent);
    transform: scale(1.03);
    box-shadow: 0 6px 20px var(--a4notes-accent-glow);
    background: rgba(255, 255, 255, 0.08);
}

.a4notes-search-box input::placeholder {
    color: var(--a4notes-text-secondary);
}

.a4notes-notes-list {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.a4notes-note-item {
    padding: 18px 24px;
    border-radius: 16px;
    margin-bottom: 18px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, rgba(254, 0, 202, 0.03) 0%, rgba(10, 10, 10, 0.8) 100%);
    border: 1px solid rgba(254, 0, 202, 0.1);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 8px rgba(254, 0, 202, 0.05);
}

.a4notes-note-item.a4notes-pinned-last {
    margin-bottom: 50px;
    padding-bottom: 24px;
    position: relative;
}

.a4notes-note-item.a4notes-pinned-last::after {
    content: '';
    position: absolute;
    bottom: -25px;
    left: 5%;
    right: 5%;
    height: 3px;
    background: linear-gradient(90deg, transparent, rgba(254, 0, 202, 0.6), transparent);
    border-radius: 2px;
    box-shadow: 0 0 15px rgba(254, 0, 202, 0.4);
    animation: a4notes-separator-pulse 2s ease-in-out infinite;
}

@keyframes a4notes-separator-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.a4notes-note-item.a4notes-note-entering {
    animation: a4notes-note-enter-simple 0.4s ease-out;
}

@keyframes a4notes-note-enter-simple {
    0% {
        opacity: 0;
        transform: translateX(-30px) scale(0.95);
    }
    60% {
        transform: translateX(5px) scale(1.02);
    }
    100% {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

.a4notes-note-item::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--a4notes-accent) 0%, transparent 100%);
    opacity: 0;
    transition: opacity var(--a4notes-transition-normal);
}

.a4notes-note-item::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(254, 0, 202, 0.05), rgba(204, 0, 160, 0.03));
    opacity: 0;
    transition: all var(--a4notes-transition-normal);
    border-radius: 14px;
    box-shadow: inset 0 0 30px rgba(254, 0, 202, 0);
}

.a4notes-note-item:hover {
    background: linear-gradient(135deg, rgba(254, 0, 202, 0.08) 0%, rgba(26, 10, 26, 0.9) 100%);
    border-color: rgba(254, 0, 202, 0.3);
    transform: translateX(3px);
    box-shadow: 0 6px 20px rgba(254, 0, 202, 0.12), 0 3px 10px rgba(0, 0, 0, 0.3);
}

.a4notes-note-item:hover::after {
    opacity: 1;
    box-shadow: inset 0 0 30px rgba(254, 0, 202, 0.1);
}

.a4notes-note-item.a4notes-active {
    background: linear-gradient(135deg, rgba(254, 0, 202, 0.25) 0%, rgba(204, 0, 160, 0.2) 50%, rgba(10, 10, 10, 0.95) 100%);
    color: #ffffff;
    border-color: rgba(254, 0, 202, 0.5);
    box-shadow: 
        0 0 20px rgba(254, 0, 202, 0.2),
        0 6px 24px rgba(254, 0, 202, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transform: translateX(3px);
}

.a4notes-note-item.a4notes-selected::before {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 18px;
    background: rgba(254, 0, 202, 0.35);
    filter: blur(22px);
    opacity: 0;
    animation: a4notes-note-focus 0.5s ease-out forwards;
}

@keyframes a4notes-note-focus {
    0% {
        opacity: 0;
        transform: scale(0.85);
    }
    100% {
        opacity: 1;
        transform: scale(1.04);
    }
}

.a4notes-note-item.a4notes-just-selected {
    animation: a4notes-select-pulse 0.35s ease-out;
}

@keyframes a4notes-select-pulse {
    0% {
        transform: translateX(0) scale(1);
    }
    40% {
        transform: translateX(8px) scale(1.02);
    }
    100% {
        transform: translateX(3px) scale(1);
    }
}

.a4notes-note-item.a4notes-active .a4notes-note-item-preview {
    color: rgba(255, 255, 255, 0.85);
}

.a4notes-note-item-title {
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    position: relative;
    z-index: 1;
}

.a4notes-note-item-preview {
    font-size: 13px;
    color: var(--a4notes-text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    position: relative;
    z-index: 1;
}

.a4notes-sidebar-footer {
    padding: 22px;
    border-top: 1px solid var(--a4notes-border);
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(20px);
    animation: a4notes-footer-slide 0.8s var(--a4notes-spring);
}

@keyframes a4notes-footer-slide {
    0% {
        opacity: 0;
        transform: translateY(30px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.a4notes-footer-info {
    margin-bottom: 16px;
}

.a4notes-footer-info p {
    font-size: 11px;
    color: var(--a4notes-text-secondary);
    text-align: center;
    animation: a4notes-blink 2s ease-in-out infinite;
}

@keyframes a4notes-blink {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

.a4notes-footer-actions {
    display: flex;
    gap: 12px;
}

.a4notes-btn-small {
    flex: 1;
    padding: 14px 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--a4notes-border);
    border-radius: 12px;
    color: var(--a4notes-text-primary);
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--a4notes-spring);
    backdrop-filter: blur(10px);
}

.a4notes-btn-small:hover {
    background: var(--a4notes-accent);
    border-color: var(--a4notes-accent);
    color: #ffffff;
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 8px 25px var(--a4notes-accent-glow);
}

.a4notes-btn-small:active {
    transform: translateY(-2px) scale(0.98);
}

.a4notes-editor-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--a4notes-bg-primary);
    position: relative;
    animation: a4notes-slide-in-right 0.6s var(--a4notes-spring);
    transition: background 0.6s ease, color 0.6s ease;
}

.a4notes-editor-container[data-theme="light"] {
    background: var(--a4notes-editor-light-bg);
}

@keyframes a4notes-slide-in-right {
    0% {
        opacity: 0;
        transform: translateX(100px);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

.a4notes-editor-header {
    padding: 32px 45px;
    border-bottom: 1px solid var(--a4notes-border);
    display: none;
    align-items: center;
    justify-content: space-between;
    animation: a4notes-editor-header-slide 0.6s var(--a4notes-spring);
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(18px);
    transition: background 0.6s ease, color 0.6s ease, border-color 0.6s ease;
}

@keyframes a4notes-editor-header-slide {
    0% {
        opacity: 0;
        transform: translateY(-40px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.a4notes-editor-header.a4notes-active {
    display: flex;
}

.a4notes-editor-container[data-theme="light"] .a4notes-editor-header {
    background: var(--a4notes-editor-light-surface);
    border-bottom: 1px solid var(--a4notes-editor-light-border);
    color: var(--a4notes-editor-light-text);
}

.a4notes-editor-title {
    flex: 1;
    font-size: 36px;
    font-weight: 700;
    background: transparent;
    border: 2px solid transparent;
    border-radius: 35px;
    padding: 12px 20px;
    color: var(--a4notes-text-primary);
    font-family: inherit;
    outline: none;
    transition: all var(--a4notes-transition-normal), opacity 0.4s ease-out, transform 0.4s ease-out;
}

.a4notes-editor-container[data-theme="light"] .a4notes-editor-title {
    color: var(--a4notes-editor-light-text);
}

.a4notes-editor-title:focus {
    border-color: var(--a4notes-accent);
    transform: translateY(-3px);
    text-shadow: 0 4px 12px rgba(254, 0, 202, 0.3);
    box-shadow: 0 0 0 3px rgba(254, 0, 202, 0.1);
}

.a4notes-editor-title::placeholder {
    color: var(--a4notes-text-secondary);
}

.a4notes-editor-actions {
    display: flex;
    gap: 10px;
    margin-left: 25px;
}

.a4notes-editor-container[data-theme="light"] .a4notes-editor-actions .a4notes-btn-icon {
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(0, 0, 0, 0.12);
}

.a4notes-editor-container[data-theme="light"] .a4notes-editor-actions .a4notes-btn-icon svg {
    color: #151515;
}

.a4notes-editor-container[data-theme="light"] .a4notes-editor-actions .a4notes-btn-icon:hover {
    background: rgba(254, 0, 202, 0.12);
    border-color: rgba(254, 0, 202, 0.3);
    box-shadow: 0 6px 18px rgba(254, 0, 202, 0.15);
    transform: scale(1.15) rotate(10deg);
}

.a4notes-editor-container[data-theme="light"] .a4notes-editor-actions .a4notes-btn-icon:hover svg {
    color: var(--a4notes-accent);
}

.a4notes-format-toolbar {
    padding: 16px 45px;
    border-bottom: 1px solid var(--a4notes-border);
    display: none;
    align-items: center;
    gap: 20px;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(18px);
    animation: a4notes-slide-down 0.5s var(--a4notes-spring);
    flex-wrap: wrap;
    transition: background 0.6s ease, border-color 0.6s ease, color 0.6s ease;
}

.a4notes-format-toolbar.a4notes-active {
    display: flex;
}

.a4notes-editor-container[data-theme="light"] .a4notes-format-toolbar {
    background: var(--a4notes-editor-light-surface);
    border-bottom: 1px solid var(--a4notes-editor-light-border);
}

.a4notes-format-group {
    display: flex;
    gap: 6px;
    padding: 6px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.a4notes-editor-container[data-theme="light"] .a4notes-format-group {
    background: rgba(255, 255, 255, 0.72);
    border-color: rgba(0, 0, 0, 0.08);
}

.a4notes-format-btn {
    width: 38px;
    height: 38px;
    padding: 0;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--a4notes-transition-normal);
    font-size: 14px;
    font-weight: 600;
    color: var(--a4notes-text-primary);
}

.a4notes-format-btn:hover {
    background: rgba(254, 0, 202, 0.2);
    border-color: rgba(254, 0, 202, 0.4);
    transform: scale(1.1);
}

.a4notes-format-btn.active {
    background: rgba(254, 0, 202, 0.3);
    border-color: var(--a4notes-accent);
    color: var(--a4notes-accent);
}

.a4notes-editor-container[data-theme="light"] .a4notes-format-btn {
    color: var(--a4notes-editor-light-text);
}

.a4notes-editor-container[data-theme="light"] .a4notes-format-btn:hover {
    background: rgba(0, 0, 0, 0.08);
    border-color: rgba(0, 0, 0, 0.12);
}

.a4notes-editor-container[data-theme="light"] .a4notes-format-btn.active {
    background: rgba(254, 0, 202, 0.22);
}

.a4notes-format-select {
    padding: 8px 14px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: var(--a4notes-text-primary);
    font-size: 13px;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--a4notes-transition-normal);
    outline: none;
}

.a4notes-format-select:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(254, 0, 202, 0.3);
}

.a4notes-format-select:focus {
    border-color: var(--a4notes-accent);
    box-shadow: 0 0 0 3px rgba(254, 0, 202, 0.1);
}

.a4notes-editor-container[data-theme="light"] .a4notes-format-select {
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(0, 0, 0, 0.08);
    color: var(--a4notes-editor-light-text);
}

.a4notes-editor-container[data-theme="light"] .a4notes-format-select:hover {
    background: rgba(0, 0, 0, 0.06);
    border-color: rgba(0, 0, 0, 0.15);
}

.a4notes-format-divider {
    width: 1px;
    height: 30px;
    background: rgba(255, 255, 255, 0.1);
}

.a4notes-editor-content {
    flex: 1;
    padding: 45px 55px;
    font-size: 18px;
    line-height: 1.9;
    color: var(--a4notes-text-primary);
    background: transparent;
    border: none;
    outline: none;
    overflow-y: auto;
    font-family: inherit;
    white-space: pre-wrap;
    word-wrap: break-word;
    transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}

.a4notes-reveal-word {
    display: inline-block;
    transition: opacity 0.3s ease-out, transform 0.3s ease-out;
}

.a4notes-editor-container[data-theme="light"] .a4notes-editor-content {
    color: var(--a4notes-editor-light-text);
    background: var(--a4notes-editor-light-surface-strong);
    border-left: 1px solid var(--a4notes-editor-light-border);
    border-right: 1px solid var(--a4notes-editor-light-border);
    border-bottom: 1px solid var(--a4notes-editor-light-border);
    box-shadow: 0 22px 48px rgba(15, 23, 42, 0.18);
}

.a4notes-editor-content[contenteditable="true"]:empty:before {
    content: 'Écrivez tout ce que vous voulez ici!';
    color: var(--a4notes-text-secondary);
    pointer-events: none;
    position: absolute;
}

.a4notes-editor-content img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    margin: 20px 0;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    transition: all var(--a4notes-transition-normal);
    animation: a4notes-image-appear 0.6s var(--a4notes-spring);
    cursor: move;
    resize: both;
    overflow: auto;
    position: relative;
    display: inline-block;
}

.a4notes-editor-content img:hover {
    transform: scale(1.02);
    box-shadow: 0 12px 48px rgba(254, 0, 202, 0.3);
}

.a4notes-editor-container[data-theme="light"] .a4notes-editor-content img {
    box-shadow: 0 14px 40px rgba(15, 23, 42, 0.18);
}

@keyframes a4notes-image-appear {
    0% {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.a4notes-editor-content h1 {
    font-size: 32px;
    font-weight: 700;
    margin: 30px 0 20px 0;
    color: var(--a4notes-accent);
}

.a4notes-editor-content h2 {
    font-size: 26px;
    font-weight: 600;
    margin: 25px 0 15px 0;
    color: var(--a4notes-accent);
}

.a4notes-editor-content h3 {
    font-size: 22px;
    font-weight: 600;
    margin: 20px 0 12px 0;
    color: var(--a4notes-accent);
}

.a4notes-editor-container[data-theme="light"] .a4notes-editor-content h1,
.a4notes-editor-container[data-theme="light"] .a4notes-editor-content h2,
.a4notes-editor-container[data-theme="light"] .a4notes-editor-content h3 {
    color: var(--a4notes-accent-hover);
}

.a4notes-editor-content:focus {
    background: rgba(255, 255, 255, 0.01);
}

.a4notes-empty-state {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: a4notes-empty-float 1s var(--a4notes-spring);
    pointer-events: none;
}

@keyframes a4notes-empty-float {
    0% {
        opacity: 0;
        transform: scale(0.8);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.a4notes-empty-content {
    text-align: center;
}

.a4notes-empty-icon {
    font-size: 120px;
    margin-bottom: 25px;
    animation: a4notes-empty-bounce 2s ease-in-out infinite;
    filter: drop-shadow(0 8px 30px rgba(254, 0, 202, 0.3));
}

@keyframes a4notes-empty-bounce {
    0%, 100% { 
        transform: translateY(0) scale(1);
    }
    50% { 
        transform: translateY(-20px) scale(1.05);
    }
}

.a4notes-empty-icon {
    font-size: 100px;
    margin-bottom: 25px;
    animation: a4notes-empty-bounce 2s ease-in-out infinite;
    line-height: 1;
    filter: drop-shadow(0 4px 20px rgba(0, 0, 0, 0.3));
}

@keyframes a4notes-empty-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.a4notes-reconnect-state {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: a4notes-empty-float 1s var(--a4notes-spring);
    pointer-events: none;
}

.a4notes-empty-state p {
    font-size: 20px;
    color: var(--a4notes-text-secondary);
    margin-bottom: 10px;
    animation: a4notes-fade-in-up 1.2s var(--a4notes-transition-normal);
}

.a4notes-empty-hint {
    font-size: 15px;
    color: var(--a4notes-text-secondary);
    opacity: 0.5;
    animation: a4notes-fade-in-up 1.5s var(--a4notes-transition-normal);
}

.a4notes-fab {
    position: fixed;
    bottom: 45px;
    right: 45px;
    width: 75px;
    height: 75px;
    background: linear-gradient(135deg, var(--a4notes-accent) 0%, var(--a4notes-accent-hover) 100%);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    box-shadow: var(--a4notes-shadow-lg), var(--a4notes-shadow-glow);
    transition: all var(--a4notes-spring);
    z-index: 100;
    animation: a4notes-fab-pulse 3s ease-in-out infinite;
}

.a4notes-fab.a4notes-compact {
    width: 60px;
    height: 60px;
    bottom: 35px;
    right: 35px;
}

@keyframes a4notes-fab-pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: var(--a4notes-shadow-lg), 0 0 40px var(--a4notes-accent-glow);
    }
    50% {
        transform: scale(1.08);
        box-shadow: var(--a4notes-shadow-lg), 0 0 80px var(--a4notes-accent-glow);
    }
}

.a4notes-fab.a4notes-active,
.a4notes-fab.a4notes-compact {
    display: flex;
    animation: a4notes-fab-enter 0.8s var(--a4notes-spring);
}

@keyframes a4notes-fab-enter {
    0% {
        opacity: 0;
        transform: scale(0) rotate(-180deg);
    }
    100% {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }
}

.a4notes-fab:hover {
    transform: scale(1.2) rotate(90deg);
    box-shadow: 0 0 60px var(--a4notes-accent-glow), 0 0 100px rgba(254, 0, 202, 0.3);
}

.a4notes-fab:active {
    transform: scale(1.1) rotate(90deg);
}

.a4notes-fab svg {
    width: 36px;
    height: 36px;
    color: #ffffff;
    transition: transform var(--a4notes-transition-normal), width var(--a4notes-spring), height var(--a4notes-spring);
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.4));
}

.a4notes-fab.a4notes-compact svg {
    width: 28px;
    height: 28px;
}

.a4notes-fab:hover svg {
    transform: rotate(-90deg);
}

.a4notes-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.42);
    backdrop-filter: blur(16px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    animation: a4notes-modal-overlay-fade 0.4s var(--a4notes-transition-normal);
}

.a4notes-modal-overlay.a4notes-leaving {
    animation: a4notes-modal-overlay-fade 0.25s ease-out reverse forwards;
}

@keyframes a4notes-modal-overlay-fade {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

.a4notes-modal-content {
    background: rgba(10, 10, 10, 0.9);
    backdrop-filter: blur(18px) saturate(180%);
    border: 1px solid var(--a4notes-border);
    border-radius: var(--a4notes-border-radius-lg);
    padding: 45px;
    max-width: 520px;
    width: 90%;
    animation: none;
    box-shadow: var(--a4notes-shadow-lg);
}

.a4notes-modal-content.a4notes-leaving {
    animation: none;
}

.a4notes-modal-content h3 {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 16px;
    background: linear-gradient(135deg, #ffffff, #999999);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.a4notes-modal-content p {
    color: var(--a4notes-text-secondary);
    font-size: 15px;
    line-height: 1.7;
    margin-bottom: 28px;
}

.a4notes-modal-content input {
    width: 100%;
    padding: 18px 24px;
    background: rgba(255, 255, 255, 0.05);
    border: 1.5px solid var(--a4notes-border);
    border-radius: var(--a4notes-border-radius);
    color: var(--a4notes-text-primary);
    font-size: 16px;
    font-family: inherit;
    margin-bottom: 28px;
    transition: all var(--a4notes-spring);
    outline: none;
    backdrop-filter: blur(10px);
}

.a4notes-modal-content input:focus {
    border-color: var(--a4notes-accent);
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 30px var(--a4notes-accent-glow);
    background: rgba(255, 255, 255, 0.08);
}

.a4notes-modal-content input::placeholder {
    color: var(--a4notes-text-secondary);
}

.a4notes-modal-buttons {
    display: flex;
    gap: 14px;
}

.a4notes-modal-buttons button {
    flex: 1;
    padding: 18px 28px;
    border: none;
    border-radius: var(--a4notes-border-radius);
    font-size: 16px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--a4notes-spring);
}

.a4notes-btn-cancel {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--a4notes-border);
    color: var(--a4notes-text-primary);
    backdrop-filter: blur(10px);
}

.a4notes-btn-cancel:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-3px) scale(1.02);
    box-shadow: var(--a4notes-shadow-sm);
}

.a4notes-btn-confirm {
    background: linear-gradient(135deg, var(--a4notes-accent) 0%, var(--a4notes-accent-hover) 100%);
    color: #ffffff;
}

.a4notes-btn-confirm:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 12px 35px var(--a4notes-accent-glow);
}

.a4notes-btn-cancel:active,
.a4notes-btn-confirm:active {
    transform: translateY(-1px) scale(0.98);
}

.a4notes-hidden {
    display: none !important;
}

.a4notes-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 18px 28px;
    border-radius: 14px;
    font-weight: 600;
    font-size: 15px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.1);
    z-index: 10000;
    backdrop-filter: blur(20px);
    animation: a4notes-notif-enter 0.6s var(--a4notes-spring);
    max-width: 320px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.a4notes-notification.success {
    background: linear-gradient(135deg, rgba(48, 209, 88, 0.95) 0%, rgba(40, 180, 75, 0.95) 100%);
    color: #000;
}

.a4notes-notification.error {
    background: linear-gradient(135deg, rgba(255, 59, 59, 0.95) 0%, rgba(220, 40, 40, 0.95) 100%);
    color: #fff;
}

.a4notes-notification.info {
    background: linear-gradient(135deg, rgba(254, 0, 202, 0.95) 0%, rgba(204, 0, 160, 0.95) 100%);
    color: #fff;
}

@keyframes a4notes-notif-enter {
    0% {
        opacity: 0;
        transform: translateX(400px) rotate(10deg) scale(0.8);
    }
    60% {
        transform: translateX(-20px) rotate(-2deg) scale(1.05);
    }
    100% {
        opacity: 1;
        transform: translateX(0) rotate(0deg) scale(1);
    }
}

.a4notes-notification.leaving {
    animation: a4notes-notif-leave 0.5s var(--a4notes-spring) forwards;
}

@keyframes a4notes-notif-leave {
    0% {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateX(400px) scale(0.8);
    }
}

.a4notes-lock-overlay {
    position: fixed;
    inset: 0;
    background: #000000;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: a4notes-lock-enter 0.6s ease-out;
    pointer-events: none;
}

.a4notes-lock-overlay.unlocking {
    animation: a4notes-unlock-burst 0.8s ease-out;
}

@keyframes a4notes-lock-enter {
    0% {
        opacity: 0;
    }
    100% {
        opacity: 1;
    }
}

@keyframes a4notes-unlock-burst {
    0% {
        opacity: 1;
    }
    100% {
        opacity: 0;
    }
}

.a4notes-lock-icon {
    font-size: 120px;
    animation: a4notes-lock-shake 0.8s ease-in-out;
    filter: drop-shadow(0 0 60px rgba(254, 0, 202, 1));
    text-shadow: 0 0 80px rgba(254, 0, 202, 0.8);
}

@keyframes a4notes-lock-shake {
    0%, 100% { 
        transform: rotate(0deg) scale(1); 
        filter: drop-shadow(0 0 60px rgba(254, 0, 202, 1)) drop-shadow(0 0 100px rgba(48, 209, 88, 0.6));
    }
    20% { 
        transform: rotate(-15deg) scale(1.1); 
        filter: drop-shadow(0 0 80px rgba(254, 0, 202, 1)) drop-shadow(0 0 120px rgba(48, 209, 88, 0.8));
    }
    40% { 
        transform: rotate(15deg) scale(1.1); 
        filter: drop-shadow(0 0 80px rgba(48, 209, 88, 1)) drop-shadow(0 0 120px rgba(254, 0, 202, 0.8));
    }
    60% { 
        transform: rotate(-10deg) scale(1.05); 
        filter: drop-shadow(0 0 70px rgba(254, 0, 202, 1)) drop-shadow(0 0 110px rgba(48, 209, 88, 0.7));
    }
    80% { 
        transform: rotate(10deg) scale(1.05); 
        filter: drop-shadow(0 0 70px rgba(48, 209, 88, 1)) drop-shadow(0 0 110px rgba(254, 0, 202, 0.7));
    }
}

.a4notes-ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(254, 0, 202, 0.6);
    pointer-events: none;
    transform: scale(0);
    animation: a4notes-ripple-effect 0.8s ease-out;
}

@keyframes a4notes-ripple-effect {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

button, .a4notes-btn, .a4notes-btn-icon, .a4notes-btn-small {
    position: relative;
    overflow: hidden;
}

button::after, .a4notes-btn::after, .a4notes-btn-icon::after, .a4notes-btn-small::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.3) 0%, transparent 70%);
    transform: scale(0);
    transition: transform 0.5s ease-out;
}

button:active::after, .a4notes-btn:active::after, .a4notes-btn-icon:active::after, .a4notes-btn-small:active::after {
    transform: scale(2);
    transition: transform 0s;
}

@keyframes a4notes-particle-float {
    0% {
        opacity: 1;
        transform: translate(0, 0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(var(--tx), var(--ty)) scale(0);
    }
}

.a4notes-particle {
    position: fixed;
    width: 8px;
    height: 8px;
    background: var(--a4notes-accent);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    box-shadow: 0 0 10px var(--a4notes-accent-glow);
    animation: a4notes-particle-float 1.5s ease-out forwards;
}


.a4notes-deleting {
    animation: a4notes-delete-shrink 0.5s var(--a4notes-spring) forwards;
}

@keyframes a4notes-delete-shrink {
    0% {
        opacity: 1;
        transform: scale(1) rotate(0deg) translateX(0);
    }
    30% {
        transform: scale(1.05) rotate(3deg) translateX(-5px);
    }
    60% {
        opacity: 0.5;
        transform: scale(0.8) rotate(20deg) translateX(30px);
    }
    100% {
        opacity: 0;
        transform: scale(0.3) rotate(45deg) translateX(50px);
    }
}

.a4notes-pinning {
    animation: a4notes-pin-bounce 0.6s var(--a4notes-spring);
}

@keyframes a4notes-pin-bounce {
    0%, 100% { 
        transform: translateY(0) rotate(0deg); 
    }
    15% { 
        transform: translateY(-25px) rotate(-10deg) scale(1.1); 
    }
    30% { 
        transform: translateY(-12px) rotate(5deg) scale(1.05); 
    }
    45% { 
        transform: translateY(-18px) rotate(-3deg) scale(1.08); 
    }
    60% { 
        transform: translateY(-8px) rotate(2deg) scale(1.03); 
    }
    75% { 
        transform: translateY(-12px) rotate(-1deg) scale(1.05); 
    }
    90% { 
        transform: translateY(-3px) rotate(0deg) scale(1.01); 
    }
}

.a4notes-sidebar-header, .a4notes-sidebar-footer {
    transition: all var(--a4notes-transition-slow);
}

.a4notes-sidebar-header:hover {
    background: rgba(254, 0, 202, 0.05);
}

.a4notes-sidebar-footer:hover {
    background: rgba(254, 0, 202, 0.05);
}

.a4notes-fab:active {
    animation: a4notes-fab-click 0.3s ease-out;
}

@keyframes a4notes-fab-click {
    0% { transform: scale(1) rotate(0deg); }
    50% { transform: scale(0.9) rotate(45deg); }
    100% { transform: scale(1) rotate(90deg); }
}

.a4notes-modal-overlay::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at var(--mouse-x, 50%) var(--mouse-y, 50%), 
                rgba(254, 0, 202, 0.1) 0%, 
                transparent 50%);
    pointer-events: none;
    opacity: 0.5;
    animation: a4notes-modal-glow 3s ease-in-out infinite;
}

@keyframes a4notes-modal-glow {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.6; }
}

@media (max-width: 768px) {
    .a4notes-sidebar {
        width: 100%;
        max-width: none;
        position: absolute;
        z-index: 10;
        transition: transform 0.3s ease-out;
    }
    
    .a4notes-sidebar.a4notes-mobile-hidden {
        transform: translateX(-100%);
    }
    
    .a4notes-editor-container {
        display: flex;
        position: absolute;
        width: 100%;
        z-index: 5;
    }
    
    .a4notes-editor-container.a4notes-mobile-hidden {
        display: none;
    }
    
    .a4notes-mobile-back {
        position: fixed;
        top: 20px;
        left: 20px;
        width: 50px;
        height: 50px;
        background: var(--a4notes-accent);
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        z-index: 100;
        box-shadow: 0 8px 25px var(--a4notes-accent-glow);
        animation: a4notes-fab-enter 0.5s var(--a4notes-spring);
    }
    
    .a4notes-mobile-back::before {
        content: '←';
        font-size: 24px;
        color: white;
        font-weight: bold;
    }
    
    .a4notes-resize-handle {
        display: none;
    }
    
    .a4notes-fab {
        bottom: 25px;
        right: 25px;
        width: 65px;
        height: 65px;
    }
    
    .a4notes-fab.a4notes-compact {
        width: 55px;
        height: 55px;
        bottom: 20px;
        right: 20px;
    }
    
    .a4notes-fab svg {
        width: 30px;
        height: 30px;
    }
    
    .a4notes-fab.a4notes-compact svg {
        width: 24px;
        height: 24px;
    }
    
    .a4notes-welcome-content {
        padding: 25px;
    }
    
    .a4notes-welcome-content h1 {
        font-size: 52px;
    }
    
    .a4notes-welcome-icon {
        width: 96px;
        height: 96px;
    }
    
    .a4notes-welcome-icon svg {
        width: 55px;
        height: 55px;
    }
    
    .a4notes-welcome-hint {
        white-space: normal;
        font-size: 12px;
    }
}

.a4notes-confirm-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.42);
    backdrop-filter: blur(16px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: a4notes-modal-overlay-fade 0.3s ease-out;
}

.a4notes-confirm-content {
    background: rgba(10, 10, 10, 0.9);
    backdrop-filter: blur(18px) saturate(180%);
    border: 1px solid var(--a4notes-border);
    border-radius: var(--a4notes-border-radius-lg);
    padding: 40px;
    max-width: 420px;
    width: 90%;
    animation: none;
    box-shadow: var(--a4notes-shadow-lg);
    text-align: center;
}

.a4notes-confirm-content.a4notes-leaving {
    animation: a4notes-modal-bounce 0.25s ease-in reverse forwards;
}

.a4notes-confirm-icon {
    font-size: 64px;
    margin-bottom: 20px;
    animation: a4notes-confirm-shake 0.6s ease-in-out;
}

@keyframes a4notes-confirm-shake {
    0%, 100% { transform: rotate(0deg) scale(1); }
    25% { transform: rotate(-10deg) scale(1.1); }
    75% { transform: rotate(10deg) scale(1.1); }
}

.a4notes-confirm-content h3 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--a4notes-text-primary);
}

.a4notes-confirm-content p {
    color: var(--a4notes-text-secondary);
    font-size: 15px;
    margin-bottom: 28px;
}

.a4notes-confirm-buttons {
    display: flex;
    gap: 12px;
}

.a4notes-confirm-buttons button {
    flex: 1;
    padding: 16px 24px;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--a4notes-spring);
}

.a4notes-editor-content * {
    caret-color: var(--a4notes-accent);
}

.a4notes-image-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
}

.a4notes-tab-btn {
    flex: 1;
    padding: 14px 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--a4notes-border);
    border-radius: 12px;
    color: var(--a4notes-text-primary);
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--a4notes-transition-normal);
}

.a4notes-tab-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(254, 0, 202, 0.3);
}

.a4notes-tab-btn.a4notes-active {
    background: linear-gradient(135deg, var(--a4notes-accent) 0%, var(--a4notes-accent-hover) 100%);
    border-color: var(--a4notes-accent);
    color: #ffffff;
}

.a4notes-tab-content {
    margin-bottom: 20px;
}

.a4notes-upload-btn {
    width: 100%;
    padding: 40px 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 2px dashed var(--a4notes-border);
    border-radius: var(--a4notes-border-radius);
    color: var(--a4notes-text-primary);
    font-size: 16px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--a4notes-spring);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.a4notes-upload-btn:hover {
    background: rgba(254, 0, 202, 0.1);
    border-color: var(--a4notes-accent);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(254, 0, 202, 0.2);
}

.a4notes-upload-btn svg {
    width: 48px;
    height: 48px;
    color: var(--a4notes-accent);
}

.a4notes-file-hint {
    text-align: center;
    color: var(--a4notes-text-secondary);
    font-size: 13px;
    margin-top: 15px;
}

.a4notes-color-picker-modal {
    max-width: 480px;
}

.a4notes-color-palette {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 12px;
    margin-bottom: 25px;
    max-width: 100%;
}

.a4notes-color-item {
    width: 100%;
    aspect-ratio: 1;
    max-width: 45px;
    max-height: 45px;
    border-radius: 12px;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all var(--a4notes-spring);
    position: relative;
    overflow: hidden;
}

.a4notes-color-item::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle, rgba(255,255,255,0.3) 0%, transparent 70%);
    opacity: 0;
    transition: opacity var(--a4notes-transition-normal);
}

.a4notes-color-item:hover {
    transform: scale(1.15) translateY(-3px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.4);
    border-color: rgba(255,255,255,0.4);
}

.a4notes-color-item:hover::before {
    opacity: 1;
}

.a4notes-color-item:active {
    transform: scale(1.05);
}

.a4notes-blurred-text {
    filter: blur(4px);
    transition: filter 0.3s ease;
    cursor: pointer;
}

.a4notes-blurred-text:hover {
    filter: blur(0);
}

.a4notes-format-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url('data:image/svg+xml;utf8,<svg fill="white" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path d="M7 10l5 5 5-5z"/></svg>');
    background-repeat: no-repeat;
    background-position-x: calc(100% - 8px);
    background-position-y: center;
    background-size: 18px;
    padding-right: 32px;
    color-scheme: dark;
}

.a4notes-format-select option {
    background-color: #1a1a1a;
    background: #1a1a1a;
    color: #ffffff;
    padding: 10px;
    font-weight: 500;
}

.a4notes-format-select option:checked,
.a4notes-format-select option:hover {
    background: linear-gradient(135deg, var(--a4notes-accent) 0%, var(--a4notes-accent-hover) 100%);
    background-color: var(--a4notes-accent);
    color: #ffffff;
}

.a4notes-editor-container[data-theme="light"] .a4notes-format-select {
    background-image: url('data:image/svg+xml;utf8,<svg fill="black" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path d="M7 10l5 5 5-5z"/></svg>');
    color-scheme: light;
}

.a4notes-editor-container[data-theme="light"] .a4notes-format-select option {
    background-color: #ffffff;
    background: #ffffff;
    color: #151515;
}

.a4notes-editor-container[data-theme="light"] .a4notes-format-select option:checked,
.a4notes-editor-container[data-theme="light"] .a4notes-format-select option:hover {
    background: rgba(254, 0, 202, 0.15);
    background-color: rgba(254, 0, 202, 0.15);
    color: #151515;
}

@media (max-width: 768px) {
    .a4notes-color-palette {
        grid-template-columns: repeat(6, 1fr);
    }
    
    .a4notes-color-item {
        max-width: 40px;
        max-height: 40px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

@media print {
    .a4notes-sidebar,
    .a4notes-resize-handle,
    .a4notes-fab,
    .a4notes-editor-header,
    .a4notes-welcome-screen {
        display: none !important;
    }
    
    .a4notes-editor-content {
        padding: 0;
        color: #000;
        background: #fff;
    }
}
