/* =============================================
   Memo Panel Styles - 글래스모피즘 디자인
   ============================================= */

/* 메모 패널 (사이드 패널) */
.memo-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 380px;
    max-width: 100vw;
    height: 100vh;
    z-index: 9500;
    display: flex;
    flex-direction: column;
    
    /* 글래스모피즘 효과 */
    background: linear-gradient(135deg, rgba(30, 40, 50, 0.85) 0%, rgba(20, 30, 40, 0.9) 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: -8px 0 32px rgba(0, 0, 0, 0.3);
    
    /* 애니메이션 */
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.memo-panel:not(.hidden) {
    transform: translateX(0);
}

.memo-panel.hidden {
    pointer-events: none;
}

/* 리사이즈 핸들 */
.memo-resize-handle {
    position: absolute;
    left: 0;
    top: 0;
    width: 6px;
    height: 100%;
    cursor: ew-resize;
    background: transparent;
    z-index: 20;
    transition: background 0.2s ease;
}

.memo-resize-handle:hover,
.memo-resize-handle.active {
    background: rgba(74, 158, 255, 0.5);
}

.memo-resize-handle::before {
    content: '';
    position: absolute;
    left: 1px;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.memo-resize-handle:hover::before,
.memo-resize-handle.active::before {
    opacity: 1;
}

/* 리사이즈 중 선택 방지 */
.memo-panel.resizing {
    user-select: none;
}

.memo-panel.resizing * {
    pointer-events: none;
}

/* 헤더 */
.memo-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.03);
}

.memo-panel-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #fff;
    letter-spacing: 0.5px;
}

.memo-header-actions {
    display: flex;
    gap: 8px;
}

/* 아이콘 버튼 */
.memo-icon-btn {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: all 0.2s ease;
}

.memo-icon-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    transform: scale(1.05);
}

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

.memo-icon-btn.active {
    background: rgba(74, 158, 255, 0.3);
    color: #4a9eff;
}

.memo-icon-btn-small {
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    transition: all 0.2s ease;
}

.memo-icon-btn-small:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

/* 검색 바 */
.memo-search-bar {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    gap: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.2);
}

.memo-search-bar.hidden {
    display: none;
}

.memo-search-bar input {
    flex: 1;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 10px 14px;
    color: #fff;
    font-size: 14px;
    outline: none;
    transition: all 0.2s ease;
}

.memo-search-bar input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.memo-search-bar input:focus {
    border-color: rgba(74, 158, 255, 0.5);
    background: rgba(255, 255, 255, 0.1);
}

/* 폴더 목록 */
.memo-folder-list {
    padding: 12px;
    padding-bottom: 16px;
    border-bottom: none;
    background: rgba(0, 0, 0, 0.15);
    min-height: 100px;
    max-height: 50vh;
    overflow-y: auto;
    position: relative;
    flex-shrink: 0;
}

.memo-folder-list.hidden {
    display: none;
}

/* 폴더/메모 목록 리사이즈 핸들 */
.memo-folder-resize-handle {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 8px;
    cursor: ns-resize;
    background: transparent;
    z-index: 5;
    transition: background 0.2s ease;
}

.memo-folder-resize-handle::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.memo-folder-resize-handle:hover,
.memo-folder-resize-handle.active {
    background: rgba(74, 158, 255, 0.3);
}

.memo-folder-resize-handle:hover::before,
.memo-folder-resize-handle.active::before {
    opacity: 1;
}

/* 리사이즈 중 선택 방지 */
.memo-folder-list.resizing {
    user-select: none;
}

.memo-folder-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
}

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

.memo-folder-item.active {
    background: rgba(74, 158, 255, 0.2);
    color: #fff;
}

.memo-folder-item i {
    width: 18px;
    text-align: center;
    font-size: 14px;
}

.memo-folder-item span:first-of-type {
    flex: 1;
}

.memo-folder-count {
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
}

/* 폴더 편집/삭제 버튼 */
.memo-folder-edit,
.memo-folder-delete {
    opacity: 0;
    width: 24px;
    height: 24px;
    border: none;
    border-radius: 4px;
    background: transparent;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    transition: all 0.15s ease;
    margin-left: 2px;
}

.memo-folder-item:hover .memo-folder-edit,
.memo-folder-item:hover .memo-folder-delete {
    opacity: 1;
}

