/* Vector Space Knowledge Whiteboard Styles - Clean Version */

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    overflow: hidden;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    user-select: none;
    cursor: crosshair;
}

/* Canvas and Viewport */
#canvas {
    width: 100vw;
    height: 100vh;
    position: relative;
    overflow: hidden;
    cursor: grab;
    background: 
        radial-gradient(circle at 20% 50%, rgba(120, 119, 198, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 80%, rgba(120, 119, 198, 0.2) 0%, transparent 50%);
}

#canvas.panning {
    cursor: grabbing;
}

.viewport-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transform-origin: 0 0;
    transition: transform 0.2s ease-out;
}

.grid-overlay {
    position: absolute;
    top: -5000px;
    left: -5000px;
    width: 10000px;
    height: 10000px;
    background-image: 
        linear-gradient(rgba(255,255,255,0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.1) 1px, transparent 1px);
    background-size: 50px 50px;
    opacity: 0.3;
    pointer-events: none;
}

/* Zoom Controls */
.zoom-controls {
    position: fixed;
    top: 30px;
    left: 30px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    backdrop-filter: blur(20px);
    background: rgba(255, 255, 255, 0.15);
    border-radius: 16px;
    padding: 16px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    min-width: 120px;
}

.zoom-control-group {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: space-between;
}

.zoom-button {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    width: 36px;
    height: 36px;
    cursor: pointer;
    font-size: 18px;
    font-weight: 600;
    color: white;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
}

.zoom-button:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.zoom-button:active {
    transform: translateY(0);
}

.zoom-indicator {
    color: white;
    font-size: 12px;
    font-weight: 500;
    text-align: center;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 6px 10px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    min-width: 60px;
}

.reset-view-button {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 11px;
    font-weight: 500;
    color: white;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    text-align: center;
    user-select: none;
}

.reset-view-button:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

/* Main Controls */
.controls {
    position: fixed;
    top: 30px;
    right: 30px;
    z-index: 1000;
    display: flex;
    gap: 15px;
    flex-direction: column;
}

