/* Black Alpha Overlay */

#black-overlay {

    position: fixed;

    top: 0;

    left: 0;

    width: 100%;

    height: 100%;

    background: rgba(0, 0, 0, 0.7);

    z-index: 999;

}



/* Documentation Panel */

#doc-panel {

    position: fixed;

    top: 10%;

    left: 50%;

    transform: translate(-50%, 0);

	background: white;

    width: 70%;

    height: 80%;

    border-radius: 8px;

    display: flex;

    flex-direction: column;

    z-index: 10000;

    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);

    overflow: hidden;

}



/* Responsive Adjustments */

@media (max-width: 1200px) {

    #doc-panel {

        width: 70%;

        height: 85%;

    }

}



@media (max-width: 992px) {

    #doc-panel {

        width: 80%;

        height: 90%;

    }

}



@media (max-width: 768px) {

    #doc-panel {

        width: 90%;

        height: 95%;

        top: 5%; /* Adjust to better fit small screens */

    }

}



@media (max-width: 576px) {

    #doc-panel {

        width: 95%;

        height: 95%;

        top: 2%; /* Push closer to the top */

    }



    /* Smaller font for small devices */

    .doc-header, .doc-content {

        font-size: 0.9em;

    }

}



.close-button {

    background: none;

    border: none;

    font-size: 1.5em;

    color: #333;

    cursor: pointer;

}



.close-button:hover {

    color: #e74c3c;

}



.doc-header {

    display: flex;

    justify-content: space-between;

    align-items: center;

    background: #f7f7f7;

    padding: 10px 15px;

    border-bottom: 1px solid #ddd;

}



#breadcrumb {

    font-size: 0.9em;

    color: #777;

}



/* Main Content Area */

.doc-main {

    display: flex;

    height: 100%;

}



#doc-nav h4 {

    margin-bottom: 10px;

}



#doc-nav ul {

    list-style: none;

    padding: 0;

}



#doc-nav li {

    margin: 5px 0;

}



#doc-nav a {

    text-decoration: none;

    color: #333;

    font-size: 0.9em;

}



#doc-nav {

	width: 25%;

	min-width: 315px;

    height: 100%;

    background: #f4f4f4;

    border-right: 1px solid #ddd;

    overflow-y: auto;

    font-family: Arial, sans-serif;

	position: static;

    top: 0;

    left: 0;

    z-index: 1000;

}



#doc-nav h3 {

    margin: 0 0 10px;

    font-size: 1.2em;

    color: #333;

}



/* Sticky Header */

.nav-header {

    position: sticky;

    top: 0;

    background: #fff;

    padding: 10px;

    border-bottom: 1px solid #ddd;

    z-index: 10;

}



/* Search Container */

.search-container {

    position: relative;

    display: flex;

    align-items: center;

}



#node-search:focus {

    border-color: #3498db; /* Highlight on focus */

}



#node-search {

    width: 100%;

    padding: 8px 30px 8px 10px; /* Room for clear button */

    border: 1px solid #ccc;

	box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);

    outline: none;

    border-radius: 4px;

    font-size: 1em;

}



.clear-button {

    position: absolute;

    right: 10px;

    cursor: pointer;

    color: #999;

    font-size: 1.2em;

}



.clear-button:hover {

    color: #e74c3c;

}



#node-menu {

    list-style: none;

    padding: 0;

    margin: 0;

}



#node-menu li {

    cursor: pointer;

    user-select: none;

    padding: 0px 0px 0px 10px;

    margin: 2px 0;

    border-radius: 4px;

    transition: background 0.2s ease;

}



/*#node-menu li:hover {

    background: #ddd;

}*/



/* Selected Node Style */

#node-menu li.selected {

    background: #3498db;

    color: white;

    font-weight: bold;

}



#node-menu li.selected i {

    color: white;

}



.folder-title {

    font-weight: bold;

    color: #444;

}



.nested {

    display: none; /* Initially hide nested categories */

    list-style: none;

    padding-left: 15px;

}



.folder > .folder-title::before {

    content: "\25B6"; /* Right-facing triangle */

    font-size: 0.8em;

    margin-right: 5px;

    display: inline-block; /* Required for transform */

    transition: transform 0.2s ease;

}



.folder.open > .folder-title::before {

    transform: rotate(90deg); /* Rotate only direct child */

}



.node-item {

    color: #555;

    font-size: 0.9em;

    padding-left: 20px !important;

	border-radius: 4px;

	cursor: pointer;

	transition: background 0.2s ease;

}



