/* Base styles */
:root {
  font-family: Inter, system-ui, Avenir, Helvetica, Arial, sans-serif;
  line-height: 1.5;
  font-weight: 400;

  color-scheme: light dark;
  color: rgba(255, 255, 255, 0.87);
  background-color: #242424;

  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
  display: flex;
  place-items: center;
  min-width: 320px;
  min-height: 100vh;
}

#app {
  max-width: 1280px;
  margin: 0 auto;
  padding: 2rem;
  text-align: center;
}

h1 {
  font-size: 2.2em;
  line-height: 1.1;
  margin-bottom: 2rem;
}

h3 {
  color: var(--text-color);
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
  font-weight: 600;
}

h4 {
  color: var(--text-color);
  font-size: 1.25rem;
  margin-bottom: 1rem;
  font-weight: 600;
}

h5 {
  color: var(--text-color);
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

/* Principal container */
.principal-container {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
  justify-content: center;
}

.principal-display {
  font-family: monospace;
  background-color: rgba(0, 0, 0, 0.2);
  padding: 0.5rem 1rem;
  border-radius: 8px;
  color: #a8a6a6;
  white-space: pre-wrap;
  word-break: break-all;
  max-width: 600px;
}

/* Buttons */
button {
  border-radius: 8px;
  border: 1px solid transparent;
  padding: 0.6em 1.2em;
  font-size: 1em;
  font-weight: 500;
  font-family: inherit;
  background-color: #1a1a1a;
  cursor: pointer;
  transition: border-color 0.25s;
}

button:hover {
  border-color: #646cff;
}

button:focus,
button:focus-visible {
  outline: 4px auto -webkit-focus-ring-color;
}

#loginButton {
  background-color: #28a745;
  color: white;
}

#loginButton:hover {
  background-color: #218838;
}

#logoutButton {
  background-color: #dc3545;
  color: white;
}

#logoutButton:hover {
  background-color: #c82333;
}

/* Lot actions */
#lotActions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin: 2rem 0;
}

#lotActions button {
  background-color: #1a1a1a;
  color: white;
}

#lotActions button:hover {
  background-color: #2a2a2a;
}

/* Lot form */
#lotForm {
  max-width: 600px;
  margin: 2rem auto;
  padding: 2rem 3rem;
  background-color: #1a1a1a;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

#lotForm div {
  margin-bottom: 1.5rem;
}

#lotForm label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.87);
}

#lotForm input,
#lotForm textarea {
  width: 100%;
  padding: 0.75rem;
  background-color: #242424;
  border: 1px solid #333;
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.87);
  font-size: 1rem;
}

#lotForm input:focus,
#lotForm textarea:focus {
  outline: none;
  border-color: #646cff;
}

#lotForm textarea {
  height: 120px;
  resize: vertical;
}

#lotForm button {
  width: 100%;
  background-color: #28a745;
  color: white;
}

#lotForm button:hover {
  background-color: #218838;
}

/* Lots list */
#lotsList {
  margin: 2rem 0;
}

.lot {
  margin: 1.5rem 0;
  padding: 1.5rem;
  background-color: #1a1a1a;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s ease;
  position: relative;
}

.lot:hover {
  transform: translateY(-2px);
}

.lot h5 {
  margin: 0 0 1rem 0;
  color: rgba(255, 255, 255, 0.87);
}

.lot p {
  margin: 0.5rem 0;
  color: #a8a6a6;
}

.lot-status {
  position: absolute;
  top: 1rem;
  right: 1rem;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.9rem;
  font-weight: 500;
  text-transform: uppercase;
}

.status-placed {
  background-color: rgba(40, 167, 69, 0.2);
  color: #28a745;
}

.status-owner {
  background-color: rgba(13, 110, 253, 0.2);
  color: #0d6efd;
}

.status-won {
  background-color: rgba(255, 193, 7, 0.2);
  color: #ffc107;
}

.status-lost {
  background-color: rgba(220, 53, 69, 0.2);
  color: #dc3545;
}

.status-skipped {
  background-color: rgba(108, 117, 125, 0.2);
  color: #6c757d;
}

.lot-countdown {
  font-family: monospace;
  color: #ffc107;
  margin-bottom: 0.5rem;
}

.principal-indicator {
  display: inline-block;
  margin-right: 0.5rem;
}

.principal-winner::before {
  content: "🏆";
  margin-right: 0.5rem;
}

.principal-me::before {
  content: "ME";
  background-color: #646cff;
  color: white;
  padding: 0.1rem 0.3rem;
  border-radius: 4px;
  font-size: 0.8rem;
  margin-right: 0.5rem;
}

/* Handle combinations of classes */
.principal-me.principal-winner::before {
  content: "ME 🏆";
  background-color: #646cff;
  color: white;
  padding: 0.1rem 0.3rem;
  border-radius: 4px;
  font-size: 0.8rem;
  margin-right: 0.5rem;
}

/* Bid form */
.bid-form {
  margin-top: 1.5rem;
  padding: 1.5rem;
  background-color: #242424;
  border-radius: 8px;
  max-width: 300px;
  margin-left: auto;
  margin-right: auto;
}

.bid-form div {
  margin-bottom: 1rem;
}

.bid-form label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.87);
}

.bid-form input {
  width: 100%;
  padding: 0.5rem;
  background-color: #1a1a1a;
  border: 1px solid #333;
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.87);
  font-size: 1rem;
  box-sizing: border-box;
}

.bid-form button {
  width: 100%;
  background-color: #28a745;
  color: white;
}

.bid-form button:hover {
  background-color: #218838;
}

/* Responsive design */
@media (max-width: 768px) {
  #app {
    padding: 1rem;
  }

  h1 {
    font-size: 2rem;
  }

  .principal-container {
    flex-direction: column;
    gap: 1rem;
  }

  #lotActions {
    flex-direction: column;
  }
}

@media (prefers-color-scheme: light) {
  :root {
    color: #213547;
    background-color: #ffffff;
  }
  a:hover {
    color: #747bff;
  }
  button {
    background-color: #f9f9f9;
  }
  .principal-display {
    background-color: rgba(0, 0, 0, 0.05);
    color: #666;
  }
  #lotForm {
    background-color: #f9f9f9;
  }
  #lotForm label {
    color: #213547;
  }
  #lotForm input,
  #lotForm textarea {
    background-color: #ffffff;
    color: #213547;
    border-color: #ddd;
  }
  .lot {
    background-color: #f9f9f9;
  }
  .lot h5 {
    color: #213547;
  }
  .lot p {
    color: #666;
  }
  .bid-form {
    background-color: #ffffff;
  }
  .bid-form label {
    color: #213547;
  }
  .bid-form input {
    background-color: #f9f9f9;
    color: #213547;
    border-color: #ddd;
  }
}

.login-container {
  display: flex;
  justify-content: center;
  margin: 1rem 0;
}

#openLots h4,
#closedLots h4 {
  color: rgba(255, 255, 255, 0.95);
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
  font-weight: 600;
  text-align: left;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* Auth state classes */
.hidden {
  display: none !important;
}

/* Initial state classes for auth elements */
#loginButton {
  display: block;
}

#messageButtons {
  display: flex;
}

#principalDisplay {
  display: block;
}

#logoutButton {
  display: block;
}

#lotActions {
  display: flex;
}

#lotForm {
  display: block;
}

#lotsList {
  display: block;
}
