/*
This file is use to hold styles relative to sample page
No style for React viewer component should be here. To add style specific to the viewer go to src/assests/style
  - theme.tsx for Material-UI
  - style.css for specific viewer style
  - vendor.css to override a third party library style
*/
html {
  font-family: 'Roboto', sans-serif;
}

body {
  margin: 0;
  padding: 0px 20px;
  background-color: #ffffff !important;
}

td {
  width: 100%;
}

.collapsible {
  background-color: #777;
  color: white;
  cursor: pointer;
  padding: 18px;
  margin: 3px 0px;
  width: 100%;
  border: none;
  text-align: left;
  outline: none;
  font-size: 15px;
}

.collapsible.active,
.collapsible:hover {
  background-color: #555;
}

.panel {
  display: none;
  background: #ffffff;
  margin: 2px 0px 5px 0px;
  box-shadow: 0px 0px 2px 2px #666666;
  -webkit-box-shadow: 2px 2px 5px 5x #666666;
  -moz-box-shadow: 2px 2px 5px 5px #666666;
  padding: 5px;
  font-size: 12px;
  overflow: auto;
  max-height: 400px;
}

.toolbar {
  display: flex;
  flex-direction: row;
  justify-content: center;
  width: 100%;
  margin: 10px;
  gap: 10px;
}

.page-header {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 20px;
}

.page-header .header-logo {
  height: 120px;
  width: 120px;
  flex-shrink: 0;
}

.page-header-titles {
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 1;
}

.index-header-title {
  text-align: center;
  margin: 0;
}

.header-title {
  text-align: center;
  position: absolute;
  left: 0;
  font-size: 0.7rem !important;
}

.header-table {
  width: 100%;
  text-align: left;
  margin: 0 auto;
}

.header-table > table:first-child {
  width: 100%;
}
.header-table > table:first-child tr:first-child {
  box-shadow: 0px 15px 10px -15px #2e2e2e;
  background-color: #f8f8f8;
  margin-bottom: 100px;
  vertical-align: top;
}

.header-table > table:first-child tr:first-child td {
  padding: 10px;
}

.header-table > table:first-child tr:nth-child(2) td {
  padding-top: 40px;
}

img.header-logo {
  height: 60px;
  width: 60px;
}

.geoview-map {
  border: gray 1px solid;
  width: calc(100%);
  margin-bottom: 30px;
  height: 800px;
}

.map-title-holder {
  display: flex;
}

.map-title-holder .ref-link {
  margin-top: auto;
  margin-bottom: auto;
  margin-left: 20px;
}

.theme-selector {
  padding: 1rem 0;
}

.theme-selector > select {
  width: 120px;
  height: 30px;
  font-size: 1rem;
}

.draw-menu {
  text-align: center;
}

.draw-menu-item {
  display: inline-block;
  margin: 0px 20px;
}

.logs-container {
  position: absolute;
  top: 0px;
  right: 0px;
  width: 200px;
  height: 100%;
  background-color: lightgrey;
  z-index: 1;
  overflow: auto;
  font-size: smaller;
}

.logs-container-title {
  text-align: center;
  font-weight: bold;
}

.logs-container-sub-title {
  text-align: center;
  font-size: smaller;
}

table.info,
th.info,
td.info,
th.infoCol1,
td.infoCol1 {
  border: 1px solid black;
}
th.info,
td.info,
th.infoCol1,
td.infoCol1 {
  padding: 15px;
  width: 15%;
}
th.info,
th.infoCol1,
td.infoCol1 {
  text-align: left;
  font-weight: bold;
  font-size: 15px;
}

table.state {
  font-family: arial, sans-serif;
  border-collapse: collapse;
  width: 100%;
}

td.state,
th.state {
  border: 1px solid #dddddd;
  text-align: left;
  padding: 8px;
}

table.state {
  display: flex;
}

.config-error {
  color: red;
}

.config-json-valid {
  color: green;
}

.editor {
  display: inline-flex;
  gap: 10px;
  font-family: monospace;
  line-height: 21px;
  background: #282a3a;
  border-radius: 2px;
  padding: 20px 10px;
  height: 600px;
  overflow-y: auto;
}

.editor .line-numbers {
  width: 20px;
  text-align: right;
  height: 9999px;
}

.editor .line-numbers span {
  counter-increment: linenumber;
}

.editor .line-numbers span::before {
  content: counter(linenumber);
  display: block;
  color: #506882;
}

.editor textarea {
  height: 9999px;
  line-height: 21px;
  overflow-y: hidden;
  padding: 0;
  border: 0;
  background: #282a3a;
  color: #fff;
  min-width: 500px;
  outline: none;
  resize: none;
}

