@import url('https://fonts.googleapis.com/css2?family=Kalam:wght@300&display=swap');

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', sans-serif;
    background-color: #86c0f9;
    margin: 0;
    color: #333;
    padding-top: 100px !important;
}

.header {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    padding: 0 50px;
    width: 100%;
    height: 100px;
    background-color: white;
    box-shadow: 0 3px 15px rgba(0, 0, 0, 0.15);
    position: fixed;
    top: 0;
    z-index: 100;
    font-family: 'Cambria Math', 'Times New Roman', serif;
    font-weight: 400;
    font-size: 1.0rem;
    color: #333;
    overflow: hidden;
}

.sidebar {
    width: 390px;
    background-color: #fff;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.1);
    margin-right: 20px;
    flex-shrink: 0;
    align-self: flex-start;
}

.diagram-menu {
    overflow: visible;
}

.sidebar h2 {
    font-size: 1.2rem;
    margin-bottom: 20px;
}

.tree-level {
    list-style: none;
    padding-left: 10px;
    margin: 0;
}

.tree-level-0 {
    padding-left: 0;
}

.tree-node {
    font-weight: 600;
    color: #333;
    cursor: pointer;
    display: block;
    padding: 13px 10px;
    position: relative;
    padding-right: 20px;
}

.tree-node:hover {
    color: #007bff;
}

.tree-node::after {
    content: "";
    position: absolute;
    right: 10px;
    width: 8px;
    height: 8px;
    border: solid #333;
    border-width: 0 2px 2px 0;
    transform: rotate(-45deg); /* Right-pointing chevron for collapsed state */
    transition: transform 0.2s ease;
}

.tree-node.expanded::after {
    transform: rotate(45deg); /* Down-pointing chevron for expanded state */
}

.diagram-item {
    cursor: pointer;
    padding: 5px 15px;
    color: #555;
    display: block;
}

.diagram-item:hover {
    color: #007bff;
    font-weight: bold;
}

.diagram-item.active {
    background-color: #f9fdff;
    font-weight: bold;
    color: #007bff;
}

.diagram-item.highlighted {
    background-color: #dbe9ff !important;
    border-radius: 4px;
    font-weight: bold;
}

.container {
    flex: 1;
    min-width: 0;
    background-color: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.1);
}

.format-options-title {
    font-size: 1.10rem;
    font-weight: 600;
    color: #666;
    margin-top: 25px;
    margin-bottom: 35px;
    display: block;
}

button {
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    margin-top: 30px;
    padding: 12px 24px;
    font-size: 16px;
    cursor: pointer;
}

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

.format-options {
    margin-top: 35px;
}

.radio-btn-group {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.radio-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #e9ecef;
    border-radius: 20px;
    padding: 8px 14px;
    cursor: pointer;
    font-size: 15px;
    user-select: none;
    transition: background-color 0.3s;
}

.radio-btn:hover {
    background-color: #dbe3eb;
}

input[type="radio"] {
    accent-color: #007bff;
    transform: scale(1.1);
}

.constraint-mode-select {
    width: 300px;
    height: 43px;
    padding: 8px 12px;
    font-size: 15px;
    border-radius: 6px;
    border: 1px solid #ccc;
    background-color: #e9ecef;
    cursor: pointer;
    font-family: 'Segoe UI', sans-serif;
    transition: background-color 0.3s;
    margin-top: 31px;

    /* optioneel voor mooiere dropdown-pijl */
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%23333' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 20px center;
}


.constraint-mode-select:hover {
    background-color: #dbe3eb;
}

.constraint-mode-select:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 5px rgba(0, 123, 255, 0.5);
}

.enum-select label {
    font-size: 1.2rem;
}

.enum-select {
    margin-top: 17px; /* Moves the whole div (checkbox + label) down */
}

.config-hidden {
    display: none;
}

.config-allowed.config-hidden {
    display: none; /* Blijft verborgen tenzij getoggeld */
}

.config-allowed:not(.config-hidden) {
    display: block; /* Toon als toegestaan en niet verborgen */
}

#toggle-config {
    background-color: #17a2b8; /* Cyan, zoals .external-link-btn */
    color: white;
    border: none;
    border-radius: 4px;
    padding: 12px 24px;
    font-size: 16px;
    cursor: pointer;
}

#toggle-config:hover {
    background-color: #138496; /* Donkerder cyan bij hover */
}

.ddl-container {
    margin-top: 40px;
    position: relative; /* Needed for absolute positioning of buttons */
}

.ddl-container:empty::before {
    content: "Selecteer of zoek een diagram om een Database Schema te genereren.";
    color: #666;
    font-style: italic;
}

