/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary-color: #a61e4d;
  --primary-dark: #7d1538;
  --primary-light: #c2255c;
  --secondary-color: #f59f00;
  --bg-color: #f8f9fa;
  --card-bg: #ffffff;
  --text-color: #212529;
  --text-muted: #6c757d;
  --border-color: #dee2e6;
  --success-color: #40c057;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.15);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-color);
  line-height: 1.6;
  min-height: 100vh;
  padding-bottom: 2rem;
}

/* Container */
.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 1rem;
}

/* Header */
header {
  text-align: center;
  padding: 2rem 1rem 1rem;
}

header h1 {
  font-size: 2.5rem;
  color: var(--primary-color);
  margin-bottom: 0.5rem;
}

.subtitle {
  color: var(--text-muted);
  font-size: 1.1rem;
}

/* Card */
.card {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow);
}

/* Current Bake Section */
.active-bake-card {
  background: var(--card-bg);
  border: 2px solid var(--border-color);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow);
  transition: transform 0.2s, box-shadow 0.2s;
}

.active-bake-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary-color);
}

.current-bake-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--border-color);
}

.current-bake-header h2 {
  color: var(--primary-color);
  font-size: 1.5rem;
}

.current-bake-header h3 {
  color: var(--primary-color);
  font-size: 1.35rem;
  margin: 0;
}

.time-badge {
  background: var(--secondary-color);
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
}

.bake-info h3 {
  font-size: 1.75rem;
  margin-bottom: 0.5rem;
  color: var(--text-color);
}

.bake-type {
  display: inline-block;
  background: var(--primary-light);
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 4px;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.bake-description {
  color: var(--text-muted);
  font-style: italic;
  margin: 0.75rem 0;
  padding: 0.75rem;
  background: var(--bg-color);
  border-radius: 6px;
}

.bake-stats {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-top: 0.5rem;
}

/* Rating Input */
.rating-input {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-color);
}

.rating-input label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: var(--text-color);
}

.rating-controls {
  display: flex;
  gap: 1rem;
}

.rating-controls input,
.rating-controls select {
  flex: 1;
  padding: 0.75rem;
  font-size: 1.1rem;
  border: 2px solid var(--border-color);
  border-radius: 8px;
  transition: border-color 0.2s;
  font-family: inherit;
  background-color: white;
}

.rating-controls input:focus,
.rating-controls select:focus {
  outline: none;
  border-color: var(--primary-color);
}

.rating-select {
  cursor: pointer;
}

/* No Bake Message */
.no-bake {
  text-align: center;
  padding: 2rem 1rem;
}

.no-bake h2 {
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.no-bake p {
  color: var(--text-muted);
  margin: 0.5rem 0;
}

/* Action Buttons */
.actions {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

/* Buttons */
.btn {
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  flex: 1;
  min-width: 150px;
}

.btn-primary {
  background: var(--primary-color);
  color: white;
}

.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn-secondary {
  background: var(--secondary-color);
  color: white;
}

.btn-secondary:hover {
  background: #fab005;
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn:active {
  transform: translateY(0);
}

/* League Table */
.league {
  margin-bottom: 2rem;
}

.league h2 {
  color: var(--primary-color);
  margin-bottom: 1rem;
  font-size: 1.75rem;
}

.table-wrapper {
  background: var(--card-bg);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

table {
  width: 100%;
  border-collapse: collapse;
}

thead {
  background: var(--primary-color);
  color: white;
}

th {
  padding: 1rem;
  text-align: left;
  font-weight: 600;
  font-size: 0.95rem;
}

tbody tr {
  border-bottom: 1px solid var(--border-color);
  transition: background-color 0.2s;
}

tbody tr:hover {
  background-color: var(--bg-color);
}

tbody tr:last-child {
  border-bottom: none;
}

td {
  padding: 1rem;
}

.rank {
  font-weight: bold;
  font-size: 1.2rem;
  width: 60px;
  text-align: center;
}

.bake-title {
  font-weight: 600;
  color: var(--text-color);
}

.avg-score {
  font-weight: 700;
  color: var(--primary-color);
  font-size: 1.1rem;
}

.votes {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Form Styles */
.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text-color);
}

.required {
  color: var(--primary-color);
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.75rem;
  font-size: 1rem;
  border: 2px solid var(--border-color);
  border-radius: 8px;
  font-family: inherit;
  transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary-color);
}

.form-group textarea {
  resize: vertical;
  min-height: 80px;
}

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

.form-actions .btn {
  flex: 1;
}

/* Footer */
footer {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--text-muted);
  font-size: 0.9rem;
  position: relative;
}

.admin-link {
  position: absolute;
  bottom: 0.5rem;
  right: 0.5rem;
  opacity: 0.5;
  font-size: 1.5rem;
  text-decoration: none;
  transition: all 0.2s;
  background: rgba(0, 0, 0, 0.05);
  padding: 0.5rem;
  border-radius: 50%;
  line-height: 1;
}

.admin-link:hover {
  opacity: 1;
  transform: scale(1.1);
  background: rgba(166, 30, 77, 0.1);
}

/* Admin Page */
.admin-actions {
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  flex-wrap: wrap;
}

.admin-bake-item {
  background: var(--bg-color);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1rem;
}

.admin-bake-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-color);
}

.admin-bake-header h3 {
  margin: 0;
  color: var(--text-color);
  font-size: 1.25rem;
}

.bake-type-badge {
  background: var(--primary-color);
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 4px;
  font-size: 0.85rem;
  font-weight: 600;
}

.admin-bake-details {
  margin: 0.75rem 0;
}

.admin-bake-details p {
  margin: 0.5rem 0;
  color: var(--text-color);
  font-size: 0.95rem;
}

.admin-bake-details strong {
  color: var(--text-muted);
  font-weight: 600;
}

.admin-bake-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-color);
}

.btn-small {
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  font-weight: 600;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-danger {
  background: #fa5252;
  color: white;
}

.btn-danger:hover {
  background: #e03131;
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn-danger:active {
  transform: translateY(0);
}

/* Responsive Design */
@media (max-width: 600px) {
  header h1 {
    font-size: 2rem;
  }

  .subtitle {
    font-size: 1rem;
  }

  .actions {
    flex-direction: column;
  }

  .rating-controls {
    flex-direction: column;
  }

  .card {
    padding: 1rem;
  }

  th, td {
    padding: 0.75rem 0.5rem;
    font-size: 0.9rem;
  }

  .rank {
    width: 50px;
  }

  .form-actions {
    flex-direction: column-reverse;
  }
}

/* Loading State */
.loading {
  text-align: center;
  padding: 3rem;
  color: var(--text-muted);
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
}

.empty-state h3 {
  margin-bottom: 0.5rem;
}