.memo-folder-edit:hover {
    background: rgba(74, 158, 255, 0.2);
    color: #4a9eff;
}

.memo-folder-delete:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

/* 폴더 이름 */
.memo-folder-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.memo-add-folder-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 10px 12px;
    margin-top: 8px;
    border: 1px dashed rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    background: transparent;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s ease;
}

.memo-add-folder-btn:hover {
    border-color: rgba(74, 158, 255, 0.5);
    color: #4a9eff;
    background: rgba(74, 158, 255, 0.1);
}

/* 메모 목록 */
.memo-list {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
}

.memo-list-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: rgba(255, 255, 255, 0.4);
    text-align: center;
    padding: 40px 20px;
}

.memo-list-empty i {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.memo-list-empty p {
    margin: 4px 0;
    font-size: 14px;
}

.memo-list-empty p:first-of-type {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.6);
}

/* 메모 아이템 */
.memo-item {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.memo-item:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-1px);
}

.memo-item.pinned {
    border-left: 3px solid #f59e0b;
}

.memo-item-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.memo-item-title {
    flex: 1;
    font-size: 15px;
    font-weight: 500;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.memo-item-pin {
    color: #f59e0b;
    font-size: 12px;
}

.memo-item-preview {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.5);
    line-height: 1.4;
    max-height: 40px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.memo-item-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 10px;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.4);
}

.memo-item-folder {
    display: flex;
    align-items: center;
    gap: 4px;
}

.memo-item-folder i {
    font-size: 10px;
}

/* 메모 에디터 */
.memo-editor {
    display: flex;
    flex-direction: column;
    height: 100%;
    position: absolute;
    top: 0;
    left: 6px; /* 리사이즈 핸들 너비만큼 여백 */
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(30, 40, 50, 0.95) 0%, rgba(20, 30, 40, 0.98) 100%);
    z-index: 5; /* 리사이즈 핸들(z-index: 10)보다 낮게 */
}

.memo-editor.hidden {
    display: none;
}

.memo-editor-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.03);
}

.memo-title-input {
    flex: 1;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 16px;
    font-weight: 500;
    outline: none;
    padding: 8px 0;
}

.memo-title-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.memo-editor-actions {
    display: flex;
    gap: 6px;
}

/* 에디터 툴바 */
.memo-editor-toolbar {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.2);
    flex-wrap: wrap;
}

.memo-format-btn {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    transition: all 0.15s ease;
}

.memo-format-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.memo-format-btn.active {
    background: rgba(74, 158, 255, 0.2);
    color: #4a9eff;
}

/* 헤딩 버튼 스타일 */
.memo-heading-btn {
    font-weight: 700;
    font-size: 12px;
    min-width: 28px;
}

.memo-heading-btn[data-heading="h1"] { font-size: 14px; }
.memo-heading-btn[data-heading="h2"] { font-size: 13px; }
.memo-heading-btn[data-heading="h3"] { font-size: 12px; }
.memo-heading-btn[data-heading="p"] { font-size: 11px; font-weight: 400; }

.memo-toolbar-divider {
    width: 1px;
    height: 20px;
    background: rgba(255, 255, 255, 0.15);
    margin: 0 6px;
}

/* 색상 선택기 */
.memo-color-picker-wrapper {
    position: relative;
    display: inline-block;
}

