/* Twitter-like centered layout */
.twitter-layout {
  max-width: 600px;
  margin: 0 auto;
  padding: 0 1rem;
  background: var(--pico-background-color, #f8f9fa);
  border-radius: 16px;
  box-shadow: 0 2px 16px 0 rgba(0,0,0,0.04);
}

.post-card {
  border: 1px solid var(--pico-muted-border-color);
  border-radius: 12px;
  padding: 1.2rem 1.3rem 1rem 1.3rem;
  margin-bottom: 1.5rem;
  background-color: var(--pico-card-background-color);
  box-shadow: 0 2px 8px 0 rgba(0,0,0,0.06);
  transition: box-shadow 0.2s, border-color 0.2s;
}
.post-card:hover {
  box-shadow: 0 4px 18px 0 rgba(0,0,0,0.10);
  border-color: var(--pico-primary-border-color, #e0e0e0);
}

.post-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.post-actions button {
  margin: 0;
  padding: 0.2rem 0.7rem;
  border-radius: 16px;
  background: var(--pico-primary-background-color, #f5f5f5);
  transition: background 0.2s, color 0.2s;
}
.post-actions button:hover:not(:disabled) {
  background: var(--pico-primary-hover-background-color, #eaeaea);
  color: var(--pico-primary, #d72660);
  cursor: pointer;
}

.post-meta {
  margin-top: 0.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  color: var(--pico-muted-color);
  font-size: 0.92em;
}

.centered-header {
  text-align: center;
  margin-bottom: 1.5rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.submit-button {
  display: flex;
  justify-content: flex-end;
}

.submit-button button {
  border-radius: 20px;
  padding: 0.3rem 1.2rem;
  font-weight: 500;
  box-shadow: 0 1px 4px 0 rgba(0,0,0,0.04);
  transition: background 0.2s, color 0.2s;
}
.submit-button button:hover:not(:disabled) {
  background: var(--pico-primary-hover-background-color, #d72660);
  color: #fff;
  cursor: pointer;
}

textarea[name="postContent"] {
  border-radius: 12px;
  min-height: 60px;
  font-size: 1.05em;
  padding: 0.7rem 1rem;
  resize: vertical;
  background: var(--pico-form-element-background-color, #fff);
  border: 1px solid var(--pico-muted-border-color);
  transition: border-color 0.2s;
}
textarea[name="postContent"]:focus {
  outline: none;
  border-color: var(--pico-primary, #d72660);
  box-shadow: 0 0 0 2px rgba(215,38,96,0.08);
}

footer {
  text-align: center;
  padding: 1rem 0;
  margin-top: 2rem;
  color: var(--pico-muted-color);
}

body {
  background: linear-gradient(180deg, #f8f9fa 0%, #f1f3f6 100%);
}

html, body {
  overflow-y: auto;
  scrollbar-width: none; /* Firefox */
}
body::-webkit-scrollbar {
  display: none; /* Chrome, Safari, Opera */
}

@media (prefers-color-scheme: dark) {
  body {
    background: linear-gradient(180deg, #181c20 0%, #23272e 100%);
  }
  .twitter-layout {
    background: var(--pico-background-color, #23272e);
    box-shadow: 0 2px 16px 0 rgba(0,0,0,0.18);
  }
  .post-card {
    background-color: var(--pico-card-background-color, #23272e);
    border-color: var(--pico-muted-border-color, #2d3138);
    box-shadow: 0 2px 8px 0 rgba(0,0,0,0.22);
  }
  .post-card:hover {
    border-color: var(--pico-primary-border-color, #3a3f47);
  }
  .post-actions button {
    background: var(--pico-primary-background-color, #23272e);
    color: var(--pico-primary, #ff5c8a);
  }
  .post-actions button:hover:not(:disabled) {
    background: var(--pico-primary-hover-background-color, #353a42);
    color: var(--pico-primary, #ff5c8a);
  }
  .submit-button button {
    background: var(--pico-primary-background-color, #23272e);
    color: var(--pico-primary, #ff5c8a);
  }
  .submit-button button:hover:not(:disabled) {
    background: var(--pico-primary-hover-background-color, #ff5c8a);
    color: #fff;
  }
  textarea[name="postContent"] {
    background: var(--pico-form-element-background-color, #181c20);
    border-color: var(--pico-muted-border-color, #2d3138);
    color: var(--pico-color, #fff);
  }
  textarea[name="postContent"]:focus {
    border-color: var(--pico-primary, #ff5c8a);
    box-shadow: 0 0 0 2px rgba(255,92,138,0.10);
  }
  .post-meta, footer {
    color: var(--pico-muted-color, #b0b8c1);
  }
  footer small {
    color: #dde1e4; /* Lighter grey for better contrast in dark mode */
  }
}

.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 0.5rem 1rem 0.5rem;
  max-width: 600px;
  margin: 0 auto 1.2rem auto;
  background: var(--pico-background-color, #fff);
  border-radius: 14px;
  box-shadow: 0 2px 12px 0 rgba(0,0,0,0.06);
}
.navbar-title {
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}
.navbar-actions {
  display: flex;
  align-items: center; /* Align items vertically */
  gap: 0.5rem;
}
.navbar-actions button {
  min-width: 90px;
  border-radius: 22px;
  font-weight: 600;
  font-size: 1rem;
  padding: 0.4rem 1.3rem;
  box-shadow: 0 1px 4px 0 rgba(0,0,0,0.04);
  transition: background 0.18s, color 0.18s, box-shadow 0.18s;
}
.navbar-actions button:active {
  box-shadow: 0 0 0 2px var(--pico-primary, #d72660);
}
@media (max-width: 600px) {
  .navbar {
    padding: 0.7rem 0.3rem 0.7rem 0.3rem;
  }
  .navbar-title {
    font-size: 1.1rem;
  }
  .navbar-actions button {
    font-size: 0.97rem;
    padding: 0.35rem 1rem;
  }
}

/* Added error message style */
.error-message {
  color: var(--pico-form-invalid-border-color, red); /* Use Pico variable if available, fallback to red */
  text-align: center;
  margin-top: 0.5rem; /* Add some space above the error */
}

/* Added margin below create post section */
.twitter-layout > section:first-of-type {
  margin-bottom: 2rem; /* Increased spacing */
}

/* Styles from the second style block in index.html */
@keyframes pulse {
  0% { opacity: 0.5; }
  100% { opacity: 1; }
}
/* Ensure body takes full height for potential sticky footer later */
html, body { height: 100%; margin: 0; }
body { display: flex; flex-direction: column; }
#app { flex: 1 0 auto; } /* Allow app content to grow */
footer { flex-shrink: 0; } /* Prevent footer from shrinking */
