/* =================== GLOBAL =================== */
@import url("https://fonts.googleapis.com/css2?family=Lato:ital,wght@0,100;0,300;0,400;0,700;0,900;1,100;1,300;1,400;1,700;1,900&display=swap");

/* Universal Reset & Font */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: Lato, sans-serif;
}
body,
html {
  height: 100%;
  width: 100%;
  scroll-behavior: smooth;
}

/* App Container */
#app-container {
  display: flex;
  flex-direction: row;
  height: 94vh;
  padding-left: 10px;
  padding-right: 10px;
  overflow: hidden;
}

/* Header and Dropdown */
.header {
  background-color: #0039a6;
  height: 6vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.header h1 {
  font-size: 24px;
  color: white;
  flex-grow: 1;
  text-align: center;
}
.dropdown-header .Select-control {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  justify-content: center;
  cursor: pointer;
}
.dropdown-header .Select-value-label {
  color: white !important;
  text-align: center;
  font-size: 24px;
}
.dropdown-header .Select-arrow-zone {
  color: white !important;
}
.dropdown-header .Select-menu-outer {
  background-color: #0039a6 !important;
  border: none !important;
}
.dropdown-header .Select-option {
  color: white !important;
  font-size: 18px;
  text-align: center;
}
.dropdown-header .Select-option.is-focused {
  background-color: #0050d4 !important;
}

/* Modal */
.modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 80vw;
  height: 80vh;
  background-color: white;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
  z-index: 1000;
  display: block;
  flex-direction: column;
  padding: 20px;
  border-radius: 8px;
  overflow-y: auto;
}
.modal-content {
  position: relative;
}
.modal-overlay {
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 999;
}
#button-container,
#query-button-container {
  position: sticky;
  top: 0;
  text-align: right;
  z-index: 1000;
}
#close-modal-btn,
#close-query-modal-btn,
#datalog-close-docs-btn,
#datalog-close-queries-btn {
  background-color: #0039a6;
  color: white;
  border: none;
  padding: 10px 20px;
  cursor: pointer;
  border-radius: 5px;
  font-size: 14px;
}
#close-modal-btn:hover,
#close-query-modal-btn:hover,
#datalog-close-docs-btn:hover,
#datalog-close-queries-btn:hover {
  background-color: #082d70;
}

/* Markdown */
.markdown-content {
  line-height: 1.6;
  padding: 10px;
}
.markdown-content h1 {
  font-size: 30px;
  color: #0039a6;
  margin-bottom: 20px;
  border-bottom: 2px solid #e0e0e0;
  padding-bottom: 5px;
}
.markdown-content h2 {
  font-size: 26px;
  margin-bottom: 15px;
}
.markdown-content h3,
.markdown-content h4 {
  font-size: 20px;
  margin-bottom: 10px;
}
.markdown-content code {
  background-color: #f5f5f5;
  color: #0039a6;
  padding: 2px 4px;
  border-radius: 4px;
  font-family: "Courier New", Courier, monospace;
  font-size: 16px;
}
.markdown-content pre {
  background-color: #f5f5f5;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 7px;
  overflow-x: auto;
  font-family: "Courier New", Courier, monospace;
  margin-bottom: 10px;
  cursor: pointer;
  font-size: 16px;
}
.markdown-content ul,
.markdown-content ol {
  padding-left: 40px;
  margin-bottom: 20px;
  font-size: 16px;
}
.markdown-content li {
  margin-bottom: 8px;
}
.markdown-content p {
  margin-bottom: 15px;
  font-size: 17px;
}
.markdown-content a {
  color: #0039a6;
  line-height: 0;
}
.markdown-content table {
  width: 50%;
  border-collapse: collapse;
  margin: 20px 0;
  font-size: 16px;
}
.markdown-content th,
.markdown-content td {
  border: 1px solid #e0e0e0;
  padding: 12px;
  text-align: left;
}
.markdown-content th {
  background-color: #0039a6;
  color: white;
  font-weight: bold;
}
.markdown-content tr:nth-child(even) {
  background-color: #f5f5f5;
}
.markdown-content hr {
  border: none;
  height: 3px;
  background-color: #e0e0e0;
  margin: 30px 0;
}

/* Table  */
.classic-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15.5px;
  text-align: left;
  border: 1px solid #ddd;
}
.classic-table th,
.classic-table td {
  padding: 5px 10px;
  border: 1px solid #ddd;
}
.classic-table th {
  background-color: #0071ce;
  color: white;
  font-weight: bold;
}
.classic-table tr:nth-child(even) {
  background-color: #eeeeee;
}

/* Divider  */
.divider,
#divider {
  width: 2px;
  background-color: #0039a6;
  cursor: ew-resize;
}