.memo-color-palette {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-top: 8px;
    padding: 8px;
    background: rgba(30, 30, 30, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    z-index: 100;
}

.memo-color-palette.hidden {
    display: none;
}

.memo-palette-color {
    width: 24px;
    height: 24px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    cursor: pointer;
    transition: transform 0.15s, border-color 0.15s;
}

.memo-palette-color:hover {
    transform: scale(1.15);
    border-color: rgba(255, 255, 255, 0.6);
}

.memo-palette-color[data-color="#ffffff"] {
    border-color: rgba(0, 0, 0, 0.3);
}

/* 밝은 테마 색상 팔레트 */
body[data-bg-color="#F1F1F1"] .memo-color-palette {
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

body[data-bg-color="#F1F1F1"] .memo-palette-color {
    border-color: rgba(0, 0, 0, 0.15);
}

body[data-bg-color="#F1F1F1"] .memo-palette-color:hover {
    border-color: rgba(0, 0, 0, 0.4);
}

/* 메모 내용 에디터 */
.memo-content-editor {
    flex: 1;
    padding: 16px 20px;
    color: #fff;
    font-size: 15px;
    line-height: 1.7;
    overflow-y: auto;
    outline: none;
}

.memo-content-editor:empty::before {
    content: attr(data-placeholder);
    color: rgba(255, 255, 255, 0.3);
    pointer-events: none;
}

.memo-content-editor ul,
.memo-content-editor ol {
    padding-left: 24px;
    margin: 8px 0;
}

.memo-content-editor li {
    margin: 4px 0;
}

/* 헤딩 스타일 */
.memo-content-editor h1 {
    font-size: 1.75em;
    font-weight: 700;
    margin: 0.8em 0 0.6em;
    line-height: 1.3;
}

.memo-content-editor h2 {
    font-size: 1.375em;
    font-weight: 600;
    margin: 0.7em 0 0.5em;
    line-height: 1.4;
}

.memo-content-editor h3 {
    font-size: 1.125em;
    font-weight: 600;
    margin: 0.6em 0 0.4em;
    line-height: 1.4;
}

.memo-content-editor p {
    margin: 8px 0;
}

/* 수평선 스타일 */
.memo-content-editor hr,
.memo-content-editor .memo-hr,
.memo-content-editor hr[style],
.memo-content-editor .memo-hr[style] {
    border: none !important;
    height: 1px !important;
    background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.5) 5%, rgba(255, 255, 255, 0.5) 95%, transparent 100%) !important;
    margin: 16px 0 !important;
}

/* 체크리스트 스타일 */
.memo-content-editor .memo-checklist-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 6px 0;
}

.memo-content-editor .memo-checkbox {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-radius: 4px;
    cursor: pointer;
    flex-shrink: 0;
    margin-top: 2px;
    transition: all 0.2s ease;
}

.memo-content-editor .memo-checkbox.checked {
    background: #10b981;
    border-color: #10b981;
}

.memo-content-editor .memo-checkbox.checked::after {
    content: '✓';
    color: #fff;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.memo-content-editor .memo-checklist-text.checked {
    text-decoration: line-through;
    color: rgba(255, 255, 255, 0.4);
}

/* 에디터 푸터 */
.memo-editor-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.2);
    font-size: 12px;
}

.memo-save-status {
    color: rgba(255, 255, 255, 0.5);
}

.memo-save-status.saving {
    color: #f59e0b;
}

.memo-save-status.saved {
    color: #10b981;
}

.memo-folder-select {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    padding: 6px 10px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 12px;
    outline: none;
    cursor: pointer;
    max-width: 150px;
}

.memo-folder-select option {
    background: #1a2530;
    color: #fff;
}

/* 더보기 메뉴 */
.memo-more-menu {
    position: absolute;
    top: 60px;
    right: 16px;
    background: rgba(30, 40, 50, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    padding: 8px;
    min-width: 180px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    z-index: 20;
}

.memo-more-menu.hidden {
    display: none;
}

.memo-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 12px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: rgba(255, 255, 255, 0.8);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.15s ease;
    text-align: left;
}

.memo-menu-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.memo-menu-item i {
    width: 16px;
    text-align: center;
    font-size: 13px;
}

.memo-menu-danger {
    color: #ef4444;
}

.memo-menu-danger:hover {
    background: rgba(239, 68, 68, 0.15);
}

.memo-menu-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 6px 0;
}

/* 폴더 모달 */
.memo-folder-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.memo-folder-modal.hidden {
    display: none;
}

.memo-folder-modal-content {
    background: linear-gradient(135deg, rgba(40, 50, 60, 0.98) 0%, rgba(30, 40, 50, 0.98) 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 16px;
    padding: 24px;
    width: 320px;
    max-width: 90vw;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.4);
}

.memo-folder-modal-content h4 {
    margin: 0 0 16px;
    color: #fff;
    font-size: 18px;
    font-weight: 600;
}

.memo-folder-modal-content input {
    width: 100%;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    padding: 12px 14px;
    color: #fff;
    font-size: 14px;
    outline: none;
    margin-bottom: 16px;
    box-sizing: border-box;
}

.memo-folder-modal-content input:focus {
    border-color: rgba(74, 158, 255, 0.5);
}

.memo-folder-colors {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.memo-color-btn {
    width: 32px;
    height: 32px;
    border: 2px solid transparent;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
}

.memo-color-btn:hover {
    transform: scale(1.1);
}

.memo-color-btn.active {
    border-color: #fff;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.3);
}

.memo-folder-modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.memo-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.memo-btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.8);
}

