/* Google Fonts Import */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700;800&display=swap');

/* CSS Variables for Premium Themes */
:root {
    /* Fonts */
    --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

    /* Theme colors: Dark Mode (Default) */
    --bg-app: #090d16;
    --bg-canvas: #0b0f19;
    --bg-panel: rgba(15, 22, 38, 0.7);
    --bg-panel-hover: rgba(23, 33, 56, 0.8);
    --border-panel: rgba(255, 255, 255, 0.08);
    --border-panel-focus: rgba(255, 255, 255, 0.16);
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --grid-color: rgba(255, 255, 255, 0.04);
    
    /* Interactive Accents */
    --accent: #6366f1; /* Indigo */
    --accent-hover: #4f46e5;
    --accent-glow: rgba(99, 102, 241, 0.35);
    
    /* Node Color Presets (Light & Dark compatible HSL) */
    --node-root-bg: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
    --node-root-text: #ffffff;
    --node-root-border: rgba(255, 255, 255, 0.2);
    
    --color-lavender-bg: #818cf8;
    --color-lavender-border: #4f46e5;
    --color-lavender-text: #ffffff;
    
    --color-emerald-bg: #34d399;
    --color-emerald-border: #059669;
    --color-emerald-text: #022c22;
    
    --color-ocean-bg: #38bdf8;
    --color-ocean-border: #0284c7;
    --color-ocean-text: #0369a1;
    
    --color-rose-bg: #fb7185;
    --color-rose-border: #e11d48;
    --color-rose-text: #ffffff;
    
    --color-gold-bg: #fbbf24;
    --color-gold-border: #d97706;
    --color-gold-text: #451a03;
    
    --color-slate-bg: #94a3b8;
    --color-slate-border: #475569;
    --color-slate-text: #0f172a;

    --color-coral-bg: #f97316;
    --color-coral-border: #ea580c;
    --color-coral-text: #ffffff;

    --color-amber-bg: #f59e0b;
    --color-amber-border: #d97706;
    --color-amber-text: #451a03;

    --color-lime-bg: #84cc16;
    --color-lime-border: #65a30d;
    --color-lime-text: #1a2e05;

    --color-teal-bg: #14b8a6;
    --color-teal-border: #0d9488;
    --color-teal-text: #042f2e;

    --color-sky-bg: #0ea5e9;
    --color-sky-border: #0284c7;
    --color-sky-text: #ffffff;

    --color-violet-bg: #8b5cf6;
    --color-violet-border: #7c3aed;
    --color-violet-text: #ffffff;

    --color-fuchsia-bg: #d946ef;
    --color-fuchsia-border: #c026d3;
    --color-fuchsia-text: #ffffff;

    --color-pink-bg: #ec4899;
    --color-pink-border: #db2777;
    --color-pink-text: #ffffff;

    --color-red-bg: #ef4444;
    --color-red-border: #dc2626;
    --color-red-text: #ffffff;

    /* Shadow styles */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.2), 0 4px 6px -4px rgba(0, 0, 0, 0.2);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.3), 0 8px 10px -6px rgba(0, 0, 0, 0.3);
    --shadow-glass: 0 8px 32px 0 rgba(0, 0, 0, 0.3);

    --border-radius-sm: 8px;
    --border-radius-md: 12px;
    --border-radius-lg: 16px;
    --border-radius-xl: 24px;
}

/* Light Theme Variables */
[data-theme="light"] {
    --bg-app: #f1f5f9;
    --bg-canvas: #f8fafc;
    --bg-panel: rgba(255, 255, 255, 0.75);
    --bg-panel-hover: rgba(255, 255, 255, 0.9);
    --border-panel: rgba(15, 23, 42, 0.08);
    --border-panel-focus: rgba(15, 23, 42, 0.16);
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --grid-color: rgba(15, 23, 42, 0.03);
    
    --accent: #4f46e5;
    --accent-hover: #4338ca;
    --accent-glow: rgba(79, 70, 229, 0.15);
    
    --shadow-glass: 0 8px 32px 0 rgba(15, 23, 42, 0.08);
    
    --color-emerald-text: #ffffff;
    --color-ocean-text: #ffffff;
    --color-gold-text: #ffffff;
    --color-slate-text: #ffffff;
    --color-coral-text: #ffffff;
    --color-amber-text: #ffffff;
    --color-sky-text: #ffffff;
    --color-violet-text: #ffffff;
    --color-fuchsia-text: #ffffff;
    --color-pink-text: #ffffff;
    --color-red-text: #ffffff;
}

