*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #000000;
  color: #ffffff;
  min-height: 100vh;
}

/* Container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem;
  background: #000000;
  min-height: 100vh;
}

/* Header */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}

header h1 {
  margin: 0;
  color: #FF6B35;
  font-size: 1.5rem;
  font-weight: 700;
}

nav {
  display: flex;
  gap: 0.5rem;
}

/* Buttons */
.btn {
  border: none;
  border-radius: 0.5rem;
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-decoration: none;
  display: inline-block;
  text-align: center;
}

.btn:active {
  transform: translateY(1px) scale(0.98);
}

.btn-primary {
  background: linear-gradient(135deg, #FF6B35, #FF8C42);
  color: #000000;
  box-shadow: 0 2px 8px rgba(255, 107, 53, 0.4);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #FF8C42, #FF6B35);
  box-shadow: 0 4px 12px rgba(255, 107, 53, 0.5);
  transform: translateY(-1px);
}

.btn-secondary {
  background: #1a1a1a;
  color: #FF8C42;
  border: 1px solid rgba(255, 107, 53, 0.3);
}

.btn-secondary:hover {
  background: rgba(255, 107, 53, 0.1);
  border-color: rgba(255, 107, 53, 0.5);
}

.btn-small {
  padding: 0.4rem 0.75rem;
  font-size: 0.8rem;
}

/* Dashboard Container */
.dashboard-container {
  min-height: 100vh;
  padding: 0.75rem;
  background: #000000;
}

.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.dashboard-header h2 {
  color: #FF6B35;
  font-size: 1.3rem;
  font-weight: 700;
  margin: 0;
}

.total-kilometers {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: rgba(255, 107, 53, 0.1);
  border-radius: 0.5rem;
  border: 1px solid rgba(255, 107, 53, 0.2);
}

.total-km-label {
  font-size: 0.85rem;
  color: #FF8C42;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.total-km-value {
  font-size: 1.1rem;
  color: #FF6B35;
  font-weight: 700;
  font-family: monospace;
}

/* Results Cards - Kompakter */
.results-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

@media (max-width: 900px) {
  .results-container {
    grid-template-columns: 1fr;
  }
}

.result-card {
  background: #000000;
  border-radius: 0.75rem;
  padding: 1rem;
  border: 1px solid rgba(255, 107, 53, 0.2);
  box-shadow: 0 4px 16px rgba(255, 107, 53, 0.1);
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.result-card:hover {
  box-shadow: 0 6px 24px rgba(255, 107, 53, 0.15);
  border-color: rgba(255, 107, 53, 0.3);
}

.result-label {
  font-size: 0.75rem;
  color: #FF8C42;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 600;
  margin: 0;
}

.result-value {
  font-size: 2rem;
  font-weight: 700;
  color: #ffffff;
  font-family: monospace;
  margin: 0;
  line-height: 1.2;
}

.result-value.km-value {
  font-size: 1.75rem;
}

/* Rounds Container - Zeigt nur eine Runde */
.rounds-container {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.round-card {
  background: #1a1a1a;
  border-radius: 0.75rem;
  padding: 1rem;
  box-shadow: 0 4px 16px rgba(255, 107, 53, 0.1), 0 0 0 1px rgba(255, 107, 53, 0.1);
  border: 1px solid rgba(255, 107, 53, 0.2);
  transition: all 0.3s ease;
}

.round-card:hover {
  box-shadow: 0 6px 24px rgba(255, 107, 53, 0.15), 0 0 0 1px rgba(255, 107, 53, 0.2);
}

.round-card.active {
  border-color: rgba(255, 107, 53, 0.4);
  background: rgba(255, 107, 53, 0.05);
  box-shadow: 0 6px 24px rgba(255, 107, 53, 0.2), 0 0 0 1px rgba(255, 107, 53, 0.3);
}

/* "Mehr anzeigen" Button */
.load-more-container {
  display: flex;
  justify-content: center;
  margin-top: 1rem;
  margin-bottom: 1rem;
}

.load-more-btn {
  width: 100%;
  max-width: 300px;
}

.round-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.edit-btn {
  padding: 0.4rem 0.75rem;
  background: rgba(255, 107, 53, 0.2);
  border: 1px solid rgba(255, 107, 53, 0.3);
  border-radius: 0.5rem;
  color: #FF6B35;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.edit-btn:hover {
  background: rgba(255, 107, 53, 0.3);
  border-color: rgba(255, 107, 53, 0.5);
  transform: translateY(-1px);
}

/* Bearbeitungsformular */
.edit-mode {
  max-width: 600px;
  margin: 0 auto;
}

.edit-form-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(255, 107, 53, 0.2);
}

.edit-form-header h3 {
  margin: 0;
  color: #FF6B35;
  font-size: 1.2rem;
}

.cancel-edit-btn {
  padding: 0.4rem 0.75rem;
  background: rgba(107, 114, 128, 0.2);
  border: 1px solid rgba(107, 114, 128, 0.3);
  border-radius: 0.5rem;
  color: #94a3b8;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.cancel-edit-btn:hover {
  background: rgba(107, 114, 128, 0.3);
  transform: translateY(-1px);
}

.edit-round-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.edit-round-form .form-group {
  margin-bottom: 0;
}

.edit-round-form input[type="datetime-local"] {
  width: 100%;
  padding: 0.6rem 0.75rem;
  background: #000000;
  border: 1px solid rgba(255, 107, 53, 0.3);
  border-radius: 0.5rem;
  font-size: 0.9rem;
  color: #ffffff;
  transition: all 0.3s ease;
  font-family: inherit;
}

.edit-round-form input[type="datetime-local"]:focus {
  outline: none;
  border-color: #FF6B35;
  box-shadow: 0 0 0 2px rgba(255, 107, 53, 0.2);
}

.edit-round-form .time-input-group {
  display: flex;
  gap: 1rem;
  align-items: flex-end;
}

.edit-round-form .time-input-item {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
}

.edit-round-form .time-input-item input {
  width: 100%;
  padding: 0.6rem 0.75rem;
  background: #000000;
  border: 1px solid rgba(255, 107, 53, 0.3);
  border-radius: 0.5rem;
  font-size: 0.9rem;
  color: #ffffff;
  transition: all 0.3s ease;
  font-family: inherit;
}

.edit-round-form .time-input-item input:focus {
  outline: none;
  border-color: #FF6B35;
  box-shadow: 0 0 0 2px rgba(255, 107, 53, 0.2);
}

.edit-round-form .time-label {
  font-size: 0.75rem;
  color: #FF8C42;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

.round-name {
  font-size: 1rem;
  font-weight: 700;
  color: #FF6B35;
  margin: 0;
}

.round-date {
  font-size: 0.75rem;
  color: #FF8C42;
}

.round-notes {
  margin-top: 1rem;
  padding: 0.75rem;
  background: #000000;
  border-radius: 0.5rem;
  border: 1px solid rgba(255, 107, 53, 0.2);
}

.notes-label {
  font-size: 0.7rem;
  color: #FF8C42;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.notes-content {
  font-size: 0.85rem;
  color: #ffffff;
  line-height: 1.5;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.round-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
}

.stat-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.75rem;
  background: #000000;
  border-radius: 0.5rem;
  border: 1px solid rgba(255, 107, 53, 0.2);
  transition: all 0.2s ease;
  text-align: center;
}

.stat-item:hover {
  border-color: rgba(255, 107, 53, 0.4);
  box-shadow: 0 2px 8px rgba(255, 107, 53, 0.15);
  transform: translateY(-1px);
}

.stat-label {
  font-size: 0.65rem;
  color: #FF8C42;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 600;
}

.stat-value {
  font-size: 1.1rem;
  font-weight: 700;
  color: #ffffff;
  font-family: monospace;
}

.stat-value.time {
  color: #FF6B35;
}

/* Loading State */
.loading-state {
  text-align: center;
  padding: 2rem 1rem;
  background: #1a1a1a;
  border-radius: 0.75rem;
  box-shadow: 0 4px 16px rgba(255, 107, 53, 0.1);
  border: 1px solid rgba(255, 107, 53, 0.2);
}

.loading-state p {
  font-size: 1rem;
  color: #FF8C42;
  margin: 0;
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

/* No Rounds */
.no-rounds {
  text-align: center;
  padding: 2rem 1rem;
  background: #1a1a1a;
  border-radius: 0.75rem;
  box-shadow: 0 4px 16px rgba(255, 107, 53, 0.1);
  border: 1px solid rgba(255, 107, 53, 0.2);
}

.no-rounds p {
  font-size: 1rem;
  color: #FF8C42;
  margin-bottom: 1rem;
}

/* Navigation - Kompakter */
.navigation {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem;
  background: #1a1a1a;
  border-radius: 0.75rem;
  box-shadow: 0 4px 16px rgba(255, 107, 53, 0.1);
  border: 1px solid rgba(255, 107, 53, 0.2);
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.nav-btn {
  padding: 0.5rem 1rem;
  background: linear-gradient(135deg, #FF6B35, #FF8C42);
  color: #000000;
  border: none;
  border-radius: 0.5rem;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  box-shadow: 0 2px 8px rgba(255, 107, 53, 0.4);
}

.nav-btn:hover:not(:disabled) {
  background: linear-gradient(135deg, #FF8C42, #FF6B35);
  box-shadow: 0 4px 12px rgba(255, 107, 53, 0.5);
  transform: translateY(-1px);
}

.nav-btn:disabled {
  background: #1a1a1a;
  color: #666;
  cursor: not-allowed;
  opacity: 0.5;
  box-shadow: none;
}

.round-counter {
  font-size: 0.9rem;
  font-weight: 600;
  color: #FF8C42;
}

/* iFrame Container - Responsive */
.iframe-container {
  position: relative;
  width: 100%;
  max-width: 100%;
  height: 80vh; /* Responsive Höhe basierend auf Viewport */
  min-height: 500px;
  max-height: 900px;
  border-radius: 0.75rem;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(255, 107, 53, 0.1);
  border: 1px solid rgba(255, 107, 53, 0.2);
  background: #1a1a1a;
}

iframe {
  width: 100%;
  height: 100%;
  border: none;
  background: #000000;
  display: block;
}

/* Form Styles */
.form-container {
  max-width: 600px;
  margin: 0 auto;
  background: #1a1a1a;
  padding: 1.5rem;
  border-radius: 0.75rem;
  box-shadow: 0 4px 16px rgba(255, 107, 53, 0.1), 0 0 0 1px rgba(255, 107, 53, 0.1);
  border: 1px solid rgba(255, 107, 53, 0.2);
}

.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.4rem;
  font-weight: 600;
  color: #FF8C42;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.form-group input {
  width: 100%;
  padding: 0.6rem 0.75rem;
  background: #000000;
  border: 1px solid rgba(255, 107, 53, 0.3);
  border-radius: 0.5rem;
  font-size: 0.9rem;
  color: #ffffff;
  transition: all 0.3s ease;
  font-family: inherit;
}

.form-group input:focus {
  outline: none;
  border-color: #FF6B35;
  box-shadow: 0 0 0 2px rgba(255, 107, 53, 0.2);
}

.form-group input::placeholder {
  color: #666;
}

.form-group textarea {
  width: 100%;
  padding: 0.6rem 0.75rem;
  background: #000000;
  border: 1px solid rgba(255, 107, 53, 0.3);
  border-radius: 0.5rem;
  font-size: 0.9rem;
  color: #ffffff;
  transition: all 0.3s ease;
  font-family: inherit;
  resize: vertical;
  min-height: 60px;
}

.form-group textarea:focus {
  outline: none;
  border-color: #FF6B35;
  box-shadow: 0 0 0 2px rgba(255, 107, 53, 0.2);
}

.form-group textarea::placeholder {
  color: #666;
}

/* Zeit-Eingabe Gruppe */
.time-input-group {
  display: flex;
  gap: 1rem;
  align-items: flex-end;
}

.time-input-item {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  flex: 1;
}

.time-input-item input {
  width: 100%;
  padding: 0.6rem 0.75rem;
  background: #000000;
  border: 1px solid rgba(255, 107, 53, 0.3);
  border-radius: 0.5rem;
  font-size: 0.9rem;
  color: #ffffff;
  transition: all 0.3s ease;
  font-family: inherit;
  text-align: center;
}

.time-input-item input:focus {
  outline: none;
  border-color: #FF6B35;
  box-shadow: 0 0 0 2px rgba(255, 107, 53, 0.2);
}

.time-label {
  font-size: 0.75rem;
  color: #FF8C42;
  text-align: center;
  font-weight: 500;
}

.form-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}

.success-message {
  max-width: 600px;
  margin: 1.5rem auto;
  background: #1a1a1a;
  padding: 1.5rem;
  border-radius: 0.75rem;
  box-shadow: 0 4px 16px rgba(255, 107, 53, 0.1);
  border: 1px solid rgba(255, 107, 53, 0.2);
  text-align: center;
}

.success-message p {
  font-size: 1.1rem;
  color: #FF6B35;
  margin-bottom: 1rem;
  font-weight: 600;
}

/* Footer */
footer {
  padding: 1rem;
  text-align: center;
  color: #666;
  font-size: 0.8rem;
  margin-top: 1rem;
}

/* Responsive Design */
/* Responsive Design für kleinere Bildschirme */
@media (max-width: 768px) {
  header {
    flex-direction: column;
    text-align: center;
  }
  
  header h1 {
    font-size: 1.3rem;
  }
  
  .iframe-container {
    height: 70vh;
    min-height: 400px;
    max-height: 800px;
  }
  
  .dashboard-header {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .round-stats {
    grid-template-columns: 1fr;
  }
  
  .navigation {
    flex-direction: column;
  }
  
  .form-container {
    padding: 1rem;
  }
  
  .result-value {
    font-size: 1.5rem;
  }
  
  .result-value.km-value {
    font-size: 1.25rem;
  }
}

/* Responsive Design für sehr kleine Bildschirme */
@media (max-width: 480px) {
  .iframe-container {
    height: 60vh;
    min-height: 350px;
    max-height: 600px;
    border-radius: 0.5rem;
  }
  
  .container {
    padding: 0.5rem;
  }
  
  header h1 {
    font-size: 1.2rem;
  }
}