/* Info Links  */
#documentation-placeholder {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 15px;
}
#documentation-placeholder a {
  color: #0039a6;
  font-size: 16px;
  text-decoration: none;
}
#documentation-placeholder a:hover {
  text-decoration: underline;
  cursor: pointer;
}
#installation-info-link,
#open-query-modal-btn,
#open-docs,
#open-queries,
#datalog-open-queries,
#datalog-open-docs {
  font-size: 16px;
  color: #0039a6;
  text-decoration: none;
  padding: 2px;
  background-color: white;
  border: 0;
}
#installation-info-link:hover,
#open-query-modal-btn:hover,
#open-docs:hover,
#open-queries:hover,
#datalog-open-queries:hover,
#datalog-open-docs:hover {
  text-decoration: underline;
  cursor: pointer;
}

/* Error Popup */
#error-div {
  display: none;
  background-color: red;
  color: white;
  text-align: center;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  padding: 20px;
  border-radius: 10px;
  z-index: 1000;
}

/* =================== HOME PAGE =================== */
#home-container {
  max-width: 80%;
  margin: 40px auto;
  padding: 24px;
}
.tool-gif {
  display: block;
  margin: 16px auto 16px auto;
  max-width: 100%;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.07);
}
.home-title {
  text-align: center;
  font-size: 2.5rem;
  margin-bottom: 18px;
}
.home-intro {
  text-align: center;
  font-size: 1.2rem;
  margin-bottom: 24px;
}
.home-section-title {
  margin-top: 32px;
  font-size: 1.5rem;
  color: #0039a6;
}
.home-about {
  margin-bottom: 18px;
}
.tools-section {
  display: flex;
  flex-direction: row;
  gap: 32px;
  margin-bottom: 32px;
  justify-content: center;
}
.tool-block {
  background: #f7faff;
  border-radius: 8px;
  padding: 18px 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.tool-title {
  margin-bottom: 8px;
  color: #0071ce;
}
.tool-desc {
  margin-bottom: 0;
}
.home-footer {
  text-align: center;
  margin-top: 32px;
  color: #555;
}

/* =================== RAVIZ PAGE =================== */
.left-section {
  flex: 8;
  display: flex;
  flex-direction: column;
  padding: 10px;
  height: 100%;
  overflow: hidden;
}
.input-container {
  flex-shrink: 0;
}
.header-dropdown-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
#db-name-header {
  text-align: left;
  font-size: 17px;
}
#db-dropdown,
#datalog-db-dropdown {
  width: 200px;
}
.Select--single > .Select-control .Select-value,
.Select-placeholder {
  cursor: pointer;
}
#query-input {
  resize: none;
  width: 100%;
  height: 100px;
  font-size: 16px;
  border: 1px solid #cccccc;
}
#submit-btn,
#datalog-submit {
  width: 100%;
  padding: 5px;
  font-size: 16px;
  color: white;
  background-color: #0071ce;
  border: 0;
}
#submit-btn:hover,
#datalog-submit:hover {
  cursor: pointer;
  background-color: #05508d;
}
.tree-table-container {
  display: flex;
  flex-direction: row;
  overflow: hidden;
  width: 100%;
  flex: 1;
  min-height: 0;
}
.datalog-tree-table-container {
  display: flex;
  flex-direction: row;
  overflow: hidden;
  width: 100%;
  height: 100%;
}

.tree-table-container #cytoscape-tree {
  flex: 8;
  height: 100%;
  width: 100%;
  min-width: 0;
}

.tree-table-container .table-and-pagination {
  flex: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 10px;
  overflow-y: auto;
}
.table-and-pagination {
  flex-basis: 45%;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 10px;
  overflow-y: auto;
}
#node-table-placeholder,
#datalog-results-panel {
  height: 110%;
  width: 100%;
  overflow-y: auto;
  border: 1px solid #cccccc;
  padding: 5px;
  font-size: 16px;
}
.pagination-buttons {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 10px;
  padding-bottom: 10px;
}
#prev-page-btn,
#next-page-btn,
#datalog-prev-page-btn,
#datalog-next-page-btn {
  padding: 5px;
  font-size: 16px;
  color: white;
  background-color: #0071ce;
  border: 0;
}
#prev-page-btn:hover,
#next-page-btn:hover,
#datalog-prev-page-btn:hover,
#datalog-next-page-btn:hover {
  cursor: pointer;
  background-color: #05508d;
}
.tuple-count {
  font-weight: bold;
  margin-bottom: 8px;
  color: #333;
}
.right-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  padding: 5px;
  border: none;
}
.right-section div {
  margin-bottom: 10px;
  overflow-y: auto;
}
#schema-container {
  margin-top: 10px;
  font-size: 16px;
}
#schema-info {
  margin-bottom: 10px;
  overflow-y: auto;
  padding: 10px;
}
details {
  margin-bottom: 15px;
  cursor: pointer;
}
details summary {
  margin-bottom: 7px;
}
