/* Inter 폰트 import - 최적화된 로딩 */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* Inter 폰트 preload로 더 빠른 로딩 */
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 300 700;
    font-display: swap;
    src: url('https://fonts.gstatic.com/s/inter/v13/UcCO3FwrK3iLTeHuS_fvQtMwCp50KnMw2boKoduKmMEVuLyfAZ9hiA.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* CSS 변수 (테마)4 */
:root {
    --primary-color: #6366f1;
    --primary-hover: #5856eb;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --danger-hover: #dc2626;
    --background: #fafbfc;
    --surface: #f5f5f5;
    --surface-hover: #e2e8f0;
    --surface-elevated: #ffffff;
    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --border: #e2e8f0;
    --border-hover: #cbd5e1;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] {
    --primary-color: #8b5cf6;
    --primary-hover: #7c3aed;
    --secondary-color: #9ca3af;
    --success-color: #34d399;
    --warning-color: #fbbf24;
    --danger-color: #f87171;
    --danger-hover: #ef4444;
    --background: #1f1f1f;
    --surface: #1f1f1f;
    --surface-hover: #374151;
    --surface-elevated: #36404f;
    --text-primary: #f1f5f9;
    --text-secondary: #9ca3af;
    --border: #282828;
    --border-hover: #36404f;
}

/* 다크모드 body 배경색 강제 적용 */
[data-theme="dark"] body {
    background-color: #1f1f1f !important;
}

/* 다크모드에서 로고 스타일 개선 */
[data-theme="dark"] .logo {
    background: transparent;
    border: none;
    box-shadow: none;
    color: var(--text-primary);
}

[data-theme="dark"] .logo:hover {
    background: transparent;
    border: none;
    box-shadow: none;
}

[data-theme="dark"] .logo i {
    filter: drop-shadow(0 1px 2px rgba(139, 92, 246, 0.4));
}

[data-theme="dark"] .logo-icon {
    filter: drop-shadow(0 1px 2px rgba(139, 92, 246, 0.4));
}

[data-theme="dark"] .logo:hover i {
    filter: drop-shadow(0 2px 4px rgba(139, 92, 246, 0.5));
}

[data-theme="dark"] .logo:hover .logo-icon {
    filter: drop-shadow(0 2px 4px rgba(139, 92, 246, 0.5));
}

[data-theme="dark"] .logo-text {
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .logo:hover .logo-text {
    text-shadow: 0 1px 3px rgba(139, 92, 246, 0.3);
}

/* 기본 스타일 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 전체 텍스트 렌더링 품질 개선 */
html {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    /* 웹 폰트 최적화 */
    font-variant-ligatures: common-ligatures;
    font-feature-settings: "kern" 1, "liga" 1, "calt" 1;
}

/* 탭 포커스 완전 비활성화 (마인드맵에서만 사용) */
*:not(input):not(textarea) {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    outline: none !important;
    -webkit-tap-highlight-color: transparent;
}

/* 포커스 가능한 요소들의 탭 인덱스 제거 */
button, a, [tabindex] {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Malgun Gothic', '맑은 고딕', sans-serif;
    background-color: var(--background);
    color: var(--text-primary);
    line-height: 1.5;
    overflow: hidden;
    /* Inter 폰트 최적화 렌더링 */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    font-kerning: auto;
    font-feature-settings: "liga", "kern";
    font-variant-ligatures: common-ligatures;
    font-optical-sizing: auto;
}

/* 앱 컨테이너 */
.app-container {
    height: 100vh;
    display: flex;
    flex-direction: column;
}

/* 메뉴바 레이아웃 */
.left-menubar, .right-menubar {
    position: fixed;
    top: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.6rem;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 2rem;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    z-index: 100;
    height: auto;
    box-sizing: border-box;
    transition: all 0.3s ease;
}

.left-menubar {
    left: 1rem;
    padding: 0.35rem 0.6rem;
}

.right-menubar {
    right: 1rem;
    justify-content: flex-end;
}

.right-menubar .user-name {
    padding-left: 1rem;
}

[data-theme="dark"] .left-menubar,
[data-theme="dark"] .right-menubar {
    background: rgba(55, 65, 81, 0.95);
    border-color: rgba(139, 92, 246, 0.3);
}

/* 기존 툴바 스타일 제거 */
.toolbar {
    display: none;
}

.toolbar-left, .toolbar-right {
    display: none;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--primary-color);
    padding: 0.25rem 0.5rem;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
    background: transparent;
    border: none;
    box-shadow: none;
    position: relative;
}

.logo:hover {
    transform: translateY(-0.5px);
    background: transparent;
    border: none;
    box-shadow: none;
}

.logo i {
    font-size: 1.25rem;
    filter: drop-shadow(0 1px 2px rgba(99, 102, 241, 0.3));
    transition: all 0.2s ease;
}

.logo-icon {
    width: 24px;
    height: 24px;
    filter: drop-shadow(0 1px 2px rgba(99, 102, 241, 0.3));
    transition: all 0.2s ease;
    pointer-events: none;
}

.logo:hover i {
    transform: scale(1.05);
    filter: drop-shadow(0 2px 4px rgba(99, 102, 241, 0.4));
}

.logo:hover .logo-icon {
    transform: scale(1.05);
    filter: drop-shadow(0 2px 4px rgba(99, 102, 241, 0.4));
}

.logo-text {
    letter-spacing: -0.01em;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease;
}

.mindmap-title {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-color);
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    background: var(--background-primary);
    border: none;
    min-width: 120px;
    max-width: 350px;
    overflow: visible;
    white-space: nowrap;
    transition: width 0.1s ease, all 0.2s ease;
    position: relative;
    display: inline-block;
    min-height: 36px;
    line-height: 1.4;
}

.mindmap-name {
    cursor: pointer;
    display: block;
    user-select: none;
    transition: all 0.2s ease;
}

.mindmap-name:hover {
    background: var(--surface-elevated);
}

.mindmap-name-input {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-color);
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    background: var(--surface-elevated);
    border: 2px solid var(--primary-color);
    min-width: 200px;
    max-width: 350px;
    width: auto;
    font-family: inherit;
    outline: none;
    position: absolute;
    top: -2px;
    left: 0;
    z-index: 10;
    box-sizing: border-box;
    height: auto;
    min-height: 36px;
    line-height: 1.4;
}