.control-group {
    display: flex;
    gap: 10px;
    backdrop-filter: blur(20px);
    background: rgba(255, 255, 255, 0.15);
    border-radius: 16px;
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.control-button {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    padding: 10px 16px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: white;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    min-width: 80px;
    text-align: center;
}

.control-button:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

/* API Setup Modal */
.api-setup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1000;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(30px);
    padding: 32px;
    border-radius: 24px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 480px;
    width: 90%;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.api-setup h3 {
    margin: 0 0 20px 0;
    color: #2d3748;
    font-size: 24px;
    font-weight: 600;
}

.api-setup input[type="text"] {
    width: 100%;
    padding: 12px 16px;
    margin: 12px 0;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 14px;
    background: rgba(255, 255, 255, 0.8);
    transition: all 0.3s ease;
}

.api-setup input[type="text"]:focus {
    outline: none;
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.api-setup button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.api-setup button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
}

.api-setup.hidden {
    display: none;
}

/* Knowledge Nodes */
.knowledge-node {
    position: absolute;
    cursor: move;
    user-select: none;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 16px;
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Concept Nodes */
.concept-node {
    background: rgba(255, 255, 255, 0.95);
    padding: 20px 24px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    min-width: 180px;
    max-width: 320px;
    width: auto;
    text-align: center;
    z-index: 20;
    position: relative;
}

.concept-node.expandable {
    cursor: pointer;
}

.concept-node.expandable::after {
    content: '⚡';
    position: absolute;
    top: -8px;
    right: -8px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.concept-node.radial-active {
    box-shadow: 0 0 30px rgba(102, 126, 234, 0.4);
    background: rgba(255, 255, 255, 1);
}

.concept-node.radial-active::after {
    content: '⚡';
    animation: expandPulse 1s ease-in-out infinite;
}

@keyframes expandPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

.concept-node input {
    border: none;
    outline: none;
    background: transparent;
    font-size: 18px;
    font-weight: 600;
    text-align: center;
    min-width: 130px;
    max-width: 270px;
    width: auto;
    cursor: text;
    color: #2d3748;
    box-sizing: border-box;
}

.concept-node input::placeholder {
    color: #a0aec0;
}

/* Sticky Notes */
.sticky-note {
    width: 200px;
    min-height: 120px;
    max-height: none; /* Remove height restrictions */
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    position: relative;
    font-family: 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    border: 2px solid rgba(0, 0, 0, 0.1);
    cursor: move;
    display: flex;
    flex-direction: column;
}

.sticky-note:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.sticky-note.selected {
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.3);
}

/* Sticky Note Colors */
.sticky-yellow { background: #fff3cd; border-color: #f4d03f; }
.sticky-pink { background: #fce4ec; border-color: #f48fb1; }
.sticky-blue { background: #e3f2fd; border-color: #64b5f6; }
.sticky-green { background: #e8f5e8; border-color: #81c784; }
.sticky-orange { background: #fff3e0; border-color: #ffb74d; }
.sticky-purple { background: #f3e5f5; border-color: #ba68c8; }
.sticky-red { background: #ffebee; border-color: #e57373; }
.sticky-gray { background: #f5f5f5; border-color: #bdbdbd; }

.sticky-text {
    font-size: 14px;
    line-height: 1.4;
    color: #333;
    min-height: 80px;
    font-weight: 400;
    flex: 1;
    border: none !important;
    background: transparent !important;
    outline: none !important;
    resize: none !important;
    width: 100% !important;
    padding: 12px !important;
    box-sizing: border-box !important;
    font-family: inherit !important;
    overflow: hidden !important; /* Remove scrollbar */
    pointer-events: none; /* Prevent click interference with dragging */
}

.sticky-text:focus {
    outline: none;
    pointer-events: auto; /* Re-enable interactions when editing */
}

/* Editing state for sticky notes */
.sticky-note.editing {
    cursor: text;
}

.sticky-note.editing .sticky-text {
    pointer-events: auto;
}

/* Readonly state styling */
.sticky-text[readonly] {
    cursor: inherit;
}

.sticky-text:not([readonly]) {
    cursor: text;
}

.sticky-color-picker {
    transition: opacity 0.2s ease;
}

.sticky-note:hover .sticky-color-picker {
    opacity: 1 !important;
}

.color-picker-dropdown {
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Selection System */
.knowledge-node.selected {
    border: 2px solid #667eea !important;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.3) !important;
}

.selection-box {
    border: 2px dashed rgba(102, 126, 234, 0.8);
    background: rgba(102, 126, 234, 0.1);
    pointer-events: none;
    z-index: 1000;
}

/* Knowledge Clusters */
.knowledge-cluster {
    background: rgba(255, 255, 255, 0.85);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.4s ease;
    z-index: 10;
    transform-origin: center;
}

/* Disable all interactive elements within knowledge clusters */
.knowledge-cluster img,
.knowledge-cluster a,
.knowledge-cluster video {
    pointer-events: none !important;
    user-select: none !important;
    -webkit-user-drag: none !important;
    -khtml-user-drag: none !important;
    -moz-user-drag: none !important;
    -o-user-drag: none !important;
    cursor: inherit !important;
    text-decoration: none !important;
}

.knowledge-cluster a:hover,
.knowledge-cluster a:focus,
.knowledge-cluster a:active {
    text-decoration: none !important;
    color: inherit !important;
}

.knowledge-cluster.dimmed {
    opacity: 0.4;
    filter: blur(2px);
    transform: scale(0.85);
    z-index: 1;
}

.knowledge-cluster:not(.dimmed) {
    opacity: 1;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

.knowledge-cluster.radial-menu-item {
    opacity: 0.8;
    transform: scale(0.9);
    transition: all 0.3s ease;
    border: 2px dashed rgba(255, 255, 255, 0.5);
}

.knowledge-cluster.radial-menu-item:hover {
    opacity: 0.95;
    transform: scale(0.95);
    border-style: solid;
}

.knowledge-cluster.anchored {
    opacity: 1;
    transform: scale(1);
    border-style: solid;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

/* Special styling for anchored items that are still in radial menu */
.knowledge-cluster.radial-menu-item.anchored {
    border-style: solid;
    opacity: 1;
    transform: scale(1);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.anchor-indicator {
    position: absolute;
    top: -8px;
    right: -8px;
    font-size: 12px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(0, 0, 0, 0.1);
    animation: anchorAppear 0.3s ease-out;
}

@keyframes anchorAppear {
    0% { 
        opacity: 0; 
        transform: scale(0.5) rotate(-45deg); 
    }
    100% { 
        opacity: 1; 
        transform: scale(1) rotate(0deg); 
    }
}

/* Image Clusters */
.image-cluster {
    border: 2px solid #48bb78;
    width: 140px;
    height: 140px;
    position: relative;
    overflow: hidden;
}

.image-cluster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
    user-select: none;
    -webkit-user-drag: none;
    -khtml-user-drag: none;
    -moz-user-drag: none;
    -o-user-drag: none;
    pointer-events: none;
    cursor: inherit;
}

.image-cluster:hover img {
    transform: scale(1.1);
}

/* Video Clusters */
.video-cluster {
    border: 2px solid #ed8936;
    width: 140px;
    height: 140px;
    position: relative;
    overflow: hidden;
}

.video-cluster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    user-select: none;
    -webkit-user-drag: none;
    -khtml-user-drag: none;
    -moz-user-drag: none;
    -o-user-drag: none;
    pointer-events: none;
    cursor: inherit;
}

.video-cluster::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 0;
    height: 0;
    border-left: 20px solid rgba(255, 255, 255, 0.9);
    border-top: 12px solid transparent;
    border-bottom: 12px solid transparent;
    transition: all 0.3s ease;
}

.video-cluster:hover::after {
    border-left-color: white;
    transform: translate(-50%, -50%) scale(1.2);
}

/* Text Clusters */
.text-cluster {
    border: 2px solid #4299e1;
    width: 200px;
    padding: 16px;
    cursor: pointer;
    position: relative;
}

.text-cluster:hover {
    background: rgba(255, 255, 255, 0.95);
}

.text-cluster h4 {
    margin: 0 0 8px 0;
    font-size: 15px;
    color: #2d3748;
    font-weight: 600;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.text-cluster p {
    margin: 0;
    font-size: 13px;
    color: #4a5568;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Enhanced Preview */
.enhanced-preview {
    position: fixed;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(30px);
    padding: 24px;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    max-width: 480px;
    display: none;
    pointer-events: none;
    border: 1px solid rgba(255, 255, 255, 0.3);
    transform: scale(0.9);
    transition: all 0.3s ease;
}

.enhanced-preview.show {
    transform: scale(1);
}

.enhanced-preview img {
    max-width: 100%;
    max-height: 300px;
    border-radius: 12px;
    display: block;
    margin: 0 auto;
}

.enhanced-preview h3 {
    margin: 16px 0 12px 0;
    color: #2d3748;
    font-size: 20px;
    font-weight: 600;
}

.enhanced-preview p {
    margin: 0;
    color: #4a5568;
    font-size: 14px;
    line-height: 1.6;
}

/* Vector Connections (SVG-based) */
.connections-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: visible;
}

/* Loading and Status Elements */
.loading-pulse {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(45deg, #667eea, #764ba2);
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.loading-pulse::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: white;
    animation: innerPulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
    0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
    50% { transform: translate(-50%, -50%) scale(1.2); opacity: 0.7; }
}

@keyframes innerPulse {
    0%, 100% { transform: translate(-50%, -50%) scale(1); }
    50% { transform: translate(-50%, -50%) scale(0.8); }
}

.error-notification {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(254, 178, 178, 0.95);
    color: #742a2a;
    padding: 12px 20px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 500;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(252, 129, 129, 0.3);
}

.status-indicator {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 1000;
    padding: 12px 20px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 500;
    color: white;
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.status-indicator.online {
    background: rgba(72, 187, 120, 0.9);
    box-shadow: 0 0 20px rgba(72, 187, 120, 0.3);
}

.status-indicator.offline {
    background: rgba(245, 101, 101, 0.9);
    box-shadow: 0 0 20px rgba(245, 101, 101, 0.3);
}

.spatial-hint {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: rgba(255, 255, 255, 0.7);
    font-size: 18px;
    font-weight: 300;
    text-align: center;
    pointer-events: none;
    animation: breathe 4s ease-in-out infinite;
}

@keyframes breathe {
    0%, 100% { opacity: 0.7; transform: translate(-50%, -50%) scale(1); }
    50% { opacity: 0.4; transform: translate(-50%, -50%) scale(1.05); }
}

.force-field {
    position: absolute;
    border-radius: 50%;
    border: 1px dashed rgba(255, 255, 255, 0.3);
    pointer-events: none;
    animation: fieldPulse 6s ease-in-out infinite;
}

@keyframes fieldPulse {
    0%, 100% { opacity: 0.3; transform: scale(1); }
    50% { opacity: 0.1; transform: scale(1.1); }
}

/* Concepts Panel */
.concepts-panel {
    position: fixed;
    bottom: 30px;
    left: 30px;
    z-index: 1000;
    backdrop-filter: blur(20px);
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    cursor: pointer;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.concepts-panel:hover {
    width: 320px;
    height: auto;
    min-height: 200px;
    cursor: default;
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

.concepts-panel-icon {
    color: white;
    font-size: 24px;
    transition: all 0.4s ease;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.concepts-panel:hover .concepts-panel-icon {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.8);
}

.concepts-panel-content {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 24px;
    width: 100%;
    color: white;
}

.concepts-panel:hover .concepts-panel-content {
    opacity: 1;
    transform: translateY(0);
}

.concepts-panel-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.concepts-panel-title {
    font-size: 16px;
    font-weight: 600;
    color: white;
    margin: 0;
}

.concepts-panel-subtitle {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
    margin: 4px 0 0 0;
}

.concepts-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 200px;
    overflow: hidden;
}

.concepts-list::-webkit-scrollbar {
    width: 4px;
}

.concepts-list::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
}

.concepts-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
}

.concept-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    transition: all 0.3s ease;
    cursor: pointer;
}

.concept-item:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateX(4px);
    border-color: rgba(255, 255, 255, 0.3);
}

.concept-confidence {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 60px;
}

.confidence-bar {
    width: 32px;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    overflow: hidden;
}

.confidence-fill {
    height: 100%;
    background: linear-gradient(90deg, #48bb78 0%, #38a169 100%);
    border-radius: 2px;
    transition: width 0.6s ease;
}

.confidence-text {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 500;
}

.concept-name {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
    color: white;
}

.concept-type {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.6);
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 6px;
    border-radius: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.empty-concepts {
    text-align: center;
    color: rgba(255, 255, 255, 0.6);
    font-size: 13px;
    padding: 20px;
    font-style: italic;
}

.refresh-concepts {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 8px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    opacity: 0;
}

.concepts-panel:hover .refresh-concepts {
    opacity: 1;
}

.refresh-concepts:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(180deg);
}

.refresh-concepts svg {
    width: 16px;
    height: 16px;
    color: white;
}

.analysis-status {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 11px;
    color: rgba(255, 255, 255, 0.7);
}

.analysis-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #48bb78;
    animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.8); }
}

/* Connection Animations */
@keyframes connectionPulse {
    0%, 100% { opacity: 0.8; }
    50% { opacity: 1; }
}

.vector-connection {
    transition: all 0.3s ease;
}

.vector-connection:hover {
    stroke-width: 4px !important;
}

/* AI Log Panel */
.ai-log-panel {
    position: fixed;
    left: 0;
    top: 0;
    width: 400px;
    height: 100vh;
    background: rgba(20, 25, 40, 0.95);
    backdrop-filter: blur(10px);
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    transform: translateX(-100%);
    transition: transform 0.3s ease-out;
    font-family: 'SF Pro Display', -apple-system, BlinkMacSystemFont, sans-serif;
}

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

.ai-log-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.02);
}

.ai-log-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ai-log-icon {
    font-size: 24px;
}

.ai-log-title h3 {
    margin: 0;
    color: white;
    font-size: 18px;
    font-weight: 600;
}

.ai-log-controls {
    display: flex;
    gap: 8px;
}

.ai-log-control-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    color: white;
    padding: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ai-log-control-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
}

.ai-log-content {
    flex: 1;
    overflow-y: auto;
    padding: 0;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
}

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

.ai-log-content::-webkit-scrollbar-track {
    background: transparent;
}

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

.ai-log-empty {
    text-align: center;
    padding: 60px 20px;
    color: rgba(255, 255, 255, 0.6);
}

.ai-log-empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.ai-log-empty p {
    margin: 0 0 8px 0;
    font-size: 16px;
    font-weight: 500;
}

.ai-log-empty small {
    font-size: 14px;
    opacity: 0.7;
}

.ai-log-message {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding: 16px 20px;
    transition: background-color 0.2s ease;
}

.ai-log-message:hover {
    background: rgba(255, 255, 255, 0.02);
}

.ai-log-message-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.ai-log-message-icon {
    font-size: 16px;
}

.ai-log-message-label {
    font-weight: 600;
    color: white;
    font-size: 14px;
}

.ai-log-message-time {
    margin-left: auto;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
}

.ai-log-message-content {
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    line-height: 1.5;
}

.ai-log-message-metadata {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
}

/* Message type specific styling */
.user-message {
    border-left: 3px solid #4A90E2;
}

.context-message {
    border-left: 3px solid #7B68EE;
}

.ai-message {
    border-left: 3px solid #50C878;
}

.system-message {
    border-left: 3px solid #FFA500;
}

.suggestion-message {
    border-left: 3px solid #FFD700;
}

.error-message {
    border-left: 3px solid #FF6B6B;
}

/* Message content styling */
.user-query {
    font-style: italic;
    color: #4A90E2;
    padding: 8px 12px;
    background: rgba(74, 144, 226, 0.1);
    border-radius: 6px;
}

.context-analysis {
    background: rgba(123, 104, 238, 0.1);
    border-radius: 6px;
    padding: 12px;
}

.context-section {
    margin-bottom: 8px;
}

.context-section:last-child {
    margin-bottom: 0;
}

.ai-response {
    background: rgba(80, 200, 120, 0.1);
    border-radius: 6px;
    padding: 12px;
}

.ai-response-text {
    margin-bottom: 8px;
}

.response-actions {
    margin-top: 12px;
}

.response-actions ul {
    margin: 8px 0 0 0;
    padding-left: 20px;
}

.response-actions li {
    margin-bottom: 4px;
}

.recommendations ul {
    margin: 0;
    padding-left: 20px;
}

.recommendations li {
    margin-bottom: 8px;
}

.confidence {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.6);
    margin-left: 8px;
}

.system-action {
    color: #FFA500;
    font-weight: 500;
}

.metadata-content {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.metadata-item {
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 11px;
}

.ai-log-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.02);
}

.ai-log-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
}

.ai-log-status {
    color: #50C878;
    font-weight: 500;
}

/* AI Log button styling */
#aiLogBtn.active {
    background: rgba(80, 200, 120, 0.2);
    border-color: #50C878;
    color: white;
}

/* Responsive design */
@media (max-width: 768px) {
    .ai-log-panel {
        width: 100vw;
    }
}

/* AI Action Highlights */
.ai-highlighted {
    animation: ai-highlight-pulse 2s ease-in-out;
    border: 2px solid #FFD700 !important;
    box-shadow: 0 0 0 4px rgba(255, 215, 0, 0.3) !important;
    z-index: 100;
}

@keyframes ai-highlight-pulse {
    0% {
        box-shadow: 0 0 0 4px rgba(255, 215, 0, 0.8);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(255, 215, 0, 0.4);
    }
    100% {
        box-shadow: 0 0 0 4px rgba(255, 215, 0, 0.3);
    }
}

/* AI Action Feedback */
.ai-action-feedback {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(80, 200, 120, 0.95);
    color: white;
    padding: 16px 24px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    z-index: 2000;
    animation: ai-feedback-show 0.3s ease-out;
}

@keyframes ai-feedback-show {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.9);
    }
    100% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

