/*
 * Stylesheet for the family planner web application.
 */

body {
  margin: 0;
  padding: 0;
  font-family: Arial, sans-serif;
  background-color: #1c1c1c;
  color: #e0e0e0;
}

#app {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

/* --- Cards & Layout --- */
.card {
  background-color: #2b2b2b;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
  padding: 20px;
  margin-bottom: 20px;
}

.hidden { display: none !important; }

label {
  display: block;
  margin-top: 10px;
  font-weight: bold;
}

input[type="text"],
input[type="number"],
input[type="date"],
input[type="time"],
textarea,
select {
  width: 100%;
  padding: 8px;
  margin-top: 4px;
  border: 1px solid #ccc;
  border-radius: 4px;
  box-sizing: border-box;
  background-color: #fff;
  color: #000;
}

textarea { resize: vertical; }

button {
  background-color: #388e3c;
  color: #fff;
  padding: 10px 16px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  margin-top: 12px;
  transition: background-color 0.2s ease;
  font-size: 14px;
}

button:hover { background-color: #2e7d32; }

#buttonRow {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
#buttonRow button { flex: 1; }

#headerLayer { margin-bottom: 10px; }

/* --- Calendar Table --- */
.calendar-container {
  overflow-x: auto;
  border: 1px solid #444;
  border-radius: 4px;
  margin-top: 10px;
  background-color: #1c1c1c;
  width: 100%;
  display: block;
}

table.calendar-table {
  border-collapse: collapse;
  width: 100%;
  min-width: 600px; /* Erzwingt Scrollen auf kleinen Screens */
  table-layout: fixed;
  background-color: #1c1c1c;
}

table.calendar-table th,
table.calendar-table td {
  border: 1px solid #444;
  padding: 4px;
  text-align: left;
  vertical-align: top;
  font-size: 14px;
  overflow: hidden;
  color: #e0e0e0;
}

table.calendar-table th {
  background-color: #2a2a2a;
  position: sticky;
  top: 0;
  z-index: 1;
  color: #e0e0e0;
}

table.calendar-table td.collision { background-color: #593a3a; }

.event {
  margin-bottom: 4px;
  color: #fff;
  font-size: 12px;
  background-color: rgba(255,255,255,0.1);
  padding: 2px;
  border-radius: 2px;
  cursor: pointer;
}
.event-title { font-weight: bold; }

/* --- Modal Styles (Desktop Basis) --- */
.modal {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-content {
  background-color: #fff;
  padding: 20px;
  border-radius: 8px;
  width: 90%;
  max-width: 500px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  color: #000;
}

.modal-content h3 { margin-top: 0; color: #000; }
.modal-content label { color: #000; }

/* --- Mic Button --- */
.mic-button {
  background-color: #d32f2f;
  margin-bottom: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
}
.mic-button.listening {
  animation: pulse 1.5s infinite;
  background-color: #b71c1c;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(211, 47, 47, 0.7); }
  70% { box-shadow: 0 0 0 10px rgba(211, 47, 47, 0); }
  100% { box-shadow: 0 0 0 0 rgba(211, 47, 47, 0); }
}

/* --- MOBILE OPTIMIERUNG (Modal) --- */
@media (max-width: 600px) {
  #app { padding: 10px; }
  
  /* Modal Overlay fixieren */
  .modal {
    padding: 0;
    align-items: flex-start; /* Oben anfangen */
  }

  /* Modal Inhalt füllt den ganzen Screen */
  .modal-content {
    width: 100% !important;
    height: 100dvh !important; /* Volle Höhe */
    max-width: none !important;
    border-radius: 0 !important;
    margin: 0 !important;
    display: flex;
    flex-direction: column;
    padding: 15px;
    box-sizing: border-box;
    overflow-y: auto; /* Scrollen erlaubt */
  }

  /* Formular flexibel machen */
  #modalForm {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
  }

  /* Inputs größer für Touch */
  input, select, textarea {
    font-size: 16px !important; /* Verhindert Zoom auf iPhone */
    padding: 12px;
  }

  /* Buttons größer */
  #modalForm button, 
  .mic-button {
    padding: 15px;
    margin-top: 15px;
    font-size: 16px;
  }
}