/*
 * Copyright 2024 Joe Meszaros
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

@font-face {
  font-family: 'fragment-mono';
  src:
    /* IE6-IE8 */
    url('/fonts/fragmentmono-regular.woff2') format('woff2'),
    /* Super Modern Browsers */ url('/fonts/fragmentmono-regular.woff') format('woff'),
    /* Pretty Modern Browsers */ url('/fonts/fragmentmono-regular.ttf') format('truetype');
}

body {
  margin: 0;
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 14px;
  height: 100vh; /* since every element within the body is positioned absolute, the height of the body would be 0, causing problems in tabulator popup */
}

@page landscape {
  size: a4 landscape;
  margin: 0;
}

@page portrait {
  size: a4 portrait;
  margin: 0;
}

@media print {
  body > * {
    display: none !important;
  }

  #export-canvas {
    display: block !important;
  }

  .landscape {
    page: landscape;
  }

  .portrait {
    page: portrait;
  }
}

#export-canvas {
  display: none;
}

.viewport .logo {
  position: absolute;
  bottom: 10px;
  left: 10px;
  z-index: 10;
}

#scene-overview {
  width: 100%;
  height: 100%;
  position: relative;
  z-index: 102;
  border: 1px solid #404040;
  background: black;
  margin-left: auto;
  margin-right: auto;
}
#close {
  position: absolute;
  top: 3px;
  right: 3px;
  display: inline-block;
  padding: 2px 5px;
  transition: 0.3s;
}

#close:hover {
  float: right;
  display: inline-block;
  padding: 2px 5px;
  background: #ccc;
  color: black;
}

#infopanel {
  text-align: left;
  display: none;
  color: azure;
  width: 350px;
  background: #333;
  z-index: 100;
}

#infopanel .infopanel-content {
  padding: 10px;
  overflow: auto;
}

.cautionpanel {
  position: fixed;
  z-index: 1100;
  display: none;
  left: 50%;
  top: 20px;
  transform: translateX(-50%);
  min-width: 300px;
  max-width: 600px;
  color: white;
  padding: 0;
  border: none;
  border-radius: 12px;
  font-size: 14px;
  text-align: left;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(10px);
  animation: slideInDown 0.3s ease-out;
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

@keyframes slideInDown {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

@keyframes slideOutUp {
  from {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
  to {
    opacity: 0;
    transform: translateX(-50%) translateY(-20px);
  }
}

.cautionpanel.hiding {
  animation: slideOutUp 0.3s ease-in;
}

.cautionpanel-error {
  background: linear-gradient(135deg, #dc2626 0%, #991b1b 100%);
  border-left: 4px solid #fecaca;
}

.cautionpanel-warning {
  background: linear-gradient(135deg, #d97706 0%, #92400e 100%);
  border-left: 4px solid #fed7aa;
}

.cautionpanel-success {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  border-left: 4px solid #a7f3d0;
}

.cautionpanel-info {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  border-left: 4px solid #bfdbfe;
}

.cautionpanel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 12px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.cautionpanel-icon {
  font-size: 20px;
  margin-right: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(5px);
}

.cautionpanel-title {
  font-weight: 600;
  font-size: 16px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  flex-grow: 1;
}

.cautionpanel-content {
  padding: 16px 20px 20px 20px;
  line-height: 1.5;
}

.cautionpanel-message {
  margin-bottom: 8px;
}

.cautionpanel-message:last-child {
  margin-bottom: 0;
}

.cautionpanel-message-list {
  margin-top: 8px;
}

.cautionpanel-message-list .message-item {
  display: flex;
  align-items: flex-start;
  margin-bottom: 6px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  backdrop-filter: blur(5px);
}

.cautionpanel-message-list .message-item:last-child {
  margin-bottom: 0;
}

.cautionpanel-message-list .message-bullet {
  color: rgba(255, 255, 255, 0.7);
  margin-right: 8px;
  font-weight: bold;
  flex-shrink: 0;
  margin-top: 1px;
}

.caution-close-btn {
  cursor: pointer;
  font-weight: 300;
  font-size: 24px;
  color: rgba(255, 255, 255, 0.8);
  transition: all 0.2s ease;
  user-select: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(5px);
}

.caution-close-btn:hover {
  color: white;
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.1);
}

.caution-close-btn:active {
  transform: scale(0.95);
}

.file-upload {
  position: absolute;
  bottom: 10px;
  text-align: center;
  z-index: 100;
  display: block;
  color: azure;
}

#welcome-panel {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  display: block;
  z-index: 2000;
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.8) 0%, rgba(40, 40, 40, 0.9) 100%);
  backdrop-filter: blur(10px);
  animation: fadeIn 0.5s ease-out;
}

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

.welcome-container {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(90vw, 650px);
  max-width: 650px;
  min-width: 320px;
  background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 40px;
  text-align: center;
  animation: slideInUp 0.6s ease-out 0.2s both;
}

@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translate(-50%, -40%);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%);
  }
}

