/* Variables */
:root {
  --primary-color: #c41e3a;
  --primary-dark: #a01830;
  --secondary-color: #228b22;
  --secondary-dark: #1a6b1a;
  --background-color: #f5f5f5;
  --card-background: #ffffff;
  --text-color: #333333;
  --text-muted: #666666;
  --border-color: #dddddd;
  --success-color: #28a745;
  --warning-color: #ffc107;
  --danger-color: #dc3545;
  --info-color: #17a2b8;
}

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

/* Base styles */
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background-color: var(--background-color);
  color: var(--text-color);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
header {
  background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
  color: white;
  padding: 1rem 2rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

nav {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 1.5rem;
  font-weight: bold;
  color: white;
  text-decoration: none;
}

.nav-links {
  display: flex;
  gap: 1.5rem;
}

.nav-links a {
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
  transition: color 0.2s;
}

.nav-links a:hover {
  color: white;
}

/* Main content */
main {
  flex: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
  width: 100%;
}

/* Footer */
footer {
  background-color: var(--primary-dark);
  color: white;
  text-align: center;
  padding: 1rem;
  margin-top: auto;
}

/* Hero section */
.hero {
  text-align: center;
  padding: 3rem 1rem;
  background: linear-gradient(135deg, #fff8dc, #ffe4e1);
  border-radius: 12px;
  margin-bottom: 2rem;
}

.hero h1 {
  font-size: 3rem;
  color: var(--primary-color);
  margin-bottom: 0.5rem;
}

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

/* Stats */
.stats {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-bottom: 2rem;
}

.stat-box {
  background: white;
  padding: 1.5rem 2rem;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  text-align: center;
}

.stat-number {
  font-size: 2.5rem;
  font-weight: bold;
  color: var(--secondary-color);
  display: block;
}

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

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

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

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

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

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

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

.btn-danger:hover {
  background-color: #c82333;
}

.btn-small {
  padding: 0.4rem 0.8rem;
  font-size: 0.85rem;
}

.btn-large {
  padding: 1rem 2rem;
  font-size: 1.1rem;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.cta-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
}

/* Steps section */
.how-it-works {
  margin-top: 2rem;
}

.how-it-works h2 {
  text-align: center;
  color: var(--primary-color);
  margin-bottom: 2rem;
}

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

.step {
  background: white;
  padding: 2rem;
  border-radius: 8px;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.step-number {
  width: 50px;
  height: 50px;
  background: var(--secondary-color);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: bold;
  margin: 0 auto 1rem;
}

.step h3 {
  color: var(--primary-color);
  margin-bottom: 0.5rem;
}

/* Form styles */
.form-page {
  max-width: 600px;
  margin: 0 auto;
  background: white;
  padding: 2rem;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.form-page h1 {
  color: var(--primary-color);
  margin-bottom: 0.5rem;
}

.form-section {
  margin: 2rem 0;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
}

.form-section:first-of-type {
  border-top: none;
  margin-top: 1rem;
}

.form-section h2 {
  color: var(--secondary-color);
  font-size: 1.2rem;
  margin-bottom: 1rem;
}

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

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

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

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

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 1rem;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(196, 30, 58, 0.1);
}

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

/* Alerts */
.alert {
  padding: 1rem;
  border-radius: 6px;
  margin-bottom: 1rem;
}

.alert-success {
  background-color: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.alert-error {
  background-color: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

.alert-warning {
  background-color: #fff3cd;
  color: #856404;
  border: 1px solid #ffeeba;
}

.alert-info {
  background-color: #d1ecf1;
  color: #0c5460;
  border: 1px solid #bee5eb;
}

/* Success page */
.success-page {
  text-align: center;
  max-width: 600px;
  margin: 0 auto;
  background: white;
  padding: 3rem;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.success-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
}

.success-page h1 {
  color: var(--secondary-color);
  margin-bottom: 0.5rem;
}

.success-info {
  text-align: left;
  background: #f8f9fa;
  padding: 1.5rem;
  border-radius: 8px;
  margin: 2rem 0;
}

.success-info h2 {
  color: var(--primary-color);
  margin-bottom: 1rem;
}

.success-info ul {
  list-style: none;
}

.success-info li {
  padding: 0.5rem 0;
}

/* Error page */
.error-page {
  text-align: center;
  max-width: 600px;
  margin: 2rem auto;
  background: white;
  padding: 3rem;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.error-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
}

.error-page h1 {
  color: var(--danger-color);
  margin-bottom: 1rem;
}

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

/* Login page */
.login-page {
  max-width: 400px;
}

.login-form {
  margin-top: 1.5rem;
}

.back-link {
  margin-top: 1.5rem;
  text-align: center;
}

.back-link a {
  color: var(--text-muted);
}

/* Admin pages */
.admin-page {
  background: white;
  padding: 2rem;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.admin-page h1 {
  color: var(--primary-color);
  margin-bottom: 0.5rem;
}

.admin-page > p {
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

/* Admin stats */
.admin-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}

.stat-card {
  background: #f8f9fa;
  padding: 1.5rem;
  border-radius: 8px;
  text-align: center;
}

.stat-card .stat-value {
  font-size: 2rem;
  font-weight: bold;
  color: var(--primary-color);
  display: block;
}

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

.stat-card.stat-success {
  background: #d4edda;
}

.stat-card.stat-success .stat-value {
  color: var(--success-color);
}

.stat-card.stat-warning {
  background: #fff3cd;
}

.stat-card.stat-warning .stat-value {
  color: #856404;
}

/* Admin actions */
.admin-actions {
  display: flex;
  gap: 1rem;
  margin: 1.5rem 0;
}

/* Data tables */
.table-wrapper {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
}

.data-table th,
.data-table td {
  padding: 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

.data-table th {
  background: #f8f9fa;
  font-weight: 600;
}

.data-table tr:hover {
  background: #f8f9fa;
}

/* Sections */
.participants-section,
.exclusions-list-section,
.add-exclusion-section,
.draw-action-section,
.draw-results-section,
.email-section,
.reset-section {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-color);
}

.participants-section h2,
.exclusions-list-section h2,
.add-exclusion-section h2,
.draw-action-section h2,
.draw-results-section h2,
.email-section h2,
.reset-section h2 {
  color: var(--secondary-color);
  margin-bottom: 1rem;
}

.empty-message {
  color: var(--text-muted);
  font-style: italic;
}

/* Exclusion form */
.exclusion-form .form-row {
  display: flex;
  align-items: flex-end;
  gap: 1rem;
  flex-wrap: wrap;
}

.arrow-group {
  display: flex;
  align-items: center;
}

.arrow-group .arrow {
  color: var(--text-muted);
  font-weight: 500;
  white-space: nowrap;
}

.arrow-cell {
  color: var(--text-muted);
  font-weight: bold;
}

/* Draw page */
.draw-status {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}

.status-card {
  background: #f8f9fa;
  padding: 1.5rem;
  border-radius: 8px;
  text-align: center;
}

.status-card h3 {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

.status-value {
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--text-color);
}

.status-done {
  color: var(--success-color);
}

.status-pending {
  color: var(--warning-color);
}

.draw-form {
  margin-top: 1.5rem;
}

.security-notice {
  background: #e7f3ff;
  padding: 1rem;
  border-radius: 6px;
  border-left: 4px solid var(--info-color);
  margin-bottom: 1rem;
}

.email-actions {
  margin-top: 1rem;
}

/* Badges */
.badge {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.85rem;
}

.badge-success {
  background: #d4edda;
  color: #155724;
}

.badge-pending {
  background: #fff3cd;
  color: #856404;
}

/* Text utilities */
.text-muted {
  color: var(--text-muted);
}

.text-success {
  color: var(--success-color);
}

.text-warning {
  color: #856404;
}

/* Responsive */
@media (max-width: 768px) {
  .hero h1 {
    font-size: 2rem;
  }

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

  .admin-stats,
  .draw-status {
    grid-template-columns: 1fr 1fr;
  }

  nav {
    flex-direction: column;
    gap: 1rem;
  }

  .nav-links {
    flex-wrap: wrap;
    justify-content: center;
  }

  .exclusion-form .form-row {
    flex-direction: column;
    align-items: stretch;
  }

  .arrow-group {
    justify-content: center;
  }
}