.logo:hover .logo-text {
    text-shadow: 0 1px 3px rgba(99, 102, 241, 0.2);
}

.separator {
    width: 1px;
    height: 1.5rem;
    background: var(--border);
    margin: 0 0.5rem;
}

/* 버튼 스타일- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    background: transparent;
    color: var(--text-primary);
}

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

.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    border-radius: 0.375rem;
    gap: 0.25rem;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

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

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

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

.btn-success {
    background: var(--success-color);
    color: white;
}

.btn-success:hover {
    background: #059669;
    box-shadow: var(--shadow-lg);
}

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

.btn-outline:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: rgba(99, 102, 241, 0.05);
}

.btn-danger {
    background: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
    box-shadow: var(--shadow-lg);
}

.btn-icon {
    padding: 0.5rem;
    border-radius: 0.375rem;
}

.btn-close {
    padding: 0.25rem;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: 0.25rem;
    transition: all 0.2s ease;
}

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

/* 버튼 비활성화 스타일 */
.btn.disabled,
.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: var(--secondary-color) !important;
    color: var(--text-secondary) !important;
    pointer-events: none;
}

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

/* 캔버스 컨테이너 */
.canvas-container {
    flex: 1;
    position: relative;
    overflow: hidden;
    background: var(--surface);
    margin-top: 0; /* 라운드 메뉴바는 absolute positioning이므로 margin 제거 */
}

/* 다크모드 캔버스 컨테이너 배경색 강제 적용 */
[data-theme="dark"] .canvas-container {
    background: #1f1f1f !important;
}

#mindMapCanvas {
    width: 100%;
    height: 100%;
    cursor: grab;
    outline: none; /* 포커스 아웃라인 제거 */
    /* 피그마/iOS 스타일의 Canvas 텍스트 렌더링 최적화 */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    /* 웹 환경에서 네이티브 앱 수준의 렌더링 품질 */
    font-kerning: auto;
    font-variant-ligatures: common-ligatures;
}

#mindMapCanvas:active {
    cursor: grabbing;
}

#mindMapCanvas:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: -2px;
}

/* 노드 에디터 */
.node-editor {
    position: absolute;
    top: 50%;
    right: 1rem;
    transform: translateY(-50%);
    width: 300px;
    background: var(--surface-elevated);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    box-shadow: var(--shadow-xl);
    z-index: 200;
    max-height: calc(100vh - 8rem);
    overflow-y: auto;
    transition: all 0.3s ease;
}

/* 첫 번째 메뉴 박스 (기본 기능들) - 좌측 중앙 */
.primary-menu {
    position: absolute !important;
    top: 50% !important;
    left: 1rem !important;
    right: auto !important;
    transform: translateY(-50%) !important;
}

/* 두 번째 메뉴 박스 (스타일 기능들) - 우측 중앙 */
.secondary-menu {
    position: absolute !important;
    top: 50% !important;
    right: 1rem !important;
    left: auto !important;
    transform: translateY(-50%) !important;
}

/* 노드 에디터 최소화 상태 */
.node-editor.minimized {
    width: 60px;
    height: auto;
    max-height: none;
    overflow: visible;
    border-radius: 2rem;
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(99, 102, 241, 0.2);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

[data-theme="dark"] .node-editor.minimized {
    background: rgba(55, 65, 81, 0.95);
    border-color: rgba(139, 92, 246, 0.3);
}

/* 두 번째 메뉴 박스 위치 조정 */
.node-editor.secondary-menu {
    top: calc(6rem + 300px); /* 첫 번째 박스 아래에 위치 */
}

.node-editor.minimized .editor-header {
    border-bottom: none;
    padding: 0.5rem;
    justify-content: center;
}

.node-editor.minimized .editor-header h3 {
    display: none;
}

/* 노드 편집기는 항상 minimized 상태로만 표시 */
.node-editor.minimized .editor-icon-buttons {
    display: flex;
}

/* 최소화 토글 버튼 (사용 안함) */
.editor-toggle-btn {
    display: none;
}

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

.node-editor.minimized .editor-toggle-btn {
    display: none; /* 최소화 상태에서는 토글 버튼 숨김 */
}

/* 아이콘 버튼 그룹 - 수직 탭 스타일 */
.editor-icon-buttons {
    display: none;
    flex-direction: column;
    gap: 0.5rem;
    padding: 1rem 0.5rem;
    max-height: calc(100vh - 10rem);
    overflow-y: auto;
    overflow-x: hidden;
}

/* 스크롤바 스타일 */
.editor-icon-buttons::-webkit-scrollbar {
    width: 4px;
}

.editor-icon-buttons::-webkit-scrollbar-track {
    background: transparent;
}

.editor-icon-buttons::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 2px;
}

.editor-icon-buttons::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

.node-editor.minimized .editor-icon-buttons {
    display: flex;
}

.icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    border-radius: 0.75rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 1rem;
    position: relative;
    overflow: hidden;
}

.icon-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--primary-color);
    border-radius: 0.75rem;
    transform: scale(0);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: -1;
}

.icon-btn:hover::before {
    transform: scale(1);
}

.icon-btn:hover {
    color: white;
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
}

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

.icon-btn.active {
    color: white;
}

/* 툴팁 스타일 개선 */
.icon-btn {
    position: relative;
}

.icon-btn::after {
    content: attr(title);
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.75rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    margin-left: 0.5rem;
    z-index: 1000;
}

.icon-btn:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translateY(-50%) translateX(0);
}

/* 다크모드 대응 */
[data-theme="dark"] .icon-btn::after {
    background: rgba(255, 255, 255, 0.9);
    color: var(--text-primary);
}

/* 확장 가능한 버튼 스타일 */
.expandable-btn {
    position: relative;
}

/* 커스텀 연결선 타입 아이콘 - 크고 직관적인 디자인 */
.connection-type-icon {
    width: 20px;
    height: 20px;
    position: relative;
    display: inline-block;
}

/* 더 큰 두 개의 원과 명확한 직선 연결선 */
.connection-type-icon::before {
    content: '';
    position: absolute;
    width: 5px;
    height: 5px;
    background: currentColor;
    border-radius: 50%;
    top: 2px;
    left: 2px;
    box-shadow: 11px 11px 0 currentColor;
}

