/* Growing Beyond Earth Device Theme - Highlands Color Scheme */

/* Exo Regular */
@font-face {
  font-family: "Exo";
  src: url("/assets/fonts/exo-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* Exo Bold */
@font-face {
  font-family: "Exo";
  src: url("/assets/fonts/exo-700.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

body {
  background-color: #ffffff;
  color: #333333;
  font-family: 'Exo', sans-serif;
}

.main-container {
  background-color: #f1e9ff;
  max-width: 900px;
  margin: 40px auto;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 0 10px rgba(0,0,0,0.1);
}

.banner-image img {
  width: 100%;
  height: auto;
  display: block;
}

.banner-title,
.section-title {
  text-align: center;
  font-weight: bold;
  color: #55683c;
  padding: 0 20px;
  font-family: 'Exo', sans-serif;
}

.banner-title {
  font-size: clamp(1.3rem, 2.5vw, 2.5rem);
  margin: 20px 0 30px 0;
}

.section-title {
  font-size: 1.3rem;
  margin: 20px 0 10px 0;
}

/* Tabs */
.tab {
  display: flex;
  justify-content: center;
  border-bottom: 2px solid #55683c;
  margin: 0 20px;
}

.tab button {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 12px 20px;
  color: #333333;
  font-family: 'Exo', sans-serif;
  font-size: 1rem;
  border-top-left-radius: 10px;
  border-top-right-radius: 10px;
  transition: background-color 0.3s;
}

.tab button:hover {
  background-color: #dacfe2;
}

.tab button.active {
  border-bottom: 2px solid #55683c;
  font-weight: bold;
}

.tab-content {
  padding: 20px;
}

/* Info tab specific styling */
#about-gbe {
  margin-bottom: 20px;
}

#about-gbe h2 {
  color: #55683c;
  margin-top: 0;
}

#about-gbe p {
  line-height: 1.6;
  color: #333333;
}

#about-gbe a {
  color: #55683c;
  text-decoration: underline;
}

#about-gbe a:hover {
  color: #55683c;
}

/* Device info section */
h2 {
  color: #55683c;
  font-size: 1.4rem;
  margin: 25px 0 10px 0;
}

/* Resources list */
ul {
  list-style: none;
  padding-left: 0;
}

ul li {
  padding: 8px 0;
}

ul li a {
  color: #55683c;
  text-decoration: underline;
}

ul li a:hover {
  color: #55683c;
  text-decoration: underline;
}

/* Compact averages grid */
.average-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 20px;
  margin: 15px 0;
  font-size: 0.95rem;
}

.avg-item {
  padding: 6px 0;
}

.avg-label {
  font-weight: bold;
  color: #333333;
}

.avg-value {
  color: #333333;
}

/* Dropdown menu */
select#data-type {
  background-color: #dacfe2;
  color: #333333;
  border: 1px solid #55683c;
  padding: 6px 10px;
  border-radius: 4px;
  font-family: 'Exo', sans-serif;
  font-size: 1rem;
  margin-bottom: 10px;
}

/* Chart area */
#canvasContainer {
  width: 100%;
  height: 300px;
  margin: 0 auto;
  padding: 10px 0;
}

canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.section-spacer {
  height: 30px;
}

/* Program tab */
pre {
  background-color: #dacfe2;
  padding: 15px;
  border-radius: 6px;
  border: 1px solid #55683c;
  color: #333333;
  font-family: 'Courier New', monospace;
  overflow-x: auto;
  white-space: pre;
  font-size: 0.9rem;
  line-height: 1.4;
}

/* JSON syntax highlighting */
.json-key {
  color: #55683c;
  font-weight: bold;
}

.json-string {
  color: #8b4513;
}

.json-number {
  color: #0066cc;
}

.json-boolean {
  color: #cc0066;
  font-weight: bold;
}

.json-null {
  color: #999999;
  font-style: italic;
}

/* Form styling */
form {
  background-color: #dacfe2;
  padding: 20px;
  border-radius: 8px;
  border: 1px solid #55683c;
  margin-top: 20px;
}

input[type="file"] {
  background-color: #dacfe2;
  border: 1px solid #55683c;
  border-radius: 6px;
  padding: 8px 12px;
  color: #333333;
  font-family: 'Exo', sans-serif;
  margin-right: 10px;
}

