body {
    font-family: Arial, sans-serif;
    display: flex;
    height: 100vh;
    margin: 0;
    overflow: hidden;
    background-color: #f8f9fa;
}

#options-panel {
    width: 250px;
    height: 100vh;
    padding: 20px;
    background-color: #ffffff;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

#language-toggle-container {
    margin-bottom: 15px;
}

#language-toggle {
    width: 100%;
    padding: 8px;
    border: 1px solid #ced4da;
    border-radius: 4px;
}

#json-controller {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

#export-button,
#labelImportJSON {
    display: inline-block;
    width: 100%;
    padding: 8px 12px;
    font-size: 14px;
    color: #ffffff;
    background-color: #007bff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    text-align: center;
    box-sizing: border-box;
}

#export-button:hover,
#labelImportJSON:hover {
    background-color: #0056b3;
}

#existing-files-dropdown {
    width: 100%;
    padding: 8px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    background-color: #fff;
}

#labelSelectJSON {
    display: block;
    margin-bottom: 5px;
    font-size: 14px;
}

#controls {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

#controls div {
    display: flex;
    align-items: center;
    gap: 5px;
}

#controls label {
    display: flex;
    align-items: center;
    gap: 5px;
}

#scholar-toggle-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.dropdown-container {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

#source-integrity,
#source-nature,
#source-type {
    width: 100%;
    padding: 8px;
    border: 1px solid #ced4da;
    border-radius: 4px;
}

#visualization {
    flex-grow: 1;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

#side-panel {
    width: 30%;
    height: 100vh;
    padding: 20px;
    background-color: white;
    border-left: 1px solid #ccc;
    box-shadow: -2px 0 5px rgba(0, 0, 0, 0.1);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

#side-panel.hidden {
    display: none;
}

#side-panel.rtl {
    direction: rtl;
}

#close-button {
    align-self: flex-end;
    cursor: pointer;
    background: none;
    border: none;
    font-size: 16px;
    color: #888;
    margin-bottom: 20px;
}

#navigation {
    margin-top: 20px;
}

#navigation h3 {
    margin-bottom: 10px;
}

#navigation h4 {
    margin-top: 10px;
}

#previous-list, #next-list {
    list-style-type: none;
    padding: 0;
}

#previous-list li, #next-list li {
    cursor: pointer;
    padding: 5px;
    margin: 5px 0;
    background-color: #f0f0f0;
    border: 1px solid #ccc;
}

#previous-list li:hover, #next-list li:hover {
    background-color: #e0e0e0;
}

svg {
    width: 100%;
    height: 100%;
}

.node {
    stroke: #fff;
    stroke-width: 1.5px;
}

.node.main {
    fill: gold;
    stroke: #070101;
    stroke-width: 2.5px;
}

.node.gen1 {
    fill: green;
    stroke: #fff;
    stroke-width: 1.5px;
}

.node.gen2 {
    fill: red;
    stroke: #fff;
    stroke-width: 1.5px;
}

.node.gen3 {
    fill: orange;
    stroke: #fff;
    stroke-width: 1.5px;
}

.node.gen4, .node.gen5, .node.gen6, .node.gen7, .node.gen8 {
    fill: #1f77b4;
    stroke: #fff;
    stroke-width: 1.5px;
}

.node.selected {
    stroke: #00fff2;
    stroke-width: 3px;
}

.link {
    stroke: #999;
    stroke-opacity: 0.6;
    stroke-width: 2px;
}

.link.selected {
    stroke-width: 2px;
    filter: drop-shadow(0 0 100px #00fff2);
}

#certificate {
    width: 30%;
    margin: 20px auto;
    padding: 0;
    display: none;
}

#certificate-frame {
    border: 2px solid black;
    background-color: white;
    padding: 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    overflow: hidden;
}

#certificate-title-section {
    border-bottom: 2px solid black;
    padding: 10px;
    text-align: center;
    font-size: 12px;
    font-weight: bold;
}

#certificate-body-section {
    padding: 20px;
    text-align: center;
    font-size: 16px;
}

#certificate-checksum-section {
    border-top: 2px solid black;
    padding: 10px;
    text-align: center;
    font-size: 12px;
    color: red;
    font-weight: bold;
}

/* Media queries for responsiveness */
@media screen and (max-width: 768px) {
    body {
        flex-direction: column;
    }

    #options-panel {
        width: 100%;
        height: auto;
        padding: 10px;
    }

    #visualization {
        height: 50vh;
    }

    #side-panel {
        width: 100%;
        height: auto;
        border-left: none;
        border-top: 1px solid #ccc;
    }

    #certificate {
        width: 90%;
    }
}

@media screen and (max-width: 480px) {
    #controls div {
        flex-direction: column;
        align-items: flex-start;
    }

    #controls label {
        margin-bottom: 5px;
    }

    #certificate-title-section,
    #certificate-body-section,
    #certificate-checksum-section {
        font-size: 10px;
    }
}