/* General Layout resets */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    user-select: none;
    -webkit-user-drag: none;
}

body, html {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: var(--bg-app);
    font-family: var(--font-body);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* App container holds full height layout */
.app-container {
    display: flex;
    width: 100%;
    height: 100%;
    position: relative;
}

/* ---------------------------------------------------- */
/* SVG Viewport / Infinite Canvas Styles                */
/* ---------------------------------------------------- */
.canvas-container {
    flex-grow: 1;
    height: 100%;
    position: relative;
    background-color: var(--bg-canvas);
    outline: none;
}

.canvas-svg {
    width: 100%;
    height: 100%;
    display: block;
    cursor: grab;
}

.canvas-svg:active {
    cursor: grabbing;
}

.grid-pattern {
    fill: none;
    stroke: var(--grid-color);
    stroke-width: 1;
}

/* Canvas connection lines */
.connector-line {
    fill: none;
    stroke: var(--text-muted);
    stroke-width: 2.5;
    stroke-linecap: round;
    transition: stroke 0.3s ease, stroke-width 0.3s ease;
    opacity: 0.7;
}

.connector-line.active {
    stroke: var(--accent);
    stroke-width: 3.5;
    opacity: 1;
}

/* Custom cross-node relationship lines */
.relation-line {
    fill: none;
    stroke: var(--text-muted);
    stroke-width: 2;
    stroke-linecap: round;
    stroke-dasharray: 6, 6;
    transition: stroke 0.2s, stroke-width 0.2s, filter 0.2s;
    opacity: 0.8;
}

.relation-line:hover {
    stroke: var(--accent);
    stroke-width: 2.5;
    opacity: 1;
}

.relation-line.selected {
    stroke: var(--accent);
    stroke-width: 3;
    opacity: 1;
    stroke-dasharray: 5, 4;
    filter: drop-shadow(0 0 5px var(--accent-glow));
}

.relation-hover-target {
    fill: none;
    stroke: transparent;
    stroke-width: 14;
    cursor: pointer;
    pointer-events: stroke;
}

/* ---------------------------------------------------- */
/* Mind Map Node HTML rendering elements (ForeignObject)*/
/* ---------------------------------------------------- */
.mindmap-node {
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--border-radius-md);
    padding: 10px 18px;
    background: var(--bg-panel);
    border: 2px solid var(--border-panel);
    box-shadow: var(--shadow-md);
    color: var(--text-primary);
    cursor: pointer;
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 500;
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275), 
                box-shadow 0.2s ease, 
                border-color 0.2s ease,
                background-color 0.3s ease;
    width: calc(100% - 4px);
    height: calc(100% - 4px);
    margin: 2px;
    box-sizing: border-box;
    text-align: center;
    overflow: hidden;
}

.mindmap-node:hover {
    transform: scale(1.03);
    box-shadow: var(--shadow-lg);
    border-color: var(--border-panel-focus);
}

.mindmap-node.selected {
    border-color: var(--accent);
    box-shadow: 0 0 0 1px var(--accent), var(--shadow-lg), 0 0 15px var(--accent-glow);
    transform: scale(1.03);
}

/* Node Presets override */
.mindmap-node.node-root {
    background: var(--node-root-bg);
    color: var(--node-root-text);
    border-color: var(--node-root-border);
    font-size: 18px;
    font-weight: 700;
    font-family: var(--font-heading);
    box-shadow: 0 10px 25px -5px rgba(99, 102, 241, 0.3), var(--shadow-lg);
}
.mindmap-node.node-root:hover {
    border-color: rgba(255, 255, 255, 0.4);
}

