/* ### Body & Container */
body {
    font-family: Roboto, sans-serif;
    background-color: #f8f9fa;
    margin: 0;
    padding: 0;
    color: #212529;
}

h1 {
    color: #ffffff;
    text-align: center;
    padding: 20px;
    background-color: #2d8acb;
}

p {
    text-align: center;
    font-size: 1.2em;
}

.container, .card {
    max-width: 900px;
    margin: 50px auto;
    padding: 2rem;
    background-color: #ffffff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border-radius: 8px;
}

/* ### Forms / Inputs */
.search-box {
    width: 400px;
    padding: 8px 12px;
    font-size: 1.1em;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;    
}

.form-container {
    margin-top: 1rem;
}

fieldset {
    border: 1px solid #ccc;
    padding: 1rem;
    border-radius: 4px;
}

.flex-container {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

/* ### Top Bar & Sorting */
.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.sort-form {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ### Buttons & Links */
a.button, .graph-btn, .toolbar button, .downloads button {
    padding: 6px 12px;
    background-color: #2d8acb;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    font-size: 0.9em;
}

a.button:hover, .graph-btn:hover, .toolbar button:hover, .downloads button:hover {
    background-color: #0056b3;
}

.index-link {
    color: #2d8acb;
    text-decoration: none;
}

.index-link:hover {
    text-decoration: underline;
}

/* ### Downloads */
.downloads {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
}

.download-links {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
}

/* ### Results List */
ul.results-list {
    list-style: none;
    margin: 0;
    padding-left: 0;
}

ul.results-list li {
    margin-bottom: 15px;
    padding: 10px 0;
    border-bottom: 1px solid #ddd;
}

.break {
    white-space: nowrap;
}

/* ### Result Items */
.result-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid #ccc;
}

.result-content {
    display: flex;
    width: 100%;
}

.result-content > div:first-child {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.checkbox-wrapper {
    margin-left: 20px;
    flex-shrink: 0;
}

/* ### Toolbar */
.toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 15px;
}

.toolbar button {
    padding: 6px 12px;
    background-color: #2d8acb;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.toolbar button:hover {
    background-color: #0056b3;
}

.toolbar .select-all {
    display: flex;
    gap: 5px;
    margin-left: auto;
    align-items: center;
}

/* ### Select All Wrapper */
.select-all-wrapper {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-left: auto;
}

/* ### Logo (PID4NFDI) */
.logo-wrapper {
    text-align: right;
    margin-bottom: 10px;
}

.logo-wrapper .logo {
    height: 80px;
    width: auto;
}

/* ### Key/Value Alignment */
.kv-line {
    display: block;
    line-height: 1.4;
    margin-bottom: 0.3rem;
}

.kv-label {
    display: inline-block;
    width: 120px;
    vertical-align: top;
    font-weight: bold;
}

.kv-val {
    display: inline-block;
    max-width: 80%;
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: anywhere;
}

/* ### Highlight / Indent */
.highlight {
    background-color: #d4edda;
    font-weight: bold;
}

.highlighted {
    background-color: #d4edda; /* light green */
}

.description-cell.highlighted {
    background-color: #d4edda;
}

.indent {
    padding-left: 1.5rem;
    font-style: italic;
    color: #444;
}

/* ### Table / Mapping */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

table, th, td {
    border: 1px solid #ccc;
}

th, td {
    padding: 6px;
    text-align: left;
}

/* ### Connections Key/Value */
.kv-connections {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 5px;
}

.kv-connections .kv-counts {
    display: flex;
    flex-direction: column;
    gap: 2px;
    text-align: left;
}

.kv-connections .graph-btn {
    flex-shrink: 0;
}

/* ### Connections Graph Container */
.connections-container {
    max-width: 900px;
    margin: 50px auto;
    padding: 2rem;
    background-color: #ffffff;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
    border-radius: 8px;
}

.connections-container h2 {
    text-align: center;
    color: #2d8acb;
    margin-bottom: 20px;
}

/* ### Edges / Labels */
.vis-network .vis-edge {
    font-size: 12px;
    color: #333;
}

/* ### Legend */
.legend {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 15px;
    gap: 10px;
    min-height: 40px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.9em;
    padding: 0;
    background: none;
    border-radius: 4px;
}

.legend-color {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    flex-shrink: 0;
}

.legend h3 {
    text-align: center;
    color: #2d8acb;
    margin-bottom: 10px;
}

.legend ul {
    list-style: none;
    padding-left: 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

.legend li {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.9em;
}