/* Infinite Nexus Mindmap Styles */

/* Main container */
.mindmap-container {
    position: relative;
    width: 100%;
    height: calc(100vh - 200px);
    min-height: 600px;
    background: linear-gradient(135deg, #0f3460 0%, #16213e 50%, #1a1a2e 100%);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 0 30px rgba(233, 69, 96, 0.2);
}

/* Cytoscape canvas */
#cy {
    width: 100%;
    height: 100%;
    position: relative;
}

/* Nebula background effect */
.mindmap-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1200 800"><defs><filter id="nebula"><feTurbulence baseFrequency="0.02" numOctaves="4" /><feColorMatrix values="0 0 0 0 0.1 0 0 0 0 0.1 0 0 0 0 0.2 0 0 0 1 0"/></filter></defs><rect width="1200" height="800" filter="url(%23nebula)" opacity="0.3"/></svg>') center/cover;
    pointer-events: none;
    opacity: 0.3;
    animation: nebulaDrift 120s ease-in-out infinite;
}

@keyframes nebulaDrift {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(-2%, 1%) scale(1.05); }
    66% { transform: translate(1%, -2%) scale(1.02); }
}

/* Controls toolbar */
.mindmap-controls {
    position: absolute;
    top: 20px;
    left: 20px;
    right: 20px;
    display: flex;
    gap: 15px;
    align-items: center;
    z-index: 100;
    background: rgba(26, 26, 46, 0.9);
    padding: 15px;
    border-radius: 8px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(233, 69, 96, 0.3);
}

/* Search container */
.search-container {
    flex: 1;
    max-width: 400px;
    position: relative;
}

.search-container input {
    width: 100%;
    padding: 10px 40px 10px 15px;
    background: rgba(15, 52, 96, 0.5);
    border: 1px solid rgba(233, 69, 96, 0.3);
    border-radius: 5px;
    color: #f1f1f1;
    font-size: 14px;
    transition: all 0.3s ease;
}

.search-container input:focus {
    outline: none;
    border-color: #e94560;
    box-shadow: 0 0 10px rgba(233, 69, 96, 0.3);
}

.search-container button {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #e94560;
    cursor: pointer;
    padding: 5px 10px;
}

/* Control buttons */
.mindmap-controls button {
    padding: 10px 20px;
    background: linear-gradient(135deg, #e94560 0%, #c41e3a 100%);
    border: none;
    border-radius: 5px;
    color: white;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.mindmap-controls button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(233, 69, 96, 0.4);
}

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

/* Node styles (for Cytoscape) */
.cy-node {
    background-color: #1a1a2e;
    border: 2px solid #e94560;
    color: #f1f1f1;
    text-align: center;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.cy-node:selected {
    background-color: #e94560;
    box-shadow: 0 0 20px rgba(233, 69, 96, 0.8);
}

/* Edge styles */
.cy-edge {
    width: 2px;
    line-color: rgba(233, 69, 96, 0.6);
    target-arrow-color: rgba(233, 69, 96, 0.6);
    curve-style: bezier;
    transition: all 0.3s ease;
}

/* Node editor modal */
.node-editor-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    backdrop-filter: blur(5px);
    padding: 20px;
    box-sizing: border-box;
}

.node-editor-modal[style*="display: none"] {
    display: none !important;
}

.node-editor-modal[style*="display: block"] {
    display: flex !important;
    align-items: center;
    justify-content: center;
}

.node-editor-content {
    position: relative;
    max-width: 800px;
    width: 100%;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border-radius: 10px;
    padding: 30px;
    border: 1px solid rgba(233, 69, 96, 0.3);
    box-shadow: 0 0 30px rgba(233, 69, 96, 0.2);
    max-height: 90vh;
    overflow-y: auto;
    margin: 0;
}

.node-editor-content h2 {
    color: #e94560;
    margin-bottom: 20px;
    font-size: 24px;
}

.node-editor-content .close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 30px;
    color: #e94560;
    cursor: pointer;
    transition: all 0.3s ease;
}

.node-editor-content .close:hover {
    transform: rotate(90deg);
}

/* Form styles */
.node-editor-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.node-editor-form label {
    color: #f1f1f1;
    font-weight: 500;
    margin-bottom: 5px;
    display: block;
}

