/* Ontology-specific styles */

.ontology-content {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Control Panel */
.control-panel {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.panel-left h2 {
    font-size: 1.25rem;
    margin-bottom: 0.25rem;
}

.subtitle {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.panel-right {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.control-group label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.control-select {
    padding: 0.5rem 0.75rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.control-select:hover,
.control-select:focus {
    border-color: var(--blue);
    outline: none;
}

.control-btn {
    padding: 0.5rem 1rem;
    background: var(--blue);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.control-btn:hover {
    background: #3a8eef;
    transform: translateY(-1px);
}

/* Graph Container */
.graph-container {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    position: relative;
    height: 600px;
}

#ontologyGraph {
    width: 100%;
    height: 100%;
    cursor: grab;
}

#ontologyGraph:active {
    cursor: grabbing;
}

/* Graph Legend */
.graph-legend {
    position: absolute;
    top: 2rem;
    right: 2rem;
    background: rgba(26, 29, 41, 0.95);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    backdrop-filter: blur(10px);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    font-size: 0.813rem;
}

.legend-item:last-child {
    margin-bottom: 0;
}

.legend-color {
    width: 16px;
    height: 16px;
    border-radius: 4px;
}

/* Details Panel */
.details-panel {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    max-height: 400px;
    overflow-y: auto;
}

.details-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.details-header h3 {
    font-size: 1rem;
    font-weight: 600;
}

.close-btn {
    width: 32px;
    height: 32px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.details-content {
    font-size: 0.875rem;
    line-height: 1.6;
}

.empty-state {
    text-align: center;
    color: var(--text-secondary);
    padding: 2rem;
}

.detail-section {
    margin-bottom: 1.5rem;
}

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

.detail-title {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

.detail-value {
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}

.property-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.property-item {
    display: flex;
    padding: 0.5rem;
    background: var(--bg-tertiary);
    border-radius: 6px;
}

.property-key {
    font-weight: 600;
    color: var(--blue);
    min-width: 120px;
}

.property-value {
    color: var(--text-primary);
}

.relationship-badge {
    display: inline-block;
    padding: 0.25rem 0.625rem;
    background: rgba(74, 158, 255, 0.2);
    color: var(--blue);
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    margin: 0.25rem 0.25rem 0.25rem 0;
}

/* Statistics */
.ontology-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

.stat-box {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    transition: all 0.3s ease;
}

.stat-box:hover {
    border-color: var(--blue);
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(74, 158, 255, 0.1);
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--blue);
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* Node Tooltip */
.node-tooltip {
    position: absolute;
    background: rgba(26, 29, 41, 0.95);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 0.75rem;
    pointer-events: none;
    z-index: 1000;
    backdrop-filter: blur(10px);
    max-width: 250px;
}

.tooltip-title {
    font-weight: 600;
    color: var(--blue);
    margin-bottom: 0.25rem;
}

.tooltip-type {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.tooltip-description {
    font-size: 0.813rem;
    color: var(--text-primary);
    line-height: 1.4;
}

/* Scrollbar */
.details-panel::-webkit-scrollbar {
    width: 6px;
}

.details-panel::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
    border-radius: 3px;
}

.details-panel::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.details-panel::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Responsive */
@media (max-width: 1200px) {
    .control-panel {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .panel-right {
        width: 100%;
        flex-wrap: wrap;
    }

    .ontology-stats {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .ontology-stats {
        grid-template-columns: 1fr;
    }

    .graph-container {
        height: 400px;
    }

    .graph-legend {
        position: static;
        margin-top: 1rem;
    }
}
