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

:root {
  --primary-color: #8B4513;
  --primary-dark: #6B3410;
  --secondary-color: #D4A574;
  --background: #1a1a1a;
  --surface: #2d2d2d;
  --surface-light: #3d3d3d;
  --text: #ffffff;
  --text-muted: #a0a0a0;
  --success: #4CAF50;
  --error: #f44336;
  --danger: #d32f2f;
  --border-radius: 12px;
  --shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  background: var(--background);
  color: var(--text);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

#app {
  min-height: 100%;
}

.screen {
  min-height: 100vh;
  padding: 20px;
  display: flex;
  flex-direction: column;
}

.hidden {
  display: none !important;
}

.container {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  flex: 1;
}

.center {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

/* Typography */
h1 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--secondary-color);
}

h2 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.subtitle {
  color: var(--text-muted);
  margin-bottom: 2rem;
}

/* Loading */
#loading-screen {
  justify-content: center;
  align-items: center;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid var(--surface-light);
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 1rem;
}

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

/* Header */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.whisky-number {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--secondary-color);
}

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

.form-group label {
  display: block;
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.form-group small {
  display: block;
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-top: 0.5rem;
}

.form-group .optional {
  font-weight: 400;
  color: var(--text-muted);
  font-size: 0.85rem;
}

input[type="text"],
input[type="tel"],
input[type="password"] {
  width: 100%;
  padding: 14px 16px;
  font-size: 1rem;
  border: 2px solid var(--surface-light);
  border-radius: var(--border-radius);
  background: var(--surface);
  color: var(--text);
  transition: border-color 0.2s;
}

input:focus {
  outline: none;
  border-color: var(--primary-color);
}

input::placeholder {
  color: var(--text-muted);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 24px;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}

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

.btn-primary:hover {
  background: var(--primary-dark);
}

.btn-primary:active {
  transform: scale(0.98);
}

.btn-secondary {
  background: var(--surface-light);
  color: var(--text);
}

.btn-secondary:hover {
  background: #4d4d4d;
}

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

.btn-danger:hover {
  background: #b71c1c;
}

.btn-small {
  padding: 8px 16px;
  font-size: 0.9rem;
}

.btn-large {
  padding: 18px 32px;
  font-size: 1.1rem;
}

.btn-link {
  background: none;
  color: var(--secondary-color);
  padding: 8px;
}

.btn-link:hover {
  text-decoration: underline;
}

/* Divider */
.divider {
  display: flex;
  align-items: center;
  margin: 2rem 0;
  color: var(--text-muted);
}

.divider::before,
.divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--surface-light);
}

.divider span {
  padding: 0 1rem;
  font-size: 0.9rem;
}

/* Error message */
.error-message {
  background: rgba(244, 67, 54, 0.1);
  border: 1px solid var(--error);
  color: var(--error);
  padding: 12px 16px;
  border-radius: var(--border-radius);
  margin-top: 1rem;
  font-size: 0.9rem;
}


/* Welcome card */
.welcome-card {
  background: var(--surface);
  padding: 1.5rem;
  border-radius: var(--border-radius);
  margin-bottom: 2rem;
  box-shadow: var(--shadow);
}

.progress-info {
  margin-top: 1rem;
}

.progress-bar {
  height: 8px;
  background: var(--surface-light);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 0.5rem;
}

.progress-fill {
  height: 100%;
  background: var(--success);
  transition: width 0.3s ease;
  width: 0%;
}

#progress-text {
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* Instructions */
.instructions {
  background: var(--surface);
  padding: 1.5rem;
  border-radius: var(--border-radius);
  margin-bottom: 2rem;
}

.instructions ol {
  padding-left: 1.5rem;
}

.instructions li {
  margin-bottom: 0.75rem;
  color: var(--text-muted);
}

/* Completed list */
.completed-list {
  margin-top: 1rem;
}


#completed-whiskies {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

#completed-whiskies span {
  background: var(--success);
  color: white;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 500;
}

/* Radio & Checkbox groups */
.radio-group,
.checkbox-group {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.radio-option,
.checkbox-option {
  display: block;
  cursor: pointer;
}

.radio-option input,
.checkbox-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.radio-label,
.checkbox-label {
  display: block;
  padding: 14px 16px;
  background: var(--surface);
  border: 2px solid var(--surface-light);
  border-radius: var(--border-radius);
  text-align: center;
  font-weight: 500;
  transition: all 0.2s;
}

.radio-option input:checked + .radio-label,
.checkbox-option input:checked + .checkbox-label {
  background: var(--primary-color);
  border-color: var(--primary-color);
  color: white;
}

.radio-option:active .radio-label,
.checkbox-option:active .checkbox-label {
  transform: scale(0.98);
}

/* Info card */
.info-card {
  background: var(--surface);
  padding: 2rem;
  border-radius: var(--border-radius);
  text-align: center;
}


.info-card p {
  margin-bottom: 1.5rem;
  color: var(--text-muted);
}

/* Success screen */
.success-icon {
  width: 80px;
  height: 80px;
  background: var(--success);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  color: white;
  margin-bottom: 1.5rem;
}

#success-progress {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

#success-home-btn {
  margin-top: 2rem;
  width: auto;
  padding: 14px 48px;
}