.ai-action-feedback.error {
    background: rgba(255, 107, 107, 0.95);
}

.ai-action-feedback.success {
    background: rgba(80, 200, 120, 0.95);
}

/* Tutorial Mode */
.tutorial-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(20px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.tutorial-modal.hidden {
    opacity: 0;
    pointer-events: none;
}

.tutorial-content {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(30px);
    padding: 40px;
    border-radius: 24px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    border: 1px solid rgba(255, 255, 255, 0.3);
    text-align: left;
}

.tutorial-content h2 {
    margin: 0 0 24px 0;
    color: #2d3748;
    font-size: 28px;
    font-weight: 700;
    text-align: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.tutorial-section {
    margin: 24px 0;
    padding: 20px;
    background: rgba(102, 126, 234, 0.05);
    border-radius: 16px;
    border: 1px solid rgba(102, 126, 234, 0.1);
}

.tutorial-section h3 {
    margin: 0 0 12px 0;
    color: #2d3748;
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tutorial-section p {
    margin: 8px 0;
    color: #4a5568;
    font-size: 14px;
    line-height: 1.6;
}

.tutorial-section ul {
    margin: 8px 0;
    padding-left: 20px;
    color: #4a5568;
}

.tutorial-section li {
    margin: 6px 0;
    font-size: 14px;
    line-height: 1.5;
}

.tutorial-section strong {
    color: #2d3748;
    font-weight: 600;
}

.tutorial-close {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 16px 32px;
    border-radius: 16px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    width: 100%;
    margin-top: 24px;
    transition: all 0.3s ease;
}

.tutorial-close:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
}

/* Close Button Styles */
.tutorial-close-x {
    position: absolute;
    top: 16px;
    right: 16px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    cursor: pointer;
    font-size: 20px;
    font-weight: 300;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.tutorial-close-x:hover {
    background: rgba(255, 0, 0, 0.1);
    color: #e53e3e;
    transform: scale(1.1);
}

.preview-close {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    width: 28px;
    height: 28px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 300;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.preview-close:hover {
    background: rgba(255, 0, 0, 0.1);
    color: #e53e3e;
}

.panel-close {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 300;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    opacity: 0;
}

.concepts-panel:hover .panel-close {
    opacity: 1;
}

.panel-close:hover {
    background: rgba(255, 255, 255, 0.3);
    color: #e53e3e;
    transform: scale(1.1);
}

/* Enhanced Panel Transitions */
.concepts-panel {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1), transform 0.3s ease;
}

.concepts-panel.closing {
    transform: translateX(-100%);
    opacity: 0;
}

/* Search Panel */
.search-panel {
    position: fixed;
    top: calc(50% - 100px);
    right: 30px;
    transform: translateY(-50%);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(20px);
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.2);
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.search-panel:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-50%) scale(1.05);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.2);
}

