/* ==============================
   Base / Reset
============================== */

/* CSS Variables */
/* For ease of standardization */
:root {
  --color-bg: #f6f3ee;
  --color-text: #222;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
}

header {
  margin-bottom: 2rem;
}

h1, h2 {
  margin-bottom: 0.5rem;
}

button {
  border: none;
  border-radius: 999px;
  padding: 0.85rem 1.2rem;
  background: #222;
  color: white;
  cursor: pointer;
  font-weight: bold;
}

button:hover {
  background: #444;
}

button:disabled {
  opacity: 0.6;
  cursor: wait;
}

form {
  display: grid;
  gap: 1rem;
}

label {
  display: grid;
  gap: 0.35rem;
  font-weight: bold;
}

input,
textarea,
button {
  font: inherit;
}

input,
textarea {
  width: 100%;
  padding: 0.7rem;
  border: 1px solid #ccc;
  border-radius: 10px;
}

/* ==============================
   General Custom Classes
============================== */

.page {
  width: min(1000px, 92%);
  margin: 0 auto;
  padding: 2rem 0;
}

.entry-form-section,
.entries-section {
  background: white;
  padding: 1.5rem;
  border-radius: 16px;
  margin-bottom: 2rem;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.08);
}

.entries-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 1rem;
}

.number-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
}

.meal-card {
  border: 1px solid #ddd;
  border-radius: 14px;
  overflow: hidden;
  background: #fffdf9;
}

.meal-card img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  display: block;
}

.meal-card-content {
  padding: 1rem;
}

.meal-date {
  font-size: 0.85rem;
  color: #666;
  margin-bottom: 0.5rem;
}

.meal-notes {
  margin-bottom: 0.75rem;
}

.meal-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.4rem;
  font-size: 0.9rem;
}

.delete-button {
  margin-top: 1rem;
  background: #9d2f2f;
  width: 100%;
}

.delete-button:hover {
  background: #7d2020;
}

.empty-message {
  color: #666;
  font-style: italic;
}

.journal-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: white;
  padding: 1rem 1.5rem;
  border-radius: 16px;
  margin-bottom: 2rem;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.08);
}

.status-message {
  color: #666;
  font-style: italic;
}

.error-message {
  color: #9d2f2f;
  font-weight: bold;
}

.upload-status {
  min-height: 1.25rem;
  margin: 0;
}

.toolbar-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.meal-form-overlay {
  position: fixed;
  inset: 0;

  background: rgba(0, 0, 0, 0.45);

  display: grid;
  place-items: center;

  padding: 1rem;

  z-index: 1000;
}

/* Required because .meal-form-overlay uses display: grid;
   without this, the hidden attribute can be overridden. */
.meal-form-overlay[hidden] {
  display: none;
}

.meal-form-panel {
  width: min(700px, 100%);

  max-height: 90vh;
  overflow-y: auto;

  margin: 0;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;

  gap: 1rem;
}

.secondary-button {
  background: #666;
}

/* ==============================
   Login Form - custom classes
============================== */

.login-form {
  display: grid;
  gap: 1rem;
  max-width: 400px;
}

/* ==============================
   General Custom IDs
============================== */

/* Stuff for selecting different users
- TODO: Will be updated when user refactor happens
*/

#activeUserLabel {
  margin: 0;
  font-weight: bold;
}

/* ==============================
   Responsive Styles
============================== */
@media (max-width: 650px) {
  .number-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .journal-toolbar {
    align-items: stretch;
    flex-direction: column;
  }
}