.mindmap-node.node-lavender {
    background-color: var(--color-lavender-bg);
    border-color: var(--color-lavender-border);
    color: var(--color-lavender-text);
}
.mindmap-node.node-emerald {
    background-color: var(--color-emerald-bg);
    border-color: var(--color-emerald-border);
    color: var(--color-emerald-text);
}
.mindmap-node.node-ocean {
    background-color: var(--color-ocean-bg);
    border-color: var(--color-ocean-border);
    color: var(--color-ocean-text);
}
.mindmap-node.node-rose {
    background-color: var(--color-rose-bg);
    border-color: var(--color-rose-border);
    color: var(--color-rose-text);
}
.mindmap-node.node-gold {
    background-color: var(--color-gold-bg);
    border-color: var(--color-gold-border);
    color: var(--color-gold-text);
}
.mindmap-node.node-slate {
    background-color: var(--color-slate-bg);
    border-color: var(--color-slate-border);
    color: var(--color-slate-text);
}

.mindmap-node.node-coral { background-color: var(--color-coral-bg); border-color: var(--color-coral-border); color: var(--color-coral-text); }
.mindmap-node.node-amber { background-color: var(--color-amber-bg); border-color: var(--color-amber-border); color: var(--color-amber-text); }
.mindmap-node.node-lime { background-color: var(--color-lime-bg); border-color: var(--color-lime-border); color: var(--color-lime-text); }
.mindmap-node.node-teal { background-color: var(--color-teal-bg); border-color: var(--color-teal-border); color: var(--color-teal-text); }
.mindmap-node.node-sky { background-color: var(--color-sky-bg); border-color: var(--color-sky-border); color: var(--color-sky-text); }
.mindmap-node.node-violet { background-color: var(--color-violet-bg); border-color: var(--color-violet-border); color: var(--color-violet-text); }
.mindmap-node.node-fuchsia { background-color: var(--color-fuchsia-bg); border-color: var(--color-fuchsia-border); color: var(--color-fuchsia-text); }
.mindmap-node.node-pink { background-color: var(--color-pink-bg); border-color: var(--color-pink-border); color: var(--color-pink-text); }
.mindmap-node.node-red { background-color: var(--color-red-bg); border-color: var(--color-red-border); color: var(--color-red-text); }

/* Text editor inside node */
.node-editor {
    width: 100%;
    height: 100%;
    background: transparent;
    border: none;
    outline: none;
    color: inherit;
    font-family: inherit;
    font-size: inherit;
    font-weight: inherit;
    text-align: center;
    resize: none;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: text;
    white-space: pre-wrap;
}

/* Collapse/Expand subtree indicator buttons */
.collapse-btn {
    fill: var(--bg-canvas);
    stroke: var(--text-secondary);
    stroke-width: 1.5;
    cursor: pointer;
    transition: transform 0.2s ease, stroke 0.2s ease, fill 0.2s ease;
}
.collapse-btn:hover {
    stroke: var(--accent);
    fill: var(--bg-panel);
    transform: scale(1.15);
}

/* ---------------------------------------------------- */
/* Glassmorphism Control Panel (Sidebar)                */
/* ---------------------------------------------------- */
.sidebar {
    position: absolute;
    top: 20px;
    left: 20px;
    bottom: 20px;
    width: 320px;
    background: var(--bg-panel);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-panel);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-glass);
    z-index: 10;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
}

.sidebar.collapsed {
    transform: translateX(-360px);
    opacity: 0;
    pointer-events: none;
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-icon {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--accent) 0%, #a855f7 100%);
    border-radius: var(--border-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.25);
}

.logo-text {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 20px;
    letter-spacing: -0.5px;
    background: linear-gradient(to right, var(--text-primary), var(--text-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.close-sidebar-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s, color 0.2s;
}

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

.sidebar-content {
    flex-grow: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Sidebar scrollbar styles */
.sidebar-content::-webkit-scrollbar {
    width: 6px;
}
.sidebar-content::-webkit-scrollbar-track {
    background: transparent;
}
.sidebar-content::-webkit-scrollbar-thumb {
    background: var(--border-panel);
    border-radius: 3px;
}
.sidebar-content::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

.panel-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.section-title {
    font-family: var(--font-heading);
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
}

/* Map Manager list items */
.maps-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.map-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    border-radius: var(--border-radius-md);
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-panel);
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s;
}

.map-item:hover {
    background: var(--bg-panel-hover);
    border-color: var(--border-panel-focus);
}

.map-item.active {
    background: rgba(99, 102, 241, 0.08);
    border-color: var(--accent);
}

.map-item-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow: hidden;
    flex-grow: 1;
}

