/* Todums Styles */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  line-height: 1.5;
  color: #1a1a1a;
  background: #f5f5f5;
  min-height: 100vh;
}
#app { max-width: 640px; margin: 0 auto; padding: 2rem 1rem; }
.view { display: none; }
.view.active { display: block; }

h1 { font-size: 1.75rem; margin-bottom: 1.5rem; text-align: center; }
h1 .logo { vertical-align: middle; margin-top: -0.2em; }
h2 { font-size: 1.25rem; margin-bottom: 1rem; }

button {
  cursor: pointer;
  font-size: 0.95rem;
  padding: 0.5rem 1rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  background: #fff;
}
button:hover { background: #f0f0f0; }
button.primary {
  background: #1a1a1a;
  color: #fff;
  border-color: #1a1a1a;
}
button.primary:hover { background: #333; }
button.danger { color: #d32f2f; border-color: #d32f2f; }
button.danger:hover { background: #fff0f0; }
button.small { font-size: 0.8rem; padding: 0.25rem 0.6rem; }

input[type="text"], input[type="url"] {
  font-size: 0.95rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  width: 100%;
  font-family: inherit;
}
input:focus { outline: none; border-color: #1a1a1a; }

/* Landing */
#landing { text-align: center; padding-top: 4rem; }
#landing h1 { font-size: 2.5rem; margin-bottom: 0.5rem; }
#landing .subtitle { color: #666; margin-bottom: 2rem; }

/* Password prompt */
#password-prompt { max-width: 360px; margin: 4rem auto; }
#password-prompt input { margin-bottom: 0.75rem; }
#password-prompt button { width: 100%; }
#password-error { color: #d32f2f; margin-top: 0.5rem; font-size: 0.85rem; }

/* List view */
#list-header { display: flex; gap: 0.5rem; margin-bottom: 1.5rem; align-items: center; }
#list-header input { font-size: 1.2rem; font-weight: 600; flex: 1; }

#items-list { list-style: none; margin-bottom: 1rem; }
.item-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid #eee;
}
.item-row input[type="checkbox"] {
  width: 1.2rem; height: 1.2rem; cursor: pointer; flex-shrink: 0;
}
.item-row input[type="text"] { flex: 1; }
.item-row input[type="text"].checked { text-decoration: line-through; color: #999; }
.item-row .remove-btn {
  background: none; border: none; color: #999; font-size: 1.2rem;
  padding: 0 0.25rem; cursor: pointer; flex-shrink: 0;
}
.item-row .remove-btn:hover { color: #d32f2f; }
.item-row .item-meta {
  font-size: 0.75rem;
  color: #999;
  flex-shrink: 0;
  white-space: nowrap;
  cursor: default;
}
.item-row .you-badge {
  color: #2e7d32;
  font-weight: 500;
}

#list-toolbar { display: flex; gap: 0.5rem; margin-bottom: 1rem; flex-wrap: wrap; align-items: center; }
#client-id { font-size: 0.75rem; color: #aaa; margin-left: auto; }
#save-status { font-size: 0.85rem; color: #4caf50; opacity: 0; transition: opacity 0.3s; }
#save-status.visible { opacity: 1; }
#save-status.error { color: #d32f2f; }

/* Error */
#error-view { text-align: center; padding-top: 4rem; }
#error-view p { margin-bottom: 1.5rem; color: #666; font-size: 1.1rem; }

/* Footer */
#site-footer {
  text-align: center;
  padding: 3rem 0 1.5rem;
  color: #aaa;
  font-size: 0.8rem;
}
#site-footer img {
  vertical-align: middle;
  opacity: 0.4;
}
#site-footer .footer-name {
  margin: 0 0.5rem 0 0.25rem;
}
#site-footer .footer-copy {
  color: #bbb;
}
#site-footer a {
  color: #888;
}
/* Hide branding in footer on landing page */
#landing.active ~ #site-footer img,
#landing.active ~ #site-footer .footer-name {
  display: none;
}

/* Recent Lists (history) */
#recent-lists { margin-top: 2rem; text-align: left; }
#recent-lists h2 { font-size: 1rem; color: #666; margin-bottom: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; }
#history-list { list-style: none; }
.history-item {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.6rem 0.75rem; border-radius: 6px; cursor: pointer;
}
.history-item:hover { background: #eee; }
.history-item .history-title {
  flex: 1; font-size: 0.95rem;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.history-item .history-time { font-size: 0.75rem; color: #999; flex-shrink: 0; }
.history-item .history-remove {
  background: none; border: none; color: #ccc; font-size: 1rem;
  padding: 0 0.25rem; cursor: pointer; flex-shrink: 0;
}
.history-item .history-remove:hover { color: #d32f2f; }
#history-empty { font-size: 0.85rem; color: #aaa; text-align: center; }
#clear-history-btn { display: block; margin: 0.75rem auto 0; }

.hidden { display: none !important; }

/* Offline banner */
#offline-banner {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  background: #ffd54f; color: #1a1a1a; text-align: center;
  font-size: 0.85rem; padding: 0.35rem;
}
