body {
  margin: 0;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: #f7f9fb;
  color: #222;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #232946;
  color: #fff;
  padding: 0 32px;
  height: 70px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.topbar-logos {
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar-logo {
  width: 48px;
  height: 48px;
  background: #fff;
  border-radius: 8px;
  object-fit: contain;
  padding: 2px;
}

.topbar h1 {
  font-size: 1.5rem;
  margin: 0;
  letter-spacing: 1px;
  flex: 1;
  text-align: center;
}

.topbar-btn {
  background: #eebf63;
  color: #232946;
  border: none;
  border-radius: 8px;
  font-size: 1.1rem;
  font-weight: bold;
  cursor: pointer;
  padding: 10px 18px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar-btn:disabled {
  background: #bdbdbd;
  color: #fff;
  cursor: not-allowed;
}

.dashboard-main {
  padding: 24px 16px 0 16px;
  max-width: 1600px;
  margin: 0 auto;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-areas:
    "video viewer"
    "model viewer"
    "weather logs";
  gap: 24px;
}

#video { grid-area: video; }
#model { grid-area: model; }
#viewer-section { grid-area: viewer; }
#logs { grid-area: logs; }
#weather { grid-area: weather; }

.viewer-section {
  width: 90%;
  max-width: 90%;
  margin: 0 auto;
  grid-column: viewer;
  display: flex;
  flex-direction: column;
}

#viewer3d {
  width: 100%;
  max-width: 100%;
  height: 500px;
  margin-top: 10px;
  border: 1px solid #eaeaea;
  border-radius: 12px;
  box-sizing: border-box;
  box-shadow: 0 4px 15px rgba(0,0,0,0.09);
  background: #f7f7fa;
  padding: 0;
  overflow: hidden;
}

.card {
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 4px 18px rgba(0,0,0,0.07);
  padding: 24px 24px 18px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.card h3 {
  margin: 0 0 10px 0;
  font-size: 1.25rem;
  color: #232946;
  display: flex;
  align-items: center;
  gap: 10px;
}

form label {
  font-weight: 500;
  margin-top: 10px;
}

input[type="file"],
input[type="text"],
input[type="number"] {
  width: 100%;
  padding: 8px;
  margin-top: 5px;
  margin-bottom: 10px;
  border-radius: 6px;
  border: 1px solid #d1d5db;
  background: #f7f7fa;
  font-size: 1rem;
}

.btn-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}

button, .weather-btn {
  padding: 10px 18px;
  border: none;
  border-radius: 7px;
  background-color: #232946;
  color: #fff;
  font-size: 1rem;
  cursor: pointer;
  font-weight: 500;
  transition: background 0.2s;
  display: flex;
  align-items: center;
  gap: 8px;
}

button:disabled, .weather-btn:disabled {
  background: #bdbdbd;
  color: #fff;
  cursor: not-allowed;
}

button:hover:enabled, .weather-btn:hover:enabled {
  background: #eebf63;
  color: #232946;
}

#progressBarContainer {
  width: 100%;
  background-color: #eaeaea;
  margin-top: 10px;
  height: 18px;
  border-radius: 8px;
  overflow: hidden;
}

#progressBar {
  height: 100%;
  width: 0%;
  background-color: #eebf63;
  transition: width 0.3s ease;
}

#log {
  white-space: pre;
  background: #181818;
  color: #eebf63;
  padding: 1em;
  margin-top: 12px;
  height: 350px;
  overflow-y: auto;
  border-radius: 7px;
  font-size: 0.98em;
}

.cracks-list {
  margin-top: 18px;
  max-height: 180px;
  overflow-y: auto;
  background: #f7f7fa;
  padding: 14px 14px 10px 14px;
  border-radius: 10px;
  font-size: 1.01em;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  border: 1px solid #eaeaea;
}

.cracks-list p {
  margin: 0 0 8px 0;
  font-weight: 500;
  color: #232946;
}

