/* Base Variables */
:root {
    --primary: #3b82f6;
    --primary-light: #93c5fd;
    --primary-dark: #2563eb;
    --text: #1e293b;
    --text-light: #64748b;
    --background: #f8fafc;
    --surface: #ffffff;
    --border: #e2e8f0;
    --shadow: rgba(0, 0, 0, 0.1);
    --error: #ef4444;
    --success: #22c55e;
}

/* Container */
.mindmap-container {
    position: relative;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    background: var(--surface);
    border-radius: 1rem;
    box-shadow: 0 4px 6px var(--shadow);
}

/* Toolbar */
.mindmap-toolbar {
    display: flex;
    gap: 0.5rem;
    padding: 0.75rem;
    background: var(--background);
    border-radius: 0.75rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.toolbar-group {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.toolbar-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    color: var(--text);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.toolbar-button:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
    transform: translateY(-1px);
}

.toolbar-button svg {
    width: 1.25rem;
    height: 1.25rem;
    stroke: currentColor;
    stroke-width: 2;
}

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

.orientation-selector {
    display: flex;
    gap: 0.25rem;
    align-items: center;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    padding: 0.25rem;
    background: var(--surface);
}

.orientation-btn {
    padding: 0.5rem !important;
    min-width: 36px !important;
    height: 36px !important;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none !important;
    background: transparent !important;
    border-radius: 0.375rem;
    transition: all 0.2s ease;
}

.orientation-btn:hover {
    background: var(--primary-light) !important;
    color: var(--primary-dark);
}

.orientation-btn.active {
    background: var(--primary) !important;
    color: white;
}

.orientation-btn svg {
    width: 18px;
    height: 18px;
}

/* Input Options */
.input-options {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 0.75rem;
    background: var(--background);
    border-radius: 0.75rem;
}

.input-option {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem;
    height: 48px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    color: var(--text-light);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.input-option:hover {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary-dark);
}

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

.input-option svg {
    width: 1.5rem;
    height: 1.5rem;
    stroke: currentColor;
    stroke-width: 2;
}

/* Input Container */
.input-container {
    margin-bottom: 2rem;
}

#mindmap-input {
    width: 100%;
    min-height: 100px;
    padding: 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    color: var(--text);
    font-size: 0.875rem;
    line-height: 1.5;
    resize: vertical;
    transition: all 0.2s ease;
}

#mindmap-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

#generate-mindmap {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
    padding: 0.75rem 1.5rem;
    background: var(--primary);
    border: none;
    border-radius: 0.5rem;
    color: white;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

#generate-mindmap:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

#generate-mindmap svg {
    width: 1.25rem;
    height: 1.25rem;
    stroke: currentColor;
    stroke-width: 2;
}

/* Network Container */
#mindmap-network {
    width: 100%;
    height: 600px;
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    overflow: hidden;
    cursor: default;
    position: relative;
}

/* Outline View */
.mindmap-outline {
    width: 100%;
    height: 600px;
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    background: var(--surface);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

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

.outline-header h3 {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text);
}

.outline-content {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    background: var(--surface);
}

.outline-content::-webkit-scrollbar {
    width: 8px;
}

.outline-content::-webkit-scrollbar-track {
    background: var(--background);
    border-radius: 4px;
}

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

.outline-content::-webkit-scrollbar-thumb:hover {
    background: var(--text-light);
}

.outline-item {
    margin: 0.25rem 0;
    padding: 0.5rem 0;
    border-left: 2px solid transparent;
    transition: all 0.2s ease;
}

.outline-item:hover {
    border-left-color: var(--primary);
    background: var(--background);
    border-radius: 0.25rem;
    padding-left: 0.5rem;
}

.outline-item-content {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.5rem;
    cursor: pointer;
}

