:root {
    --bg-color: #121212;
    --surface-color: #1e1e1e;
    --text-color: #e0e0e0;
    --accent-color: #2196f3;
    --border-color: #333;

    /* Category Colors */
    --color-disease: #ff5252;
    --color-symptom: #ffab40;
    --color-poison: #b388ff;
    --color-heavy-metal: #3f51b5;
    --color-place: #bdbdbd;
    --color-contaminant: #6a1b9a;
    --color-remedy: #006400;
    --color-food: #40c4ff;
    --color-adulterant: #ffff00;
    --color-allergen: #6a1b9a;
    --color-residue: #6a1b9a;
    --color-poison: #6a1b9a;
    --color-pesticide: #6a1b9a;
    --color-fungicide: #6a1b9a;
    --color-herbicide: #6a1b9a;
}

body,
html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    overflow: hidden;
}

#disclaimer-banner {
    background-color: #ffeb3b;
    color: #000;
    padding: 8px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    position: relative;
    z-index: 1000;
}

#close-disclaimer {
    background: none;
    border: none;
    color: #000;
    cursor: pointer;
    font-size: 1.1rem;
}

#app-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 35px);
    /* Adjust for banner height */
    position: relative;
}

#overlay-ui {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 100;
    pointer-events: none;
}

#search-section {
    position: absolute;
    top: 20px;
    left: 20px;
    width: 350px;
    padding: 10px 44px 10px 10px;/*space for toggle button*/
    background: rgba(30, 30, 30, 0.8);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    pointer-events: auto;
    backdrop-filter: blur(5px);
    transition: transform 0.28s ease;
    overflow: visible;
}

#search-section.minimized {
    transform: translateX(calc(-100% - 20px + 42px));
}

#search-content {
    transition: opacity 0.18s ease;
}

#search-section.minimized #search-content {
    opacity: 0;
    pointer-events: none;
}

#toggle-search-section {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: #2a2a2a;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

#toggle-search-section:hover {
    background: #3a3a3a;
}

#search-content #search-bar-container {
    padding-right: 0;
}

#search-bar-container {
    display: flex;
    position: relative;
    gap: 5px;
}

#search-input {
    flex: 1;
    background: #2c2c2c;
    border: 1px solid var(--border-color);
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    outline: none;
}

#submit-search {
    background: var(--accent-color);
    border: none;
    color: black;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
}

#reset-search {
    background: #444;
    border: none;
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Make help button slightly wider */
#help-btn {
    padding-left: 8px;
    padding-right: 8px;
}

#reset-search:hover {
    background: #555;
    color: var(--color-disease);
}

#reset-search:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

#suggestions-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    width: calc(100% - 40px);
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 0 0 4px 4px;
    max-height: 200px;
    overflow-y: auto;
    display: none;
    z-index: 110;
}

.suggestion-item {
    padding: 8px 12px;
    cursor: pointer;
    border-bottom: 1px solid #333;
}

.suggestion-item:hover {
    background: #333;
}

#search-options {
    margin-top: 5px;
    font-size: 0.8rem;
}

#active-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.tag {
    display: flex;
    align-items: center;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #000;
}

.tag .close-tag {
    margin-left: 6px;
    cursor: pointer;
    opacity: 0.7;
}

.tag .close-tag:hover {
    opacity: 1;
}

/* Tag Specific Colors */
.tag-disease {
    background-color: var(--color-disease);
}

.tag-symptom {
    background-color: var(--color-symptom);
}

.tag-poison {
    background-color: var(--color-poison);
}

.tag-heavy-metal {
    background-color: var(--color-heavy-metal);
}

.tag-place {
    background-color: var(--color-place);
    color: #fff;
}

.tag-medicine {
    background-color: var(--color-medicine);
}

.tag-remedy {
    background-color: var(--color-remedy);
}

.tag-contaminant {
    background-color: var(--color-contaminant);
    color: #fff;
}

.tag-food {
    background-color: var(--color-food);
}

.tag-adulterant {
    background-color: var(--color-adulterant);
}

.tag-pesticide,
.tag-fungicide,
.tag-herbicide,
.tag-poison {
    background-color: var(--color-poison);
    color: #fff;
}

.tag-residue {
    background-color: var(--color-residue);
    color: #fff;
}

.tag-allergen {
    background-color: var(--color-allergen);
    color: #fff;
}

#visual-display {
    flex: 1;
    background-color: #1a1a1a;
    position: relative;
}

#graph-controls {
    position: absolute;
    bottom: 20px;
    left: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 50;
}

#graph-controls button {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

#graph-controls button:hover {
    background: #333;
}

#details-sidebar {
    position: absolute;
    right: 0;
    top: 0;
    width: 350px;
    height: 100%;
    background: var(--surface-color);
    border-left: 1px solid var(--border-color);
    transform: translateX(0);
    transition: transform 0.3s ease;
    z-index: 200;
    display: flex;
    flex-direction: column;
}

#details-sidebar.minimized {
    transform: translateX(calc(100% - 40px));
}

#details-sidebar.minimized #sidebar-header h3 {
    display: none;
}

#sidebar-header {
    padding: 5px 15px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 40px;
}

#sidebar-header h3 {
    margin: 0;
    font-size: 1rem;
}

#toggle-sidebar {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 1.2rem;
}

#sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 10px 15px;
    font-size: 0.9rem;
}

.placeholder-text {
    color: #888;
    text-align: center;
    margin-top: 30%;
}

.detail-section {
    margin-bottom: 12px;
}

.detail-section h2 {
    margin: 0 0 5px 0;
    font-size: 1.2rem;
}

.detail-section h4 {
    border-bottom: 1px solid var(--accent-color);
    padding-bottom: 3px;
    margin-bottom: 5px;
    font-size: 0.95rem;
}

.detail-section p,
.detail-section ul {
    margin: 5px 0;
}

.detail-section li {
    margin-bottom: 3px;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: #1e1e1e;
}

::-webkit-scrollbar-thumb {
    background: #444;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Node Highlighting */
.node.glowing-node circle {
    stroke-width: 4px !important;
    filter: drop-shadow(0 0 8px var(--glow-color));
}

.node.glowing-node text {
    font-weight: bold;
    text-shadow: 0 0 4px rgba(0, 0, 0, 0.8);
}

/* Glowing link style */
.links line.glowing-link {
    stroke: #fff;
    stroke-width: 4px;
    stroke-opacity: 1;
    filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.9));
}

/* Context Menu */
#context-menu {
    position: absolute;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 5px 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    min-width: 120px;
    pointer-events: auto;
}

#context-menu ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

#context-menu li {
    padding: 8px 12px;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-color);
}

#context-menu li:hover {
    background: #333;
    color: var(--accent-color);
}

/* Modal Styling */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.modal-content {
    background-color: var(--surface-color);
    margin: 10% auto;
    padding: 0;
    border: 1px solid var(--border-color);
    width: 500px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
    animation: modalScale 0.3s ease-out;
}

@keyframes modalScale {
    from {
        transform: scale(0.8);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.modal-header {
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.2rem;
    color: var(--accent-color);
}

.close-modal {
    color: #888;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close-modal:hover {
    color: #fff;
}

.modal-body {
    padding: 20px;
    max-height: 400px;
    overflow-y: auto;
}

.modal-body section {
    margin-bottom: 20px;
}

.modal-body h3 {
    margin-top: 0;
    font-size: 1rem;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-body ul {
    padding-left: 20px;
}

.modal-body li {
    margin-bottom: 8px;
    color: #ccc;
    line-height: 1.4;
}