.node-editor-form input[type="text"] {
    width: 100%;
    padding: 12px;
    background: rgba(15, 52, 96, 0.5);
    border: 1px solid rgba(233, 69, 96, 0.3);
    border-radius: 5px;
    color: #f1f1f1;
    font-size: 16px;
    transition: all 0.3s ease;
}

.node-editor-form input[type="text"]:focus {
    outline: none;
    border-color: #e94560;
    box-shadow: 0 0 10px rgba(233, 69, 96, 0.3);
}

/* Quill editor container */
#node-content-editor {
    background: rgba(15, 52, 96, 0.3);
    border: 1px solid rgba(233, 69, 96, 0.3);
    border-radius: 5px;
    min-height: 200px;
}

.ql-toolbar {
    background: rgba(26, 26, 46, 0.9);
    border: none !important;
    border-bottom: 1px solid rgba(233, 69, 96, 0.3) !important;
}

.ql-container {
    border: none !important;
    font-size: 16px;
}

.ql-editor {
    min-height: 150px;
    color: #f1f1f1;
}

/* Node details panel */
.node-details-panel {
    position: absolute;
    right: 20px;
    top: 80px;
    width: 300px;
    background: rgba(26, 26, 46, 0.95);
    border: 1px solid rgba(233, 69, 96, 0.3);
    border-radius: 8px;
    padding: 20px;
    display: none;
    z-index: 100;
    backdrop-filter: blur(10px);
    max-height: calc(100vh - 300px);
    overflow-y: auto;
}

.node-details-panel h3 {
    color: #e94560;
    margin-bottom: 15px;
    font-size: 18px;
}

.node-details-panel .content {
    color: #f1f1f1;
    margin-bottom: 20px;
    line-height: 1.6;
}

/* Credibility widget */
.credibility-widget {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    padding: 15px;
    background: rgba(15, 52, 96, 0.3);
    border-radius: 5px;
}

.credibility-score {
    font-size: 24px;
    font-weight: bold;
    color: #e94560;
}

.vote-buttons {
    display: flex;
    gap: 10px;
}

.vote-buttons button {
    padding: 8px 15px;
    background: rgba(233, 69, 96, 0.2);
    border: 1px solid rgba(233, 69, 96, 0.5);
    border-radius: 5px;
    color: #f1f1f1;
    cursor: pointer;
    transition: all 0.3s ease;
}

.vote-buttons button:hover {
    background: rgba(233, 69, 96, 0.4);
    transform: scale(1.1);
}

.vote-buttons button.voted {
    background: #e94560;
    color: white;
}

/* Citations list */
.citations-list {
    margin-top: 20px;
}

.citations-list h4 {
    color: #e94560;
    margin-bottom: 10px;
    font-size: 16px;
}

.citation-item {
    padding: 10px;
    background: rgba(15, 52, 96, 0.3);
    border-radius: 5px;
    margin-bottom: 10px;
}

.citation-item a {
    color: #e94560;
    text-decoration: none;
}

.citation-item a:hover {
    text-decoration: underline;
}

/* Connection modal */
.connection-modal {
    position: absolute;
    background: rgba(26, 26, 46, 0.95);
    border: 1px solid rgba(233, 69, 96, 0.3);
    border-radius: 8px;
    padding: 20px;
    z-index: 200;
    backdrop-filter: blur(10px);
    display: none;
}

.connection-modal h4 {
    color: #e94560;
    margin-bottom: 15px;
}

.connection-input {
    position: relative;
}

.connection-input input {
    width: 250px;
    padding: 10px;
    background: rgba(15, 52, 96, 0.5);
    border: 1px solid rgba(233, 69, 96, 0.3);
    border-radius: 5px;
    color: #f1f1f1;
    font-size: 14px;
}

.label-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(26, 26, 46, 0.98);
    border: 1px solid rgba(233, 69, 96, 0.3);
    border-top: none;
    border-radius: 0 0 5px 5px;
    max-height: 200px;
    overflow-y: auto;
    display: none;
}