.outline-toggle {
    background: none;
    border: none;
    padding: 0.25rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    transition: all 0.2s ease;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.outline-toggle:hover {
    color: var(--primary);
    background: var(--primary-light);
    border-radius: 0.25rem;
}

.outline-chevron {
    width: 16px;
    height: 16px;
    transition: transform 0.2s ease;
    transform: rotate(-90deg);
}

.outline-spacer {
    width: 20px;
    flex-shrink: 0;
}

.outline-icon {
    font-size: 1.125rem;
    flex-shrink: 0;
}

.outline-label {
    flex: 1;
    font-weight: 500;
    color: var(--text);
    font-size: 0.9375rem;
}

.outline-link {
    color: var(--primary);
    text-decoration: none;
    flex: 1;
}

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

.outline-notes-indicator {
    font-size: 0.875rem;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s ease;
    flex-shrink: 0;
}

.outline-notes-indicator:hover {
    opacity: 1;
}

.outline-add-notes {
    background: var(--primary-light);
    border: 1px solid var(--primary);
    border-radius: 0.375rem;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    color: var(--primary-dark);
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.outline-add-notes:hover {
    background: var(--primary);
    color: white;
}

.outline-notes-section {
    margin-top: 0.5rem;
    margin-left: 2rem;
}

.outline-notes-display {
    padding: 0.75rem 1rem;
    background: var(--background);
    border-left: 3px solid var(--primary);
    border-radius: 0.25rem;
    font-size: 0.875rem;
    line-height: 1.6;
    color: var(--text-light);
}

.outline-no-notes {
    margin: 0;
    font-style: italic;
    color: var(--text-light);
    font-size: 0.8125rem;
}

.outline-notes-editor {
    padding: 0.75rem;
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
}

.outline-notes-toolbar {
    display: flex;
    gap: 0.25rem;
    margin-bottom: 0.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}

.format-btn-small {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 0.25rem;
    padding: 0.25rem 0.5rem;
    cursor: pointer;
    font-size: 0.75rem;
    color: var(--text);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 24px;
}

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

.outline-notes-textarea {
    width: 100%;
    min-height: 100px;
    max-height: 200px;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 0.375rem;
    resize: vertical;
    font-size: 0.875rem;
    font-family: inherit;
    color: var(--text);
    background: var(--surface);
    margin-bottom: 0.5rem;
}

.outline-notes-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.outline-notes-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
}

.outline-edit-notes-btn {
    margin-top: 0.5rem;
}

.outline-notes {
    margin-top: 0.5rem;
    padding: 0.75rem 1rem;
    background: var(--background);
    border-left: 3px solid var(--primary);
    border-radius: 0.25rem;
    font-size: 0.875rem;
    line-height: 1.6;
    color: var(--text-light);
    margin-left: 2rem;
}

.outline-notes p {
    margin: 0.5rem 0;
}

.outline-notes p:first-child {
    margin-top: 0;
}

.outline-notes p:last-child {
    margin-bottom: 0;
}

.outline-notes strong {
    color: var(--text);
    font-weight: 600;
}

.outline-notes code {
    background: rgba(0, 0, 0, 0.05);
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    font-family: 'Courier New', monospace;
    font-size: 0.8125rem;
}

.outline-notes pre {
    background: rgba(0, 0, 0, 0.05);
    padding: 0.75rem;
    border-radius: 0.375rem;
    overflow-x: auto;
    margin: 0.5rem 0;
}

.outline-notes ul,
.outline-notes ol {
    margin: 0.5rem 0;
    padding-left: 1.5rem;
}

.outline-notes li {
    margin: 0.25rem 0;
}

.outline-children {
    margin-left: 0.5rem;
}

.outline-empty {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-light);
}

/* Make Cytoscape canvas show pointer cursor on nodes */
#mindmap-network canvas {
    cursor: default;
}

/* Loading State */
.loading-container {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(4px);
    border-radius: 1rem;
    z-index: 100;
}

.mindmap-container.loading .loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.loading-spinner {
    width: 3rem;
    height: 3rem;
    border: 3px solid var(--primary-light);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 2rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Progress Steps */
.progress-steps {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
}

.progress-step {
    display: flex;
    align-items: center;
    gap: 1rem;
    opacity: 0.5;
    transition: opacity 0.3s ease;
}

.progress-step.active {
    opacity: 1;
}

.step-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    background: var(--primary);
    border-radius: 50%;
    color: white;
    font-weight: 600;
    font-size: 0.875rem;
}

.step-text {
    color: var(--text);
    font-size: 0.875rem;
    font-weight: 500;
}

/* Error Message */
.mindmap-error {
    margin: 1rem 0;
    padding: 0.75rem 1rem;
    background: var(--error);
    color: white;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    animation: slideIn 0.3s ease;
}

