/*
 * Styles for the Poem Mash application.
 * A dark, minimal aesthetic keeps focus on the poems.
 */

html,
body {
  margin: 0;
  padding: 0;
  background: #0b0b1a;
  color: #e0e0f5;
  font-family: "Georgia", serif;
}

header {
  text-align: center;
  padding: 1rem;
  background: #13132b;
  border-bottom: 1px solid #22224b;
}

header h1 {
  margin: 0;
  font-size: 2.2rem;
  color: #f5f5ff;
}

header p {
  margin-top: 0.5rem;
  color: #b6b6d0;
  font-size: 1rem;
}

main {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

footer {
  text-align: center;
  padding: 1rem;
  background: #13132b;
  border-top: 1px solid #22224b;
}

.masthead {
  color: #7a7ab7;
  font-size: 0.85rem;
  margin: 0;
}

.masthead a {
  color: #9c9cdf;
  text-decoration: none;
}

.masthead a:hover {
  text-decoration: underline;
}

#poems-container {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  width: 100%;
  max-width: 1100px;
  justify-content: center;
}

.poem-box {
  flex: 1 1 45%;
  max-width: 500px;
  min-width: 280px;
  background: #181836;
  border: 1px solid #2e2e5e;
  border-radius: 8px;
  padding: 1rem;
  cursor: pointer;
  transition: background 0.3s ease, border-color 0.3s ease, transform 0.2s ease;
  max-height: 40vh;
  overflow-y: auto;
}

.poem-box:hover {
  background: #22224c;
  border-color: #44447c;
  transform: translateY(-3px);
}

.poem-box.selected {
  background: #2c2c63;
  border-color: #5a5aa0;
}

.poem-box h3 {
  margin-top: 0;
  margin-bottom: 0.5rem;
  font-size: 1.3rem;
  color: #fafaff;
}

.poem-box pre {
  white-space: pre-wrap;
  font-size: 0.95rem;
  line-height: 1.5;
  color: #d5d5e8;
}

.controls {
  display: flex;
  justify-content: center;
  gap: 1rem;
  width: 100%;
}

.controls button {
  background: #2c2c63;
  color: #e0e0f5;
  border: 1px solid #44447c;
  border-radius: 4px;
  padding: 0.5rem 1rem;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.2s ease;
}

.controls button:hover {
  background: #3b3b78;
}

#leaderboard {
  width: 100%;
  max-width: 1100px;
}

#leaderboard h2 {
  margin-top: 0;
  margin-bottom: 0.5rem;
  font-size: 1.6rem;
  color: #f0f0ff;
}

#leaderboard table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

#leaderboard th,
#leaderboard td {
  padding: 0.5rem;
  text-align: left;
}

#leaderboard th {
  border-bottom: 2px solid #3a3a70;
  color: #cfcfea;
}

#leaderboard tr:nth-child(even) {
  background: #1a1a38;
}

#leaderboard tr:nth-child(odd) {
  background: #161632;
}

#leaderboard td {
  border-bottom: 1px solid #2c2c55;
}

/* EthicalAds container styles */
.ad-container {
  width: 100%;
  max-width: 728px; /* typical max width for ads */
  padding: 1rem 0;
  display: flex;
  justify-content: center;
}

@media (max-width: 768px) {
  .poem-box {
    flex: 1 1 100%;
    max-width: none;
  }
}

/* Submission form styles */
#submission {
  width: 100%;
  max-width: 600px;
  background: #181836;
  border: 1px solid #2e2e5e;
  border-radius: 8px;
  padding: 1rem;
  margin-top: 1.5rem;
}

#submission h2 {
  margin-top: 0;
  color: #f5f5ff;
  font-size: 1.5rem;
  margin-bottom: 0.75rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  margin-bottom: 0.75rem;
}

.form-group label {
  margin-bottom: 0.25rem;
  font-size: 0.9rem;
  color: #b6b6d0;
}

.form-group input,
.form-group textarea {
  background: #13132b;
  border: 1px solid #2e2e5e;
  border-radius: 4px;
  padding: 0.5rem;
  color: #e0e0f5;
  font-family: inherit;
  font-size: 1rem;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #44447c;
  box-shadow: 0 0 0 2px rgba(68, 68, 124, 0.4);
}

#submission button[type="submit"] {
  background: #2c2c63;
  color: #f5f5ff;
  border: 1px solid #4a4a8a;
  border-radius: 4px;
  padding: 0.6rem 1.2rem;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.3s ease, border-color 0.3s ease;
}

#submission button[type="submit"]:hover {
  background: #3a3a74;
  border-color: #5a5aa0;
}

#submissionStatus {
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: #9c9cdf;
}

/* Visitors progress bar (additive) */
.visitors { margin: 1.5rem 0; }
.visitors h2 { margin-bottom: 0.5rem; }

#visitors .vis-progress {
  width: 100%;
  height: 12px;
  background: #2a2a2a;
  border-radius: 9999px;
  overflow: hidden;
}
#visitors .vis-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #4ade80, #22d3ee);
  transition: width 0.6s ease;
}
#visitors .vis-meta {
  margin-top: 0.4rem;
  font-size: 0.95rem;
  opacity: 0.9;
}