.copy-btn, .download-btn {
    position: absolute;
    top: -40px;
    height: 36px;
    padding: 8px 16px;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    line-height: 20px;
    font-size: 14px;
    text-align: center;
    background-color: #28a745;
}

.copy-btn {
    right: 0;
}

.download-btn {
    right: 80px; /* Adjust spacing from Copy button */
}

.copy-btn:hover, .download-btn:hover {
    background-color: #218838;
}

.copy-btn.copied {
    background-color: #2ecc71;
}

.copy-btn.copied::after {
    content: " ✓";
    margin-left: -1px;
}

pre {
    background-color: rgb(255, 255, 255) !important;
    border: 1px solid #ddd;
    padding: 20px;
    white-space: pre-wrap;
    word-wrap: break-word;
    font-family: Consolas, monospace;
    font-size: 0.95rem;
}

pre code {
    font-family: Consolas, monospace;
    font-size: 0.95rem;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.search-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    margin-bottom: 20px;
}

.search-box {
    flex-grow: 1;
    flex-shrink: 1;
    flex-basis: 0;
    height: 36px;
    box-sizing: border-box;
    padding: 8px 12px;
    font-size: 0.95rem;
    border-radius: 6px;
    border: 1px solid #ccc;
    margin: 0;
    font-family: inherit;
    line-height: 1.2;
}

#clear-search {
    flex-shrink: 0;
    height: 36px;
    padding-left: 16px;
    padding-right: 16px;
    background-color: #007BFF;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-family: inherit;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
}

.clear-btn:hover {
    background-color: #0056b3;
}

/* Ensure the html and body take full height */
html, body {
    height: 100%;
    margin: 0;
    padding: 0;
}

/* Body as a flex container */
body {
    display: flex;
    flex-direction: column;
    font-family: 'Segoe UI', sans-serif;
    background-color: #86c0f9;
    margin: 0;
    color: #333;
    padding-top: 100px !important;
}

/* Page wrapper to push footer down */
.page-wrapper {
    flex: 1 0 auto; /* Grow to fill space, but don't shrink */
    display: flex;
    flex-direction: column;
}

/* Main container to hold sidebar and content */
.main-container {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 20px;
    max-width: 1800px;
    margin: 40px auto 0 auto;
    padding: 0 20px;
    padding-bottom: 60px !important;
    flex-grow: 1; /* Ensure it grows to fit content */
}

/* Footer styling */
.footer {
    background-color: white;
    text-align: center;
    padding: 10px 20px;
    font-size: 13px;
    color: #666;
    box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.05);
    flex-shrink: 0; /* Prevent footer from shrinking */
}

#network-header {
    position: absolute;
    top: 0;
    left: 0;
    height: 100px;
    width: 100%;
    overflow: hidden;
    z-index: 0;
    pointer-events: none;
}

#network-canvas {
    display: block;
    width: 100%;
    height: 100%;
    background: transparent;
}

/* Styling for external link button */
.external-link-btn {
    position: absolute;
    top: -10px; /* Align with copy and download buttons */
    right: 190px; /* Positioned to the left of the download button */
    background-color: #17a2b8; /* Cyan to distinguish from Copy (blue) and Download (green) */
    color: white;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 14px;
    line-height: 20px;
    text-align: center;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
}

.external-link-btn:hover {
    background-color: #138496; /* Darker cyan on hover */
}

#toggle-config:not(.config-allowed) {
    display: none;
}

.loader-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    justify-content: center;
    align-items: center;
}

.loader {
    width: 90px;
    height: 14px;
    box-shadow: 0 3px 0 #fff;
    position: relative;
    clip-path: inset(-40px 0 -5px);
}

.loader:before {
    content: "";
    position: absolute;
    inset: auto calc(50% - 17px) 0;
    height: 50px;
    --g: no-repeat linear-gradient(#ccc 0 0);
    background: var(--g), var(--g), var(--g), var(--g);
    background-size: 16px 14px;
    animation:
        l7-1 2s infinite linear,
        l7-2 2s infinite linear;
}

.ggm-logo {
   /* height: 60px; */
    height: 70%;
    margin-right: 20px;
    z-index: 10;
}


@keyframes l7-1 {
    0%, 100%  { background-position: 0 -50px, 100% -50px }
    17.5%     { background-position: 0 100%, 100% -50px, 0 -50px, 100% -50px }
    35%       { background-position: 0 100%, 100% 100%, 0 -50px, 100% -50px }
    52.5%     { background-position: 0 100%, 100% 100%, 0 calc(100% - 16px), 100% -50px }
    70%, 98%  { background-position: 0 100%, 100% 100%, 0 calc(100% - 16px), 100% calc(100% - 16px) }
}

@keyframes l7-2 {
    0%, 70%   { transform: translate(0) }
    100%      { transform: translate(200%) }
}