/* Knowledge Page Styles */

/* Layout and Container Styles */
.knowledge-main-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
}


.knowledge-content-container {
    border-radius: 0.5rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    background-color: white;
    padding: 1.5rem;
}

/* Header Styles */
.knowledge-header {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.knowledge-title {
    font-size: 1.875rem;
    font-weight: bold;
    color: var(--text-primary);
    text-align: center;
}

/* Search Container Styles */
.knowledge-search-container {
    width: 100%;
    max-width: 400px;
}

.knowledge-search-wrapper {
    position: relative;
}

.knowledge-search-input {
    width: 100%;
    padding: 0.5rem 1rem 0.5rem 2.5rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    transition: all 0.2s ease-in-out;
}

.knowledge-search-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.knowledge-search-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    pointer-events: none;
}

.knowledge-button-group {
    display: flex;
    flex-direction: row;
    gap: 0.5rem;
    width: 100%;
    justify-content: center;
}

/* Button Styles */
.knowledge-btn-base {
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease-in-out;
    display: inline-flex;
    align-items: center;
    outline: none;
}

.knowledge-btn-base:focus {
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.5);
}

.knowledge-btn-list {
    background-color: #6b7280;
    color: white;
}

.knowledge-btn-list:hover {
    background-color: #4b5563;
}

.knowledge-btn-network {
    background-color: #3b82f6;
    color: white;
}

.knowledge-btn-network:hover {
    background-color: #2563eb;
}

.knowledge-btn-add {
    background-color: #10b981;
    color: white;
}

.knowledge-btn-add:hover {
    background-color: #059669;
}

.knowledge-btn-icon {
    margin-right: 0.5rem;
}

.knowledge-btn-hidden {
    display: none;
}

/* Network Container Styles */
.knowledge-network-container {
    width: 100%;
    height: calc(100vh - 4rem);
    background-color: var(--bg-secondary);
    border-radius: 0.5rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    background-color: white;
    padding: 1.5rem;
}

#network-container {
    width: 100%;
    height: calc(100vh - 4rem);
    background-color: var(--bg-secondary);
}

#network-vis {
    width: 100%;
    height: 100%;
}

/* Responsive Design */
@media (min-width: 768px) {
    .knowledge-main-container {
        padding: 2rem;
    }
    
    .knowledge-header {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
    
    .knowledge-title {
        text-align: left;
    }
    
    .knowledge-button-group {
        width: auto;
        justify-content: flex-start;
    }
    
    .knowledge-network-container {
        height: calc(100vh - 4rem);
    }
}

@media (max-width: 768px) {
    .knowledge-network-container {
        height: 80vh;
    }
    
    #network-container {
        height: 80vh;
    }
}

/* Network and Modal Styles */
.vis-network {
    outline: none;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 50;
}

.modal-content {
    background-color: var(--bg-primary);
    padding: 2rem;
    border-radius: 0.5rem;
    max-width: 32rem;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    border: 1px solid var(--border-color);
}

/* Topic Icon Styles */
.topic-icon {
    margin-right: 0.5rem;
    width: 1.25rem;
    flex-shrink: 0;
}

.topic-list-item-row {
    display: flex;
    align-items: center;
    width: 100%;
}

/* Topic type styles */
.topic-resource {
    font-size: 0.875rem;
    font-weight: 400;
    color: var(--text-primary);
    padding: 0;
    margin-bottom: 0;
}

.topic-top-level {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    padding: 0;
    background-color: var(--bg-secondary);
    border-radius: 0.5rem;
    border: 1px solid var(--border-color);
    margin-bottom: 0;
}

.topic-subtopic {
    font-size: 1rem;
    font-weight: 400;
    color: var(--text-primary);
    padding: 0;
}

.topic-list-item {
    display: flex;
    align-items: center;
    flex-grow: 1;
    cursor: pointer;
    border-radius: 0.375rem;
    transition: all 0.2s ease-in-out;
    text-decoration: none;
    color: inherit;
}

.topic-list-item:hover {
    background-color: rgba(59, 130, 246, 0.1) !important;
    transform: translateX(2px);
}

.topic-list-item-link {
    display: flex;
    align-items: center;
    width: 100%;
    text-decoration: none;
    color: inherit;
    padding: 8px 16px;
}

