body {
  font-family: Arial, sans-serif;
  text-align: center;
}

.weekend {
  position: relative;
}

.weekend::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: repeating-linear-gradient(45deg, rgba(255, 168, 0, 0.1), rgba(255, 168, 0, 0.1) 5px, rgba(255, 168, 0, 0.05) 5px, rgba(255, 168, 0, 0.05) 10px);
  pointer-events: none;
  border-radius: 5px;
  z-index: 1;
}

.holiday {
  position: relative;
}

.holiday::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: repeating-linear-gradient(45deg, rgba(255, 96, 0, 0.15), rgba(255, 96, 0, 0.15) 5px, rgba(255, 96, 0, 0.08) 5px, rgba(255, 96, 0, 0.08) 10px);
  pointer-events: none;
  border-radius: 5px;
  z-index: 1;
}

.day-details-popup {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: white;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  z-index: 1000;
  min-width: 250px;
  max-width: 90%;
}

.popup-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 15px;
  border-bottom: 1px solid #eee;
}

.popup-header h3 {
  margin: 0;
  font-size: 18px;
}

.close-popup {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #666;
}

.popup-content {
  padding: 15px;
}

.checkbox-setting {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
}

.checkbox-setting input[type="checkbox"] {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  margin: 0;
}

.checkbox-setting label {
  cursor: pointer;
}

.field-label {
  display: block;
  margin-bottom: 5px;
  font-size: 14px;
  color: #555;
}

#stateSelector {
  margin: 5px 0 15px;
}

#stateSelector select {
  min-height: 44px;
  padding: 8px;
  border: 1px solid #ccc;
  border-radius: 8px;
  background-color: #fff;
}

.copyright {
  font-size: 12px;
  color: #666;
  text-align: center;
  margin-top: 5px;
  margin-bottom: 5px;
  font-style: italic;
}

#settings {
  text-align: left;
  margin: 0;
  background-color: #fafafa;
}

.settings-page {
  max-width: 34rem;
  margin: 0 auto;
  padding: 0 12px;
}

/* Gemeinsame Karten-Optik aller Einstellungs-Abschnitte */
.card {
  margin-bottom: 16px;
  padding: 15px;
  background-color: #fff;
  border: 1px solid #e2e2e2;
  border-radius: 10px;
}

.card h3 {
  margin-top: 0;
  margin-bottom: 10px;
}

#defaults {
  padding-bottom: 20px;
}

#defaults input[type="submit"] {
  width: 100%;
  min-height: 44px;
  font-size: 15px;
  background-color: transparent;
  color: #555;
  border: 1px solid #bbb;
  border-radius: 8px;
  cursor: pointer;
}

/* Speichern bleibt beim Scrollen erreichbar */
#speichern {
  position: sticky;
  bottom: 0;
  padding-top: 12px;
  padding-bottom: max(12px, env(safe-area-inset-bottom));
  background-color: #fafafa;
  border-top: 1px solid #e2e2e2;
}

#speichern input[type="submit"] {
  width: 100%;
  font-size: 18px;
  font-weight: bold;
  min-height: 48px;
  padding: 12px 20px;
  background-color: #080ff3;
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
}

.framed-title {
  border: 2px solid #333;
  padding: 10px 20px;
  margin: 0 auto;
  width: 100%;
  font-size: 24px;
  font-weight: bold;
  max-width: 100%;
  background: #080ff3;
  color: #fff;
  font-family: 'Arial', sans-serif;
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.title-text {
  flex-grow: 1;
  text-align: center;
}

.settings-icon {
  font-size: 24px;
  margin: 0;
  cursor: pointer;
}

/* Zurueck-Knopf in der Kopfleiste der Einstellungen */
.icon-btn,
.icon-btn-spacer {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
}

.icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  line-height: 1;
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
}

.settings {
  display: none; /* Verstecken, da wir das Icon jetzt in der Titelleiste haben */
}

.calendar-container {
  max-width: 100%;
  margin: 0 auto;
  margin-top: 0.5rem; /* Kleinerer Abstand nach oben */
  margin-bottom: 0px;
}

.calendar-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0;
  width: 100%;
}

.calendar-header button {
  flex-grow: 1;
  flex-basis: 100px;
  margin-right: 10px;
  margin-left: 10px;
  width: 60px;
  height: 60px;
  font-size: 24px;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.5rem;
  transition: transform 0.5s ease-out;
}

* {
  box-sizing: border-box;
}

.day {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background-color: #f2f2f2;
  border-radius: 5px;
  cursor: pointer;
  padding: 0;
  margin: 0.1rem;
}

.day-number {
  padding: 0.4rem;
  padding-bottom: 0.6rem;
  font-size: 1.4rem;
  flex-grow: 1;
}

.day-info {
  background-color: #4CAF50;
  color: white;
  padding: 0.1rem;
  border-radius: 0 0 5px 5px;
  margin: 0;
  font-size: 0.8rem;
  width: 100%;
}

.day-label {
  height: 30px;
  align-items: center;
  justify-content: center;
  display: flex;
  padding: 0.5rem;
}

h2 {
  font-size: 30px;
  margin-top: 8px; /* Kleinerer Abstand nach dem Copyright */
  margin-bottom: 8px;
}

.calendar-header #today {
  font-size: 12px;
}

/* Nur Freitext-Felder sollen die volle Breite einnehmen — Checkboxen und
   Buttons behalten ihre natürliche Groesse. */
input[type="text"],
input[type="number"],
textarea,
select {
  width: 100%;
  display: block;
}

input[type="checkbox"],
input[type="radio"] {
  width: auto;
  display: inline-block;
}

/* Schichtfarben: pro Schicht eine Zeile aus Kopf (Kuerzel + Text) und
   Farbwahl (Flaeche, Schrift, Vorschau). */