.cracks-list details {
  margin: 0;
}

.cracks-list summary {
  font-weight: 600;
  cursor: pointer;
  color: #232946;
  margin-bottom: 6px;
}

.cracks-list ul {
  list-style-type: none;
  padding-left: 0;
  margin: 0;
}

.cracks-list li {
  cursor: pointer;
  padding: 7px 6px;
  border-radius: 6px;
  margin-bottom: 4px;
  color: #232946;
  background: #eaeaea;
  transition: background 0.15s, color 0.15s;
  border: none;
}

.cracks-list li:hover {
  background-color: #eebf63;
  color: #232946;
  font-weight: 600;
  text-decoration: underline;
}

#weatherEventsModal {
  display: none;
  position: fixed;
  top: 12%;
  left: 50%;
  transform: translateX(-50%);
  background: #fff;
  border: 1px solid #eebf63;
  padding: 24px 20px;
  z-index: 1000;
  max-width: 400px;
  box-shadow: 0 2px 18px rgba(0,0,0,0.13);
  border-radius: 12px;
}

#weatherEventsModal h4 {
  margin-top: 0;
}

#weatherEventsModal form label {
  margin-top: 10px;
}

#weatherEventsModal form input {
  width: 100%;
  padding: 7px;
  box-sizing: border-box;
  border-radius: 6px;
  border: 1px solid #d1d5db;
  background: #f7f7fa;
}

#weatherEventsList {
  margin-top: 15px;
  max-height: 200px;
  overflow-y: auto;
  border-top: 1px solid #eebf63;
  padding-top: 10px;
}

#videoDurationSliderContainer {
  position: relative;
  width: 100%;
  height: 40px;
  margin-bottom: 10px;
}

#videoDurationSliderContainer input[type=range] {
  position: absolute;
  pointer-events: none;
  -webkit-appearance: none;
  width: 100%;
  height: 8px;
  border-radius: 5px;
  background: transparent;
  margin: 0;
  padding: 0;
}

#videoDurationSliderContainer input[type=range]::-webkit-slider-thumb {
  pointer-events: auto;
  position: relative;
  z-index: 1;
  -webkit-appearance: none;
  height: 20px;
  width: 20px;
  border-radius: 50%;
  background: #eebf63;
  cursor: pointer;
  margin-top: -6px;
  box-shadow: 0 0 2px 0 rgba(0, 0, 0, 0.5);
}

#videoDurationSliderContainer input[type=range]::-moz-range-thumb {
  pointer-events: auto;
  position: relative;
  z-index: 1;
  height: 20px;
  width: 20px;
  border-radius: 50%;
  background: #eebf63;
  cursor: pointer;
  box-shadow: 0 0 2px 0 rgba(0, 0, 0, 0.5);
}

#sliderTrack {
  position: absolute;
  height: 8px;
  border-radius: 5px;
  background: #eaeaea;
  top: 50%;
  transform: translateY(-50%);
  width: 100%;
  z-index: 0;
}

#sliderRange {
  position: absolute;
  height: 8px;
  border-radius: 5px;
  background: #eebf63;
  top: 50%;
  transform: translateY(-50%);
  z-index: 0;
}

#timeDisplays {
  display: flex;
  justify-content: space-between;
  font-weight: bold;
}

#map {
  height: 400px;
  width: 100%;
  margin-top: 10px;
  border-radius: 8px;
  border: 1px solid #eaeaea;
  box-shadow: 0 2px 8px rgba(0,0,0,0.07);
}

@media (max-width: 1100px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
    grid-template-areas:
      "video"
      "model"
      "viewer"
      "logs"
      "weather";
    gap: 18px;
  }
  .dashboard-main {
    padding: 10px 2vw 0 2vw;
  }
  .viewer-section {
    margin-top: 18px;
  }
  #viewer3d {
    height: 320px;
    max-width: 100%;
  }
}