.topic-list-item-content {
    flex-grow: 1;
    display: flex;
    align-items: center;
}

.topic-list-item-details {
    margin-left: auto;
    padding-left: 1rem;
    padding-right: 8px;
    font-size: 0.75rem;
    color: #6b7280;
    white-space: nowrap;
}

.topic-list-item-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: auto;
    padding-left: 1rem;
    padding-right: 8px;
}

.topic-action-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 0.375rem;
    color: #6b7280;
    transition: all 0.2s ease-in-out;
    text-decoration: none;
}

.topic-action-icon:hover {
    background-color: rgba(59, 130, 246, 0.15);
    color: #2563eb;
    transform: scale(1.1);
}

.topic-action-icon i {
    font-size: 0.875rem;
}


.knowledge-icon-blue {
    color: #2563eb;
}

.knowledge-icon-green {
    color: #059669;
}

.knowledge-icon-purple {
    color: #7c3aed;
}

.knowledge-icon-gray {
    color: #6b7280;
}

/* Error message */
.knowledge-error {
    background-color: #fee2e2;
    border: 1px solid #f87171;
    color: #b91c1c;
    padding: 0.75rem 1rem;
    border-radius: 0.375rem;
}

.dark .knowledge-error {
    background-color: #991b1b;
    border-color: #dc2626;
    color: #fecaca;
}

/* Search highlight styles */
mark {
    background-color: #fef08a;
    color: #374151;
    padding: 2px 4px;
    border-radius: 3px;
    font-weight: 500;
}

/* Dark mode search highlights */
html.dark mark {
    background-color: #eab308;
    color: #111827;
}

/* Responsive search container */
@media (min-width: 768px) {
    .knowledge-search-container {
        max-width: 500px;
    }
}

.topic-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem; /* replaces space-y-3 */
}

.topic-list-item-wrapper {
    list-style: none;
}

/* Depth-based indentation (replaces ml-${depth * 4}) */
.topic-list-depth-0 { margin-left: 0; }
.topic-list-depth-1 { margin-left: 1rem; }
.topic-list-depth-2 { margin-left: 2rem; }
.topic-list-depth-3 { margin-left: 3rem; }
.topic-list-depth-4 { margin-left: 4rem; }
.topic-list-depth-5 { margin-left: 5rem; }

/* Title text that grows to fill space */
.topic-title-text {
    flex-grow: 1;
}

/* Topic Popup Styles */
.topic-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
}

.topic-popup-content {
    background-color: white;
    border-radius: 0.5rem;
    padding: 1.5rem;
    max-width: 28rem;
    width: 100%;
    margin: 0 1rem;
}

.topic-popup-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.topic-popup-title-container {
    display: flex;
    align-items: center;
}

.topic-popup-title {
    font-size: 1.5rem;
    font-weight: bold;
    color: #111827;
    margin: 0;
}

.topic-popup-category {
    font-size: 0.875rem;
    color: #6b7280;
    margin-top: 0.25rem;
    margin-bottom: 0;
}

.topic-popup-close-icon {
    color: #6b7280;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    transition: color 0.2s ease-in-out;
}

.topic-popup-close-icon:hover {
    color: #374151;
}

.topic-popup-svg-icon {
    width: 1.5rem;
    height: 1.5rem;
}

.topic-popup-importance {
    color: #374151;
    margin-bottom: 1.5rem;
}

.topic-popup-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

.topic-popup-btn {
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    border: none;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    font-weight: 500;
    transition: background-color 0.2s ease-in-out;
}

.topic-popup-btn-primary {
    background-color: #3b82f6;
    color: white;
}

.topic-popup-btn-primary:hover {
    background-color: #2563eb;
}

.topic-popup-btn-secondary {
    background-color: #d1d5db;
    color: #374151;
}

.topic-popup-btn-secondary:hover {
    background-color: #9ca3af;
}

/* Topic Content Styles */
.topic-content-section {
    margin-bottom: 1.5rem;
}

.topic-content-heading {
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.5rem;
    margin-top: 0;
}

.topic-content-text {
    color: #4b5563;
    margin: 0;
}

.topic-content-list {
    list-style-type: disc;
    margin-left: 1.5rem;
    color: #4b5563;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0;
}

.topic-content-list li {
    margin: 0;
} 