button[type="submit"] {
  background-color: #dacfe2;
  border: 1px solid #55683c;
  color: #333333;
  padding: 10px 20px;
  border-radius: 4px;
  font-family: 'Exo', sans-serif;
  font-weight: bold;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

button[type="submit"]:hover {
  background-color: #c4b5d6;
}

/* Queued Program Notice */
.queued-expand-button {
  display: inline-block;
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 8px solid #28a745;
  margin-right: 8px;
  cursor: pointer;
  transition: transform 0.2s ease;
  vertical-align: middle;
}

.queued-expand-button.expanded {
  transform: rotate(180deg);
}

.queued-program-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.queued-program-content.expanded {
  max-height: 400px;
  overflow-y: auto;
  margin-top: 10px;
}

/* Program Form Fields */
.program-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px 20px;
  margin-bottom: 15px;
}

/* Program Action Buttons */
.program-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 30px;
}

.program-buttons button {
  background-color: #55683c;
  color: #f1e9ff;
  padding: 12px 16px;
  border: none;
  border-radius: 4px;
  font-family: 'Exo', sans-serif;
  font-weight: bold;
  cursor: pointer;
  font-size: 1rem;
  width: 100%;
  min-height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  transition: background-color 0.2s ease;
}

.program-buttons button:hover {
  background-color: #6d8450;
}

/* Download Section */
.download-section {
  background-color: #dacfe2;
  padding: 20px;
  border-radius: 8px;
  border: 1px solid #55683c;
  margin-top: 15px;
  display: flex;
  gap: 20px;
  align-items: center;
}

.gbe-download-button {
  display: inline-block;
  background-color: #55683c;
  color: #f1e9ff;
  text-decoration: none;
  padding: 12px 24px;
  border: none;
  border-radius: 4px;
  font-family: 'Exo', sans-serif;
  font-weight: bold;
  cursor: pointer;
  font-size: 1rem;
  transition: background-color 0.2s ease;
  text-align: center;
  white-space: nowrap;
}

.gbe-download-button:hover {
  background-color: #6d8450;
  color: #f1e9ff;
}

@media (max-width: 768px) {
  .download-section {
    flex-direction: column;
    align-items: stretch;
    gap: 15px;
  }
}

/* Upload Form Buttons */
.upload-form-buttons {
  display: none;
  gap: 10px;
  margin-top: 15px;
}

.upload-form-buttons.visible {
  display: flex;
}

.upload-form-button {
  background-color: #55683c !important;
  color: #f1e9ff !important;
  padding: 12px 24px;
  border: none;
  border-radius: 4px;
  font-family: 'Exo', sans-serif;
  font-weight: bold;
  cursor: pointer;
  font-size: 1rem;
  transition: background-color 0.2s ease;
  text-align: center;
  display: inline-block;
}

.upload-form-button:hover {
  background-color: #6d8450 !important;
}

.upload-clear-button {
  background-color: #55683c;
  color: #f1e9ff;
  padding: 12px 24px;
  border: none;
  border-radius: 4px;
  font-family: 'Exo', sans-serif;
  font-weight: bold;
  cursor: pointer;
  font-size: 1rem;
  transition: background-color 0.2s ease;
}

.upload-clear-button:hover {
  background-color: #6d8450;
}

/* Custom File Upload */
.custom-file-upload {
  display: inline-block;
  background-color: #55683c;
  color: #f1e9ff;
  padding: 12px 24px;
  border: none;
  border-radius: 4px;
  font-family: 'Exo', sans-serif;
  font-weight: bold;
  cursor: pointer;
  font-size: 1rem;
  transition: background-color 0.2s ease;
}

.custom-file-upload:hover {
  background-color: #6d8450;
}

.custom-file-upload.hidden {
  display: none;
}

#custom-program-file {
  display: none;
}

.file-name-display {
  margin-left: 15px;
  font-family: 'Exo', sans-serif;
  color: #555;
  font-style: italic;
}

/* Utility Classes */
.gbe-form {
  background-color: #dacfe2;
  padding: 20px;
  border-radius: 8px;
  border: 1px solid #55683c;
  margin-top: 15px;
}

.gbe-notice {
  background-color: #fff3cd;
  border: 1px solid #ffc107;
  border-radius: 4px;
  padding: 15px;
  margin-top: 15px;
}

.gbe-notice p {
  margin: 8px 0 0 0;
}

.gbe-notice a {
  font-weight: bold;
}

.gbe-notice-info {
  background-color: #f0f8ff;
  border-left: 4px solid #4a90e2;
  padding: 20px;
  margin: 20px 0;
}

.gbe-notice-success {
  background-color: #d4edda;
  border: 1px solid #28a745;
  border-radius: 4px;
  padding: 15px;
  margin: 20px 0;
}