.memo-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
}

.memo-btn-primary {
    background: #4a9eff;
    color: #fff;
}

.memo-btn-primary:hover {
    background: #3b8bef;
}

/* 스크롤바 스타일 */
.memo-panel ::-webkit-scrollbar {
    width: 6px;
}

.memo-panel ::-webkit-scrollbar-track {
    background: transparent;
}

.memo-panel ::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.memo-panel ::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* 반응형 */
@media (max-width: 480px) {
    .memo-panel {
        width: 100vw;
    }
}

/* 태블릿에서 메모 기능 숨김 (터치 기기에서 패널 동작 문제) */
@media (max-width: 1024px) and (pointer: coarse),
       (max-width: 768px) {
    #memoButton {
        display: none !important;
    }
    
    .memo-panel {
        display: none !important;
    }
}

/* 밝은 배경 테마 대응 */
body[data-bg-color="#F1F1F1"] .memo-panel {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(245, 248, 252, 0.98) 100%) !important;
    border-left-color: rgba(0, 0, 0, 0.15) !important;
    box-shadow: -8px 0 32px rgba(0, 0, 0, 0.15) !important;
}

body[data-bg-color="#F1F1F1"] .memo-panel-header h3,
body[data-bg-color="#F1F1F1"] .memo-item-title,
body[data-bg-color="#F1F1F1"] .memo-title-input,
body[data-bg-color="#F1F1F1"] .memo-content-editor {
    color: #1a1a1a;
}

body[data-bg-color="#F1F1F1"] .memo-icon-btn {
    color: rgba(0, 0, 0, 0.6);
    background: rgba(0, 0, 0, 0.05);
}

body[data-bg-color="#F1F1F1"] .memo-icon-btn:hover {
    background: rgba(0, 0, 0, 0.1);
    color: #1a1a1a;
}

body[data-bg-color="#F1F1F1"] .memo-item {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.08);
}

body[data-bg-color="#F1F1F1"] .memo-item:hover {
    background: rgba(0, 0, 0, 0.06);
}

body[data-bg-color="#F1F1F1"] .memo-item-preview,
body[data-bg-color="#F1F1F1"] .memo-item-footer {
    color: rgba(0, 0, 0, 0.5);
}

body[data-bg-color="#F1F1F1"] .memo-search-bar input,
body[data-bg-color="#F1F1F1"] .memo-folder-select {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.1);
    color: #1a1a1a;
}

body[data-bg-color="#F1F1F1"] .memo-folder-item {
    color: rgba(0, 0, 0, 0.7);
}

body[data-bg-color="#F1F1F1"] .memo-folder-item:hover {
    background: rgba(0, 0, 0, 0.05);
}

body[data-bg-color="#F1F1F1"] .memo-folder-resize-handle::before {
    background: rgba(0, 0, 0, 0.2) !important;
}

body[data-bg-color="#F1F1F1"] .memo-folder-resize-handle:hover,
body[data-bg-color="#F1F1F1"] .memo-folder-resize-handle.active {
    background: rgba(74, 158, 255, 0.2) !important;
}

body[data-bg-color="#F1F1F1"] .memo-format-btn {
    color: rgba(0, 0, 0, 0.5);
}

body[data-bg-color="#F1F1F1"] .memo-format-btn:hover {
    background: rgba(0, 0, 0, 0.08);
    color: #1a1a1a;
}

body[data-bg-color="#F1F1F1"] .memo-title-input::placeholder {
    color: rgba(0, 0, 0, 0.4) !important;
}

body[data-bg-color="#F1F1F1"] .memo-content-editor:empty::before {
    color: rgba(0, 0, 0, 0.4) !important;
}

body[data-bg-color="#F1F1F1"] .memo-content-editor {
    color: #1a1a1a;
}

body[data-bg-color="#F1F1F1"] .memo-content-editor h1,
body[data-bg-color="#F1F1F1"] .memo-content-editor h2,
body[data-bg-color="#F1F1F1"] .memo-content-editor h3,
body[data-bg-color="#F1F1F1"] .memo-content-editor p,
body[data-bg-color="#F1F1F1"] .memo-content-editor li,
body[data-bg-color="#F1F1F1"] .memo-content-editor div,
body[data-bg-color="#F1F1F1"] .memo-content-editor ul,
body[data-bg-color="#F1F1F1"] .memo-content-editor ol {
    color: inherit;
}