@media only screen and (max-width: 767px) {
  body {
    padding: 20px; /* Adjust the value as needed */
  }

  img.header-logo {
    height: 40px;
    width: 40px;
  }

  .header-title {
    font-size: 0.6rem !important;
  }

  .header-table {
    width: 100%;
  }
}

@media only screen and (max-width: 300px) {
  img.header-logo {
    visibility: hidden; /* remove header image when screen is too small */
  }
}

/* Tab Navigation Styles - Footer Bar Style */
.tabs {
  display: flex;
  background-color: #f1f2f5 !important;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  margin-bottom: 20px;
  border-bottom: 1px solid #e0e0e0;
}

.tab-button {
  padding: 10px 24px;
  cursor: pointer;
  background-color: transparent !important;
  border: none;
  outline: none;
  transition:
    background-color 0.2s ease-out,
    color 0.2s ease-out;
  font-family: 'Roboto', 'Helvetica', 'Arial', sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: #393939 !important;
  min-height: 40px;
  position: relative;
}

.tab-button:hover {
  background-color: rgba(0, 0, 0, 0.04) !important;
}

.tab-button.active {
  background-color: #515ba5 !important;
  color: #ffffff !important;
}

.tab-content {
  visibility: hidden;
  position: absolute;
  left: -9999px;
  animation: fadeIn 0.5s;
  background-color: #f1f2f5;
  padding: 30px;
  box-shadow:
    0px 3px 1px -2px rgba(0, 0, 0, 0.2),
    0px 2px 2px 0px rgba(0, 0, 0, 0.14),
    0px 1px 5px 0px rgba(0, 0, 0, 0.12);
  margin-bottom: 30px;
  width: calc(100% - 60px);
}

.tab-content.active {
  visibility: visible;
  position: relative;
  left: 0;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.demo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 15px;
  margin-top: 15px;
}

.demo-section {
  margin-bottom: 30px;
}

.demo-section h4 {
  color: #333;
  border-bottom: 2px solid #4caf50;
  padding-bottom: 8px;
  margin-bottom: 15px;
}

/* Only apply to direct paragraph children, not nested components like geoview */
.demo-section > p,
.demo-section > div > p:not([class*='MuiTypography']) {
  color: #555;
  margin-bottom: 15px;
}

.demo-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 10px;
}

.demo-list li {
  margin: 0;
}

.demo-list a {
  display: block;
  padding: 12px 16px;
  background-color: #f8f9fa;
  border-left: 4px solid #4caf50;
  text-decoration: none;
  color: #333;
  font-size: 15px;
  transition: all 0.2s ease;
  border-radius: 4px;
}

.demo-list a:hover {
  background-color: #e8f5e9;
  border-left-color: #2e7d32;
  transform: translateX(4px);
}

/* Button Styles */
.btn {
  padding: 8px 16px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 500;
  font-size: 14px;
  transition: background-color 0.2s ease;
  text-decoration: none;
  display: inline-block;
}

.btn-primary {
  background-color: #515ba5;
  color: white;
}

.btn-primary:hover {
  background-color: #3d4580;
}

.btn-success {
  background-color: #4caf50;
  color: white;
}

.btn-success:hover {
  background-color: #45a049;
}

.btn-danger {
  background-color: #d32f2f;
  color: white;
}

.btn-danger:hover {
  background-color: #b71c1c;
}

.btn-secondary {
  background-color: #777;
  color: white;
}

.btn-secondary:hover {
  background-color: #555;
}

.btn-large {
  padding: 10px 20px;
}

/* Form Control Styles */
.form-control {
  padding: 8px 12px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 14px;
  background-color: white;
}

.form-control:focus {
  outline: none;
  border-color: #515ba5;
  box-shadow: 0 0 0 2px rgba(81, 91, 165, 0.1);
}

.form-select {
  padding: 8px 12px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 14px;
  background-color: white;
  cursor: pointer;
}

.form-select:focus {
  outline: none;
  border-color: #515ba5;
  box-shadow: 0 0 0 2px rgba(81, 91, 165, 0.1);
}

.form-group {
  margin: 20px 0;
  display: flex;
  gap: 10px;
  align-items: center;
}

.form-label {
  font-weight: 500;
  margin-bottom: 5px;
}

/* Back to Main Link Style */
.back-to-main {
  text-align: center;
  margin: 20px 0;
}

.back-to-main a {
  padding: 10px 20px;
  background-color: #515ba5;
  color: white;
  text-decoration: none;
  border-radius: 4px;
  font-weight: 500;
  transition: background-color 0.2s ease;
}

.back-to-main a:hover {
  background-color: #3d4580;
}

/* Navigator Common Styles */
.actionButton {
  padding: 5px;
}

