/* upload.html styles */
.upload-container {
  display: flex;
  align-items: center;
}
.upload-container input[type="file"] {
  margin-right: 1rem;
}

/* Login container - controlled by JS */
#login-container {
  opacity: 1;
  transition: opacity 0.3s ease-in-out;
}

#login-container.hidden {
  display: none;
  opacity: 0;
}

/* login.html styles */
.login-container {
  max-width: 340px;
  margin: 80px auto;
  padding: 2em 2em 1.5em 2em;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 18px rgba(0, 0, 0, 0.08);
}
.login-container h2 {
  margin-bottom: 1.2em;
  font-weight: 500;
  color: #222;
}
.login-container label {
  display: block;
  margin-bottom: 0.4em;
  color: #444;
}
.login-container input[type="text"],
.login-container input[type="password"] {
  width: 100%;
  padding: 0.7em;
  margin-bottom: 1.1em;
  border: 1px solid #d0d0d0;
  border-radius: 4px;
  font-size: 1em;
}
.login-container button {
  width: 100%;
  padding: 0.7em;
  background: #2ecc40;
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 1.1em;
  cursor: pointer;
  font-weight: 500;
  transition: background 0.2s;
}
.login-container button:disabled {
  background: #b7eac7;
  cursor: not-allowed;
}
.login-error {
  color: #ff4136;
  margin-bottom: 1em;
  text-align: center;
  display: none;
}
/* login styles end */

/* Loading spinner */
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.loading {
  display: inline-block;
  width: 1rem;
  height: 1rem;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: #fff;
  animation: spin 1s ease-in-out infinite;
  margin-right: 0.5rem;
  vertical-align: middle;
}

button:disabled .loading {
  border-top-color: #666;
}

/* Pico Modal Overrides */
dialog {
  border: none;
  padding: 0;
  max-width: 600px;
  background: transparent;
}

dialog::backdrop {
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(3px);
}

dialog > article {
  margin: 0;
  max-height: 90vh;
  overflow-y: auto;
}

/* Form validation styles */
[aria-invalid="true"] {
  border-color: #b71c1c !important;
  background-color: #ffebee;
}

[aria-invalid="true"]:focus {
  box-shadow: 0 0 0 0.2rem rgba(183, 28, 28, 0.25);
}

/* Error and success messages */
[role="alert"].secondary {
  display: none;
  margin: 0 0 1rem 0;
  padding: 0.75rem 1rem;
  border-radius: 4px;
  font-size: 0.9em;
  animation: fadeIn 0.3s ease;
}

#login-error,
#register-error {
  color: #b71c1c;
  background-color: #ffebee;
  border-left: 4px solid #b71c1c;
}

#login-success,
#register-success {
  color: #1b5e20;
  background-color: #e8f5e9;
  border-left: 4px solid #1b5e20;
}

/* Focus styles for better accessibility */
input:focus {
  outline: none;
  box-shadow: 0 0 0 0.2rem rgba(67, 160, 71, 0.25);
  border-color: #43a047;
}

/* Loading state for buttons */
button:disabled {
  opacity: 0.8;
  cursor: not-allowed;
  position: relative;
}

button:disabled .loading {
  border-top-color: #fff;
}

.form-group label {
  display: block;
  margin-bottom: 0.4em;
  color: #444;
  font-weight: 500;
}

.form-group input {
  width: 100%;
  padding: 0.7em;
  border: 1px solid #d0d0d0;
  border-radius: 4px;
  font-size: 1em;
}

.form-group input:focus {
  border-color: #2ecc40;
  outline: none;
  box-shadow: 0 0 0 2px rgba(46, 204, 64, 0.2);
}

.form-group small {
  display: block;
  margin-top: 0.3em;
  color: #666;
  font-size: 0.85em;
}

.btn {
  display: inline-block;
  padding: 0.7em 1.4em;
  background: #2ecc40;
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 1em;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  transition: background 0.2s;
}

.btn:hover {
  background: #25a32a;
}

.btn-primary {
  width: 100%;
  padding: 0.9em;
  font-size: 1.1em;
  font-weight: 500;
}

/* logout styles */
.logout-container {
  max-width: 400px;
  margin: 80px auto;
  text-align: center;
}