body[data-bg-color="#F1F1F1"] .memo-content-editor span:not([style*="color"]),
body[data-bg-color="#F1F1F1"] .memo-content-editor font:not([color]) {
    color: #1a1a1a;
}

body[data-bg-color="#F1F1F1"] .memo-content-editor .memo-checkbox {
    border-color: rgba(0, 0, 0, 0.4) !important;
}

body[data-bg-color="#F1F1F1"] .memo-content-editor .memo-checklist-text.checked {
    color: rgba(0, 0, 0, 0.4) !important;
}

body[data-bg-color="#F1F1F1"] .memo-content-editor hr,
body[data-bg-color="#F1F1F1"] .memo-content-editor .memo-hr,
body[data-bg-color="#F1F1F1"] .memo-content-editor hr[style],
body[data-bg-color="#F1F1F1"] .memo-content-editor .memo-hr[style] {
    background: linear-gradient(90deg, transparent 0%, #cccccc 5%, #cccccc 95%, transparent 100%) !important;
}

body[data-bg-color="#F1F1F1"] .memo-editor {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 250, 252, 1) 100%) !important;
}

body[data-bg-color="#F1F1F1"] .memo-editor-header {
    background: rgba(0, 0, 0, 0.02) !important;
    border-bottom-color: rgba(0, 0, 0, 0.1) !important;
}

body[data-bg-color="#F1F1F1"] .memo-editor-footer {
    border-top-color: rgba(0, 0, 0, 0.1) !important;
}

body[data-bg-color="#F1F1F1"] .memo-save-status {
    color: rgba(0, 0, 0, 0.5) !important;
}

body[data-bg-color="#F1F1F1"] .memo-editor-toolbar {
    border-bottom-color: rgba(0, 0, 0, 0.1) !important;
}

body[data-bg-color="#F1F1F1"] .memo-toolbar-divider {
    background: rgba(0, 0, 0, 0.15) !important;
}

body[data-bg-color="#F1F1F1"] .memo-heading-btn {
    color: rgba(0, 0, 0, 0.6) !important;
}

body[data-bg-color="#F1F1F1"] .memo-heading-btn:hover {
    background: rgba(0, 0, 0, 0.08) !important;
    color: #1a1a1a !important;
}

body[data-bg-color="#F1F1F1"] .memo-add-folder-btn {
    border-color: rgba(0, 0, 0, 0.25) !important;
    color: rgba(0, 0, 0, 0.5) !important;
}

body[data-bg-color="#F1F1F1"] .memo-add-folder-btn:hover {
    border-color: rgba(74, 158, 255, 0.6) !important;
    color: #2080e0 !important;
    background: rgba(74, 158, 255, 0.1) !important;
}

body[data-bg-color="#F1F1F1"] .memo-folder-count {
    background: rgba(0, 0, 0, 0.1) !important;
    color: rgba(0, 0, 0, 0.6) !important;
}

body[data-bg-color="#F1F1F1"] .memo-folder-edit,
body[data-bg-color="#F1F1F1"] .memo-folder-delete {
    color: rgba(0, 0, 0, 0.4) !important;
}

body[data-bg-color="#F1F1F1"] .memo-folder-edit:hover {
    background: rgba(74, 158, 255, 0.15) !important;
    color: #2080e0 !important;
}

body[data-bg-color="#F1F1F1"] .memo-folder-delete:hover {
    background: rgba(239, 68, 68, 0.15) !important;
    color: #dc2626 !important;
}

body[data-bg-color="#F1F1F1"] .memo-folder-name-input {
    background: rgba(0, 0, 0, 0.05) !important;
    border-color: rgba(74, 158, 255, 0.5) !important;
    color: #1a1a1a !important;
}

/* =============================================
   검은색 배경 (#262626) 테마
   ============================================= */
body[data-bg-color="#262626"] .memo-panel {
    background: linear-gradient(135deg, rgba(50, 50, 55, 0.95) 0%, rgba(35, 35, 40, 0.98) 100%) !important;
    border-left: 1px solid rgba(255, 255, 255, 0.12) !important;
    box-shadow: -8px 0 32px rgba(0, 0, 0, 0.5) !important;
}

body[data-bg-color="#262626"] .memo-panel-header h3,
body[data-bg-color="#262626"] .memo-item-title,
body[data-bg-color="#262626"] .memo-title-input {
    color: #ffffff;
}