.search-panel-icon {
    font-size: 24px;
    opacity: 0.8;
    transition: all 0.3s ease;
}

.search-panel:hover .search-panel-icon {
    opacity: 1;
    transform: scale(1.1);
}

/* Universal Search Component */
.universal-search {
    position: absolute;
    top: 50%;
    right: 0;
    transform: translateY(-50%);
    padding: 0;
    background: transparent;
    border-radius: 30px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    overflow: visible;
    width: 60px;
    height: 60px;
    justify-content: center;
}

.universal-search:hover {
    background: transparent;
}

.universal-search.expanded {
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 30px;
    width: 320px;
    padding: 12px 20px;
    right: -10px;
}

.search-icon {
    font-size: 20px;
    opacity: 0;
    min-width: 20px;
    transition: all 0.4s ease;
    position: absolute;
    left: 20px;
}

.universal-search.expanded .search-icon {
    opacity: 0.8;
    color: #667eea;
    position: relative;
    left: 0;
    font-size: 16px;
}

.search-input {
    border: none;
    background: transparent;
    outline: none;
    font-size: 14px;
    font-family: inherit;
    color: transparent;
    width: 0;
    transition: all 0.4s ease;
    padding: 0;
    opacity: 0;
}

.universal-search.expanded .search-input {
    color: #2d3748;
    width: 240px;
    opacity: 1;
}