.welcome-logo {
  width: 200px;
  height: 200px;
  margin: 0 auto 30px;
  display: block;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
  animation: logoFloat 3s ease-in-out infinite;
}

@keyframes logoFloat {
  0%,
  100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-10px);
  }
}

.welcome-title {
  font-size: clamp(24px, 4vw, 32px);
  font-weight: 600;
  color: #ffffff;
  margin-bottom: 20px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  letter-spacing: 0.5px;
}

.welcome-subtitle {
  font-size: clamp(16px, 2.5vw, 18px);
  color: #cccccc;
  margin-bottom: 40px;
  line-height: 1.6;
  font-weight: 300;
}

.welcome-button {
  background: linear-gradient(135deg, #04aa6d 0%, #059669 100%);
  color: white;
  border: none;
  border-radius: 12px;
  padding: 16px 32px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(4, 170, 109, 0.3);
  text-transform: uppercase;
  letter-spacing: 1px;
  position: relative;
  overflow: hidden;
}

.welcome-button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s;
}

.welcome-button:hover {
  cursor: pointer;
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(4, 170, 109, 0.4);
  background: linear-gradient(135deg, #059669 0%, #04aa6d 100%);
  border: solid 1px white;
  border-radius: 12px;
}

.welcome-button:hover::before {
  left: 100%;
}

.welcome-button:active {
  transform: translateY(0);
  box-shadow: 0 4px 15px rgba(4, 170, 109, 0.3);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .welcome-container {
    width: 95vw;
    padding: 30px 20px;
  }

  .welcome-logo {
    width: 100px;
    height: 100px;
    margin-bottom: 25px;
  }

  .welcome-title {
    margin-bottom: 15px;
  }

  .welcome-subtitle {
    margin-bottom: 30px;
  }

  .welcome-button {
    padding: 14px 28px;
    font-size: 14px;
  }
}

@media (max-width: 480px) {
  .welcome-container {
    width: 98vw;
    padding: 25px 15px;
  }

  .welcome-logo {
    width: 80px;
    height: 80px;
    margin-bottom: 20px;
  }

  .welcome-button {
    padding: 12px 24px;
    font-size: 13px;
  }
}

/* About Dialog Styles */
.about-dialog {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  display: none;
  z-index: 2000;
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.8) 0%, rgba(40, 40, 40, 0.9) 100%);
  backdrop-filter: blur(10px);
  animation: fadeIn 0.3s ease-out;
}

.about-container {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(90vw, 700px);
  max-width: 700px;
  min-width: 320px;
  max-height: 90vh;
  overflow-y: auto;
  background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.1);
  animation: slideInUp 0.4s ease-out 0.1s both;
}

.about-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 30px 40px 20px 40px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  position: relative;
}

.about-logo {
  width: 60px;
  height: 60px;
  margin-right: 20px;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.about-title {
  font-size: 28px;
  font-weight: 600;
  color: #ffffff;
  margin: 0;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  letter-spacing: 0.5px;
  flex-grow: 1;
}

.about-version {
  font-size: 12px;
  color: #ffffff;
  text-align: center;
  margin-bottom: 10px;
}

.about-close-btn {
  cursor: pointer;
  font-weight: 300;
  font-size: 24px;
  color: rgba(255, 255, 255, 0.8);
  transition: all 0.2s ease;
  user-select: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  backdrop-filter: blur(5px);
}

.about-close-btn:hover {
  color: white;
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.1);
}

.about-close-btn:active {
  transform: scale(0.95);
}