body[data-bg-color="#262626"] .memo-icon-btn {
    color: rgba(255, 255, 255, 0.8);
    background: rgba(255, 255, 255, 0.08);
}

body[data-bg-color="#262626"] .memo-icon-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
}

body[data-bg-color="#262626"] .memo-item {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.08);
}

body[data-bg-color="#262626"] .memo-item:hover {
    background: rgba(255, 255, 255, 0.08);
}

body[data-bg-color="#262626"] .memo-item-preview,
body[data-bg-color="#262626"] .memo-item-footer {
    color: rgba(255, 255, 255, 0.5);
}

body[data-bg-color="#262626"] .memo-search-bar input,
body[data-bg-color="#262626"] .memo-folder-select {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

body[data-bg-color="#262626"] .memo-search-bar input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

body[data-bg-color="#262626"] .memo-folder-item {
    color: rgba(255, 255, 255, 0.7);
}

body[data-bg-color="#262626"] .memo-folder-item:hover {
    background: rgba(255, 255, 255, 0.08);
}

body[data-bg-color="#262626"] .memo-format-btn {
    color: rgba(255, 255, 255, 0.6);
}

body[data-bg-color="#262626"] .memo-format-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
}

body[data-bg-color="#262626"] .memo-content-editor {
    color: #ffffff;
}

body[data-bg-color="#262626"] .memo-title-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

body[data-bg-color="#262626"] .memo-content-editor:empty::before {
    color: rgba(255, 255, 255, 0.4);
}

body[data-bg-color="#262626"] .memo-content-editor h1,
body[data-bg-color="#262626"] .memo-content-editor h2,
body[data-bg-color="#262626"] .memo-content-editor h3,
body[data-bg-color="#262626"] .memo-content-editor p,
body[data-bg-color="#262626"] .memo-content-editor li,
body[data-bg-color="#262626"] .memo-content-editor div {
    color: inherit;
}

body[data-bg-color="#262626"] .memo-content-editor span:not([style*="color"]),
body[data-bg-color="#262626"] .memo-content-editor font:not([color]) {
    color: #ffffff;
}

body[data-bg-color="#262626"] .memo-editor {
    background: linear-gradient(135deg, rgba(50, 50, 55, 0.98) 0%, rgba(40, 40, 45, 1) 100%) !important;
}

body[data-bg-color="#262626"] .memo-editor-header {
    background: rgba(255, 255, 255, 0.03) !important;
    border-bottom-color: rgba(255, 255, 255, 0.1) !important;
}

body[data-bg-color="#262626"] .memo-editor-footer {
    border-top-color: rgba(255, 255, 255, 0.08);
}

body[data-bg-color="#262626"] .memo-save-status {
    color: rgba(255, 255, 255, 0.5);
}

body[data-bg-color="#262626"] .memo-editor-toolbar {
    border-bottom-color: rgba(255, 255, 255, 0.08);
}

body[data-bg-color="#262626"] .memo-toolbar-divider {
    background: rgba(255, 255, 255, 0.15);
}

body[data-bg-color="#262626"] .memo-heading-btn {
    color: rgba(255, 255, 255, 0.7);
}

body[data-bg-color="#262626"] .memo-heading-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
}

/* =============================================
   녹색 배경 (#163A1B) 테마 - 기본
   ============================================= */
body[data-bg-color="#163A1B"] .memo-panel {
    background: linear-gradient(135deg, rgba(30, 60, 42, 0.95) 0%, rgba(22, 50, 32, 0.98) 100%) !important;
    border-left: 1px solid rgba(255, 255, 255, 0.15) !important;
    box-shadow: -8px 0 32px rgba(0, 0, 0, 0.3) !important;
}

body[data-bg-color="#163A1B"] .memo-panel-header h3,
body[data-bg-color="#163A1B"] .memo-item-title,
body[data-bg-color="#163A1B"] .memo-title-input {
    color: #ffffff;
}

body[data-bg-color="#163A1B"] .memo-icon-btn {
    color: rgba(255, 255, 255, 0.8);
    background: rgba(255, 255, 255, 0.08);
}

body[data-bg-color="#163A1B"] .memo-icon-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
}

body[data-bg-color="#163A1B"] .memo-item {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.08);
}