.map-item-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.map-item-date {
    font-size: 11px;
    color: var(--text-muted);
}

.map-item-actions {
    display: flex;
    gap: 4px;
}

.map-action-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s, color 0.2s;
}

.map-action-btn:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

/* Custom Buttons styling */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    border-radius: var(--border-radius-md);
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: transform 0.1s, background-color 0.2s, box-shadow 0.2s;
    border: 1px solid transparent;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background: var(--accent);
    color: white;
    box-shadow: 0 4px 14px var(--accent-glow);
}

.btn-primary:hover {
    background: var(--accent-hover);
    box-shadow: 0 6px 20px var(--accent-glow);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-panel);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--border-panel-focus);
}

.btn-danger {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #f87171;
}

.btn-danger:hover {
    background: #ef4444;
    color: white;
}

/* Style presets grid */
.style-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
}

.color-preset-btn {
    height: 32px;
    border-radius: 8px;
    border: 2px solid transparent;
    cursor: pointer;
    transition: transform 0.2s, border-color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Relations List items in sidebar */
.relations-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 180px;
    overflow-y: auto;
    padding-right: 4px;
}

.relations-list::-webkit-scrollbar {
    width: 4px;
}
.relations-list::-webkit-scrollbar-thumb {
    background: var(--border-panel);
    border-radius: 2px;
}

.relation-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    border-radius: var(--border-radius-sm);
    background: rgba(255, 255, 255, 0.015);
    border: 1px solid var(--border-panel);
    font-size: 12px;
    transition: background-color 0.2s, border-color 0.2s;
}

.relation-item:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: var(--border-panel-focus);
}

.relation-item-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 210px;
    color: var(--text-secondary);
}

.relation-item-label span {
    color: var(--text-primary);
    font-weight: 500;
}

.color-preset-btn:hover {
    transform: scale(1.08);
}

.color-preset-btn.active {
    border-color: var(--text-primary);
    box-shadow: var(--shadow-md);
}

/* Sync info card */
.sync-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-panel);
    border-radius: var(--border-radius-md);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sync-status-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13px;
}

.sync-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
}

.sync-badge.online {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.sync-badge.offline {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}

.sync-badge.unconfigured {
    background: rgba(100, 116, 139, 0.1);
    color: #64748b;
}

/* ---------------------------------------------------- */
/* Floating UI Controls                                 */
/* ---------------------------------------------------- */
/* Top-right menu control bar */
.top-menu-bar {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 10;
}

.icon-btn {
    width: 44px;
    height: 44px;
    background: var(--bg-panel);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-panel);
    border-radius: var(--border-radius-md);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow-md);
    transition: background-color 0.2s, transform 0.2s, border-color 0.2s;
}

.icon-btn:hover {
    background: var(--bg-panel-hover);
    border-color: var(--border-panel-focus);
    transform: translateY(-2px);
}

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

/* Cloud sync loading spinner overlay animation */
@keyframes spin {
    to { transform: rotate(360deg); }
}
.syncing-spinner {
    animation: spin 1.5s linear infinite;
    color: var(--accent);
}

/* Floating Navigation Controls (Zoom in/out/fit) */
.canvas-controls {
    position: absolute;
    bottom: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 10;
}

/* Floating Action Menu for Selected Nodes (Touch-optimized) */
.floating-actions-menu {
    position: absolute;
    background: var(--bg-panel);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-panel);
    border-radius: var(--border-radius-xl);
    padding: 8px 12px;
    display: flex;
    gap: 10px;
    box-shadow: var(--shadow-xl);
    z-index: 12;
    pointer-events: auto;
    transition: opacity 0.2s ease, transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transform-origin: center bottom;
}