.selector-container {
  display: flex;
  flex-direction: row;
  margin: 10px;
}

.selector {
  padding: 15px;
}

@media screen and (max-width: 600px) {
  .selector-container {
    display: flex;
    flex-direction: column;
    width: 100%;
  }
  .selector-container p {
    margin-bottom: 0px;
  }
  .selector {
    padding: 8px;
  }
  .editor textarea {
    min-width: 96%;
    max-width: 96%;
  }
}

/* Navigator Toolbar Styles */
.navigator-toolbar {
  display: flex;
  justify-content: flex-start;
  gap: 10px;
  margin: 20px 0;
}

/* Navigator Form Elements */
.navigator-label {
  font-weight: 500;
}

.navigator-label-nowrap {
  font-weight: 500;
  white-space: nowrap;
}

.navigator-select {
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: 4px;
  max-width: 96%;
}

.navigator-select-full {
  flex: 1;
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: 4px;
  max-width: 100%;
}

.navigator-checkbox {
  cursor: pointer;
}

/* Navigator Layout Helpers */
.navigator-option-group {
  display: flex;
  gap: 10px;
  align-items: center;
}

.navigator-option-group-narrow {
  display: flex;
  gap: 8px;
  align-items: center;
}

.navigator-selector-row {
  align-items: center;
  gap: 15px;
}

.navigator-selector-wrap {
  gap: 20px;
  flex-wrap: wrap;
  display: flex;
}

.navigator-map-section {
  margin: 20px 0;
}

.back-to-main-flex {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

/* Sandbox Styles */
.sandbox-validation-msg {
  padding: 10px;
  font-style: italic;
  color: #666;
}

.sandbox-input-short {
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: 4px;
  width: 120px;
}

.sandbox-section-spacing {
  margin: 15px 0;
}

.sandbox-label-block {
  font-weight: 500;
  display: block;
  margin-bottom: 8px;
}

.sandbox-input-full {
  width: 100%;
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: 4px;
  box-sizing: border-box;
}

.sandbox-info-box {
  background-color: #e3f2fd;
  padding: 12px;
  border-radius: 4px;
  margin: 15px 0;
}

.sandbox-info-text {
  margin: 0;
  color: #1976d2;
  font-size: 14px;
}

.sandbox-error-text {
  color: red;
  font-weight: 500;
}

.sandbox-min-height {
  min-height: 24px;
}

.sandbox-textarea {
  border: 1px solid #ddd;
  border-radius: 4px;
}

.sandbox-option-flex {
  display: flex;
  gap: 10px;
  align-items: center;
  flex: 1;
  min-width: 300px;
}

.sandbox-select-flex {
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: 4px;
  flex: 1;
}

/* Ensure code elements inside list items match the text size */
.option-item ul li code {
  font-size: 16px;
  margin: 2px 6px;
  background-color: #f6f8fa;
  border: 1px solid #e1e4e8;
  border-radius: 3px;
}

p code {
  font-size: 16px;
  margin: 2px 6px;
  background-color: #f6f8fa;
  border: 1px solid #e1e4e8;
  border-radius: 3px;
}

.option-item {
  border-top: 2px solid #4caf50;
  padding-bottom: 8px;
  margin-bottom: 15px;
}

/* Demo Important Layers Styles */
li.source-link {
  cursor: pointer;
  color: #6082b6;
}

.sourceLinkCopied {
  position: fixed;
  top: 6px;
  right: 6px;
  background-color: darkblue;
  color: white;
  padding: 16px;
  font-size: 16px;
  min-width: 150px;
  text-align: center;
  border-radius: 5px;
  z-index: 1;
}

/* Demo Important Layers - Specific Styles */
table.display-fields,
th.display-fields,
td.display-fields {
  border: 1px solid black;
  border-collapse: collapse;
  padding: 8px;
}

.demo-important-selector {
  display: flex;
  flex-direction: column;
  width: 400px;
  gap: 5px;
}

/* Demo Function Event Styles */
.demo-function-list {
  list-style-type: none;
  padding-left: 0;
}

.demo-function-list li {
  padding-top: 10px;
  padding-bottom: 10px;
  margin-bottom: 5px;
}

.demo-function-list button {
  margin-top: 5px;
  margin-bottom: 5px;
  margin-right: 5px;
}

.demo-function-list code {
  display: block;
  background-color: #f4f4f4;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 8px 12px;
  margin-top: 5px;
  font-family: 'Courier New', Courier, monospace;
  font-size: 13px;
  color: #333;
  overflow-x: auto;
}

.demo-function-list input[type='text'] {
  font-family: 'Courier New', Courier, monospace;
  font-size: 13px;
}