.search-input::placeholder {
    color: transparent;
}

.universal-search.expanded .search-input::placeholder {
    color: rgba(45, 55, 72, 0.6);
}

.search-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(0, 0, 0, 0.1);
    z-index: 1001;
    margin-top: 8px;
    overflow: hidden;
    backdrop-filter: blur(20px);
    max-height: 300px;
    overflow-y: auto;
}

.search-suggestion {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.search-suggestion:last-child {
    border-bottom: none;
}

.search-suggestion:hover,
.search-suggestion.selected {
    background: rgba(102, 126, 234, 0.1);
    transform: translateX(2px);
}

.ai-suggestion {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    border-bottom: 2px solid rgba(102, 126, 234, 0.2) !important;
}

.ai-suggestion:hover,
.ai-suggestion.selected {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.15) 0%, rgba(118, 75, 162, 0.15) 100%);
}

.suggestion-icon {
    font-size: 18px;
    min-width: 24px;
    text-align: center;
}

.suggestion-content {
    flex: 1;
    min-width: 0;
}

.suggestion-title {
    font-size: 14px;
    font-weight: 500;
    color: #2d3748;
    margin-bottom: 2px;
    line-height: 1.3;
}

.suggestion-title mark {
    background: rgba(102, 126, 234, 0.3);
    color: inherit;
    border-radius: 3px;
    padding: 1px 2px;
}