.about-content {
  padding: 30px 40px 40px 40px;
  color: #ffffff;
  line-height: 1.6;
}

.about-description {
  font-size: 16px;
  color: #cccccc;
  margin-bottom: 30px;
  text-align: justify;
}

.about-features {
  margin-bottom: 30px;
}

.about-features h3 {
  font-size: 20px;
  font-weight: 600;
  color: #ffffff;
  margin-bottom: 15px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.about-features ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.about-features li {
  padding: 8px 0;
  color: #cccccc;
  position: relative;
  padding-left: 25px;
}

.about-features li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: #04aa6d;
  font-weight: bold;
  font-size: 16px;
}

.about-technologies {
  margin-bottom: 30px;
}

.about-technologies h3 {
  font-size: 20px;
  font-weight: 600;
  color: #ffffff;
  margin-bottom: 15px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.about-technologies p {
  color: #cccccc;
  font-size: 16px;
}

.about-links {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.about-link {
  display: flex;
  align-items: center;
  padding: 15px 20px;
  background: linear-gradient(135deg, rgba(4, 170, 109, 0.1) 0%, rgba(5, 150, 105, 0.1) 100%);
  border: 1px solid rgba(4, 170, 109, 0.3);
  border-radius: 12px;
  color: #04aa6d;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.3s ease;
  backdrop-filter: blur(5px);
}

.about-link:hover {
  background: linear-gradient(135deg, rgba(4, 170, 109, 0.2) 0%, rgba(5, 150, 105, 0.2) 100%);
  border-color: rgba(4, 170, 109, 0.5);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(4, 170, 109, 0.2);
}

.about-link:active {
  transform: translateY(0);
}

.about-link-icon {
  font-size: 20px;
  margin-right: 12px;
  display: inline-block;
}

/* Generic dialog styles */
.dialog-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  display: none;
  z-index: 2000;
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.8) 0%, rgba(40, 40, 40, 0.9) 100%);
  backdrop-filter: blur(10px);
  animation: fadeIn 0.3s ease-out;
}

.dialog-container {
  color: #ffffff;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(90vw, 400px);
  max-height: 90vh;
  overflow-y: auto;
  background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.1);
  animation: slideInUp 0.4s ease-out 0.1s both;
}

.dialog-content {
  padding: 30px 40px 40px 40px;
  color: #ffffff;
  line-height: 1.6;
}

/* Responsive adjustments for about dialog */
@media (max-width: 768px) {
  .about-container {
    width: 95vw;
    padding: 0;
  }

  .about-header {
    padding: 25px 25px 15px 25px;
  }

  .about-logo {
    width: 50px;
    height: 50px;
    margin-right: 15px;
  }

  .about-title {
    font-size: 24px;
  }

  .about-content {
    padding: 25px 25px 30px 25px;
  }

  .about-description {
    font-size: 15px;
  }

  .about-features h3,
  .about-technologies h3 {
    font-size: 18px;
  }

  .about-features li {
    font-size: 14px;
  }
}

@media (max-width: 480px) {
  .about-container {
    width: 98vw;
  }

  .about-header {
    padding: 20px 20px 15px 20px;
  }

  .about-logo {
    width: 40px;
    height: 40px;
    margin-right: 12px;
  }

  .about-title {
    font-size: 20px;
  }

  .about-content {
    padding: 20px 20px 25px 20px;
  }

  .about-link {
    padding: 12px 16px;
    font-size: 14px;
  }
}

#explorer-context-menu {
  position: absolute;
  z-index: 1001;
  color: azure;
  background: rgb(40, 40, 40);
  display: none;
}

#station-context-menu {
  position: absolute;
  z-index: 1000;
  color: azure;
  background: rgb(40, 40, 40);
  display: none;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  min-width: 150px;
  max-height: 80vh;
  overflow-y: auto;
}

#station-context-menu::-webkit-scrollbar {
  width: 6px;
}

#station-context-menu::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}

#station-context-menu::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.3);
  border-radius: 3px;
}

#station-context-menu::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.5);
}

#station-context-menu button {
  display: block;
  width: 100%;
  padding: 8px 12px;
  background: transparent;
  border: none;
  color: azure;
  text-align: left;
  cursor: pointer;
  font-size: 14px;
  transition: background-color 0.2s ease;
}

