* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background: linear-gradient(135deg, #1e3a5f 0%, #2c5282 100%);
  color: #fff;
  min-height: 100vh;
  padding: 20px;
}

.container {
  max-width: 600px;
  margin: 0 auto;
}

header {
  text-align: center;
  margin-bottom: 30px;
}

header h1 {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 5px;
  color: #fff;
}

header h2 {
  font-size: 18px;
  font-weight: 400;
  color: #a0c4ff;
}

form {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.form-section {
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 2px solid rgba(255, 255, 255, 0.15);
}

.form-section:last-of-type {
  border-bottom: none;
  margin-bottom: 24px;
}

.section-title {
  font-size: 20px;
  font-weight: 600;
  color: #60a5fa;
  margin-bottom: 20px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(96, 165, 250, 0.3);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
  margin-bottom: 20px;
}

.form-group {
  margin-bottom: 20px;
}

.form-row .form-group {
  margin-bottom: 0;
}

label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 500;
  color: #e0e7ff;
}

input[type="date"],
input[type="time"],
input[type="number"],
input[type="text"],
select,
textarea {
  width: 100%;
  padding: 12px 14px;
  border: 2px solid rgba(255, 255, 255, 0.25);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 16px;
  font-family: inherit;
  transition: all 0.2s ease;
  -webkit-appearance: none;
  appearance: none;
}

input[type="date"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator {
  filter: invert(1);
  cursor: pointer;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: #60a5fa;
  background: rgba(255, 255, 255, 0.18);
  box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.1);
}

input::placeholder,
textarea::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

select {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23ffffff' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 12px;
  padding-right: 40px;
}

select option {
  background: #1e3a5f;
  color: #fff;
  padding: 8px;
}

textarea {
  resize: vertical;
  font-family: inherit;
  min-height: 100px;
}

.slots-container {
  margin-top: 20px;
}

.slots-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 0;
}

.slot-item {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  transition: all 0.3s ease;
}

.slot-item.deviated {
  border-color: #ef4444;
  background: rgba(239, 68, 68, 0.2);
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.2);
}

.slot-item label {
  font-size: 11px;
  margin-bottom: 4px;
  color: #a0c4ff;
}

.slot-item input {
  font-size: 14px;
  padding: 10px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.1);
}

.slot-item input:focus {
  border-color: #60a5fa;
  background: rgba(255, 255, 255, 0.15);
}

.slot-initials {
  font-weight: 600;
  color: #60a5fa;
  margin-bottom: 4px;
  font-size: 14px;
}

.btn {
  width: 100%;
  padding: 16px;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-top: 10px;
}

.btn-primary {
  background: #3b82f6;
  color: #fff;
}

.btn-primary:hover {
  background: #2563eb;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.btn-primary:active {
  transform: translateY(0);
}

.error {
  background: rgba(239, 68, 68, 0.2);
  border: 2px solid #ef4444;
  border-radius: 8px;
  padding: 12px;
  margin-top: 20px;
  color: #fff;
}

.loading {
  text-align: center;
  padding: 20px;
  font-size: 18px;
  color: #a0c4ff;
}

/* Mobile Optimierungen */
@media (max-width: 480px) {
  body {
    padding: 10px;
  }

  header h1 {
    font-size: 24px;
  }

  form {
    padding: 20px;
  }

  .form-row {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .slots-grid {
    grid-template-columns: 1fr;
  }

  input[type="date"],
  input[type="time"],
  input[type="number"],
  input[type="text"],
  select,
  textarea {
    font-size: 16px; /* Verhindert Zoom auf iOS */
  }
}

/* Modal für Vorschau */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  overflow: auto;
  animation: fadeIn 0.3s;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-content {
  position: relative;
  margin: 2% auto;
  padding: 0;
  width: 90%;
  max-width: 600px;
  background-color: transparent;
  animation: slideDown 0.3s;
}

@keyframes slideDown {
  from {
    transform: translateY(-50px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.modal-close {
  position: absolute;
  top: -40px;
  right: 0;
  color: #fff;
  font-size: 40px;
  font-weight: bold;
  cursor: pointer;
  z-index: 1001;
  line-height: 1;
  transition: color 0.2s;
}

.modal-close:hover,
.modal-close:focus {
  color: #60a5fa;
}

#previewImageContainer {
  width: 100%;
  text-align: center;
  background: transparent;
}

#previewImageContainer img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  cursor: pointer;
  transition: transform 0.2s;
}

#previewImageContainer img:hover {
  transform: scale(1.02);
}

@media (max-width: 768px) {
  .modal-content {
    width: 95%;
    margin: 5% auto;
  }
  
  .modal-close {
    top: -35px;
    font-size: 35px;
  }
}