body[data-bg-color="#163A1B"] .memo-item:hover {
    background: rgba(255, 255, 255, 0.08);
}

body[data-bg-color="#163A1B"] .memo-item-preview,
body[data-bg-color="#163A1B"] .memo-item-footer {
    color: rgba(255, 255, 255, 0.5);
}

body[data-bg-color="#163A1B"] .memo-search-bar input,
body[data-bg-color="#163A1B"] .memo-folder-select {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

body[data-bg-color="#163A1B"] .memo-search-bar input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

body[data-bg-color="#163A1B"] .memo-folder-item {
    color: rgba(255, 255, 255, 0.7);
}

body[data-bg-color="#163A1B"] .memo-folder-item:hover {
    background: rgba(255, 255, 255, 0.08);
}

body[data-bg-color="#163A1B"] .memo-format-btn {
    color: rgba(255, 255, 255, 0.6);
}

body[data-bg-color="#163A1B"] .memo-format-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
}

body[data-bg-color="#163A1B"] .memo-content-editor {
    color: #ffffff;
}

body[data-bg-color="#163A1B"] .memo-title-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

body[data-bg-color="#163A1B"] .memo-content-editor:empty::before {
    color: rgba(255, 255, 255, 0.4);
}

body[data-bg-color="#163A1B"] .memo-content-editor h1,
body[data-bg-color="#163A1B"] .memo-content-editor h2,
body[data-bg-color="#163A1B"] .memo-content-editor h3,
body[data-bg-color="#163A1B"] .memo-content-editor p,
body[data-bg-color="#163A1B"] .memo-content-editor li,
body[data-bg-color="#163A1B"] .memo-content-editor div {
    color: inherit;
}

body[data-bg-color="#163A1B"] .memo-content-editor span:not([style*="color"]),
body[data-bg-color="#163A1B"] .memo-content-editor font:not([color]) {
    color: #ffffff;
}

body[data-bg-color="#163A1B"] .memo-editor {
    background: linear-gradient(135deg, rgba(30, 60, 42, 0.98) 0%, rgba(25, 52, 35, 1) 100%) !important;
}

body[data-bg-color="#163A1B"] .memo-editor-header {
    background: rgba(255, 255, 255, 0.03) !important;
    border-bottom-color: rgba(255, 255, 255, 0.1) !important;
}

body[data-bg-color="#163A1B"] .memo-editor-footer {
    border-top-color: rgba(255, 255, 255, 0.08);
}

body[data-bg-color="#163A1B"] .memo-save-status {
    color: rgba(255, 255, 255, 0.5);
}

body[data-bg-color="#163A1B"] .memo-editor-toolbar {
    border-bottom-color: rgba(255, 255, 255, 0.08);
}

body[data-bg-color="#163A1B"] .memo-toolbar-divider {
    background: rgba(255, 255, 255, 0.15);
}

body[data-bg-color="#163A1B"] .memo-heading-btn {
    color: rgba(255, 255, 255, 0.7);
}

body[data-bg-color="#163A1B"] .memo-heading-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
}

/* =============================================
   메모 프레젠테이션 오버레이
   ============================================= */

.memo-present-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.memo-present-overlay.active {
    display: flex;
}

.memo-present-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: #fff;
    font-size: 32px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10001;
    transition: background 0.3s, transform 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.memo-present-close:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.1);
}

.memo-present-content {
    width: 92vw;
    height: 80vh;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 50px 80px;
    background: linear-gradient(135deg, rgba(22, 58, 27, 0.97) 0%, rgba(30, 70, 35, 0.98) 100%);
    border-radius: 16px;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #ffffff;
    line-height: 1.8;
}

.memo-present-content-inner {
    font-size: 24px;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.memo-present-content h1 {
    font-size: 48px;
    margin-bottom: 20px;
    color: #ffffff;
}

.memo-present-content h2 {
    font-size: 2em;
    margin-bottom: 0.5em;
    color: rgba(255, 255, 255, 0.95);
}

.memo-present-content h3 {
    font-size: 1.5em;
    margin-bottom: 0.5em;
    color: rgba(255, 255, 255, 0.9);
}

.memo-present-content p,
.memo-present-content div {
    color: #ffffff;
}

.memo-present-content span:not([style*="color"]),
.memo-present-content font:not([color]) {
    color: #ffffff;
}

.memo-present-content p {
    margin-bottom: 1em;
}

.memo-present-content ul,
.memo-present-content ol {
    margin-left: 1.5em;
    margin-bottom: 1em;
}

.memo-present-content li {
    margin-bottom: 0.5em;
}

.memo-present-content hr,
.memo-present-content .memo-hr,
.memo-present-content hr[style],
.memo-present-content .memo-hr[style] {
    border: none !important;
    height: 1px !important;
    background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.5) 5%, rgba(255, 255, 255, 0.5) 95%, transparent 100%) !important;
    margin: 2em 0 !important;
}