#station-context-menu button:hover {
  background: rgba(255, 255, 255, 0.1);
}

#station-context-menu button:first-child {
  border-radius: 4px 4px 0 0;
}

#station-context-menu button:last-child {
  border-radius: 0 0 4px 4px;
}

#station-context-menu button:only-child {
  border-radius: 4px;
}

#cycle-panel {
  width: 600px;
  position: absolute;
  top: 80px;
  left: 300px;
  text-align: center;
  z-index: 100;
  color: azure;
  background: rgb(40, 40, 40);
  display: none;
}

#fixed-size-editor {
  width: 700px;
  position: absolute;
  top: 80px;
  left: 300px;
  text-align: center;
  z-index: 100;
  color: azure;
  background: rgb(40, 40, 40);
  display: none;
}

#resizable-editor {
  position: absolute;
  top: 80px;
  left: 300px;
  text-align: left;
  z-index: 100;
  color: azure;
  background: rgb(40, 40, 40);
  display: none;
}

#export-panel {
  width: 300px;
  position: absolute;
  top: 80px;
  left: 300px;
  text-align: center;
  z-index: 100;
  color: azure;
  background: rgb(40, 40, 40);
  display: none;
}

#export-panel .popup-content div {
  padding: 10px;
}

#tool-panel {
  text-align: left;
  font-size: 12px;
  position: absolute;
  color: azure;
  background: #333;
  width: 260px;
  min-width: 200px;
  z-index: 100;
  display: none;
  top: 50px;
  left: 650px;
}

#tool-panel button {
  margin-top: 20px;
  text-align: center;
}

#tool-panel div {
  margin-bottom: 5px;
  text-align: center;
}

#tool-panel select {
  background: #333;
  color: azure;
  border-top-width: 0px;
  border-right-width: 0px;
  border-left-width: 0px;
  border-bottom-width: 2px;
  width: 160px;
  margin-left: 10px;
}

#tool-panel input.coord-input {
  width: 60px;
  margin-left: 5px;
  margin-right: 5px;
}

#tool-panel input.survey-input {
  width: 60px;
  margin-left: 5px;
  margin-right: 5px;
}

#tool-panel input[type='radio'] {
  margin-right: 5px;
}

#tool-panel label {
  margin-right: 10px;
}

.footer {
  position: relative;
  width: 100%;
  height: 25px;
  background: #333;
  color: azure;
  text-align: left;
  padding-left: 10px;
  padding-right: 10px;
  z-index: 100;
  font-family: inherit;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  overflow: hidden;
}

.footer .content {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  overflow: hidden;
}

.footer .meta-info {
  display: inline-flex;
  align-items: center;
  font-weight: 500;
  border-width: 0px;
  flex-shrink: 0;
  white-space: nowrap;
  height: 100%;
}

.footer .meta-info .meta-value {
  color: #ffffff;
  font-weight: 600;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.footer .footer-separator {
  display: inline-block;
  margin-left: 10px;
  margin-right: 10px;
  flex-shrink: 0;
}

.footer .footer-legal-links {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  margin-left: auto;
  padding-left: 10px;
  gap: 8px;
  order: 999;
}

.footer .footer-icon-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  opacity: 0.7;
  transition: opacity 0.2s ease;
}

.footer .footer-icon-link:hover {
  opacity: 1;
}

.footer .footer-icon {
  width: 16px;
  height: 16px;
  vertical-align: middle;
  filter: brightness(0) invert(1);
}

.google-drive-sync-indicator {
  display: inline-block;
  margin-left: -5px;
  flex-shrink: 0;
}

.google-drive-icon {
  width: 16px;
  height: 16px;
  vertical-align: middle;
  margin-bottom: 4px;
}

.google-drive-sync-indicator.blinking .google-drive-icon {
  animation: blink 1s infinite;
}

@keyframes blink {
  0%,
  50% {
    opacity: 1;
  }
  51%,
  100% {
    opacity: 0.3;
  }
}

.columns {
  display: flex;
  gap: 20px; /* Optional: space between columns */
}
.columns > div {
  flex: 1; /* Both columns take equal width */
}

