/* Default (Light) Theme */
:root {
    --background-color: #ffffff;
    --text-color: #000000;
    --path-color: #000208;
    --tooltip-background-color: #333333;
    --icon-color: #000000;
}

/* Dark Theme */
body.dark-theme {
    --background-color: #1f1f1f;
    --text-color: #ffffff;
    --path-color: #9C27B0;
    --tooltip-background-color: #444444;
    --icon-color: #ffffff;
}

body {
    background-color: var(--background-color);
    color: var(--text-color);
}

.entity-mark {
    padding-right: 0.3em;
    padding-left: 0.3em;
    padding-top: 0.05em;
    padding-bottom: 0.05em;
    margin: 0 0.1em;
    line-height: 1;
    border-radius: 0.35em;
    background: linear-gradient(#3f87a6, #ebf8e1, #f69d3c);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2); /* Subtle shadow */
    transition: background-color 0.3s ease, color 0.3s ease; /* Smooth transition */
    white-space: pre-wrap;
} 



.custom-tooltip {
    word-wrap: break-word; /* Ensures long words break into the next line */
    overflow-wrap: break-word; /* Ensures content stays within bounds */
    box-sizing: border-box; /* Ensures padding/borders don't affect width calculations */
    position: absolute;
    background-color: var(--tooltip-background-color);
    color: #fff;
    padding: 8px; /* Slightly larger padding */
    border-radius: 8px; /* More rounded corners */
    z-index: 6;
    white-space: normal;
    pointer-events: none;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); /* Subtle shadow */
    transition: opacity 0.3s ease; /* Smooth transition for opacity */
    opacity: 0.8; /* Slightly transparent */
}

#display-textbox {
    width: 100%;
    z-index: 1;
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: normal;
    position: absolute;
    line-height: 1.5;
    padding: 1.5rem;
    
    /* Add white background, shadow and rounded corners */
    background-color: var(--background-color);
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    
    /* Hide horizontal scrollbar and only show vertical when needed */
    overflow-x: hidden;
    overflow-y: auto;
}


#display-relation {
    width: 100%;
    position: absolute;
    z-index: 2;
    pointer-events: none; /* Make the SVG non-interactive */
    top: 0; 
    left: 0; 
}

.relation-path {
    opacity: 0.6;
	stroke: var(--path-color);
    stroke-width: 2; /* Set the stroke width */
    fill: none; /* Ensure the path is not filled */
}

#display-textbox-container {
    left: 0%;
    width: 95%;
    height: 95%;
    position: absolute;
    transition: width 0.3s ease-in-out; 
}


.theme-button {
    position: fixed;
    top: 0.5rem;
    left: 0.5rem; /* Position it at the leftmost position */
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    color: var(--icon-color);
    background-color: var(--background-color);
    border: 1px solid var(--text-color);
    cursor: pointer;
    z-index: 4;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    padding: 0.25rem;
}

.theme-button:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}


.filters-button {
    position: fixed;
    top: 0.5rem;
    left: 2.5rem;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    color: var(--icon-color);
    background-color: var(--background-color);
    border: 1px solid var(--text-color);
    cursor: pointer;
    z-index: 4;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    padding: 0.25rem;
}

.filters-button svg {
    width: 100%;
    height: 100%;
}

.filters-button:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.filters-panel {
    position: fixed;
    top: 0;
    left: 0;
    width: 33.333%;
    height: 100%;
    background-color: var(--background-color);
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.1);
    transform: translateX(-100%);
    transition: transform 0.3s ease-in-out;
    z-index: 5;
    overflow-y: auto;
}

.filters-panel.open {
    transform: translateX(0);
}

.filters-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease-in-out;
    z-index: 4;
}

.filters-overlay.open {
    opacity: 1;
    visibility: visible;
}

.filter-section {
    border-bottom: 1px solid rgba(128, 128, 128, 0.2);
    padding-bottom: 1rem;
}

.filter-section:last-child {
    border-bottom: none;
}

.filter-section input[type="checkbox"] {
    cursor: pointer;
}

.filter-section label {
    cursor: pointer;
    user-select: none;
}

/* Customize checkboxes */
.filter-section input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border: 2px solid var(--text-color);
    border-radius: 3px;
    outline: none;
    vertical-align: middle;
    position: relative;
    margin-right: 8px;
}

.filter-section input[type="checkbox"]:checked {
    background-color: var(--text-color);
}

