@import url("https://fonts.googleapis.com/css2?family=Open+Sans:ital,wght@0,300..800;1,300..800&display=swap");

.open-sans {
  font-family: "Open Sans", sans-serif;
}

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

body {
  min-height: 100vh;
  background-color: #0f172a;
  color: #e2e8f0;
  font-family:
    system-ui,
    -apple-system,
    sans-serif;
  padding: 0 1rem;
  padding-bottom: 8rem;
}

header {
  padding: 1.5rem 0;
  border-bottom: 1px solid #1e293b;
  margin-bottom: 2rem;
}

.header-content {
  max-width: 68rem;
  margin: 0 auto;
  padding: 0 1rem;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  flex-direction: column;
  gap: 1rem;
}

header h1 {
  font-family:
    "Open Sans",
    system-ui,
    -apple-system,
    sans-serif;
  font-weight: 700;
  font-size: 2rem;
  margin: 0;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.welcome-text {
  color: #cbd5e1;
  font-size: 1rem;
}

.logout-form {
  margin: 0;
  padding: 0;
}

.auth-nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.auth-nav a {
  color: #94a3b8;
  text-decoration: none;
  transition: color 0.2s;
  font-size: 1rem;
}

.auth-nav a:hover {
  color: #60a5fa;
}

.logout-btn {
  background: none;
  border: 1px solid #475569;
  color: #94a3b8;
  padding: 0.5rem 1rem;
  border-radius: 0.375rem;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.2s;
}

.logout-btn:hover {
  background: #1e293b;
  color: #e2e8f0;
  border-color: #60a5fa;
}

main {
  max-width: 68rem;
  margin: 0 auto;
}

#content {
  min-height: 60vh;
}

.welcome {
  text-align: center;
  padding: 1.5rem 1rem;
}

.welcome h2 {
  color: #60a5fa;
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.welcome p {
  color: #94a3b8;
  font-size: 1.25rem;
  margin-bottom: 2rem;
}

.welcome .subtitle {
  color: #fbbf24;
  font-weight: 600;
  font-size: 1.125rem;
  margin-bottom: 2rem;
}

.welcome-gif {
  max-width: 100%;
  width: 400px;
  margin: 2rem auto;
  display: block;
  border-radius: 0.5rem;
  opacity: 0.9;
}

.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border-radius: 0.375rem;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.2s;
  border: none;
  cursor: pointer;
  font-size: 1rem;
}