.suggestion-subtitle {
    font-size: 12px;
    color: #718096;
    line-height: 1.2;
}

.suggestion-shortcut {
    font-size: 11px;
    color: #a0aec0;
    background: rgba(0, 0, 0, 0.05);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
    font-weight: 500;
}

/* Search highlight effect for found nodes */
.search-highlight {
    animation: searchHighlight 2s ease-out;
    position: relative;
    z-index: 1000 !important;
}

@keyframes searchHighlight {
    0% {
        box-shadow: 0 0 0 0 rgba(102, 126, 234, 0.8);
        transform: scale(1);
    }
    25% {
        box-shadow: 0 0 0 10px rgba(102, 126, 234, 0.4);
        transform: scale(1.05);
    }
    50% {
        box-shadow: 0 0 0 20px rgba(102, 126, 234, 0.2);
        transform: scale(1.02);
    }
    100% {
        box-shadow: 0 0 0 30px rgba(102, 126, 234, 0);
        transform: scale(1);
    }
}

/* Scrollbar styling for suggestions */
.search-suggestions::-webkit-scrollbar {
    width: 6px;
}

.search-suggestions::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
}

.search-suggestions::-webkit-scrollbar-thumb {
    background: rgba(102, 126, 234, 0.3);
    border-radius: 3px;
}