/* Admin */
.admin-container {
  width: 90%;
  max-width: none;
  padding: 0;
}

.admin-login-minimal {
  max-width: 400px;
  margin: 100px auto;
}

.admin-login-minimal form {
  display: flex;
  gap: 10px;
}

.admin-login-minimal input {
  flex: 1;
}

.admin-login-minimal .btn {
  width: auto;
}

.admin-actions {
  display: flex;
  gap: 10px;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.table-wrapper {
  overflow-x: auto;
  background: var(--surface);
  border-radius: var(--border-radius);
  margin-bottom: 2rem;
}

#results-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  min-width: 600px;
}

#results-table th,
#results-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--surface-light);
}

#results-table th {
  background: var(--surface-light);
  font-weight: 600;
  white-space: nowrap;
}

#results-table tr:last-child td {
  border-bottom: none;
}

#results-table .description-row {
  background: var(--surface-light);
}

#results-table .description-row td {
  font-size: 0.8rem;
  color: var(--secondary-color);
}

#results-table .correct-row {
  background: rgba(76, 175, 80, 0.1);
  font-weight: 600;
}

#results-table .notes-cell {
  font-size: 0.75rem;
  max-width: 100px;
  word-wrap: break-word;
}

#results-table .correct-answer {
  color: var(--success);
}

#results-table .wrong-answer {
  color: var(--error);
}

#results-table .score-cell {
  font-weight: 700;
  font-size: 1rem;
}

#results-table .answer-cell {
  position: relative;
  white-space: nowrap;
}

#results-table .btn-delete-small {
  display: inline-block;
  width: 18px;
  height: 18px;
  padding: 0;
  margin-left: 4px;
  font-size: 12px;
  line-height: 16px;
  text-align: center;
  background: var(--danger);
  color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  opacity: 0.6;
  vertical-align: middle;
}

#results-table .btn-delete-small:hover {
  opacity: 1;
}

#results-table .btn-delete-user {
  padding: 4px 8px;
  font-size: 0.75rem;
}

/* Admin Header */
.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.5rem;
}

/* Admin Tabs */
.admin-tabs {
  display: flex;
  gap: 10px;
  border-bottom: 2px solid var(--surface-light);
  padding-bottom: 10px;
}

.tab-btn {
  padding: 10px 20px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  border-radius: var(--border-radius) var(--border-radius) 0 0;
  transition: all 0.2s;
}

.tab-btn:hover {
  color: var(--text);
  background: var(--surface);
}

.tab-btn.active {
  color: var(--secondary-color);
  background: var(--surface);
}


.tab-description {
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

/* Whiskies Edit List */
.whiskies-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.whisky-edit-card {
  background: var(--surface);
  border-radius: var(--border-radius);
  padding: 1.5rem;
}

.whisky-edit-card h3 {
  color: var(--secondary-color);
  margin-bottom: 1rem;
}

.whisky-edit-card .form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

.whisky-edit-card .form-row.full-width {
  grid-template-columns: 1fr;
}

.whisky-edit-card label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.whisky-edit-card input,
.whisky-edit-card select {
  width: 100%;
  padding: 10px 12px;
  font-size: 0.95rem;
  border: 1px solid var(--surface-light);
  border-radius: 8px;
  background: var(--background);
  color: var(--text);
}

.whisky-edit-card input:focus,
.whisky-edit-card select:focus {
  outline: none;
  border-color: var(--primary-color);
}

.whisky-edit-card .save-status {
  font-size: 0.85rem;
  color: var(--success);
  opacity: 0;
  transition: opacity 0.3s;
}

.whisky-edit-card .save-status.visible {
  opacity: 1;
}

.whisky-edit-card .card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.whisky-edit-card .card-header h3 {
  margin-bottom: 0;
}

.whisky-edit-card .btn-delete-whisky {
  padding: 6px 12px;
  font-size: 0.8rem;
}

.btn-add-whisky {
  margin-top: 1rem;
  width: 100%;
}

/* Language selector */
.lang-selector {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  margin-bottom: 1.5rem;
}

.lang-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  padding: 4px 8px;
  transition: color 0.2s;
}

.lang-btn:hover {
  color: var(--text);
}

.lang-btn.active {
  color: var(--secondary-color);
  font-weight: 700;
}

.lang-divider {
  color: var(--text-muted);
  margin: 0 2px;
}

/* Mobile adjustments */
@media (max-width: 400px) {
  .radio-group,
  .checkbox-group {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 1.75rem;
  }
}

/* Tablet/Desktop */
@media (min-width: 768px) {
  .screen {
    padding: 40px;
  }
}