.filter-section input[type="checkbox"]:checked::before {
    content: "✓";
    position: absolute;
    color: var(--background-color);
    font-size: 12px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.attribute-filters {
    color: var(--text-color);
}

/* Toggle Switch Styles */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 24px;
    margin-left: 10px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(128, 128, 128, 0.3);
    transition: .4s;
    border-radius: 24px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: var(--background-color);
    transition: .4s;
    border-radius: 50%;
}

.toggle-switch input:checked + .toggle-slider {
    background-color: var(--text-color);
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(24px);
}

.logic-toggle {
    font-size: 0.9em;
    opacity: 0.9;
}

.table-button:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.table-button {
    position: fixed;
    top: 0.5rem;
    left: 4.5rem;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    color: var(--icon-color);
    background-color: var(--background-color);
    border: 1px solid var(--text-color);
    cursor: pointer;
    z-index: 4;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    padding: 0.25rem;
}

.table-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 50%;
    height: 100%;
    background-color: var(--background-color);
    box-shadow: -2px 0 8px rgba(0, 0, 0, 0.1);
    transform: translateX(100%);
    transition: transform 0.3s ease-in-out;
    z-index: 5;
    overflow-y: auto;
    padding: 2rem;
}

.table-close-button {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    color: inherit;
    border-radius: 0.25rem;
}

.table-close-button:hover {
    background-color: rgba(0, 0, 0, 0.1);
}

.dark-theme .table-close-button:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.table-panel.open {
    transform: translateX(0);
}

.table-panel table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-bottom: 2rem;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.table-panel th {
    background-color: var(--background-color);
    color: var(--text-color);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.05em;
    padding: 0.75rem 1rem;
    border-bottom: 2px solid rgba(128, 128, 128, 0.2);
    position: sticky;
    top: 0;
    z-index: 10;
    text-align: left;
}

.table-panel td {
    padding: 0.5rem 1rem;
    border-bottom: 1px solid rgba(128, 128, 128, 0.1);
    color: var(--text-color);
    font-size: 0.95rem;
    line-height: 1.4;
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.table-panel tr:last-child td {
    border-bottom: none;
}

.table-panel tbody tr:hover {
    background-color: rgba(128, 128, 128, 0.05);
    transition: background-color 0.2s ease;
}

/* Add alternating row colors */
.table-panel tbody tr:nth-child(even) {
    background-color: rgba(128, 128, 128, 0.02);
}

/* Add responsive scrolling for table content */
.table-panel {
    scrollbar-width: thin;
    scrollbar-color: rgba(128, 128, 128, 0.3) transparent;
}

.table-panel::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.table-panel::-webkit-scrollbar-track {
    background: transparent;
}

.table-panel::-webkit-scrollbar-thumb {
    background-color: rgba(128, 128, 128, 0.3);
    border-radius: 4px;
}
 
.table-panel .table-section h2 {
    color: var(--text-color);
    font-size: 1.25rem;
    font-weight: 600;
    margin: 2rem 0 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid rgba(128, 128, 128, 0.2);
}

.table-panel .table-section {
    overflow-x: auto;
    margin-bottom: 2rem;
}

.table-panel .table-section table {
    width: 100%;                /* Fit table width to container */
    border-collapse: collapse;  /* Optional, makes borders clean */
}

.table-panel .table-section th,
.table-panel .table-section td {
    word-break: break-word;     /* Break long words if needed */
    overflow-wrap: break-word;  /* Wrap content gracefully */
    white-space: normal;        /* Allow natural wrapping */
    padding: 0.5rem;            /* Cell padding for readability */
    border: 1px solid rgba(128, 128, 128, 0.2); /* Optional borders */
}

#display-textbox-container.with-table {
    left: 0%;
    width: 45%;
}

.entity-table-mark {
    padding-right: 0.3em;
    padding-left: 0.3em;
    padding-top: 0.05em;
    padding-bottom: 0.05em;
    margin: 0 0.1em;
    line-height: 1;
    border-radius: 0.35em;
    background: linear-gradient(#3f87a6, #ebf8e1, #f69d3c);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2); /* Subtle shadow */
} 

.entity-highlight {
    text-shadow: 0 0 0.5px currentColor;
    font-synthesis: none;
    transition: all 0.3s ease;
}

/* Use the entity's background color for glow via JavaScript */
.entity-highlight-glow {
    box-shadow: 0 0 8px currentColor, 0 0 12px currentColor;
} 