.connection-type-icon::after {
    content: '';
    position: absolute;
    width: 12px;
    height: 2px;
    background: currentColor;
    top: 9px;
    left: 4px;
    transform: rotate(45deg);
    border-radius: 1px;
}

/* 서브메뉴 팝업 스타일 */
.submenu-popup {
    position: absolute;
    right: 100%;
    top: 0;
    margin-right: 0.25rem;
    background: var(--surface-elevated);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateX(10px) scale(0.95);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 160px;
    max-width: 200px;
    padding: 0.25rem;
}

.submenu-popup.show {
    opacity: 1;
    visibility: visible;
    transform: translateX(0) scale(1);
}

.submenu-header {
    padding: 0.75rem 1rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* 색상 그리드 */
.color-grid {
    padding: 1rem;
}

/* 기존 색상들을 감싸는 컨테이너 */
.default-colors-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
}

.color-item {
    width: 28px;
    height: 28px;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid #e5e7eb;
    position: relative;
}

.color-item::after {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 0.5rem;
    background: transparent;
    border: 2px solid transparent;
    transition: all 0.2s ease;
}

.color-item:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.color-item:hover::after {
    border-color: #6366f1;
}

/* 최근 사용 색상 행 */
.recent-colors-row {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    align-items: center;
    padding-bottom: 8px;
    border-bottom: 1px solid #e5e7eb;
}

/* 색상 피커 아이템 - 플러스 아이콘 */
.color-picker-item {
    width: 28px;
    height: 28px;
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 0.375rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 2px dashed #cbd5e1;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.plus-icon {
    position: relative;
    width: 14px;
    height: 14px;
    z-index: 1;
    pointer-events: none;
}

.plus-horizontal {
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 2px;
    background: #6b7280;
    transform: translateY(-50%);
    border-radius: 1px;
    transition: all 0.3s ease;
}

.plus-vertical {
    position: absolute;
    left: 50%;
    top: 0;
    width: 2px;
    height: 100%;
    background: #6b7280;
    transform: translateX(-50%);
    border-radius: 1px;
    transition: all 0.3s ease;
}

.color-picker-item input[type="color"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    border: none;
    border-radius: 0.375rem;
    cursor: pointer;
}

.color-picker-item input[type="color"]::-webkit-color-swatch-wrapper {
    display: none;
}

.color-picker-item input[type="color"]::-webkit-color-swatch {
    display: none;
}

.color-picker-item:hover {
    transform: scale(1.1);
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    border-color: #6366f1;
    border-style: solid;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.color-picker-item:hover .plus-horizontal,
.color-picker-item:hover .plus-vertical {
    background: white;
}

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

/* 최근 사용 색상 아이템 */
.recent-color-item {
    width: 28px;
    height: 28px;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid #e5e7eb;
    flex-shrink: 0;
    position: relative;
}

.recent-color-item::after {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 0.5rem;
    background: transparent;
    border: 2px solid transparent;
    transition: all 0.2s ease;
}

.recent-color-item:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.recent-color-item:hover::after {
    border-color: #6366f1;
}

/* 크기 목록 */
.size-list {
    padding: 0.5rem;
}

.size-item {
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    border-radius: 0.375rem;
    transition: all 0.2s ease;
    font-size: 0.875rem;
    font-weight: 500;
}

.size-item:hover {
    background: var(--primary-color);
    color: white;
    transform: translateX(4px);
}

/* 정렬 목록 */
.align-list {
    padding: 0.5rem;
}

.align-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    border-radius: 0.375rem;
    transition: all 0.2s ease;
    font-size: 0.875rem;
}

.align-item:hover {
    background: var(--primary-color);
    color: white;
    transform: translateX(4px);
}

.align-item.active {
    background: var(--primary-color);
    color: white;
}

.align-item i {
    width: 16px;
}

/* 연결선 목록 */
.connection-list {
    padding: 0.5rem;
}

.connection-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    border-radius: 0.375rem;
    transition: all 0.2s ease;
    font-size: 0.875rem;
}

.connection-item:hover {
    background: var(--primary-color);
    color: white;
    transform: translateX(4px);
}

.connection-item.active {
    background: var(--primary-color);
    color: white;
}

/* 노드 모양 메뉴에서는 배경 제거 */
#node-shape-menu .connection-item.active {
    background: none;
    color: inherit;
}

#node-shape-menu .connection-item:hover {
    background: var(--surface-hover);
    color: inherit;
    transform: translateX(4px);
}

/* 노드 모양 메뉴에서 shape-option 스타일 오버라이드 */
#node-shape-menu .shape-option {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    border: none;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: all 0.2s ease;
    background: none;
    color: inherit;
    font-size: 0.875rem;
}

#node-shape-menu .shape-option:hover {
    background: var(--surface-hover);
    transform: translateX(4px);
}

#node-shape-menu .shape-option.active {
    background: none;
    color: inherit;
}

.connection-item svg {
    color: inherit;
}

/* 화살표 설정 */
.arrow-settings {
    padding: 0.5rem;
}

.arrow-toggle {
    display: flex;
    gap: 0.25rem;
    margin-bottom: 0.5rem;
}

.toggle-btn {
    flex: 1;
    padding: 0.5rem;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-secondary);
    border-radius: 0.375rem;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.75rem;
}

.toggle-btn:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* 선 굵기 설정 */
.line-width-settings {
    padding: 0.75rem 0;
}

.line-width-list {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.line-width-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    border-radius: 0.375rem;
    transition: all 0.2s ease;
    font-size: 0.875rem;
}

.line-width-item:hover {
    background: var(--primary-color);
    color: white;
    transform: translateX(4px);
}

.line-width-item svg {
    color: inherit;
}

.line-width-item.active {
    background: var(--primary-color);
    color: white;
}

/* 아이콘 버튼 구분선 */
.icon-separator {
    width: 32px;
    height: 1px;
    background: var(--border);
    margin: 0.25rem auto;
    opacity: 0.5;
}

/* 위험 버튼 스타일 */
.btn-danger-icon {
    color: var(--danger-color) !important;
}