.tabulator .tabulator-footer {
  color: white;
}

.tabulator {
  font-size: 12px;
}

.tabulator .add-row {
  height: 20px;
  width: 20px;
  margin-left: 5px;
  vertical-align: middle;
  display: inline-block;
  background: no-repeat center/70% url(../icons/add_white.svg);
}

.tabulator .delete-row {
  height: 20px;
  width: 20px;
  margin-left: 5px;
  vertical-align: middle;
  display: inline-block;
  background: no-repeat center/70% url(../icons/trash_white.svg);
}

.tabulator .delete-row:hover {
  background: no-repeat center/70% url(../icons/trash_red.svg);
}

.tabulator .warning-row {
  height: 20px;
  width: 20px;
  background: no-repeat center/70% url(../icons/warning.svg);
}

.tabulator .ok-row {
  height: 20px;
  width: 20px;
  background: no-repeat center/70% url(../icons/ok.svg);
}

.tabulator .center-row {
  height: 20px;
  width: 20px;
  background: no-repeat center/70% url(../icons/center.svg);
}

.tabulator .splay-row {
  height: 20px;
  width: 20px;
  background: no-repeat center/70% url(../icons/splay.svg);
}

.tabulator .auxiliary-row {
  height: 20px;
  width: 20px;
  background: no-repeat center/70% url(../icons/auxiliary.svg);
}

.tabulator input[type='color'] {
  display: none;
}

.tabulator input[type='color'] + label {
  height: 20px;
  width: 20px;
  border-radius: 20px;
  position: absolute;
  left: 10px;
}

.tabulator-editing[tabulator-field='attributes'] {
  overflow: visible;
}

.tabulator-editing[tabulator-field='attribute'] {
  overflow: visible;
}

/* Force Tabulator containers to allow overflow for the editor */
.tabulator .tabulator-cell.tabulator-editing {
  overflow: visible !important;
}

.tabulator .tabulator-row.tabulator-editing {
  overflow: visible !important;
}

/* there is no scrollbar in the table with this setting
.tabulator .tabulator-tableholder {
  overflow: visible !important;
} */

.tabulator .tabulator-cell .attributes-editor {
  font-size: 12px;
  position: absolute;
  z-index: 100;
  min-width: 300px;
  right: 0;
  top: 0;
  /* Add some offset to ensure it's not hidden behind other elements */
  margin-top: -5px;
  margin-right: 5px;
  background: rgb(40, 40, 40);
  border: 2px solid white;
  padding: 5px 25px 5px 5px; /* Add right padding to reserve space for close button */
  border-radius: 4px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  /* Ensure the editor is not clipped by parent containers */
  transform: translateZ(0);
}

.tabulator .tabulator-cell .attributes-editor .close-button {
  position: absolute;
  top: 5px;
  right: 5px;
  cursor: pointer;
  color: white;
  font-size: 16px;
  font-weight: bold;
  line-height: 1;
  padding: 2px 4px;
  border-radius: 2px;
  transition: background-color 0.2s;
  margin-left: 10px;
}

.tabulator .tabulator-cell .attributes-editor .close-button:hover {
  background-color: rgba(255, 255, 255, 0.2);
}

.tabulator .tabulator-cell .attributes-editor .delete-row {
  margin-left: 5px;
  margin-right: 5px; /* Add right margin to prevent overlap with close button */
  flex-shrink: 0; /* Prevent the delete button from shrinking */
}

.tabulator .tabulator-cell .attributes-editor input {
  outline: none;
  color: azure;
  background: rgb(40, 40, 40);
  text-align: center;
  display: inline-block;
}

.tabulator .tabulator-cell .attributes-editor input[type='text'] {
  border-top-width: 0px;
  border-right-width: 0px;
  border-left-width: 0px;
}

.tabulator .tabulator-cell .attributes-editor input[type='search'] {
  border-top-width: 0px;
  border-right-width: 0px;
  border-left-width: 0px;
}

.tabulator .tabulator-cell .attributes-editor .optionalInput {
  border-bottom: solid rgb(118, 118, 118) 2px;
}

.tabulator .tabulator-cell .attributes-editor .requiredInput {
  border-bottom: solid white 2px;
}

