/* CSS Variables */
:root {
  --primary-color: #1e57e1;
  --secondary-color: #444;
  --background-color: #fafafa;
  --danger-color: #e63946;
  --button-bg: #1e57e1;
  --button-bg-hover: #1745b5;
  --button-text: #fff;
}

/* CSS reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background-color: var(--background-color);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
  line-height: 1.6;
  color: var(--secondary-color);
}

h1 {
  font-size: 2.5rem;
  text-align: center;
  font-variant: small-caps;
  font-family: Georgia, "Times New Roman", Times, serif;
  line-height: 1.3;
  color: var(--primary-color);
  margin: 1rem 0 2rem;
}

h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

/* Base Layout: Mobile First */
#app-container {
  display: flex;
  flex-direction: column; /* stack vertically on small screens */
  padding: 1rem;
  margin: 0 auto;
}

#new-list-form {
  display: flex;
  flex-direction: column; /* input and button stacked */
  max-width: 500px;
  width: 100%;
  margin: 0 auto 1.5rem; /* center horizontally, spacing below */
  gap: 0.5rem;
}

#controls-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  max-width: 500px; /* same as #new-list-form on mobile */
  margin: 0 auto 2rem; /* center horizontally, spacing below*/
  font-size: 0.95rem;
  color: var(--secondary-color);
}

#lists-view {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  align-items: center;
  width: 100%;
  max-width: 500px;
  margin: 0 auto;
}

.list-container {
  display: flex;
  flex-direction: column;
  width: 100%;
  padding: 1.25rem;
  border: 1px solid var(--secondary-color); /* neutral gray border */
  border-radius: 6px;
  background-color: #fff;
  transition: box-shadow 0.2s ease, transform 0.1s ease;
}
.list-container:hover {
  background-color: #fff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}
.list-container ul {
  padding-left: 1.5rem; /* indent bullets/text */
  margin-top: 0.5rem;
}
.list-container li {
  margin-bottom: 0.4rem;
  line-height: 1.4;
}
.list-container li::marker {
  color: var(--primary-color);
  font-size: 1.1em;
}

/* Utility layout classes (moved from JS inline styles) */
.flex-row {
  display: flex;
  flex-direction: row;
}

.flex-col {
  display: flex;
  flex-direction: column;
}

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

/* Base button (shared styles) */
button {
  margin: 0.2rem;
  padding: 0.5rem 0.8rem;
  font-size: 0.95rem;
  border-radius: 4px;
  border: none;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.1s ease;
}

/* Primary: constructive actions */
button.primary {
  background-color: var(--button-bg);
  color: var(--button-text);
}
button.primary:hover {
  background-color: var(--button-bg-hover);
}
button.primary:active {
  transform: scale(0.97);
}

/* Secondary: neutral actions */
button.secondary {
  background-color: #e0e0e0;
  color: #333;
}
button.secondary:hover {
  background-color: #d5d5d5;
}

/* Danger: destructive actions */
button.danger {
  background-color: var(--danger-color);
  color: var(--button-text);
}
button.danger:hover {
  background-color: #c52834;
}

/* Inputs */
input {
  margin: 0.2rem;
  padding: 0.5rem 0.8rem;
  font-size: 0.95rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(30, 87, 225, 0.2);
  outline: none;
}

#app-footer {
  text-align: center;
  padding: 1rem;
  margin-top: 2rem;
  font-size: 0.85rem;
  color: #666;
  border-top: 1px solid var(--secondary-color);
}
#app-footer a {
  color: var(--primary-color);
  text-decoration: none;
}
#app-footer a:hover {
  text-decoration: underline;
}

/* Tablet breakpoint */
@media (min-width: 768px) {
  #app-container {
    max-width: 700px;
    margin: 0 auto; /*center horizontally */
  }

  #new-list-form,
  #controls-bar,
  #lists-view {
    max-width: 600px;
  }
}

/* Desktop breakpoint */
@media (min-width: 1024px) {
  #app-container {
    max-width: 800px;
    margin: 0 auto;
  }

  #new-list-form,
  #controls-bar,
  #lists-view {
    max-width: 700px;
  }
}