.mindmap-success {
    margin: 1rem 0;
    padding: 0.75rem 1rem;
    background: var(--success);
    color: white;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from { transform: translateY(-1rem); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* Context Menu */
.node-context-menu {
    position: absolute;
    display: none;
    padding: 0.5rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    box-shadow: 0 4px 12px var(--shadow);
    z-index: 10000;
    min-width: 150px;
    pointer-events: auto;
}

.context-menu-item {
    display: block;
    width: 100%;
    padding: 0.5rem 1rem;
    background: none;
    border: none;
    border-radius: 0.25rem;
    color: var(--text);
    font-size: 0.875rem;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s ease;
}

.context-menu-item:hover {
    background: var(--primary);
    color: white;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 1000;
}

.mindmap-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 600px;
    padding: 2rem;
    background: var(--surface);
    border-radius: 1rem;
    box-shadow: 0 4px 20px var(--shadow);
    z-index: 1001;
    display: none;
}

.view-notes-modal {
    z-index: 10002 !important;
    max-width: 700px;
}

.view-notes-overlay {
    z-index: 10001 !important;
}

.mindmap-modal[style*="display: block"],
.mindmap-modal.show {
    display: block !important;
}

.mindmap-modal h3 {
    margin: 0 0 1.5rem;
    color: var(--text);
    font-size: 1.25rem;
    font-weight: 600;
}

/* View Notes Modal */
.view-notes-header {
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--border);
}

.view-notes-node-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--primary);
}

.view-notes-content {
    min-height: 200px;
    max-height: 500px;
    overflow-y: auto;
    padding: 1rem;
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
    line-height: 1.6;
    color: var(--text);
}

.view-notes-content::-webkit-scrollbar {
    width: 8px;
}

.view-notes-content::-webkit-scrollbar-track {
    background: var(--background);
    border-radius: 4px;
}

.view-notes-content::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.view-notes-content::-webkit-scrollbar-thumb:hover {
    background: var(--text-light);
}

/* Markdown content styling in view notes */
.view-notes-content p {
    margin: 0.75rem 0;
}

.view-notes-content p:first-child {
    margin-top: 0;
}

.view-notes-content p:last-child {
    margin-bottom: 0;
}

.view-notes-content strong {
    font-weight: 600;
    color: var(--text);
}

.view-notes-content em {
    font-style: italic;
}

.view-notes-content code {
    background: rgba(0, 0, 0, 0.05);
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
    color: var(--primary);
}

.view-notes-content pre {
    background: rgba(0, 0, 0, 0.05);
    padding: 1rem;
    border-radius: 0.5rem;
    overflow-x: auto;
    margin: 1rem 0;
    border: 1px solid var(--border);
}

.view-notes-content pre code {
    background: none;
    padding: 0;
    color: var(--text);
}

.view-notes-content ul,
.view-notes-content ol {
    margin: 0.75rem 0;
    padding-left: 2rem;
}

.view-notes-content li {
    margin: 0.5rem 0;
}

.view-notes-content h1,
.view-notes-content h2,
.view-notes-content h3,
.view-notes-content h4,
.view-notes-content h5,
.view-notes-content h6 {
    margin: 1rem 0 0.75rem 0;
    font-weight: 600;
    color: var(--text);
}

.view-notes-content h1 { font-size: 1.5rem; }
.view-notes-content h2 { font-size: 1.375rem; }
.view-notes-content h3 { font-size: 1.25rem; }
.view-notes-content h4 { font-size: 1.125rem; }
.view-notes-content h5 { font-size: 1rem; }
.view-notes-content h6 { font-size: 0.9375rem; }

.view-notes-content a {
    color: var(--primary);
    text-decoration: underline;
}

.view-notes-content a:hover {
    color: var(--primary-dark);
}

.view-notes-content blockquote {
    border-left: 4px solid var(--primary);
    padding-left: 1rem;
    margin: 1rem 0;
    font-style: italic;
    color: var(--text-light);
    background: var(--background);
    padding: 0.75rem 1rem;
    border-radius: 0.25rem;
}

.no-notes-message {
    text-align: center;
    padding: 2rem;
    color: var(--text-light);
}

.input-group {
    margin-bottom: 1.5rem;
}

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

