/* style.css - FINAL: With Settings Button */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
}

body {
  background: #f8f9fa;
  padding: 16px;
  color: #333;
}

header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin-bottom: 16px;
}

.header-buttons {
  display: flex;
  gap: 10px;
}

header button {
  font-size: 24px;
  width: 44px;
  height: 44px;
  border: none;
  background: #007aff;
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: manipulation;
}

#settingsBtn {
  font-size: 20px;
  width: 40px;
  height: 40px;
  background: #5ac8fa;
}

h2 {
  font-size: 22px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
}

#todayBtn {
  display: block;
  margin: 8px auto 16px;
  padding: 8px 16px;
  font-size: 16px;
  background: #5ac8fa;
  color: white;
  border: none;
  border-radius: 8px;
  touch-action: manipulation;
  max-width: 120px;
}

.export-buttons {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-bottom: 16px;
}

.export-buttons button {
  padding: 8px 16px;
  font-size: 15px;
  border: none;
  border-radius: 6px;
  color: white;
  touch-action: manipulation;
  flex: 1;
  max-width: 150px;
}

#exportCsv {
  background: #34c759;
}

#exportPdf {
  background: #ff9500;
}

.add-totals-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  gap: 16px;
}

#addRow {
  padding: 10px 16px;
  font-size: 18px;
  background: #34c759;
  color: white;
  border: none;
  border-radius: 8px;
  touch-action: manipulation;
  flex-shrink: 0;
}

#totals {
  font-weight: 600;
  color: #333;
  white-space: nowrap;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

th, td {
  padding: 14px 8px;
  text-align: left;
  border-bottom: 1px solid #eee;
  font-size: 16px;
}

th {
  background: #f0f0f0;
  font-weight: 600;
  color: #555;
}

#reservationTable tbody tr:nth-child(even) {
  background-color: #fafafa;
}

#reservationTable tbody tr:hover {
  background-color: #f0f0f0;
}

td {
  outline: none;
}

.time-input {
  width: 100%;
  border: none;
  background: transparent;
  font: inherit;
  font-size: 16px;
  padding: 4px;
  outline: none;
  text-align: left;
}

.time-input:focus {
  background: #f0f8ff;
  outline: 2px solid #007aff;
  border-radius: 4px;
}

.delete-btn {
  width: 32px;
  height: 32px;
  background: #ff3b30;
  color: white;
  border: none;
  border-radius: 50%;
  font-weight: bold;
  touch-action: manipulation;
}

.btn-update {
  background: #34c759;
  color: white;
}

#toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  padding: 12px 20px;
  border-radius: 8px;
  color: white;
  font-weight: 600;
  font-size: 16px;
  display: none;
  z-index: 1000;
  max-width: 80%;
  text-align: center;
}

.toast-success {
  background: #34c759;
}

.toast-error {
  background: #ff3b30;
}

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

.modal-content {
  background: white;
  padding: 20px;
  border-radius: 10px;
  width: 90%;
  max-width: 500px;
  max-height: 80vh;
  overflow-y: auto;
}

.meal-rule {
  display: flex;
  gap: 8px;
  margin: 10px 0;
  align-items: center;
}

.meal-rule input {
  font-size: 16px;
  padding: 6px;
  border: 1px solid #ccc;
  border-radius: 4px;
}

.meal-rule .meal-name {
  flex: 1;
}

.meal-rule input[type="time"] {
  width: 100px;
}

.modal-buttons {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.modal-buttons button {
  flex: 1;
  padding: 10px;
  border: none;
  border-radius: 6px;
  font-size: 16px;
  color: white;
}

.daily-message {
  font-weight: 600;
  color: #d32f2f; /* Red for alerts */
  text-align: center;
  padding: 8px;
  margin: 8px 0;
  font-size: 16px;
  min-height: 1.5em;
  outline: none;
  user-select: text;
  width: 100%;
  box-sizing: border-box;
  border-radius: 4px;
  background: #ffebee;
}

.daily-message:empty::before {
  content: "Click here to add daily message...";
  color: #999;
  font-style: italic;
  pointer-events: none;
}

.daily-message:focus {
  background: #fff;
  border: 1px solid #007aff;
}

#save-settings { background: #34c759; }
#cancel-settings { background: #ff3b30; }

@media (min-width: 768px) {
  body {
    max-width: 1000px;
    margin: 0 auto;
  }
}

input, textarea, [contenteditable] {
  font-size: 16px;
}