.memo-present-controls {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    padding: 12px 20px;
    border-radius: 50px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.memo-present-control-btn {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: #fff;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: background 0.2s, transform 0.2s;
}

.memo-present-control-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.1);
}

.memo-present-zoom-level {
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    min-width: 50px;
    text-align: center;
}

/* 프레젠테이션 테마 - 흰색 배경 */
.memo-present-overlay[data-theme="#F1F1F1"] .memo-present-content {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 250, 252, 0.98) 100%);
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.3);
    color: #1a1a1a;
}

.memo-present-overlay[data-theme="#F1F1F1"] .memo-present-content h1 {
    color: #111;
}

.memo-present-overlay[data-theme="#F1F1F1"] .memo-present-content h2 {
    color: #222;
}

.memo-present-overlay[data-theme="#F1F1F1"] .memo-present-content h3 {
    color: #333;
}

.memo-present-overlay[data-theme="#F1F1F1"] .memo-present-content p,
.memo-present-overlay[data-theme="#F1F1F1"] .memo-present-content div,
.memo-present-overlay[data-theme="#F1F1F1"] .memo-present-content li {
    color: #1a1a1a;
}

.memo-present-overlay[data-theme="#F1F1F1"] .memo-present-content span:not([style*="color"]),
.memo-present-overlay[data-theme="#F1F1F1"] .memo-present-content font:not([color]) {
    color: #1a1a1a;
}

.memo-present-overlay[data-theme="#F1F1F1"] .memo-present-content hr,
.memo-present-overlay[data-theme="#F1F1F1"] .memo-present-content .memo-hr,
.memo-present-overlay[data-theme="#F1F1F1"] .memo-present-content hr[style],
.memo-present-overlay[data-theme="#F1F1F1"] .memo-present-content .memo-hr[style] {
    background: linear-gradient(90deg, transparent 0%, #cccccc 5%, #cccccc 95%, transparent 100%) !important;
    height: 1px !important;
}

/* 프레젠테이션 테마 - 검정 배경 */
.memo-present-overlay[data-theme="#262626"] .memo-present-content {
    background: linear-gradient(135deg, rgba(38, 38, 38, 0.98) 0%, rgba(45, 45, 50, 0.98) 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.5);
    color: #ffffff;
}

.memo-present-overlay[data-theme="#262626"] .memo-present-content h1 {
    color: #ffffff;
}

.memo-present-overlay[data-theme="#262626"] .memo-present-content h2 {
    color: rgba(255, 255, 255, 0.95);
}

.memo-present-overlay[data-theme="#262626"] .memo-present-content h3 {
    color: rgba(255, 255, 255, 0.9);
}

.memo-present-overlay[data-theme="#262626"] .memo-present-content p,
.memo-present-overlay[data-theme="#262626"] .memo-present-content div,
.memo-present-overlay[data-theme="#262626"] .memo-present-content li {
    color: #ffffff;
}

.memo-present-overlay[data-theme="#262626"] .memo-present-content span:not([style*="color"]),
.memo-present-overlay[data-theme="#262626"] .memo-present-content font:not([color]) {
    color: #ffffff;
}

.memo-present-overlay[data-theme="#262626"] .memo-present-content hr,
.memo-present-overlay[data-theme="#262626"] .memo-present-content .memo-hr,
.memo-present-overlay[data-theme="#262626"] .memo-present-content hr[style],
.memo-present-overlay[data-theme="#262626"] .memo-present-content .memo-hr[style] {
    background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.5) 5%, rgba(255, 255, 255, 0.5) 95%, transparent 100%) !important;
}

/* 프레젠테이션 테마 - 초록 배경 (기본값) */
.memo-present-overlay[data-theme="#163A1B"] .memo-present-content {
    background: linear-gradient(135deg, rgba(22, 58, 27, 0.97) 0%, rgba(30, 70, 35, 0.98) 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    color: #ffffff;
}