.input-group input,
.input-group textarea {
    width: 100%;
    padding: 0.75rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    color: var(--text);
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.input-group textarea {
    min-height: 120px;
    resize: vertical;
}

.input-group input:focus,
.input-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.input-group small {
    display: block;
    margin-top: 0.25rem;
    color: var(--text-light);
    font-size: 0.75rem;
}

/* Color Picker */
.color-picker-container {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.color-picker-container input[type="color"] {
    width: 100%;
    height: 40px;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    cursor: pointer;
}

.color-presets {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.color-preset {
    width: 32px;
    height: 32px;
    border: 2px solid var(--border);
    border-radius: 0.375rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

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

/* Node Tooltip */
.node-tooltip {
    position: absolute;
    display: none;
    width: 320px;
    max-width: 90vw;
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    color: white;
    border-radius: 0.75rem;
    font-size: 0.875rem;
    z-index: 10000;
    pointer-events: none;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.1);
    overflow: hidden;
    transition: opacity 0.2s ease, transform 0.2s ease;
    backdrop-filter: blur(10px);
}

.tooltip-header {
    padding: 0.625rem 1rem;
    background: rgba(255, 255, 255, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    font-weight: 600;
    font-size: 0.8125rem;
    letter-spacing: 0.025em;
    color: rgba(255, 255, 255, 0.95);
}

.tooltip-content {
    padding: 0.875rem 1rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.9);
    max-height: 200px;
    overflow-y: auto;
    word-wrap: break-word;
}

/* Markdown content styling in tooltip */
.tooltip-content p {
    margin: 0.5rem 0;
}

.tooltip-content p:first-child {
    margin-top: 0;
}

.tooltip-content p:last-child {
    margin-bottom: 0;
}

.tooltip-content strong {
    font-weight: 600;
    color: rgba(255, 255, 255, 1);
}

.tooltip-content em {
    font-style: italic;
}

.tooltip-content code {
    background: rgba(0, 0, 0, 0.3);
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    font-family: 'Courier New', monospace;
    font-size: 0.8125rem;
    color: #60a5fa;
}

.tooltip-content pre {
    background: rgba(0, 0, 0, 0.3);
    padding: 0.75rem;
    border-radius: 0.375rem;
    overflow-x: auto;
    margin: 0.5rem 0;
}

.tooltip-content pre code {
    background: none;
    padding: 0;
    color: rgba(255, 255, 255, 0.9);
}

.tooltip-content ul,
.tooltip-content ol {
    margin: 0.5rem 0;
    padding-left: 1.5rem;
}

.tooltip-content li {
    margin: 0.25rem 0;
}

.tooltip-content h1,
.tooltip-content h2,
.tooltip-content h3,
.tooltip-content h4,
.tooltip-content h5,
.tooltip-content h6 {
    margin: 0.75rem 0 0.5rem 0;
    font-weight: 600;
    color: rgba(255, 255, 255, 1);
}

.tooltip-content h1 { font-size: 1.25rem; }
.tooltip-content h2 { font-size: 1.125rem; }
.tooltip-content h3 { font-size: 1rem; }
.tooltip-content h4 { font-size: 0.9375rem; }
.tooltip-content h5 { font-size: 0.875rem; }
.tooltip-content h6 { font-size: 0.8125rem; }

.tooltip-content a {
    color: #60a5fa;
    text-decoration: underline;
}

.tooltip-content a:hover {
    color: #93c5fd;
}

.tooltip-content blockquote {
    border-left: 3px solid rgba(255, 255, 255, 0.3);
    padding-left: 1rem;
    margin: 0.5rem 0;
    font-style: italic;
    color: rgba(255, 255, 255, 0.8);
}

.tooltip-content::-webkit-scrollbar {
    width: 6px;
}

.tooltip-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
}

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

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

.node-tooltip::before {
    content: '';
    position: absolute;
    top: -8px;
    left: 24px;
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 8px solid #1e293b;
    filter: drop-shadow(0 -2px 2px rgba(0, 0, 0, 0.1));
}

.node-tooltip::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
    opacity: 0.8;
}

/* Quick Notes Editor */
.quick-notes-editor {
    position: absolute;
    display: none;
    width: 400px;
    max-height: 400px;
    background: var(--surface);
    border: 2px solid var(--primary);
    border-radius: 0.75rem;
    box-shadow: 0 8px 24px var(--shadow);
    z-index: 10001;
    overflow: hidden;
    flex-direction: column;
}

.quick-notes-editor[style*="display: flex"] {
    display: flex !important;
}

.quick-notes-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: var(--primary);
    color: white;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.quick-notes-title {
    font-size: 0.875rem;
    font-weight: 500;
}

.quick-notes-title strong {
    font-weight: 600;
}

.quick-notes-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.25rem;
    transition: background 0.2s ease;
}

