* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: #121212;
  color: #eaeaea;
  line-height: 1.6;
}

.app-container {
  max-width: 600px;
  margin: 0 auto;
  padding: 20px;
}

/* View management */
.view {
  display: none;
}

.view.active {
  display: block;
}

header {
  text-align: center;
  margin-bottom: 20px;
}

h1 {
  color: #00b8ff;
  font-size: 2rem;
  margin-bottom: 10px;
}

.stats {
  display: flex;
  justify-content: space-between;
  background-color: #1e1e1e;
  border-radius: 8px;
  padding: 15px;
  margin-bottom: 20px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.distance, .next-milestone {
  font-size: 1.2rem;
}

.label {
  color: #00b8ff;
  font-weight: 500;
  margin-right: 5px;
}

.story-section, .config-section, .loading-section {
  background-color: #1e1e1e;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 20px;
  min-height: 150px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Loading spinner and animation */
.loading-section {
  text-align: center;
  padding: 40px 20px;
}

.loading-spinner {
  width: 60px;
  height: 60px;
  border: 6px solid rgba(0, 184, 255, 0.2);
  border-radius: 50%;
  border-top-color: #00b8ff;
  margin: 20px auto;
  animation: spin 1.5s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

#loading-message {
  font-size: 1.2rem;
  margin: 20px 0;
  color: #00b8ff;
}

.loading-info {
  color: #aaa;
  font-size: 0.9rem;
  max-width: 80%;
  margin: 0 auto;
}

.config-form {
  margin: 20px 0;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  color: #00b8ff;
  font-weight: 500;
}

.config-input {
  width: 100%;
  padding: 12px;
  border-radius: 6px;
  border: none;
  background-color: #262626;
  color: #eaeaea;
  font-size: 1rem;
  transition: all 0.3s ease;
}

.config-input:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(0, 184, 255, 0.5);
}

.story-section h2 {
  color: #00b8ff;
  margin-bottom: 15px;
  font-size: 1.5rem;
}

#story-text-container {
  background-color: #262626;
  border-radius: 6px;
  padding: 15px;
  margin-bottom: 15px;
  max-height: 200px;
  overflow-y: auto;
}

#current-story-text {
  color: #eaeaea;
  line-height: 1.5;
  font-size: 1rem;
}

#progress-bar {
  height: 8px;
  background-color: #333;
  border-radius: 4px;
  margin-top: 20px;
  overflow: hidden;
}

#progress {
  height: 100%;
  width: 0%;
  background-color: #00b8ff;
  transition: width 0.3s ease;
}

.controls {
  display: flex;
  justify-content: space-between;
  margin-bottom: 20px;
}

.btn {
  background-color: #00b8ff;
  color: #121212;
  border: none;
  border-radius: 8px;
  padding: 12px 25px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.3s ease;
  flex: 1;
  margin: 0 5px;
}

.btn:first-child {
  margin-left: 0;
}

.btn:last-child {
  margin-right: 0;
}

.btn:hover {
  background-color: #0095cc;
}

.btn:disabled {
  background-color: #555;
  cursor: not-allowed;
}

.btn-full {
  display: block;
  width: 100%;
  margin: 20px 0 10px;
}

.debug-controls {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
}

.debug-label {
  display: flex;
  align-items: center;
  cursor: pointer;
  color: #00b8ff;
}

.debug-label input[type="checkbox"] {
  margin-right: 8px;
}

.status {
  background-color: #1e1e1e;
  border-radius: 8px;
  padding: 15px;
  text-align: center;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

#status-message {
  margin-bottom: 10px;
}

#gps-status {
  font-size: 0.9rem;
  color: #aaa;
}

@media (max-width: 500px) {
  .stats {
    flex-direction: column;
  }
  
  .distance {
    margin-bottom: 10px;
  }
  
  .controls {
    flex-direction: column;
  }
  
  .btn {
    margin: 5px 0;
  }
}