.floating-action-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    background: transparent;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    padding: 6px 8px;
    border-radius: var(--border-radius-md);
    font-family: var(--font-body);
    font-size: 10px;
    font-weight: 500;
    transition: background-color 0.2s, color 0.2s;
    min-width: 50px;
}

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

.floating-action-item svg {
    width: 20px;
    height: 20px;
    color: var(--text-secondary);
    transition: color 0.2s;
}

.floating-action-item:hover svg {
    color: var(--accent);
}

/* ---------------------------------------------------- */
/* Modals styling (Passcode Setup, Login, Confirm)      */
/* ---------------------------------------------------- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(5, 7, 12, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-card {
    background: var(--bg-panel);
    border: 1px solid var(--border-panel);
    border-radius: var(--border-radius-lg);
    width: 90%;
    max-width: 400px;
    padding: 32px;
    box-shadow: var(--shadow-xl);
    transform: translateY(20px) scale(0.96);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.modal-overlay.active .modal-card {
    transform: translateY(0) scale(1);
}

.modal-header {
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.modal-icon {
    width: 48px;
    height: 48px;
    background: rgba(99, 102, 241, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    margin: 0 auto 12px;
}

.modal-title {
    font-family: var(--font-heading);
    font-size: 22px;
    font-weight: 700;
}

.modal-subtitle {
    font-size: 13px;
    color: var(--text-secondary);
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-secondary);
    letter-spacing: 0.5px;
}

.form-input {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-panel);
    border-radius: var(--border-radius-md);
    padding: 14px;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 16px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    text-align: center;
}

.form-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-glow);
}

.form-input::placeholder {
    color: var(--text-muted);
}

.modal-error {
    font-size: 13px;
    color: #f87171;
    text-align: center;
    display: none;
}

.modal-actions {
    display: flex;
    gap: 12px;
    margin-top: 8px;
}

.modal-actions .btn {
    flex: 1;
}

/* Helpful Keyboard Shortcuts guide overlay */
.shortcuts-overlay {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    font-size: 12px;
    margin-top: 8px;
}

.shortcut-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 10px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.015);
    border: 1px solid var(--border-panel);
}

.shortcut-key {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    padding: 2px 6px;
    font-family: monospace;
    font-size: 10px;
    font-weight: bold;
    border-bottom: 1.5px solid rgba(0,0,0,0.2);
}

/* ---------------------------------------------------- */
/* Toast Notification System                            */
/* ---------------------------------------------------- */
.toast-container {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 200;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    background: rgba(15, 22, 38, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-panel);
    border-radius: var(--border-radius-md);
    padding: 12px 20px;
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 10px;
    opacity: 0;
    transform: translateY(15px);
    transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: auto;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast-success svg {
    color: #10b981;
}

.toast-error svg {
    color: #ef4444;
}

.toast-info svg {
    color: var(--accent);
}

/* Topic Notes CSS modifications */
.node-text {
    width: 100%;
    display: block;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
    word-break: break-word;
    white-space: normal;
}

.node-badge-notes {
    position: absolute;
    top: 5px;
    right: 5px;
    opacity: 0.55;
    color: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s;
}

.mindmap-node:hover .node-badge-notes {
    opacity: 0.95;
}

/* iPad and Mobile Responsiveness Queries */
@media (max-width: 768px) {
    .sidebar {
        width: calc(100% - 40px);
        max-width: 340px;
    }
    
    .floating-actions-menu {
        transform: scale(0.9);
    }
}

@media (max-width: 480px) {
    .sidebar {
        top: 0;
        left: 0;
        bottom: 0;
        width: 100%;
        max-width: 100%;
        border-radius: 0;
        border: none;
    }
    
    .sidebar-header {
        padding: 16px;
    }
    
    .sidebar-content {
        padding: 16px;
    }
    
    .top-menu-bar {
        top: 12px;
        right: 12px;
        gap: 8px;
    }
    
    .canvas-controls {
        bottom: 12px;
        right: 12px;
    }
}
