/* Notes Window Overlay */
.notes-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: all 0.4s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.notes-overlay.open {
    display: flex !important;
}

.notes-overlay.closing {
    opacity: 0;
    backdrop-filter: blur(0px);
    -webkit-backdrop-filter: blur(0px);
    background: rgba(0, 0, 0, 0);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes closeWindow {
    0% {
        opacity: 1;
        transform: scale(1);
        filter: blur(0px);
    }
    100% {
        opacity: 0;
        transform: scale(0.92);
        filter: blur(0px);
    }
}

@keyframes minimizeWindow {
    from {
        opacity: 1;
        transform: scale(1);
    }
    to {
        opacity: 0;
        transform: scale(0.92);
    }
}

/* Notes Window */
.notes-window {
    width: 1200px;
    max-width: none;
    height: 700px;
    background: rgba(40, 40, 45, 0.98);
    border-radius: 10px;
    box-shadow: 
        0 25px 60px rgba(0, 0, 0, 0.4),
        0 10px 25px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    transition: all 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
    animation: slideUp 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
    will-change: transform, opacity;
    position: relative;
}

.notes-window.active {
    box-shadow: 
        0 25px 60px rgba(0, 0, 0, 0.5),
        0 10px 30px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.notes-window.inactive {
    opacity: 0.85;
    box-shadow: 
        0 15px 40px rgba(0, 0, 0, 0.3),
        0 5px 15px rgba(0, 0, 0, 0.2);
}

.notes-window.inactive .title-bar {
    background: rgba(45, 45, 45, 0.8);
}

.notes-window.inactive .traffic-light {
    opacity: 0.5;
}

.notes-window.closing {
    animation: closeWindow 0.4s cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
}

.notes-window.minimized {
    animation: minimizeWindow 0.4s cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
    pointer-events: none;
}

.notes-window.maximized {
    width: 98vw;
    height: 95vh;
    max-width: none;
    transition: all 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.notes-window.dragging {
    transition: none !important;
    cursor: grabbing;
}

.notes-window.resizing {
    transition: none !important;
}

/* Resize Handles */
.notes-window .resize-handle {
    position: absolute;
    z-index: 1000;
}

.notes-window .resize-handle.top {
    top: 0;
    left: 10px;
    right: 10px;
    height: 8px;
    cursor: ns-resize;
}

.notes-window .resize-handle.bottom {
    bottom: 0;
    left: 10px;
    right: 10px;
    height: 8px;
    cursor: ns-resize;
}

.notes-window .resize-handle.left {
    left: 0;
    top: 10px;
    bottom: 10px;
    width: 8px;
    cursor: ew-resize;
}

.notes-window .resize-handle.right {
    right: 0;
    top: 10px;
    bottom: 10px;
    width: 8px;
    cursor: ew-resize;
}

.notes-window .resize-handle.top-left {
    top: 0;
    left: 0;
    width: 16px;
    height: 16px;
    cursor: nwse-resize;
}

.notes-window .resize-handle.top-right {
    top: 0;
    right: 0;
    width: 16px;
    height: 16px;
    cursor: nesw-resize;
}

.notes-window .resize-handle.bottom-left {
    bottom: 0;
    left: 0;
    width: 16px;
    height: 16px;
    cursor: nesw-resize;
}

.notes-window .resize-handle.bottom-right {
    bottom: 0;
    right: 0;
    width: 16px;
    height: 16px;
    cursor: nwse-resize;
}

/* Title Bar */
.notes-window .title-bar {
    height: 40px;
    background: rgba(40, 40, 45, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    flex-shrink: 0;
    cursor: grab;
}

.notes-window .title-bar:active {
    cursor: grabbing;
}

/* Traffic Lights */
.notes-window .traffic-lights {
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 10;
}

.notes-window .traffic-light {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    position: relative;
    transition: all 0.15s cubic-bezier(0.2, 0.8, 0.2, 1);
    box-shadow: 
        inset 0 1px 1px rgba(255, 255, 255, 0.3),
        0 1px 2px rgba(0, 0, 0, 0.4);
}

.notes-window .traffic-light:hover {
    filter: brightness(1.15);
    transform: scale(1.05);
}

.notes-window .traffic-light:active {
    transform: scale(0.92);
    filter: brightness(0.95);
    transition: all 0.08s cubic-bezier(0.4, 0.0, 1, 1);
}

.notes-window .traffic-light.close {
    background: linear-gradient(135deg, #ff6057 0%, #ff5f57 100%);
}

.notes-window .traffic-light.minimize {
    background: linear-gradient(135deg, #ffbd2e 0%, #ffbe30 100%);
}

.notes-window .traffic-light.maximize {
    background: linear-gradient(135deg, #28ca42 0%, #29c941 100%);
}

.notes-window .window-title {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    font-size: 13px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.85);
    pointer-events: none;
}

/* Notes Content Layout */
.notes-content {
    display: flex;
    flex: 1;
    overflow: hidden;
    background: rgba(35, 35, 40, 0.95);
}

/* Sidebar */
.notes-sidebar {
    width: 200px;
    background: rgba(30, 30, 35, 0.98);
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.notes-folder {
    padding: 8px 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: background 0.2s ease;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.8);
}

.notes-folder:hover {
    background: rgba(255, 255, 255, 0.08);
}

.notes-folder.active {
    background: rgba(59, 130, 246, 0.3);
    color: #fff;
}

.notes-folder svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.notes-folder-name {
    flex: 1;
}

.notes-folder-count {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
}

.notes-section-title {
    padding: 16px 16px 8px;
    font-size: 11px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Notes List */
.notes-list {
    width: 300px;
    background: rgba(35, 35, 40, 0.95);
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.notes-list-header {
    padding: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.notes-list-title {
    font-size: 20px;
    font-weight: 600;
    color: #fff;
}

.notes-list-actions {
    display: flex;
    gap: 8px;
}

.notes-action-btn {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.notes-action-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

.notes-item {
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    cursor: pointer;
    transition: background 0.2s ease;
}

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

.notes-item.active {
    background: rgba(59, 130, 246, 0.2);
}

.notes-item-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 4px;
}

.notes-item-title {
    font-size: 14px;
    font-weight: 500;
    color: #fff;
}

.notes-item-time {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
}

.notes-item-preview {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Editor */
.notes-editor {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: rgba(45, 45, 50, 0.95);
    overflow: hidden;
}

.notes-editor-header {
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.notes-editor-time {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
}

.notes-editor-toolbar {
    display: flex;
    gap: 4px;
}

.notes-editor-content {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
}

.notes-editor-title {
    width: 100%;
    background: transparent;
    border: none;
    outline: none;
    font-size: 24px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 16px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
}

.notes-editor-title::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.notes-editor-body {
    width: 100%;
    min-height: 300px;
    background: transparent;
    border: none;
    outline: none;
    font-size: 15px;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.9);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    resize: none;
}

.notes-editor-body::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.notes-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: rgba(255, 255, 255, 0.4);
}

.notes-empty svg {
    width: 64px;
    height: 64px;
    margin-bottom: 16px;
    opacity: 0.3;
}

.notes-empty-text {
    font-size: 18px;
    font-weight: 500;
}

/* Scrollbar Styling */
.notes-sidebar::-webkit-scrollbar,
.notes-list::-webkit-scrollbar,
.notes-editor-content::-webkit-scrollbar {
    width: 8px;
}

.notes-sidebar::-webkit-scrollbar-track,
.notes-list::-webkit-scrollbar-track,
.notes-editor-content::-webkit-scrollbar-track {
    background: transparent;
}

.notes-sidebar::-webkit-scrollbar-thumb,
.notes-list::-webkit-scrollbar-thumb,
.notes-editor-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

.notes-sidebar::-webkit-scrollbar-thumb:hover,
.notes-list::-webkit-scrollbar-thumb:hover,
.notes-editor-content::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}