.dashboard-links,
.auth-links {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.error-messages,
.success-message {
  max-width: 48rem;
  margin: 0 auto 1.5rem;
  padding: 1rem;
  border-radius: 0.375rem;
}

.error-messages {
  background: #7f1d1d;
  border: 1px solid #991b1b;
  color: #fecaca;
}

.success-message {
  background: #14532d;
  border: 1px solid #166534;
  color: #86efac;
}

form {
  max-width: 28rem;
  margin: 0 auto;
  padding: 2rem;
  background: #1e293b;
  border-radius: 0.5rem;
  border: 1px solid #334155;
}

.form-group {
  margin-bottom: 1.5rem;
}

label {
  display: block;
  color: #cbd5e1;
  margin-bottom: 0.5rem;
  font-weight: 500;
}

input[type="text"],
input[type="password"],
input[type="number"],
select,
textarea {
  width: 100%;
  padding: 0.75rem;
  background: #0f172a;
  border: 1px solid #475569;
  border-radius: 0.375rem;
  color: #e2e8f0;
  font-size: 1rem;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: #3b82f6;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: #1e293b;
  border-radius: 0.5rem;
  overflow: hidden;
}

thead {
  background: #334155;
}

th,
td {
  padding: 1rem;
  text-align: left;
  border-bottom: 1px solid #334155;
}

th {
  color: #cbd5e1;
  font-weight: 600;
}

td {
  color: #94a3b8;
}

tr:hover {
  background: #334155;
}

footer {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  color: #64748b;
  padding: 1rem;
  font-size: 0.875rem;
  background-color: #0f172a;
  border-top: 1px solid #1e293b;
}

footer a {
  display: inline-block;
}

footer img {
  width: 2rem;
  height: 2rem;
  transition: transform 0.3s ease-in-out;
  filter: invert(1);
  opacity: 0.6;
}

footer img:hover {
  transform: rotate(360deg);
  opacity: 1;
}

@media (min-width: 640px) {
  body {
    padding-bottom: 6rem;
  }

  header h1 {
    font-size: 2.5rem;
  }

  footer {
    flex-direction: row;
    gap: 1rem;
    font-size: 1rem;
  }

  footer img {
    width: 2.5rem;
    height: 2.5rem;
  }
}

@media (min-width: 768px) {
  header h1 {
    font-size: 3rem;
  }
}

.auth-container {
  max-width: 28rem;
  margin: 2rem auto;
  text-align: center;
}

.auth-container h2 {
  color: #60a5fa;
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.auth-container .subtitle {
  color: #fbbf24;
  font-weight: 600;
  margin-bottom: 2rem;
}

.auth-container form {
  text-align: left;
}

.btn-full {
  width: 100%;
  margin-top: 0.5rem;
}

.form-footer {
  margin-top: 1.5rem;
  color: #94a3b8;
}

.form-footer a {
  color: #60a5fa;
  text-decoration: none;
}

.form-footer a:hover {
  text-decoration: underline;
}

.dashboard {
  max-width: 68rem;
  margin: 0 auto;
}

.dashboard h2 {
  color: #60a5fa;
  font-size: 2rem;
  margin-bottom: 2rem;
  text-align: center;
}

.dashboard h3 {
  color: #cbd5e1;
  font-size: 1.25rem;
  margin-bottom: 1rem;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: #1e293b;
  padding: 1.5rem;
  border-radius: 0.5rem;
  border: 1px solid #334155;
  text-align: center;
}

.stat-card.highlight {
  border-color: #60a5fa;
  background: linear-gradient(135deg, #1e293b 0%, #1e3a5f 100%);
}

.stat-card.positive {
  border-color: #22c55e;
}

.stat-card.negative {
  border-color: #ef4444;
}

.stat-value {
  font-size: 2.5rem;
  font-weight: bold;
  color: #60a5fa;
  margin: 0.5rem 0;
}

.stat-card.positive .stat-value {
  color: #22c55e;
}

.stat-card.negative .stat-value {
  color: #ef4444;
}

.stat-label {
  color: #94a3b8;
  font-size: 0.875rem;
}

.collection-breakdown {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.breakdown-card {
  background: #1e293b;
  padding: 1.5rem;
  border-radius: 0.5rem;
  border: 1px solid #334155;
}

.breakdown-stats {
  margin: 1rem 0;
  color: #94a3b8;
}

.breakdown-stats p {
  margin: 0.5rem 0;
}

.breakdown-stats strong {
  color: #cbd5e1;
}

.quick-actions {
  background: #1e293b;
  padding: 1.5rem;
  border-radius: 0.5rem;
  border: 1px solid #334155;
  text-align: center;
}

.action-buttons {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  justify-content: center;
}

.btn-small {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  border-radius: 0.375rem;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  font-weight: 500;
  white-space: nowrap;
}

.btn-edit {
  background: #3b82f6;
  color: white;
}

.btn-edit:hover {
  background: #2563eb;
  transform: translateY(-1px);
}

.btn-delete {
  background: #ef4444;
  color: white;
}

.btn-delete:hover {
  background: #dc2626;
  transform: translateY(-1px);
}

.btn-price {
  background: #6366f1;
  color: white;
}

.btn-price:hover {
  background: #4f46e5;
  transform: translateY(-1px);
}

.btn-price:disabled {
  background: #475569;
  cursor: not-allowed;
  transform: none;
}

.btn-price.loading {
  opacity: 0.8;
}

.spinner {
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 2px solid #fff;
  border-radius: 50%;
  border-top-color: transparent;
  animation: spin 0.6s linear infinite;
  margin-right: 4px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.price-updated {
  animation: flash 0.5s ease;
}

@keyframes flash {
  0%,
  100% {
    background-color: transparent;
  }
  50% {
    background-color: #10b981;
    color: #ffffff;
  }
}

.price-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.price-modal {
  position: relative;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 0.5rem;
  padding: 1.5rem;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  z-index: 1000;
  min-width: 400px;
  max-width: 90vw;
}

.price-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #334155;
}

.price-modal-header h3 {
  margin: 0;
  color: #e2e8f0;
  font-size: 1.25rem;
  font-weight: 600;
}

.modal-close-btn {
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.25rem;
  transition: all 0.2s;
}

.modal-close-btn:hover {
  background: #334155;
  color: #e2e8f0;
}

.price-details {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.price-detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
}

.price-detail-label {
  color: #94a3b8;
  font-size: 0.875rem;
  font-weight: 500;
}

.price-detail-value {
  color: #e2e8f0;
  font-weight: 600;
  font-size: 1rem;
  text-align: right;
}

.price-detail-value.highlight {
  color: #10b981;
  font-size: 1.5rem;
}

.price-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  padding-top: 1rem;
  border-top: 1px solid #334155;
}

.price-toast {
  position: fixed;
  top: 1rem;
  right: 1rem;
  padding: 1rem 1.5rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  z-index: 2000;
  animation: slideIn 0.3s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  min-width: 250px;
}

.price-toast.success {
  background: #10b981;
  color: white;
}

.price-toast.error {
  background: #ef4444;
  color: white;
}

.price-toast.info {
  background: #3b82f6;
  color: white;
}

.price-toast.fade-out {
  animation: fadeOut 0.3s ease forwards;
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes fadeOut {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

.action-buttons form {
  margin: 0;
  padding: 0;
  display: inline;
}

.no-data {
  text-align: center;
  color: #94a3b8;
  font-size: 1.125rem;
  margin: 2rem 0;
}

.collection-page {
  max-width: 80rem;
  margin: 0 auto;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.page-header h2 {
  color: #60a5fa;
  font-size: 2rem;
  margin: 0;
}

.collection-stats {
  display: flex;
  gap: 2rem;
  justify-content: center;
  padding: 1.5rem;
  background: #1e293b;
  border-radius: 0.5rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.stat-label {
  color: #94a3b8;
  font-size: 0.875rem;
}

.stat-item .stat-value {
  color: #60a5fa;
  font-size: 1.5rem;
  font-weight: bold;
}

.table-container {
  overflow-x: auto;
  background: #1e293b;
  border-radius: 0.5rem;
  border: 1px solid #334155;
}

table {
  margin: 0;
}

.action-buttons {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.btn-small {
  padding: 0.375rem 0.75rem;
  font-size: 0.875rem;
  border-radius: 0.25rem;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-edit {
  background: #3b82f6;
  color: white;
}

.btn-edit:hover {
  background: #2563eb;
}

.btn-delete {
  background: #ef4444;
  color: white;
}

.btn-delete:hover {
  background: #dc2626;
}

.form-page {
  max-width: 48rem;
  margin: 0 auto;
}

.form-page h2 {
  color: #60a5fa;
  font-size: 2rem;
  margin-bottom: 2rem;
  text-align: center;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.form-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-top: 2rem;
}

.empty-state {
  text-align: center;
  padding: 3rem;
  color: #94a3b8;
}

.empty-state p {
  margin-bottom: 1.5rem;
  font-size: 1.125rem;
}

.compare-page {
  max-width: 68rem;
  margin: 0 auto;
}

.compare-page h2 {
  color: #60a5fa;
  font-size: 2rem;
  margin-bottom: 2rem;
  text-align: center;
}

.compare-form {
  max-width: 28rem;
  margin: 0 auto 3rem;
  padding: 2rem;
  background: #1e293b;
  border-radius: 0.5rem;
  border: 1px solid #334155;
}

.comparison-results {
  margin-top: 3rem;
}

.comparison-results h3 {
  color: #cbd5e1;
  text-align: center;
  margin-bottom: 2rem;
}

.comparison-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 2rem;
  align-items: start;
  margin-bottom: 2rem;
}

.comparison-card {
  background: #1e293b;
  padding: 2rem;
  border-radius: 0.5rem;
  border: 1px solid #334155;
}

.comparison-card h4 {
  color: #60a5fa;
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
  text-align: center;
}

.comparison-stats .total-value {
  font-size: 2.5rem;
  font-weight: bold;
  color: #60a5fa;
  text-align: center;
  margin: 1rem 0;
}

.breakdown {
  margin: 1.5rem 0;
  padding: 1rem;
  background: #0f172a;
  border-radius: 0.375rem;
}

.breakdown-item {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0;
  color: #94a3b8;
}

.breakdown-item strong {
  color: #cbd5e1;
}

.vs-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: bold;
  color: #fbbf24;
}

.winner-banner {
  text-align: center;
  padding: 1.5rem;
  background: linear-gradient(135deg, #1e293b 0%, #1e3a5f 100%);
  border-radius: 0.5rem;
  border: 1px solid #60a5fa;
}

.winner-banner p {
  font-size: 1.5rem;
  color: #fbbf24;
  font-weight: bold;
  margin: 0;
}

.back-link {
  display: inline-block;
  color: #94a3b8;
  text-decoration: none;
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
  transition: color 0.2s;
}

.back-link:hover {
  color: #60a5fa;
}

@media (max-width: 768px) {
  .comparison-grid {
    grid-template-columns: 1fr;
  }

  .form-row {
    grid-template-columns: 1fr;
  }
}