.node-item:hover {

    background: #ddd;

    color: #333;

}



.doc-content-wrapper {

    width: 80%;

    overflow-y: auto;

    padding: 20px;

    position: relative; /* Add position relative for stacking context */

}



.doc-content {

	padding-bottom: 50px;

}



.doc-content table {

    width: 100%;

    border-collapse: collapse;

}



.doc-content th, .doc-content td {

    border: 1px solid #ddd;

    padding: 8px;

    text-align: left;

}



.doc-content th{

	background-color: #f8f7f7;

}



.hidden {

    display: none !important;

}



.doc-container {

	display: flex; /* Enables Flexbox */

	align-items: flex-start; /* Align items vertically */

	justify-content: space-between; /* Space text and image */

	gap: 20px; /* Spacing between text and image */

}



.doc-text {

	flex: 1; /* Text takes remaining space */

}



.doc-image {

	flex: 0 0 auto; /* Image does not grow/shrink */

	max-width: 120px;

}



#doc-panel img {

	max-width: 100%;

	height: auto;

}



/* Floating Actions */

.doc-actions {

    position: absolute;

	top: 12px;

	right: 45px;

	display: flex;

	gap: 10px;

	z-index: 1;

}



.doc-actions button {

    padding: 5px 10px;

    border: none;

    border-radius: 4px;

    font-size: 0.9em;

    cursor: pointer;

    transition: background 0.2s ease;

}



.doc-actions button i {

    margin-right: 5px; /* Add spacing between the icon and text */

}



/* Base Button Styling */

.btn {

    display: inline-flex;

    align-items: center;

    gap: 5px; /* Space between icon and text */

    padding: 8px 15px;

    border: none;

    border-radius: 4px;

    font-size: 1em;

    font-weight: bold;

    cursor: pointer;

    color: #fff;

    transition: background 0.2s ease, box-shadow 0.2s ease;

    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);

}



#save-prompt-btn {

    background: #27ae60;

    color: white;

}



#save-prompt-btn:hover {

    background: #219150;

}



#edit-prompt-btn {

    background: #3498db;

    color: white;

}



#edit-prompt-btn:hover {

    background: #2980b9;

}



#regenerate-btn {

    background: #f39c12;

    color: white;

}



#regenerate-btn:hover {

    background: #e67e22;

}



/* Delete or Danger Button - Red Theme */

.btn-danger {

    background-color: #e74c3c !important; /* Red */

}



.btn-danger:hover {

    background-color: #c0392b !important; /* Darker red on hover */

}



.fa-spin {

    animation: fa-spin 2s infinite linear;

}



#admin-editor {

    padding: 10px;

    background: #f7f7f7;

    border: 1px solid #ddd;

    border-radius: 4px;

    position: absolute; /* Change from fixed to absolute */

    top: 0; /* Align to the top of doc-content-wrapper */

    left: 0; /* Align to the left of doc-content-wrapper */

    width: 100%; /* Ensure it spans the full width of the wrapper */

    z-index: 2;

    height: 93%; /* Adjust the height relative to its parent */

	transition: all 0.3s ease;

	display: flex;

    flex-direction: column; /* Stack items vertically */

    justify-content: space-between;

}



#admin-editor textarea {

    flex-grow: 1; /* Ensure textarea takes up the remaining space */

    margin-bottom: 10px;

}



#admin-editor .btn {

    margin-left: 10px; /* Add spacing between buttons */

}



#admin-editor .button-group {

    display: flex;

    justify-content: flex-end; /* Align buttons to the right */

}



#admin-editor.active {

    display: block; /* Display the editor when active */

}



#prompt-editor {

    width: 100%;

    height: 85%;

    padding: 10px;

    margin-bottom: 10px;

    border: 1px solid #ccc;

    border-radius: 4px;

    resize: vertical;

    font-size: 1em;

}



/* Dark Mode Styles for #doc-panel */

#doc-panel.dark-mode {

    --background-color: #121212;

    --text-color: #ffffff;

    --border-color: #444;

    --input-background: #1e1e1e;

    --button-background: #333;

    --button-hover: #555;

}



#doc-panel.dark-mode {

    background-color: var(--background-color);

    color: var(--text-color);

}



#doc-panel.dark-mode input,

#doc-panel.dark-mode textarea {

    background-color: var(--input-background);

    color: var(--text-color);

    border: 1px solid var(--border-color);

}



#doc-panel.dark-mode button {

    background-color: var(--button-background);

    color: var(--text-color);

}



#doc-panel.dark-mode button:hover {

    background-color: var(--button-hover);

}