.quick-notes-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.notes-formatting-toolbar {
    display: flex;
    gap: 0.25rem;
    padding: 0.5rem;
    background: var(--background);
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
}

.format-btn {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 0.375rem;
    padding: 0.375rem 0.625rem;
    cursor: pointer;
    font-size: 0.8125rem;
    color: var(--text);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 28px;
}

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

.format-btn:active {
    transform: translateY(0);
}

.format-btn strong {
    font-weight: 700;
}

.format-btn em {
    font-style: italic;
}

.format-btn code {
    font-family: 'Courier New', monospace;
    font-size: 0.75rem;
    background: rgba(0, 0, 0, 0.05);
    padding: 0.125rem 0.25rem;
    border-radius: 0.25rem;
}

.quick-notes-textarea {
    width: 100%;
    min-height: 150px;
    max-height: 200px;
    padding: 1rem;
    border: none;
    border-bottom: 1px solid var(--border);
    resize: vertical;
    font-size: 0.875rem;
    font-family: inherit;
    color: var(--text);
    background: var(--surface);
    flex: 1;
    overflow-y: auto;
}

.quick-notes-textarea:focus {
    outline: none;
    background: var(--background);
}

.quick-notes-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: var(--background);
}

.quick-notes-footer .button {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

/* Load Modal Controls */
.load-modal-controls {
    margin-bottom: 1.5rem;
}

.load-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    border-bottom: 2px solid var(--border);
}

.load-tab {
    padding: 0.75rem 1.5rem;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-light);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: -2px;
}

.load-tab:hover {
    color: var(--primary);
}

.load-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.load-search-container {
    position: relative;
    margin-bottom: 1rem;
}

.load-search-input {
    width: 100%;
    padding: 0.75rem 2.5rem 0.75rem 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    color: var(--text);
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.load-search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.search-icon {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    width: 1.25rem;
    height: 1.25rem;
    color: var(--text-light);
    pointer-events: none;
}

/* Mindmap List */
.mindmaps-list-container {
    max-height: 400px;
    overflow-y: auto;
    margin-bottom: 1rem;
}

.mindmaps-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.mindmap-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem;
    margin-bottom: 0.5rem;
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    transition: all 0.2s ease;
}

.mindmap-list-item:hover {
    background: var(--primary-light);
    border-color: var(--primary);
}

.mindmap-item-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.mindmap-item-title {
    font-weight: 500;
    color: var(--text);
    font-size: 0.875rem;
}

.mindmap-item-post {
    font-size: 0.75rem;
    color: var(--primary);
    font-style: italic;
}

.mindmap-item-date {
    font-size: 0.75rem;
    color: var(--text-light);
}

.mindmap-item-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

.mindmap-list-item .button {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    white-space: nowrap;
}

.mindmap-list-item .button-link-delete {
    color: var(--error);
    border-color: var(--error);
}

.mindmap-list-item .button-link-delete:hover {
    background: var(--error);
    color: white;
}

.loading-mindmaps,
.no-mindmaps {
    padding: 2rem;
    text-align: center;
    color: var(--text-light);
}

/* Markdown Preview */
.markdown-preview {
    margin-top: 1rem;
    padding: 1rem;
    background: var(--background);
    border-radius: 0.5rem;
    font-size: 0.875rem;
}

/* Modal Buttons */
.modal-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

.modal-buttons button {
    padding: 0.75rem 1.5rem;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.modal-buttons button.button-primary {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.modal-buttons button:hover {
    transform: translateY(-1px);
}

/* Responsive Adjustments */
@media (max-width: 640px) {
    .mindmap-container {
        padding: 1rem;
    }

    .mindmap-toolbar {
        flex-wrap: wrap;
    }

    .input-options {
        flex-direction: column;
    }

    .input-option {
        width: 100%;
    }

    .mindmap-modal {
        width: 95%;
        padding: 1.5rem;
    }

    .toolbar-group {
        width: 100%;
    }

    .mindmap-item-info {
        min-width: 0;
    }

    .mindmap-item-actions {
        flex-direction: column;
    }

    .load-tabs {
        flex-wrap: wrap;
    }

    .quick-notes-editor {
        width: 90%;
        max-width: 350px;
    }
}