.gbe-notice-error {
  background-color: #f8d7da;
  padding: 20px;
  border-radius: 8px;
  border: 1px solid #dc3545;
  margin-top: 15px;
}

.gbe-notice-location {
  background-color: #d1ecf1;
  border: 1px solid #17a2b8;
  border-radius: 4px;
  padding: 15px;
  margin-top: 20px;
}

.gbe-device-info {
  background-color: #dacfe2;
  padding: 20px;
  border-radius: 8px;
  border: 1px solid #55683c;
  margin-top: 15px;
}

/* Location Banner Components */
.location-banner-content {
  display: flex;
  justify-content: space-between;
  align-items: start;
}

.location-banner-text {
  flex: 1;
}

.location-banner-message {
  margin: 8px 0 12px 0;
}

.location-set-button {
  background-color: #17a2b8;
  color: white;
  padding: 8px 16px;
  border: none;
  border-radius: 4px;
  font-family: 'Exo', sans-serif;
  font-weight: bold;
  cursor: pointer;
  font-size: 0.9rem;
  transition: background-color 0.2s ease;
}

.location-set-button:hover {
  background-color: #138496;
}

.location-banner-dismiss {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: #17a2b8;
  cursor: pointer;
  padding: 0;
  margin-left: 15px;
}

/* Device Info Components */
.device-info-intro {
  margin-top: 0;
  margin-bottom: 15px;
}

.device-info-content {
  font-family: 'Exo', sans-serif;
}

.device-location-container {
  margin-top: 10px;
}

.update-location-button {
  background-color: #55683c;
  color: #f1e9ff;
  padding: 4px 10px;
  border: none;
  border-radius: 4px;
  font-family: 'Exo', sans-serif;
  font-size: 0.85rem;
  cursor: pointer;
  margin-left: 8px;
  transition: background-color 0.2s ease;
}

.update-location-button:hover {
  background-color: #6d8450;
}

/* Heading Variations */
.heading-top-margin {
  margin-top: 20px;
}

.heading-section-margin {
  margin-top: 40px;
}

.heading-program-margin {
  margin-top: 30px;
}

/* List Variations */
.resources-list {
  line-height: 1.8;
}

/* Text Utilities */
.timestamp-text {
  font-size: 0.75em;
  font-weight: normal;
  color: #666;
}

.program-note {
  margin-top: 8px;
  font-size: 0.85em;
  color: #555;
  font-style: italic;
}

.hidden {
  display: none;
}

.hidden-textarea {
  display: none;
}

/* Program Tab Components */
.queued-program-clickable {
  cursor: pointer;
}

.queued-program-pre {
  margin: 0;
  background-color: rgba(255,255,255,0.5);
  padding: 10px;
  border-radius: 4px;
}

.current-program-container {
  position: relative;
}

.copy-program-button {
  position: absolute;
  top: 10px;
  right: 10px;
  background-color: #55683c;
  color: #f1e9ff;
  padding: 6px 12px;
  border: none;
  border-radius: 4px;
  font-family: 'Exo', sans-serif;
  font-weight: bold;
  cursor: pointer;
  font-size: 0.9rem;
  z-index: 10;
  transition: background-color 0.2s ease;
}

.copy-program-button:hover {
  background-color: #6d8450;
}

.current-program-pre {
  max-height: 200px;
  overflow-y: auto;
  padding-top: 40px;
}

/* Program Form Specific Elements */
.program-buttons-single {
  grid-template-columns: 1fr;
}

/* Clock Setup Components */
.clock-setup-intro {
  margin-top: 0;
  margin-bottom: 12px;
}

.clock-setup-list {
  margin-top: 0;
  margin-bottom: 15px;
  padding-left: 20px;
}

.clock-setup-list-item {
  margin-bottom: 8px;
}

.download-clock-button {
  background-color: #55683c;
  color: #f1e9ff;
  padding: 12px 24px;
  border: none;
  border-radius: 4px;
  font-family: 'Exo', sans-serif;
  font-weight: bold;
  cursor: pointer;
  font-size: 1rem;
  transition: background-color 0.2s ease;
}

.download-clock-button:hover {
  background-color: #6d8450;
}

.file-upload-label {
  display: block;
  margin-bottom: 12px;
  font-weight: bold;
}

/* Form Elements */
.gbe-label {
  display: block;
  margin-bottom: 3px;
  font-weight: bold;
}

.gbe-label-inline {
  font-weight: bold;
  white-space: nowrap;
}

.gbe-helper-text {
  font-size: 0.85em;
  color: #555;
  margin-bottom: 5px;
}