.search-suggestions::-webkit-scrollbar-thumb:hover {
    background: rgba(102, 126, 234, 0.5);
}

/* AI Loading Indicator */
.ai-loading-overlay {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(102, 126, 234, 0.2);
    border-radius: 12px;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    z-index: 10000;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    pointer-events: none;
}

.ai-loading-overlay.visible {
    opacity: 1;
    transform: translateY(0);
}

.ai-loading-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(102, 126, 234, 0.2);
    border-top: 2px solid #667eea;
    border-radius: 50%;
    animation: aiSpinner 1s linear infinite;
}

@keyframes aiSpinner {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.ai-loading-text {
    color: #667eea;
    font-weight: 500;
    font-size: 14px;
    white-space: nowrap;
}

.ai-loading-dots {
    color: #667eea;
    font-weight: bold;
    animation: aiDots 1.5s ease-in-out infinite;
}

@keyframes aiDots {
    0%, 20% { opacity: 0; }
    50% { opacity: 1; }
    80%, 100% { opacity: 0; }
}

/* Enhanced AI Log button state during loading */
.control-button.ai-loading {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    animation: aiButtonPulse 2s ease-in-out infinite;
}

@keyframes aiButtonPulse {
    0%, 100% { 
        box-shadow: 0 0 0 0 rgba(102, 126, 234, 0.7);
    }
    50% { 
        box-shadow: 0 0 0 10px rgba(102, 126, 234, 0);
    }
}

/* Search input loading state */
.search-input.ai-processing {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    background: linear-gradient(90deg, #f8f9ff 0%, #ffffff 50%, #f8f9ff 100%);
    background-size: 200% 100%;
    animation: searchShimmer 2s ease-in-out infinite;
}

@keyframes searchShimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* Mockup Banner */
.mockup-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: #fff3cd;
    border-bottom: 1px solid #ffeeba;
    padding: 8px 20px;
    z-index: 10000;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.mockup-banner-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
}

.mockup-banner-icon {
    font-size: 18px;
    line-height: 1;
}

.mockup-banner-text {
    font-size: 14px;
    color: #856404;
    font-weight: 500;
}

.mockup-banner-close {
    position: absolute;
    right: 0;
    background: none;
    border: none;
    font-size: 24px;
    line-height: 1;
    color: #856404;
    cursor: pointer;
    padding: 0 8px;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.mockup-banner-close:hover {
    opacity: 1;
}

/* Adjust canvas position when banner is visible */
body:has(.mockup-banner) #canvas {
    top: 45px;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .mockup-banner {
        background: #332701;
        border-bottom-color: #665003;
    }

    .mockup-banner-text,
    .mockup-banner-close {
        color: #ffec8b;
    }
}