.label-suggestion {
    padding: 10px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.label-suggestion:hover {
    background: rgba(233, 69, 96, 0.2);
}

/* Search results overlay */
.search-results-overlay {
    position: absolute;
    top: 70px;
    left: 20px;
    width: 300px;
    background: rgba(26, 26, 46, 0.95);
    border: 1px solid rgba(233, 69, 96, 0.3);
    border-radius: 8px;
    padding: 20px;
    display: none;
    z-index: 100;
    backdrop-filter: blur(10px);
    max-height: 400px;
    overflow-y: auto;
}

.search-result-item {
    padding: 10px;
    cursor: pointer;
    transition: background 0.2s ease;
    border-bottom: 1px solid rgba(233, 69, 96, 0.2);
}

.search-result-item:hover {
    background: rgba(233, 69, 96, 0.2);
}

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

/* Mobile responsiveness */
@media (max-width: 768px) {
    .mindmap-controls {
        flex-direction: column;
        gap: 10px;
        padding: 10px;
    }
    
    .search-container {
        max-width: 100%;
    }
    
    .node-details-panel {
        width: calc(100% - 40px);
        right: 20px;
        left: 20px;
    }
    
    .node-editor-content {
        margin: 0;
        padding: 20px;
        max-height: 95vh;
        width: calc(100% - 10px);
    }
    
    .node-editor-modal {
        padding: 5px;
    }
    
    /* Enable tilt navigation indicator */
    .tilt-indicator {
        position: absolute;
        bottom: 20px;
        right: 20px;
        background: rgba(26, 26, 46, 0.9);
        padding: 10px 15px;
        border-radius: 5px;
        color: #e94560;
        font-size: 12px;
        display: flex;
        align-items: center;
        gap: 10px;
    }
    
    .tilt-toggle {
        width: 40px;
        height: 20px;
        background: rgba(233, 69, 96, 0.3);
        border-radius: 10px;
        position: relative;
        cursor: pointer;
    }
    
    .tilt-toggle.active {
        background: #e94560;
    }
    
    .tilt-toggle::after {
        content: '';
        position: absolute;
        width: 16px;
        height: 16px;
        background: white;
        border-radius: 50%;
        top: 2px;
        left: 2px;
        transition: transform 0.3s ease;
    }
    
    .tilt-toggle.active::after {
        transform: translateX(20px);
    }
}

/* Loading animation */
.mindmap-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: #e94560;
}

.mindmap-loading::after {
    content: '';
    display: block;
    width: 50px;
    height: 50px;
    margin: 20px auto;
    border: 3px solid rgba(233, 69, 96, 0.3);
    border-top-color: #e94560;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Filter Modal Styles - Specific to mindmap page */
#filterModal.modal {
    /* Base modal properties now from unified-modals.css */
    backdrop-filter: blur(5px);
    padding: 20px;
    box-sizing: border-box;
}

#filterModal.modal.show {
    display: flex !important;
    align-items: center;
    justify-content: center;
    opacity: 1 !important;
    pointer-events: auto !important;
}

#filterModal .modal-content {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border-radius: 10px;
    padding: 30px;
    border: 1px solid rgba(233, 69, 96, 0.3);
    box-shadow: 0 0 30px rgba(233, 69, 96, 0.2);
    max-width: 500px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
}

#filterModal .modal-content h3 {
    color: #e94560;
    margin-bottom: 20px;
    font-size: 24px;
}

#filterModal .modal-content .close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 30px;
    color: #e94560;
    cursor: pointer;
    transition: all 0.3s ease;
}

#filterModal .modal-content .close:hover {
    transform: rotate(90deg);
}

#filterModal .modal-content form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

#filterModal .modal-content label {
    color: #f1f1f1;
    font-weight: 500;
    margin-bottom: 5px;
    display: block;
}

#filterModal .modal-content input[type="text"],
#filterModal .modal-content input[type="range"] {
    width: 100%;
    padding: 12px;
    background: rgba(15, 52, 96, 0.5);
    border: 1px solid rgba(233, 69, 96, 0.3);
    border-radius: 5px;
    color: #f1f1f1;
    font-size: 16px;
    transition: all 0.3s ease;
}

#filterModal .modal-content input[type="text"]:focus {
    outline: none;
    border-color: #e94560;
    box-shadow: 0 0 10px rgba(233, 69, 96, 0.3);
}