.btn-danger-icon::before {
    background: var(--danger-color) !important;
}

.btn-danger-icon:hover {
    box-shadow: 0 8px 25px rgba(239, 68, 68, 0.3) !important;
}

.editor-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    border-bottom: 1px solid var(--border);
    gap: 0.5rem; /* 버튼 간격 추가 */
}

.editor-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    flex: 1; /* 제목이 남은 공간을 차지하도록 */
}

/* 최소화 토글 버튼 */
.editor-toggle-btn {
    display: flex; /* 항상 표시되도록 수정 */
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: 0.375rem;
    transition: all 0.2s ease;
    font-size: 0.875rem;
    width: 32px;
    height: 32px;
}

.editor-toggle-btn:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: translateY(-1px);
}

.editor-content {
    padding: 1rem;
}

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

.label-with-action {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.label-with-action label {
    margin-bottom: 0;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
}

.label-with-action .btn {
    margin-left: auto;
    font-size: 0.75rem;
    padding: 0.375rem 0.5rem;
}

/* 색상 탭 스타일 */
.color-tab-container {
    margin-bottom: 1rem;
}

.color-tab-header {
    display: flex;
    border-bottom: 2px solid var(--border);
    margin-bottom: 0.75rem;
}

.color-tab {
    flex: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    background: var(--surface);
    border: 1px solid var(--border);
    border-bottom: none;
    margin-right: 1px;
    transition: all 0.2s ease;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.color-tab:last-child {
    margin-right: 0;
}

.color-tab:hover {
    background: var(--surface-elevated);
    color: var(--text-primary);
}

.color-tab.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: translateY(1px);
}

.color-tab .btn {
    font-size: 0.7rem;
    padding: 0.25rem 0.4rem;
    margin-left: 0.5rem;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: inherit;
}

.color-tab .btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.color-tab:not(.active) .btn {
    background: var(--border);
    border-color: var(--border-hover);
    color: var(--text-secondary);
}

.color-tab-content {
    position: relative;
}

.color-tab-panel {
    display: none;
}

.color-tab-panel.active {
    display: block;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
}

.form-group input[type="text"] {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    background: var(--surface);
    color: var(--text-primary);
    font-size: 0.875rem;
    transition: border-color 0.2s ease;
}

.form-group input[type="text"]:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    background: var(--surface);
    color: var(--text-primary);
    font-size: 0.875rem;
    font-family: 'Inter', sans-serif;
    resize: vertical;
    min-height: 60px;
    transition: border-color 0.2s ease;
}

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

.color-picker {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.color-picker input[type="color"] {
    width: 2.5rem;
    height: 2.5rem;
    border: none;
    border-radius: 0.375rem;
    cursor: pointer;
}

.color-presets {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.375rem;
    max-width: 280px;
}

.color-preset {
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 0.25rem;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s ease;
}

/* 흰색 프리셋에 테두리 추가 */
.color-preset[style*="#ffffff"] {
    border-color: var(--border);
}

/* 투명 프리셋 스타일 */
.color-preset.transparent {
    background: repeating-linear-gradient(
        45deg,
        #f8f9fa,
        #f8f9fa 4px,
        #ffffff 4px,
        #ffffff 8px
    ) !important;
    border-color: var(--border) !important;
}

.color-preset:hover {
    border-color: var(--text-primary);
    transform: scale(1.1);
}

.form-group input[type="range"] {
    width: 100%;
    margin: 0.5rem 0;
}

#fontSizeValue {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* 연결선 타입 선택 */
.connection-type-selector {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.connection-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 0.5rem;
    border: 2px solid var(--border);
    border-radius: 0.375rem;
    cursor: pointer;
    transition: all 0.2s ease;
    background: var(--surface);
    color: var(--text-secondary);
}

.connection-option:hover {
    border-color: var(--primary-color);
    background: var(--surface-elevated);
    transform: translateY(-1px);
}

.connection-option.active {
    border-color: var(--primary-color);
    background: var(--primary-color);
    color: white;
}

.connection-option svg {
    width: 40px;
    height: 20px;
    color: inherit;
}

.connection-option span {
    font-size: 0.75rem;
    font-weight: 500;
    text-align: center;
    line-height: 1;
}

/* 노드 모양 선택 */
.node-shape-selector {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.shape-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 0.5rem;
    border: 2px solid var(--border);
    border-radius: 0.375rem;
    cursor: pointer;
    transition: all 0.2s ease;
    background: var(--surface);
    color: var(--text-secondary);
}

.shape-option:hover {
    border-color: var(--primary-color);
    background: var(--surface-elevated);
    transform: translateY(-1px);
}

.shape-option.active {
    border-color: var(--primary-color);
    background: var(--primary-color);
    color: white;
}

.shape-preview {
    width: 32px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
}

.box-shape {
    background: currentColor;
    border-radius: 4px;
    opacity: 0.8;
}

.text-shape {
    background: none;
    color: inherit;
}

.shape-option span {
    font-size: 0.75rem;
    font-weight: 500;
    text-align: center;
    line-height: 1;
}

/* 화살표 설정 */
.arrow-settings {
    margin-top: 0.5rem;
}

.checkbox-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    user-select: none;
}

.checkbox-custom {
    position: relative;
    width: 18px;
    height: 18px;
    border: 2px solid var(--border);
    border-radius: 0.25rem;
    transition: all 0.2s ease;
}

.checkbox-option input[type="checkbox"] {
    display: none;
}

.checkbox-option input[type="checkbox"]:checked + .checkbox-custom {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.checkbox-option input[type="checkbox"]:checked + .checkbox-custom::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 12px;
    font-weight: bold;
}

