/* Structure Triples Viewer Styles */

/* Ontology Term Links Styles */
.ontology-term {
    border-bottom: 1px dotted #6c757d;
    cursor: help;
    background-color: transparent;
    color: inherit;
    text-decoration: none;
    padding: 0;
    margin: 0;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier, monospace;
    font-size: 0.875em;
    transition: all 0.2s ease;
}

.ontology-term:hover {
    background-color: #f8f9fa;
    border-bottom: 1px solid #007bff;
    color: #007bff;
    border-radius: 2px;
}

/* Tooltip styles for term definitions */
.ontology-term[title] {
    position: relative;
}

/* Entity type badges in term links table */
.ontology-term-links .badge {
    font-size: 0.75em;
}

/* Term links statistics */
.term-links-stats {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 8px;
    padding: 1rem;
}

/* Section-specific term styling */
.term-links-section {
    border-left: 3px solid #198754;
    padding-left: 1rem;
    margin-bottom: 1.5rem;
}

.term-links-section h6 {
    color: #198754;
    font-weight: 600;
}

/* Different colors for different entity types */
.entity-type-role { background-color: rgba(220, 53, 69, 0.1) !important; color: #dc3545 !important; }
.entity-type-principle { background-color: rgba(13, 110, 253, 0.1) !important; color: #0d6efd !important; }
.entity-type-obligation { background-color: rgba(25, 135, 84, 0.1) !important; color: #198754 !important; }
.entity-type-state { background-color: rgba(255, 193, 7, 0.1) !important; color: #ffc107 !important; }
.entity-type-resource { background-color: rgba(108, 117, 125, 0.1) !important; color: #6c757d !important; }
.entity-type-action { background-color: rgba(220, 53, 69, 0.1) !important; color: #dc3545 !important; }
.entity-type-event { background-color: rgba(102, 16, 242, 0.1) !important; color: #6610f2 !important; }
.entity-type-capability { background-color: rgba(255, 99, 132, 0.1) !important; color: #ff6384 !important; }

/* Floating Table of Contents Navigation */
.toc-navigation {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 280px;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    transform: translateX(100%);
    transition: transform 0.3s ease;
}

.toc-navigation.visible {
    transform: translateX(0);
}

.toc-header {
    background: #495057;
    color: white;
    padding: 12px 16px;
    border-radius: 8px 8px 0 0;
    display: flex;
    justify-content: between;
    align-items: center;
}

.toc-header h6 {
    flex: 1;
    margin: 0;
    font-weight: 600;
}

.toc-content {
    padding: 0;
}

.toc-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.toc-list li {
    border-bottom: 1px solid #f1f3f4;
}

.toc-list li:last-child {
    border-bottom: none;
}

.toc-link {
    display: block;
    padding: 12px 16px;
    color: #495057;
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    position: relative;
}

.toc-link:hover {
    background-color: #f8f9fa;
    color: #0d6efd;
    text-decoration: none;
    padding-left: 20px;
}

.toc-link.active {
    background-color: #e7f3ff;
    color: #0d6efd;
    border-left: 3px solid #0d6efd;
    font-weight: 500;
}

.toc-toggle-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background: #0d6efd;
    color: white;
    border: none;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    z-index: 999;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.toc-toggle-btn:hover {
    background: #0b5ed7;
    transform: scale(1.05);
}

.toc-toggle-btn.hidden {
    transform: translateX(100px);
}

/* Scroll indicator for active section */
.toc-link::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: transparent;
    transition: background-color 0.2s ease;
}

.toc-link.active::before {
    background: #0d6efd;
}

/* Responsive adjustments */
@media (max-width: 1200px) {
    .toc-navigation {
        width: 260px;
    }
}

@media (max-width: 768px) {
    .toc-navigation {
        width: 240px;
        top: 10px;
        right: 10px;
    }
    
    .toc-toggle-btn {
        top: 10px;
        right: 10px;
        width: 45px;
        height: 45px;
        font-size: 1.1rem;
    }
}

@media (max-width: 576px) {
    .toc-navigation {
        width: calc(100vw - 20px);
        right: 10px;
        left: 10px;
    }
}

.structure-viewer {
    margin-top: 1rem;
}

.viewer-controls {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.viewer-content {
    margin-top: 1rem;
}

/* Formatted View Styles */
.formatted-structure {
    max-width: 100%;
}

.document-info .card-header {
    background-color: #f8f9fa;
    font-weight: 600;
}

.section-card {
    border-left: 4px solid #0d6efd;
    transition: all 0.2s ease;
}

.section-card:hover {
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

.section-card .card-header {
    background-color: #f8f9fa;
    font-weight: 600;
}

.section-content {
    background-color: #f8f9fa;
    padding: 0.75rem;
    border-radius: 0.25rem;
}

.section-items {
    border-top: 1px solid #dee2e6;
    padding-top: 0.75rem;
}

.section-items ul li {
    padding-left: 1rem;
    position: relative;
}

.section-items ul li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: #6c757d;
}

/* Raw View Styles */
.raw-triples-container pre {
    max-height: 600px;
    overflow-y: auto;
    font-size: 0.875rem;
    line-height: 1.5;
}

.raw-triples-container code {
    color: #212529;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .viewer-controls {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .viewer-controls .btn-group {
        width: 100%;
    }
    
    .viewer-controls .btn {
        flex: 1;
    }
}

/* Icon spacing */
.bi {
    margin-right: 0.25rem;
}

/* Statistics text */
#triple-stats {
    font-size: 0.875rem;
}

/* Copy button feedback */
.btn-success {
    transition: all 0.3s ease;
}

/* Combined Section Items View */
.section-items-table {
    margin-top: 1rem;
}

.section-group {
    background-color: #ffffff;
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    padding: 1.5rem;
}

.section-group-header {
    color: #495057;
    font-weight: 600;
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
}

.item-header {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.item-id {
    font-weight: 600;
    color: #0d6efd;
}

.item-type {
    font-size: 0.75rem;
}

.item-uri {
    flex: 1;
    text-align: right;
    min-width: 200px;
}

.item-content {
    background-color: #f8f9fa;
    padding: 1rem;
    border-radius: 0.25rem;
    border-left: 3px solid #0d6efd;
    line-height: 1.6;
}

/* Make the table rows more distinct */
.section-items-table .table tbody tr {
    border-bottom: 2px solid #dee2e6;
}

.section-items-table .table tbody tr:last-child {
    border-bottom: none;
}

.section-items-table .table tbody tr:hover {
    background-color: #f8f9fa;
}

/* Responsive adjustments for item header */
@media (max-width: 768px) {
    .item-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .item-uri {
        text-align: left;
        margin-top: 0.25rem;
    }
}