#filterModal .modal-content input[type="range"] {
    padding: 0;
    background: transparent;
    border: none;
}

#filterModal .modal-content input[type="range"]::-webkit-slider-track {
    background: rgba(15, 52, 96, 0.5);
    height: 8px;
    border-radius: 4px;
}

#filterModal .modal-content input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    width: 20px;
    height: 20px;
    background: #e94560;
    border-radius: 50%;
    cursor: pointer;
}

#filterModal .modal-content button {
    padding: 12px 20px;
    border: none;
    border-radius: 5px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 16px;
}

#filterModal .modal-content button[type="submit"] {
    background: linear-gradient(135deg, #e94560 0%, #c41e3a 100%);
    color: white;
}

#filterModal .modal-content button[type="submit"]:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(233, 69, 96, 0.4);
}

#filterModal .modal-content button[type="button"] {
    background: rgba(233, 69, 96, 0.2);
    color: #f1f1f1;
    border: 1px solid rgba(233, 69, 96, 0.5);
}

#filterModal .modal-content button[type="button"]:hover {
    background: rgba(233, 69, 96, 0.4);
    transform: translateY(-2px);
}

#credibilityValue {
    color: #e94560;
    font-weight: bold;
    margin-left: 10px;
}

.filter-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.filter-buttons button {
    flex: 1;
    min-width: 120px;
}

.filter-buttons button[type="button"]:not([onclick]) {
    background: linear-gradient(135deg, #4CAF50 0%, #388E3C 100%);
    color: white;
}

.filter-buttons button[type="button"]:not([onclick]):hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(76, 175, 80, 0.4);
}

/* Cytoscape node states */
.search-match {
    box-shadow: 0 0 30px #e94560 !important;
    z-index: 999 !important;
}

.search-dimmed {
    opacity: 0.3 !important;
}

/* High credibility glow */
.high-credibility {
    box-shadow: 0 0 20px rgba(76, 175, 80, 0.6);
}

.medium-credibility {
    box-shadow: 0 0 15px rgba(255, 193, 7, 0.6);
}

.low-credibility {
    box-shadow: 0 0 10px rgba(244, 67, 54, 0.6);
}

/* Node actions buttons */
.node-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.edit-node-btn, .delete-node-btn {
    flex: 1;
    padding: 10px 15px;
    border: none;
    border-radius: 5px;
    color: white;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
}

.edit-node-btn {
    background: linear-gradient(135deg, #4CAF50 0%, #388E3C 100%);
}

.edit-node-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(76, 175, 80, 0.4);
}

.delete-node-btn {
    background: linear-gradient(135deg, #f44336 0%, #d32f2f 100%);
}

.delete-node-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(244, 67, 54, 0.4);
}

.add-citation-btn {
    display: block;
    width: 100%;
    padding: 8px 12px;
    background: linear-gradient(135deg, #e94560 0%, #c41e3a 100%);
    border: none;
    border-radius: 5px;
    color: white;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 12px;
    margin-top: 10px;
}

.add-citation-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(233, 69, 96, 0.4);
}

/* Edit relationship modal styles */
.relationship-input-container {
    position: relative;
}

.relationship-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(26, 26, 46, 0.98);
    border: 1px solid rgba(233, 69, 96, 0.3);
    border-top: none;
    border-radius: 0 0 5px 5px;
    max-height: 200px;
    overflow-y: auto;
    display: none;
    z-index: 1000;
}

.relationship-suggestion {
    padding: 10px 15px;
    cursor: pointer;
    transition: background 0.2s ease;
    color: #f1f1f1;
    font-size: 14px;
}

.relationship-suggestion:hover {
    background: rgba(233, 69, 96, 0.2);
}

.delete-relationship-btn {
    background: linear-gradient(135deg, #f44336 0%, #d32f2f 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.delete-relationship-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(244, 67, 54, 0.4);
}

.modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.modal-actions button[type="submit"] {
    flex: 1;
    background: linear-gradient(135deg, #4CAF50 0%, #388E3C 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.modal-actions button[type="submit"]:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(76, 175, 80, 0.4);
}