.arrow-position-selector {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.arrow-type-selector {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.arrow-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 0.5rem;
    border: 2px solid var(--border);
    border-radius: 0.375rem;
    cursor: pointer;
    transition: all 0.2s ease;
    background: var(--surface);
    color: var(--text-secondary);
}

.arrow-option:hover {
    border-color: var(--primary-color);
    background: var(--surface-elevated);
    transform: translateY(-1px);
}

.arrow-option.active {
    border-color: var(--primary-color);
    background: var(--primary-color);
    color: white;
}

.arrow-option svg {
    width: 40px;
    height: 20px;
    color: inherit;
}

.arrow-option span {
    font-size: 0.75rem;
    font-weight: 500;
    text-align: center;
    line-height: 1;
}

/* 텍스트 정렬 선택 */
.text-align-selector {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.text-align-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 0.5rem;
    border: 2px solid var(--border);
    border-radius: 0.375rem;
    cursor: pointer;
    transition: all 0.2s ease;
    background: var(--surface);
    color: var(--text-secondary);
}

.text-align-option:hover {
    border-color: var(--primary-color);
    background: var(--surface-elevated);
    transform: translateY(-1px);
}

.text-align-option.active {
    border-color: var(--primary-color);
    background: var(--primary-color);
    color: white;
}

.text-align-option i {
    font-size: 1rem;
    margin-bottom: 0.2rem;
}

.text-align-option span {
    font-size: 0.75rem;
    font-weight: 500;
    text-align: center;
    line-height: 1;
}

.editor-actions {
    display: flex;
    gap: 0.5rem;
    padding: 1rem;
    border-top: 1px solid var(--border);
}

.editor-actions .btn {
    flex: 1;
    justify-content: center;
}

/* 상태바 */
.statusbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 1rem;
    background: var(--surface-elevated);
    border-top: 1px solid var(--border);
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.status-left, .status-center, .status-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.status-center {
    flex: 1;
    justify-content: center;
    gap: 0.5rem;
}

/* 편집 잠금 버튼 */
.edit-lock-btn {
    background: none;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 0.375rem;
    border-radius: 0.375rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    transition: all 0.2s ease;
    font-size: 0.875rem;
}

.edit-lock-btn:hover {
    background: var(--surface-hover);
    border-color: var(--border-hover);
}

.edit-lock-btn.locked {
    background: var(--danger-color);
    border-color: var(--danger-color);
    color: white;
}

.edit-lock-btn.locked:hover {
    background: var(--danger-hover);
    border-color: var(--danger-hover);
}

/* 스냅 토글 버튼 */
.snap-toggle-btn {
    background: none;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 0.375rem;
    border-radius: 0.375rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    transition: all 0.2s ease;
    font-size: 0.875rem;
    margin-left: 0.25rem;
}

.snap-toggle-btn:hover {
    background: var(--surface-hover);
    border-color: var(--border-hover);
}

.snap-toggle-btn.enabled {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.snap-toggle-btn.enabled:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
}

/* 모달 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.modal-content {
    background: var(--surface-elevated);
    border-radius: 0.75rem;
    box-shadow: var(--shadow-xl);
    max-width: 90vw;
    max-height: 90vh;
    overflow: hidden;
    animation: modalSlideUp 0.3s ease;
}

.modal-content.large {
    width: 700px;
    max-width: 95vw;
}

/* 새로운 모달 스타일 (modal-overlay 기반) */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.modal-overlay .modal {
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    animation: modalSlideUp 0.3s ease;
}

.modal-overlay .modal.large {
    max-width: 700px;
    width: 95%;
}

.modal-overlay .modal-header {
    padding: 20px 24px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #eee;
    margin-bottom: 0;
}

.modal-overlay .modal-content {
    padding: 20px 24px 24px;
    line-height: 1.6;
}

@keyframes modalSlideUp {
    from {
        opacity: 0;
        transform: translateY(1rem) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

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

.modal-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

.modal-body {
    padding: 1.5rem;
}

/* 단축키 목록 */
.shortcut-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.shortcut-item {
    display: flex;
    align-items: center;
    gap: 1rem;
}

kbd {
    padding: 0.25rem 0.5rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-family: monospace;
    color: var(--text-primary);
    min-width: 4rem;
    text-align: center;
}

/* JSON 및 텍스트 영역 공통 스타일 */
#jsonTextarea,
#textTextarea {
    width: 100%;
    height: 300px;
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    background: var(--surface);
    color: var(--text-primary);
    font-family: monospace;
    font-size: 0.875rem;
    resize: vertical;
    margin-bottom: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

#jsonTextarea:focus,
#textTextarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* 텍스트 영역 전용 스타일 (탭 구조용) */
#textTextarea {
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    line-height: 1.6;
    tab-size: 2;
    -moz-tab-size: 2;
}

/* 텍스트 영역이 숨겨진 상태일 때도 스타일 유지 */
#textTextarea.hidden {
    display: none;
}

/* 플레이스홀더 스타일 개선 */
#textTextarea::placeholder {
    color: var(--text-secondary);
    opacity: 0.7;
    font-style: italic;
}

#jsonTextarea::placeholder {
    color: var(--text-secondary);
    opacity: 0.7;
}

/* 포맷 선택 탭 */
.format-tabs {
    display: flex;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.format-tab {
    padding: 0.75rem 1rem;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.format-tab:hover {
    color: var(--text-primary);
    background: var(--surface);
}

.format-tab.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    font-weight: 500;
}

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

/* 다크모드에서 텍스트 영역 추가 스타일 */
[data-theme="dark"] #jsonTextarea,
[data-theme="dark"] #textTextarea {
    background: var(--surface-elevated);
    border-color: var(--border);
}

[data-theme="dark"] #jsonTextarea:focus,
[data-theme="dark"] #textTextarea:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

.btn-ai {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
}

.btn-ai:hover {
    background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
    transform: translateY(-1px);
}

.btn-api {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: white;
    border: none;
}