.tabulator .tabulator-cell .attributes-editor .invalidInput {
  border-bottom: solid red 2px;
}

.tabulator .tabulator-cell .attributes-editor .shortInput {
  width: 30px;
}

.tabulator .tabulator-cell .attributes-editor .longInput {
  width: 120px;
}

.tabulator .tabulator-cell .attributes-editor .mediumInput {
  width: 80px;
}

.tabulator .tabulator-cell .attributes-editor label {
  color: white;
  margin-right: 5px;
  white-space: nowrap;
  display: inline-block;
}

.tabulator .tabulator-cell .attribute-editor .warning {
  background: rgb(40, 40, 40);
  text-align: center;
  position: absolute;
  top: -40px;
  width: 150px;
  z-index: 102;
  display: none;
}

.tabulator-menu .delete-row {
  padding: 5px 10px;
  margin-right: 3px;
  position: relative;
  background: no-repeat center/80% url(../icons/trash_white.svg);
}

.tabulator-menu {
  color: azure;
  font-size: 12px;
  border-color: white;
}

.tabulator-menu .add-row {
  padding: 5px 10px;
  margin-right: 3px;
  position: relative;
  background: no-repeat center/80% url(../icons/add_white.svg);
}

.tabulator-menu .invert-row {
  padding: 5px 10px;
  margin-right: 3px;
  position: relative;
  background: no-repeat center/80% url(../icons/invert.svg);
}

.tabulator-menu .info-row {
  padding: 5px 10px;
  margin-right: 3px;
  position: relative;
  background: no-repeat center/70% url(../icons/info.svg);
}

.tabulator-menu .locate-station {
  padding: 5px 10px;
  margin-right: 3px;
  position: relative;
  background: no-repeat center/80% url(../icons/locate.svg);
}

.tabulator-menu .prefix-station {
  padding: 5px 10px;
  margin-right: 3px;
  position: relative;
  background: no-repeat center/80% url(../icons/edit_white.svg);
}

.tabulator-menu .show-row {
  padding: 5px 10px;
  margin-right: 3px;
  position: relative;
  background: no-repeat center/80% url(../icons/visible.svg);
}

.tabulator-menu .hide-row {
  padding: 5px 10px;
  margin-right: 3px;
  position: relative;
  background: no-repeat center/80% url(../icons/invisible.svg);
}

.tabulator-menu .propagate-row {
  padding: 5px 10px;
  margin-right: 3px;
  position: relative;
  background: no-repeat center/80% url(../icons/rotate.svg);
}

.cave-stats {
  margin-top: 15px;
  font-size: 12px;
  text-align: center;
}

.cave-stats span {
  margin-top: 5px;
  margin-left: 10px;
  white-space: nowrap;
  display: inline-block;
}

.cave-revision-info {
  font-size: 11px;
  margin-top: 5px;
  margin-bottom: 5px;
}

.cave-revision-info span {
  margin-left: 10px;
}

.editor {
  font-size: 12px;
}

.editor input {
  outline: none;
  color: azure;
  background: rgb(40, 40, 40);
  border-top-width: 0px;
  border-right-width: 0px;
  border-left-width: 0px;
  display: inline-block;
}

.editor input[type='text'] {
  width: 50%;
}

.editor input[type='number'] {
  width: 50%;
}

.editor input[type='date'] {
  width: 70%;
}

.editor label {
  color: white;
  margin-left: 30px;
  margin-right: 5px;
  margin-top: 10px;
  white-space: nowrap;
  display: inline-block;
}

.editor .medium-width {
  width: 200px;
}

.editor input[type='text'].large-width {
  width: 80%;
}

.editor .large-width {
  width: 400px;
}

/* Sheet editor form layout */
.sheet-editor-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 20px;
  margin-top: 20px;
}

.sheet-editor-column {
  flex: 1;
  min-width: 200px;
}

.sheet-editor-full-width {
  width: 100%;
  margin-top: 10px;
}

.sheet-editor-field {
  display: flex;
  align-items: center;
  margin-bottom: 10px;
}

.sheet-editor-label {
  min-width: 120px;
  font-weight: 500;
  margin-right: 10px;
  text-align: right;
  white-space: nowrap;
  display: inline-block;
}