.gbe-select {
  width: 100%;
  padding: 8px;
  border: 1px solid #55683c;
  border-radius: 4px;
  background-color: #f1e9ff;
  font-family: 'Exo', sans-serif;
}

.gbe-select-inline {
  padding: 12px;
  border: 1px solid #55683c;
  border-radius: 4px;
  background-color: #f1e9ff;
  font-family: 'Exo', sans-serif;
  font-size: 1rem;
}

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

.section-heading {
  margin-top: 40px;
}

/* Download List (Update Page) */
.download-list {
  list-style-type: none;
  padding-left: 0;
}

.download-list li {
  margin-bottom: 10px;
  display: flex;
  align-items: flex-start;
}

.download-list img {
  height: 64px;
  margin-right: 15px;
  flex-shrink: 0;
}

.download-content {
  display: flex;
  flex-direction: column;
}

.small-muted {
  font-size: 0.9em;
  opacity: 0.8;
  margin-top: 5px;
}

/* Dashboard Styles */
.dashboard-container {
  padding: 20px;
}

.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
}

.dashboard-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 15px;
  margin-bottom: 30px;
}

.stat-card {
  background-color: #dacfe2;
  padding: 20px;
  border-radius: 8px;
  border: 1px solid #55683c;
  text-align: center;
}

.stat-number {
  font-size: 2rem;
  font-weight: bold;
  color: #55683c;
  margin-bottom: 5px;
}

.stat-label {
  font-size: 0.9rem;
  color: #333333;
}

.device-table {
  width: 100%;
  border-collapse: collapse;
  background-color: white;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.device-table thead {
  background-color: #55683c;
  color: #f1e9ff;
}

.device-table th {
  padding: 15px;
  text-align: left;
  font-weight: bold;
  font-family: 'Exo', sans-serif;
}

.device-table td {
  padding: 12px 15px;
  border-bottom: 1px solid #e0e0e0;
}

.device-table tbody tr:hover {
  background-color: #f5f5f5;
  cursor: pointer;
}

.device-table tbody tr:last-child td {
  border-bottom: none;
}

.device-link {
  color: #55683c;
  text-decoration: none;
  font-weight: bold;
}

.device-link:hover {
  text-decoration: underline;
}

.status-indicator {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  margin-right: 8px;
}

.status-active {
  background-color: #28a745;
}

.status-recent {
  background-color: #ffc107;
}

.status-inactive {
  background-color: #fd7e14;
}

.status-offline {
  background-color: #6c757d;
}

.status-never {
  background-color: #dc3545;
}

.status-text {
  font-size: 0.9rem;
  color: #666;
}

.loading-spinner {
  text-align: center;
  padding: 40px;
  font-size: 1.2rem;
  color: #666;
}

.filter-bar {
  margin-bottom: 20px;
  display: flex;
  gap: 15px;
  align-items: center;
}

.filter-bar label {
  font-weight: bold;
  color: #55683c;
}

.filter-bar select,
.filter-bar input {
  padding: 8px 12px;
  border: 1px solid #55683c;
  border-radius: 4px;
  background-color: #f1e9ff;
  font-family: 'Exo', sans-serif;
}

/* Responsive design */
@media (max-width: 768px) {
  .main-container {
    margin: 0;
    border-radius: 0;
    min-height: 100vh;
  }

  .banner-title {
    font-size: 1.5rem;
    margin-bottom: 20px;
  }

  .tab-content {
    padding: 15px;
  }

  .average-box {
    min-width: 100px;
    padding: 12px 8px;
    font-size: 0.9rem;
  }

  #canvasContainer {
    height: 200px;
  }

  .program-fields {
    grid-template-columns: 1fr;
    gap: 15px;
  }

  .program-buttons {
    grid-template-columns: 1fr;
    gap: 15px;
  }

  .program-buttons button {
    min-height: 60px;
  }

  .download-list img {
    height: 48px;
  }
}

@media (max-width: 600px) {
  .download-list img {
    height: 48px;
  }
}

@media (max-width: 480px) {
  .average-row {
    flex-direction: column;
    align-items: center;
  }

  .average-box {
    width: 200px;
    max-width: 90%;
  }

  .tab button {
    padding: 8px 12px;
    font-size: 0.9rem;
  }

  .device-table {
    font-size: 0.85rem;
  }

  .device-table th,
  .device-table td {
    padding: 10px 8px;
  }

  .dashboard-stats {
    grid-template-columns: 1fr 1fr;
  }

  .filter-bar {
    flex-direction: column;
    align-items: stretch;
  }
}