/* Minimal overrides to complement Pico.css */
:root {
  --brand: #f6c90e; /* Alternative Yellow */
}

  /* App background and base text color */
  html, body {
    background-color: #152147;
    color: #eef2ff;
  }

  /* Article background */
  article {
    background-color: #191e28;
  }

  /* Layout widths and centering */
  main.container { max-width: 900px; }
  main.container.centered { display: flex; flex-direction: column; align-items: center; }
form.card { max-width: 560px; width: 100%; margin-inline: auto; }

/* Grids */
.grid { display: grid; gap: 1rem; grid-template-columns: 1fr auto auto; align-items: end; }
/* Muted helper */
.muted { color: var(--muted, #9aa4c7); }

/* Links and brand */
a, .brand { color: var(--brand); }
a:hover { filter: brightness(1.1); }

/* Buttons */
button.primary, .primary[role="button"], a.primary[role="button"] {
  background-color: var(--brand);
  border-color: var(--brand);
  color: #152147;
}
button.primary:hover, .primary[role="button"]:hover, a.primary[role="button"]:hover {
  filter: brightness(0.95);
}

/* Basic alignment: stack action buttons full width */
form.card .grid, .card .grid {
  grid-template-columns: 1fr !important; /* force single column */
}
form.card .grid > *, .card .grid > * { width: 100%; }
form.card .grid > * > button,
form.card .grid > * > a[role="button"],
form.card .grid > button,
form.card .grid > a[role="button"],
.card .grid > * > button,
.card .grid > * > a[role="button"],
.card .grid > button,
.card .grid > a[role="button"] {
  width: 100%;
  display: block;
  text-align: center;
}

/* Cards and inputs for dark background - redesigned form panel */
form.card, .card {
  background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.03));
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 16px;
  padding: 2rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  backdrop-filter: saturate(120%) blur(2px);
}

form.card h1, .card h1, form.card h2, .card h2 {
  margin-top: 0.25rem;
  margin-bottom: 1.25rem;
  text-align: center;
}

form.card label {
  font-weight: 600;
  margin-bottom: 0.75rem;
}

form.card label > input,
form.card label > select,
form.card label > textarea {
  margin-top: 0.35rem;
}
input, select, textarea {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.18);
  color: #eef2ff;
  border-radius: 10px;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(246, 201, 14, 0.25);
}
input::placeholder, textarea::placeholder { color: #c7cbe6; }

/* Entry Cards Grid */
.entries-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
  padding: 1rem;
}

.entry-card {
  background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.03));
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.entry-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
  border-color: rgba(255, 255, 255, 0.2);
}

.entry-card-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 0.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.entry-title {
  font-size: 1.1rem;
  margin: 0;
  font-weight: 600;
  color: #eef2ff;
  word-break: break-word;
  flex: 1;
}

.entry-type-badge {
  background: rgba(246, 201, 14, 0.15);
  color: var(--brand);
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  white-space: nowrap;
  border: 1px solid rgba(246, 201, 14, 0.3);
}

.entry-card-body {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-height: 2rem;
}

.entry-field {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.field-label {
  font-size: 0.75rem;
  color: #9aa4c7;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.field-value {
  font-size: 0.9rem;
  color: #eef2ff;
  word-break: break-all;
}

.entry-card-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: auto;
}

.entry-card-actions form {
  display: contents;
}

.btn-small {
  padding: 0.4rem 0.75rem !important;
  font-size: 0.85rem !important;
  height: auto !important;
  border-radius: 8px;
  flex: 1;
  min-width: fit-content;
}

.no-entries {
  padding: 3rem 1rem;
  text-align: center;
}

.no-entries p {
  font-size: 1.1rem;
}

/* Inline form error under forms */
.form-error {
  margin-top: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  background: rgba(220, 38, 38, 0.15); /* red-600 tint */
  border: 1px solid rgba(220, 38, 38, 0.35);
  color: #fecaca; /* red-200 */
}

/* Entries page enhancements */
.entries-toolbar {
  grid-template-columns: 1fr !important; /* search input full width */
  align-items: end;
  gap: 0.75rem;
  margin-bottom: 0; /* no extra gap; header controls spacing */
}

.entries-header {
  display: flex;
  flex-direction: column; /* buttons row first, then search below */
  gap: 0.75rem;
}
.entries-actions-inline {
  display: flex;
  gap: 0.75rem;
  align-items: stretch; /* make children share the same height */
}
.entries-actions-inline a[role="button"],
.entries-actions-inline button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 44px; /* consistent height */
  padding: 0 1rem;
  border-radius: 10px;
}
/* Ensure the lock form doesn't shrink oddly */
.entries-actions-inline .lock-form { display: contents; }

.entries-actions {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 0.75rem;
}

.site-footer {
  margin-top: 2rem;
  padding: 1rem 0 2rem;
  text-align: center;
  color: #9aa4c7;
}
.site-footer a {
  color: var(--brand);
}

/* Responsive: adjust card grid on small screens */
@media (max-width: 640px) {
  .entries-grid {
    grid-template-columns: 1fr;
    padding: 0.5rem;
  }
  
  .entry-card-actions {
    flex-direction: column;
  }
  
  .btn-small {
    width: 100%;
  }
}