.btn-api:hover {
    background: linear-gradient(135deg, #0f8a7c 0%, #32d66b 100%);
    transform: translateY(-1px);
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: var(--text-color);
}

.form-group input,
.form-group select {
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s ease;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 20px;
}

/* AI 모달 스타일 */
.ai-modal {
    background: linear-gradient(145deg, #ffffff, #f8fafc);
    border-radius: 20px;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.15);
    max-width: 600px;
    width: 95%;
    max-height: 90vh;
    overflow: hidden;
    animation: modalSlideUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.ai-modal-header {
    display: flex;
    align-items: flex-start;
    padding: 30px 30px 20px;
    border-bottom: 1px solid #e2e8f0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    position: relative;
}

.ai-modal-icon {
    width: 60px;
    height: 60px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin-right: 20px;
    flex-shrink: 0;
}

.ai-modal-icon.text-convert {
    background: linear-gradient(135deg, #ff6b6b, #ffa500);
    box-shadow: 0 8px 20px rgba(255, 107, 107, 0.3);
}

.ai-modal-icon.import-export {
    background: linear-gradient(135deg, #667eea, #764ba2);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
}

.ai-modal-icon.ai-generate {
    background: linear-gradient(135deg, #4ecdc4, #44a08d);
    box-shadow: 0 8px 20px rgba(78, 205, 196, 0.3);
}

.ai-modal-title {
    flex: 1;
}

.ai-modal-title h2 {
    margin: 0 0 8px 0;
    font-size: 24px;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.ai-modal-title p {
    margin: 0;
    opacity: 0.9;
    font-size: 14px;
    line-height: 1.5;
}

.ai-modal-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    color: white;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-left: 20px;
}

.ai-modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

.ai-modal-body {
    padding: 30px;
    background: #ffffff;
}

.ai-input-group {
    margin-bottom: 24px;
}

.ai-input-group:last-child {
    margin-bottom: 0;
}

.ai-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: #36404f;
    margin-bottom: 12px;
    font-size: 15px;
}

.ai-label i {
    color: #6366f1;
    font-size: 16px;
}

.ai-input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 15px;
    transition: all 0.3s ease;
    background: #ffffff;
    font-family: inherit;
}

.ai-input:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
    transform: translateY(-1px);
}

.ai-textarea {
    width: 100%;
    min-height: 180px;
    padding: 16px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.6;
    resize: vertical;
    transition: all 0.3s ease;
    background: #ffffff;
    font-family: inherit;
}

.ai-textarea:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.ai-input-hint,
.ai-textarea-hint {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    font-size: 13px;
    color: #6b7280;
}

.ai-textarea-hint i {
    color: #f59e0b;
    font-size: 14px;
}

.ai-radio-group {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.ai-radio-option {
    flex: 1;
    min-width: 150px;
    position: relative;
    cursor: pointer;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 16px;
    transition: all 0.3s ease;
    background: #ffffff;
    display: flex;
    align-items: center;
    gap: 12px;
}

.ai-radio-option:hover {
    border-color: #6366f1;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.ai-radio-option input[type="radio"] {
    display: none;
}

.ai-radio-custom {
    width: 20px;
    height: 20px;
    border: 2px solid #d1d5db;
    border-radius: 50%;
    position: relative;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.ai-radio-option input[type="radio"]:checked + .ai-radio-custom {
    border-color: #6366f1;
    background: #6366f1;
}

.ai-radio-option input[type="radio"]:checked + .ai-radio-custom::after {
    content: '';
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.ai-radio-option input[type="radio"]:checked ~ .ai-radio-content {
    color: #6366f1;
}

.ai-radio-content strong {
    display: block;
    font-weight: 600;
    margin-bottom: 2px;
}

.ai-radio-content small {
    color: #6b7280;
    font-size: 12px;
}

.ai-modal-footer {
    padding: 20px 30px 30px;
    background: #f8fafc;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    border-top: 1px solid #e2e8f0;
}

.ai-btn {
    padding: 12px 24px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 120px;
    justify-content: center;
}

.ai-btn-secondary {
    background: #f3f4f6;
    color: #36404f;
    border: 1px solid #d1d5db;
}

.ai-btn-secondary:hover {
    background: #e5e7eb;
    transform: translateY(-1px);
}

.ai-btn-outline {
    background: transparent;
    color: #6366f1;
    border: 1px solid #6366f1;
}

.ai-btn-outline:hover {
    background: #6366f1;
    color: white;
    transform: translateY(-1px);
}

.ai-btn-primary {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.ai-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

.ai-btn-primary:disabled {
    opacity: 0.7;
    transform: none;
    cursor: not-allowed;
}

/* 토스트 메시지 */
.toast {
    position: fixed;
    bottom: 4rem;
    right: 2rem;
    background: var(--surface-elevated);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    padding: 1rem;
    box-shadow: var(--shadow-xl);
    z-index: 2000;
    min-width: 300px;
    animation: toastSlideIn 0.3s ease;
}

.toast.success {
    border-color: var(--success-color);
}

.toast.success .toast-icon {
    color: var(--success-color);
}

.toast.error {
    border-color: var(--danger-color);
}

.toast.error .toast-icon {
    color: var(--danger-color);
}

.toast.warning {
    border-color: var(--warning-color);
}

.toast.warning .toast-icon {
    color: var(--warning-color);
}

@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.toast-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.toast-icon {
    font-size: 1.25rem;
}

.toast-message {
    color: var(--text-primary);
    font-weight: 500;
}

/* 숨김 클래스 */
.hidden {
    display: none !important;
}

/* AI 아이콘 스타일 */
.ai-icon {
    transition: all 0.3s ease !important;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

/* 이미지 노드용 AI 아이콘 (리사이징 핸들) */
.ai-icon.image-resize-handle {
    background: linear-gradient(135deg, #06b6d4 0%, #3b82f6 100%) !important;
    box-shadow: 0 4px 15px rgba(6, 182, 212, 0.4) !important;
    cursor: nw-resize !important;
    transition: none !important;  /* 즉각적인 움직임을 위해 트랜지션 제거 */
}

.ai-icon.image-resize-handle:hover {
    background: linear-gradient(135deg, #0891b2 0%, #2563eb 100%) !important;
    box-shadow: 0 6px 20px rgba(6, 182, 212, 0.6) !important;
    transform: scale(1.1) !important;
}

/* 리사이징 중 커서 */
body.resizing {
    cursor: nw-resize !important;
}

/* 반응형 디자인 - 중간 화면에서 텍스트 숨기기 */
@media (max-width: 1800px) {
    /* 버튼 텍스트 숨기기 */
    .btn-text {
        display: none;
    }
    
    /* 아이콘만 있는 버튼의 패딩 조정 */
    .btn:not(.btn-icon) {
        padding: 0.5rem 0.75rem;
        min-width: auto;
    }
    
    /* 로고 텍스트 숨기기 */
    .logo-text {
        display: none;
    }
    
    /* GPT 모델 레이블 텍스트 숨기기 */
    .label-text {
        display: none;
    }
    
    /* 모델 셀렉터 너비 조정 */
    .model-select {
        min-width: 120px;
        max-width: 120px;
    }
}

/* 반응형 디자인 - 작은 화면에서 추가 조정 */
@media (max-width: 1200px) {
    .left-menubar, .right-menubar {
        padding: 0.4rem 0.6rem;
        gap: 0.25rem;
    }
    
    .separator {
        margin: 0 0.25rem;
    }
    
    .btn:not(.btn-icon) {
        padding: 0.5rem;
        min-width: 40px;
    }
    
    /* 모델 셀렉터 더 작게 */
    .model-select {
        min-width: 100px;
        max-width: 100px;
    }
}

/* 반응형 디자인 - 더 작은 화면 */
@media (max-width: 968px) {
    .left-menubar, .right-menubar {
        padding: 0.4rem 0.6rem;
        gap: 0.25rem;
        flex-wrap: wrap;
        border-radius: 1.5rem;
    }
    
    .separator {
        display: none;
    }
    
    .btn:not(.btn-icon) {
        padding: 0.5rem;
        min-width: 40px;
    }
    
    /* 가장 중요한 버튼들만 표시 */
    .btn-success,
    .btn-danger {
        display: none;
    }
}

/* 반응형 디자인 - 매우 작은 화면 */
@media (max-width: 480px) {
    .toolbar {
        padding: 0.25rem;
    }
    
    .toolbar-left,
    .toolbar-right {
        gap: 0.25rem;
    }
    
    .btn:not(.btn-icon) {
        padding: 0.4rem;
        min-width: 36px;
        font-size: 0.875rem;
    }
    
    .btn-icon {
        padding: 0.4rem;
        min-width: 36px;
    }
    
    /* AI 관련 버튼들도 숨기기 */
    .btn-ai,
    .btn-outline {
        display: none;
    }
}

/* 다크모드에서 라디오 버튼과 텍스트가 흰색으로 바뀌지 않도록 강제 설정 */
[data-theme="dark"] .ai-radio-option {
    background: #ffffff !important;
    border-color: #e5e7eb !important;
    color: #1f2937 !important;
}

[data-theme="dark"] .ai-radio-option:hover {
    border-color: #6366f1 !important;
    background: #ffffff !important;
}

[data-theme="dark"] .ai-radio-content strong {
    color: #1f2937 !important;
}

[data-theme="dark"] .ai-radio-content small {
    color: #6b7280 !important;
}

[data-theme="dark"] .ai-radio-option input[type="radio"]:checked ~ .ai-radio-content {
    color: #6366f1 !important;
}

[data-theme="dark"] .ai-radio-option input[type="radio"]:checked ~ .ai-radio-content strong {
    color: #6366f1 !important;
}

[data-theme="dark"] .ai-radio-custom {
    border-color: #d1d5db !important;
    background: #ffffff !important;
}

[data-theme="dark"] .ai-radio-option input[type="radio"]:checked + .ai-radio-custom {
    border-color: #6366f1 !important;
    background: #6366f1 !important;
}

/* 태그 관리 스타일 */
.tag-manager {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    min-height: 30px;
    padding: 0.5rem;
    border: 1px solid var(--border);
    border-radius: 0.375rem;
    background: var(--surface);
}

.tag-item {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    background: var(--primary-color);
    color: white;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 500;
}

.tag-item .tag-remove {
    cursor: pointer;
    padding: 0.125rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
}

.tag-item .tag-remove:hover {
    background: rgba(255, 255, 255, 0.2);
}

.tag-input-group {
    display: flex;
    gap: 0.5rem;
}

.tag-input-group input {
    flex: 1;
    padding: 0.375rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 0.375rem;
    background: var(--surface-elevated);
    color: var(--text-primary);
    font-size: 0.875rem;
    transition: border-color 0.2s ease;
}

.tag-input-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.tag-input-group .btn {
    padding: 0.375rem 0.75rem;
}

/* 새로운 태그 미리보기 스타일 */
.tag-info {
    margin-top: 0.5rem;
}

.tag-preview {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 0.375rem;
    padding: 0.75rem;
    font-size: 0.875rem;
    color: #64748b;
    margin-bottom: 0.5rem;
}

.tag-preview small {
    color: #94a3b8;
    font-style: italic;
}

.current-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    min-height: 24px;
}

.current-tags .tag-item {
    display: inline-flex;
    align-items: center;
    padding: 0.125rem 0.5rem;
    background: #3b82f6;
    color: white;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    font-weight: 500;
}

[data-theme="dark"] .tag-preview {
    background: #36404f;
    border-color: #4b5563;
    color: #9ca3af;
}

[data-theme="dark"] .tag-preview small {
    color: #6b7280;
}

/* 검색 바 스타일 */
.search-bar {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 1001;
    background: var(--surface-elevated);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    min-width: 320px;
}

.search-bar-content {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    gap: 8px;
}

.search-bar-icon {
    color: var(--text-secondary);
    font-size: 14px;
    flex-shrink: 0;
}

.search-bar-input {
    flex: 1;
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-size: 14px;
    padding: 4px 0;
    outline: none;
}

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

.search-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.search-nav span {
    font-size: 12px;
    color: var(--text-secondary);
    min-width: 35px;
    text-align: center;
}

.search-nav-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    width: 20px;
    height: 20px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 10px;
}

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

.search-nav-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.search-close-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    width: 20px;
    height: 20px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 12px;
    flex-shrink: 0;
}

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

/* 도움말 모달 탭 스타일 */
.help-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--border);
}

.help-tab {
    background: none;
    border: none;
    padding: 0.75rem 1.5rem;
    color: var(--text-secondary);
    font-weight: 500;
    cursor: pointer;
    border-radius: 8px 8px 0 0;
    transition: all 0.2s;
    position: relative;
}

.help-tab:hover {
    color: var(--text-primary);
    background: var(--surface);
}

.help-tab.active {
    color: var(--primary-color);
    background: var(--surface);
}

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

.help-tab-content {
    display: none;
}

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

/* 단축키 카테고리 스타일 */
.shortcut-category {
    margin-bottom: 2rem;
}

.shortcut-category h3 {
    color: var(--text-primary);
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.shortcut-category h3 i {
    color: var(--primary-color);
}

.shortcut-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.shortcut-item:last-child {
    border-bottom: none;
}

.shortcut-item kbd {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 0.25rem 0.5rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-primary);
    box-shadow: 0 1px 0 var(--border);
    min-width: fit-content;
    text-align: center;
}

.shortcut-item span {
    color: var(--text-secondary);
    flex: 1;
}

/* 기능 설명 스타일 */
.feature-category {
    margin-bottom: 2rem;
}

.feature-category h3 {
    color: var(--text-primary);
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.feature-category h3 i {
    color: var(--primary-color);
}

.feature-list {
    list-style: none;
    padding: 0;
}

.feature-list li {
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    color: var(--text-secondary);
    line-height: 1.6;
}

.feature-list li:last-child {
    border-bottom: none;
}

.feature-list li strong {
    color: var(--text-primary);
    font-weight: 600;
}

/* 팁 스타일 */
.tips-category {
    margin-bottom: 2rem;
}

.tips-category h3 {
    color: var(--text-primary);
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tips-category h3 i {
    color: var(--warning-color);
}

.tip-item {
    margin-bottom: 1.5rem;
    padding: 1.5rem;
    background: var(--surface);
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
}

.tip-item h4 {
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.tip-item p {
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0;
}

/* 이미지 뷰어 모달 스타일 */
.image-viewer-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    padding: 2rem;
    box-sizing: border-box;
}

.image-viewer-modal.hidden {
    display: none;
}

.image-viewer-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
}

.image-viewer-container {
    background: var(--surface-elevated);
    border-radius: 16px;
    box-shadow: var(--shadow-xl);
    max-width: 90vw;
    max-height: 90vh;
    width: auto;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    z-index: 1;
}

.image-viewer-header {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--surface);
}

.image-viewer-header h3 {
    color: var(--text-primary);
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
}

.image-viewer-controls {
    display: flex;
    gap: 0.5rem;
}

.image-viewer-btn {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 0.5rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
}

.image-viewer-btn:hover {
    background: var(--border);
}

.image-viewer-close {
    background: var(--danger-color);
    border: 1px solid var(--danger-color);
    color: white;
}

.image-viewer-close:hover {
    background: #dc2626;
    border-color: #dc2626;
}

.image-viewer-content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    max-height: calc(90vh - 150px);
    overflow: auto;
}

.image-viewer-content img {
    max-width: 100%;
    max-height: calc(90vh - 250px);
    width: auto;
    height: auto;
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.image-viewer-info {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
    padding: 0.5rem;
}

.image-info-item {
    display: flex;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.image-info-label {
    font-weight: 600;
}

/* 설정 모달 스타일 */
.settings-modal .modal-content {
    max-width: 600px;
    width: 95vw;
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    background: var(--surface);
    color: var(--text-primary);
    font-size: 0.875rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

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

.form-text {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.text-muted {
    color: var(--text-secondary) !important;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1.5rem;
    border-top: 1px solid var(--border);
    background: var(--surface);
}

/* 설정 모달 내 버튼 그룹 */
.settings-button-group {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.settings-button-group .btn {
    flex: 1;
    justify-content: center;
    font-size: 0.8rem;
    padding: 0.5rem 0.75rem;
}

/* 다크모드에서 form-control 스타일 */
[data-theme="dark"] .form-control {
    background: var(--surface-elevated);
    border-color: var(--border);
    color: var(--text-primary);
}

[data-theme="dark"] .form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

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

/* 그리드 드롭다운 메뉴 스타일 */
.grid-dropdown {
    position: absolute;
    top: 60px;
    right: 20px;
    background: var(--surface-elevated);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px;
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    min-width: 200px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.dropdown-header {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border);
}

.grid-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.grid-option:hover {
    background: var(--surface);
}

.grid-option:active {
    transform: scale(0.98);
}

.grid-option span {
    flex: 1;
    font-size: 0.875rem;
    color: var(--text-primary);
    font-weight: 500;
}

.grid-preview {
    width: 24px;
    height: 24px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--background);
    position: relative;
    flex-shrink: 0;
}

/* 그리드선 프리뷰 */
.grid-preview-lines {
    background-image: 
        linear-gradient(to right, var(--border) 1px, transparent 1px),
        linear-gradient(to bottom, var(--border) 1px, transparent 1px);
    background-size: 6px 6px;
}

/* 도트 그리드 프리뷰 */
.grid-preview-dots {
    background-image: radial-gradient(circle, var(--text-secondary) 0.5px, transparent 0.5px);
    background-size: 6px 6px;
}

/* 없음 프리뷰 */
.grid-preview-none {
    background: var(--background);
}

.grid-check {
    color: var(--primary-color);
    font-size: 0.875rem;
}

/* 다크모드 그리드 프리뷰 조정 */
[data-theme="dark"] .grid-preview-lines {
    background-image: 
        linear-gradient(to right, #404040 1px, transparent 1px),
        linear-gradient(to bottom, #404040 1px, transparent 1px);
}

[data-theme="dark"] .grid-preview-dots {
    background-image: radial-gradient(circle, #606060 0.5px, transparent 0.5px);
}

/* 배경 색상 그리드 */
.dropdown-divider {
    height: 1px;
    background: var(--border);
    margin: 8px 0;
}

.background-color-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    margin-top: 8px;
}

.background-color-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 6px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.background-color-option:hover {
    background: var(--surface);
}

.color-preview {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    border: 1px solid var(--border);
    position: relative;
}

.default-bg {
    background: var(--background);
}

.color-check {
    position: absolute;
    top: -2px;
    right: -2px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    width: 12px;
    height: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 8px;
}

/* 이모지 스티커 메뉴 애니메이션 */
@keyframes stickerMenuAppear {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes stickerBtnAppear {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0) rotate(-180deg);
    }
    50% {
        opacity: 0.8;
    }
    100% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1) rotate(0deg);
    }
}

@keyframes stickerMenuPulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.4);
    }
    50% {
        box-shadow: 0 0 0 20px rgba(99, 102, 241, 0);
    }
}

@keyframes donutSectionAppear {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.8) rotate(-10deg);
    }
    100% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1) rotate(0deg);
    }
}