.shift-row {
  padding: 10px 0;
  border-top: 1px solid #ddd;
}

.shift-row:first-of-type {
  border-top: none;
}

.shift-row-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.shift-row-badge {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background-color: #fff;
  border: 1px solid #ccc;
  font-weight: bold;
}

.shift-row-colors {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.color-pick {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: #555;
}

.color-field {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 44px;
}

input[type="color"] {
  width: 44px;
  height: 44px;
  padding: 2px;
  border: 1px solid #ccc;
  border-radius: 8px;
  background-color: #fff;
  cursor: pointer;
}

.shift-setting-example {
  margin-left: auto;
  padding: 6px 12px;
  border-radius: 5px;
  font-weight: bold;
}

.using-defaults {
  background-color: red;
  color: rgb(242, 255, 0);
  padding: 5px 10px;
  border-radius: 5px;
  font-size: 14px;
  font-weight: bold;
  text-align: center;
  display: none;
  margin-bottom: 20px;
  width: 60%;
}

/* Profile-Navigation in der Hauptansicht */
.profile-navigation {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 10px 0; /* Weniger Abstand */
  padding: 10px;
  background-color: #f0f0f0;
  border-radius: 5px;
}

.profile-navigation button {
  font-size: 18px;
  padding: 5px 10px;
  margin: 0 10px;
  background-color: #007bff;
  color: white;
  border: none;
  border-radius: 3px;
  cursor: pointer;
}

.profile-navigation span {
  font-size: 16px;
  font-weight: bold;
  padding: 5px 15px;
  min-width: 100px;
}

/* Profile-Verwaltung in den Einstellungen */
.profile-selector {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 5px;
}

.profile-selector button {
  font-size: 16px;
  min-width: 44px;
  min-height: 44px;
  padding: 5px 10px;
  margin: 0 10px;
  background-color: #007bff;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
}

.profile-selector span {
  font-size: 16px;
  font-weight: bold;
  padding: 5px 15px;
  min-width: 100px;
}

.profile-actions {
  display: flex;
  justify-content: space-between;
  margin-bottom: 5px;
  flex-wrap: wrap;
  gap: 5px;
}

.profile-actions button {
  /* min-width verhindert, dass die Beschriftung schmaler gequetscht wird als
     ihr Text — bei zu wenig Platz bricht die Zeile stattdessen um. */
  flex: 1 1 auto;
  min-width: max-content;
  min-height: 44px;
  padding: 8px 10px;
  background-color: #28a745;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  white-space: normal;
}

.profile-actions button#rename-profile {
  background-color: #007bff;
}

.profile-actions button#delete-profile {
  background-color: #dc3545;
}

.profile-actions button:disabled {
  background-color: #6c757d;
  cursor: not-allowed;
}

/* Kein display hier setzen: settings.js schaltet diese Blöcke per
   style.display = 'block' sichtbar. */
.name-input {
  margin-top: 10px;
}

.name-input input {
  padding: 10px;
  min-height: 44px;
  border: 1px solid #ced4da;
  border-radius: 8px;
}

.name-input-buttons {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.name-input-buttons button {
  flex: 1 1 0;
  min-height: 44px;
  padding: 8px 12px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
}

#profile-name-input button#save-new-profile, #rename-profile-input button#save-rename-profile {
  background-color: #28a745;
  color: white;
}

#profile-name-input button#cancel-new-profile, #rename-profile-input button#cancel-rename-profile {
  background-color: #dc3545;
  color: white;
}

/* Modell-Builder Styles */
.info-text {
  font-size: 14px;
  color: #666;
  margin-bottom: 10px;
}

.model-builder {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.model-display {
  min-height: 50px;
  background-color: white;
  border: 1px solid #ccc;
  border-radius: 5px;
  padding: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.model-shift-chip {
  display: inline-block;
  padding: 5px 10px;
  margin: 2px;
  border-radius: 3px;
  font-weight: bold;
  color: white;
}

.model-shift-chip.F {
  background-color: #009999;
}

.model-shift-chip.N {
  background-color: #003366;
}

.model-shift-chip.S {
  background-color: #CCCC00;
}

.model-shift-chip.Zero {
  background-color: #808080;
}

.model-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.add-shift-btn, #remove-last-shift, #clear-model {
  flex: 1 1 auto;
  min-width: 44px;
  min-height: 44px;
  padding: 8px 15px;
  border: none;
  border-radius: 8px;
  font-weight: bold;
  cursor: pointer;
}

.add-shift-btn[data-shift="F"] {
  background-color: #009999;
  color: white;
}

.add-shift-btn[data-shift="N"] {
  background-color: #003366;
  color: white;
}

.add-shift-btn[data-shift="S"] {
  background-color: #CCCC00;
  color: white;
}

.add-shift-btn[data-shift="0"] {
  background-color: #808080;
  color: white;
}

#remove-last-shift {
  background-color: #dc3545;
  color: white;
}

#clear-model {
  flex: 0 1 auto; /* soll beim Umbruch nicht die ganze Zeile fuellen */
  background-color: #6c757d;
  color: white;
}

/* Shift Selector Styles */
.shift-selector {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}

.shift-position {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #ccc;
  border-radius: 50%;
  cursor: pointer;
  font-weight: bold;
}

.shift-position.active {
  border-color: #007bff;
  background-color: #007bff;
  color: white;
}

@keyframes slide-in-right {
  0% { transform: translateX(100%); }
  100% { transform: translateX(0%); }
}

@keyframes slide-out-left {
  0% { transform: translateX(0%); }
  100% { transform: translateX(-100%); }
}

@keyframes slide-in-left {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(0%); }
}

@keyframes slide-out-right {
  0% { transform: translateX(0%); }
  100% { transform: translateX(100%); }
}