.sheet-editor-field input {
  outline: none;
  color: azure;
  display: inline-block;
  padding: 4px 0px;
}

.sheet-editor-field label {
  margin-top: 0px; /* Remove the top margin from editor class input label */
  margin-left: 0px;
}

/* Make name input longer */
.sheet-editor-field input[name='name'] {
  min-width: 250px;
}

.sheet-editor-field input[name='creator'] {
  min-width: 250px;
}

.sheet-editor-field input[name='team'] {
  max-width: 250px;
}

.popup button {
  font-size: 12px;
  border: 1px solid #328e3a;
  background: linear-gradient(to bottom, #328e3a 0%, #5fc768 100%);
  color: azure;
  cursor: pointer;
  padding: 5px 10px;
  font-weight: bold;
  margin-bottom: 5px;
  transition:
    color 0.3s,
    background 0.3s,
    opacity,
    0.3s;
}

.popup button:hover {
  border: 1px solid #328e3a;
  background: linear-gradient(to bottom, #5fc768 0%, #328e3a 100%);
  color: #000;
}

.popup .close {
  cursor: default;
  right: 10px;
  top: 8px;
  height: 20px;
  width: 20px;
  padding-bottom: 0px;
  padding-left: 0px;
  padding-right: 0px;
  padding-top: 0px;
  position: absolute;
  background: no-repeat center/100% url(../icons/close.svg);
}

.popup .close:hover {
  transform: scale(1.1);
  background: no-repeat center/100% url(../icons/close_hover.svg);
}

.popup .minimize {
  cursor: default;
  right: 35px;
  top: 8px;
  height: 20px;
  width: 20px;
  padding-bottom: 0px;
  padding-left: 0px;
  padding-right: 0px;
  padding-top: 0px;
  position: absolute;
  background: no-repeat center/100% url(../icons/minimize.svg);
  transition: transform 0.3s ease;
}

.popup .minimize:hover {
  transform: scale(1.1);
}

.popup .minimize.minimized {
  background: no-repeat center/100% url(../icons/maximize.svg);
  transform: rotate(180deg);
}

.popup {
  z-index: 100;
  background-color: #f1f1f1;
  border: 2px solid #d3d3d3;
  border-radius: 11px;
  text-align: center;
  min-height: 250px;
  min-width: 300px;
  max-height: 90%;
  max-width: 90%;
}

#toogle-column-visibility-menu {
  left: 210px;
  top: 85px;
  min-height: 200px;
  height: 50%;
  position: absolute;
  z-index: 100;
  background-color: #f9f9f9;
  min-width: 160px;
  box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.2);
  text-align: left;
  color: black;
  font-size: 12px;
  display: none;
  overflow: auto;
}

#toogle-column-visibility-menu-element {
  padding: 2px 8px;
  cursor: pointer;
  display: block;
  text-align: left;
  color: black;
}

#toogle-column-visibility-menu-element:hover {
  background-color: #ddd;
}

/*Dragable */

.popup {
  position: absolute;
  overflow: hidden;
}

.popup-header {
  text-align: center;
  padding: 10px;
  cursor: move;
  z-index: 10;
  background-color: rgb(17, 17, 17);
  color: #fff;
}

/* Photo Preview Tooltip Styles */
.photo-attribute-cell {
  cursor: pointer;
  position: relative;
}

.photo-preview-tooltip {
  position: fixed;
  z-index: 10000;
  background: white;
  border: 2px solid #333;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  padding: 8px;
  max-width: 300px;
  max-height: 300px;
  pointer-events: none;
}

.photo-preview-content {
  position: relative;
  width: 100%;
  height: 100%;
}

.photo-preview-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100px;
  color: #666;
  font-style: italic;
}

.photo-preview-image {
  max-width: 100%;
  max-height: 280px;
  border-radius: 4px;
  object-fit: contain;
}

.popup-content {
  margin-bottom: 6px;
}

/*Resizeable*/

.popup .resizer-right {
  width: 6px;
  height: 100%;
  background: transparent;
  position: absolute;
  right: 0;
  bottom: 0;
  cursor: e-resize;
  z-index: 100;
}

.popup .resizer-bottom {
  width: 100%;
  height: 6px;
  background: transparent;
  position: absolute;
  right: 0;
  bottom: 0;
  cursor: s-resize;
  z-index: 100;
}

.popup .resizer-both {
  width: 10px;
  height: 10px;
  background: transparent;
  z-index: 100;
  position: absolute;
  right: 0;
  bottom: 0;
  cursor: se-resize;
}

/* Google Drive Settings Panel */
.google-drive-settings-panel {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 600px;
  max-width: 90vw;
  max-height: 80vh;
  background: #1e1e1e;
  border: 1px solid #404040;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  z-index: 1001;
  overflow: hidden;
}

.google-drive-settings-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  background: #2d2d2d;
  border-bottom: 1px solid #404040;
}

.google-drive-settings-header h3 {
  margin: 0;
  font-size: 18px;
  color: #ffffff;
  font-weight: 600;
}

.google-drive-close-button {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #cccccc;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.google-drive-close-button:hover {
  color: #ffffff;
  background: #404040;
}

.google-drive-settings-content {
  padding: 20px;
  max-height: calc(80vh - 80px);
  overflow-y: auto;
  background: #1e1e1e;
  color: azure;
}

.google-drive-settings-section {
  margin-bottom: 25px;
  border: 1px solid #333;
  border-radius: 6px;
  overflow: hidden;
}

.google-drive-settings-section h4 {
  margin: 0;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.9px;
  padding: 8px 12px;
  background: #2a2a2a;
  border-bottom: 1px solid #404040;
}

.google-drive-form-group {
  padding: 8px;
  background: #1e1e1e;
  display: flex;
  align-items: center;
  gap: 8px;
}

.google-drive-form-group:last-child {
  margin-bottom: 0;
}

.google-drive-form-group label {
  display: block;
  margin-bottom: 0;
  font-weight: 500;
  font-size: 11px;
  min-width: 100px;
  flex-shrink: 0;
}

.google-drive-form-group input[type='text'],
.google-drive-form-group input[type='password'] {
  flex: 1;
  padding: 6px 8px;
  background: #2d2d2d;
  border: 1px solid #404040;
  border-radius: 3px;
  font-size: 12px;
  box-sizing: border-box;
  min-width: 0;
  color: azure;
}

.google-drive-form-group input[type='text']:focus,
.google-drive-form-group input[type='password']:focus {
  outline: none;
  border-color: #04aa6d;
  box-shadow: 0 0 0 2px rgba(4, 170, 109, 0.2);
}

.google-drive-form-group input[type='checkbox'] {
  margin-right: 8px;
  scale: 0.9;
  flex-shrink: 0;
}

.google-drive-auth-status {
  padding: 10px;
}

.google-drive-auth-status p {
  margin: 0;
  font-size: 12px;
}

.google-drive-auth-status .success {
  color: #04aa6d;
}

.google-drive-auth-status .warning {
  color: #ffc107;
}

.google-drive-auth-status .error {
  color: #dc3545;
}

.google-drive-auth-buttons {
  display: flex;
  gap: 10px;
  padding: 8px;
  background: #1e1e1e;
}

.google-drive-auth-button {
  flex: 1;
  padding: 8px 12px;
  background: #2d2d2d;
  border: 1px solid #404040;
  border-radius: 4px;
  color: #ffffff;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.google-drive-auth-button:hover:not(:disabled) {
  background: #404040;
  border-color: #04aa6d;
}

.google-drive-auth-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  background: #6c757d;
  border-color: #6c757d;
}

.google-drive-sync-buttons {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin-bottom: 15px;
  padding: 8px;
  background: #1e1e1e;
}

.google-drive-sync-button {
  padding: 10px 16px;
  border: 1px solid #04aa6d;
  border-radius: 4px;
  background: #04aa6d;
  color: white;
  cursor: pointer;
  font-size: 12px;
  transition: all 0.2s ease;
}

.google-drive-sync-button:hover:not(:disabled) {
  background: #059669;
  border-color: #059669;
}

.google-drive-sync-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  background: #6c757d;
  border-color: #6c757d;
}

.google-drive-sync-status {
  padding: 10px;
  text-align: center;
}

.google-drive-sync-status p {
  margin: 0;
  font-size: 12px;
  color: #cccccc;
}

.google-drive-sync-status .loading {
  color: #04aa6d;
}
