/* MacWP EOY Challenge - UI Components (Consolidated) */

/* ===== BUTTONS ===== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.875rem 1.75rem;
  /* 14px 28px */
  border: none;
  border-radius: 0.5rem;
  /* 8px */
  font-family: var(--font-primary);
  font-size: 1rem;
  /* 16px */
  font-weight: 500;
  letter-spacing: -0.01em;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s ease, box-shadow 0.2s ease;
  min-height: 3rem;
  /* 48px */
  /* No transform on hover as per design fix */
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  box-shadow: none;
}

/* Button Variants */
.btn-primary {
  background: #1f5f3f;
  color: #ffffff;
}

.btn-primary:hover:not(:disabled) {
  background: #15432a;
  box-shadow: 0 2px 8px rgba(31, 95, 63, 0.2);
}

.btn-secondary {
  background: linear-gradient(180deg, var(--bg-snow) 0%, var(--bg-winter) 100%);
  color: var(--text-bark);
  border: 1px solid var(--border-winter);
}

.btn-secondary:hover:not(:disabled) {
  background: linear-gradient(180deg, var(--bg-winter) 0%, var(--bg-frost) 100%);
  border-color: var(--border-pine);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.btn-festive {
  background: linear-gradient(135deg, var(--warm-red), var(--primary-green));
  color: var(--text-snow);
  box-shadow: var(--shadow-warm-glow);
}

.btn-festive:hover:not(:disabled) {
  box-shadow: var(--shadow-cozy-lg);
}

.btn-prize {
  background: var(--prize-gold);
  color: var(--text-pine);
  box-shadow: var(--shadow-prize-glow);
}

.btn-prize:hover:not(:disabled) {
  background: var(--prize-gold-hover);
}

.btn-full {
  width: 100%;
}

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  min-height: 2.5rem;
}

.btn-icon {
  background: none;
  border: none;
  color: var(--text-mist);
  font-size: var(--text-xl);
  padding: var(--space-2);
  cursor: pointer;
  border-radius: var(--radius-base);
  transition: all var(--duration-quick) var(--ease-cozy);
}

.btn-icon:hover {
  background: var(--bg-frost);
  color: var(--text-bark);
}

/* ===== FORMS ===== */

.form-group {
  margin-bottom: 20px;
}

.form-group:first-child {
  margin-top: 8px;
}

.form-label {
  display: block;
  font-weight: 500;
  color: #2a4a35;
  margin-bottom: 6px;
  font-size: 0.875rem;
}

.form-input,
.form-select,
.form-textarea {
  display: block;
  width: 100%;
  padding: 12px 16px;
  border: 1px solid #d1cec9;
  border-radius: 8px;
  font-family: var(--font-primary);
  font-size: 16px;
  line-height: 1.5;
  color: #1a1a1a;
  background: #ffffff;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  box-sizing: border-box;
  /* Important for width: 100% */
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: #1f5f3f;
  box-shadow: 0 0 0 3px rgba(31, 95, 63, 0.1);
  outline: none;
}

.form-input:invalid,
.form-select:invalid,
.form-textarea:invalid {
  border-color: var(--error-red);
}

.form-textarea {
  resize: vertical;
  min-height: 60px;
}

/* ===== CARDS ===== */

.winter-card {
  background: #ffffff;
  border: 1px solid #e5e3e0;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  position: relative;
  overflow: hidden;
  transition: box-shadow 0.2s ease;
}


.card-header {
  padding: 1.25rem 1.5rem;
  /* 20px 24px */
  border-bottom: 1px solid rgba(31, 95, 63, 0.12);
  background: #e8f4ed;
  position: relative;
  z-index: 1;
}

.card-content {
  padding: 1.5rem;
  /* 24px */
  position: relative;
  z-index: 1;
}

.card-content p {
  font-size: 16px;
  line-height: 1.65;
  color: #2d2d2d;
}

.card-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: #1f5f3f;
  margin: 0;
}

.card-subtitle {
  font-size: 0.875rem;
  color: #6b6b6b;
  margin: 8px 0 0 0;
}

/* Auth Card Specifics */
.auth-card {
  max-width: 400px;
  margin: 60px auto;
}

.auth-form {
  padding: 0 24px 24px 24px;
}

/* ===== TABS ===== */

.admin-tabs {
  display: flex;
  flex-wrap: wrap;
  border-bottom: 1px solid rgba(31, 95, 63, 0.15);
  background: #e8f4ed;
  padding: 0.5rem 0.75rem 0.25rem 0.75rem;
  margin-bottom: 1.5rem;
  border-radius: 0.5rem 0.5rem 0 0;
  gap: 0.25rem;
}

.tab-btn {
  background: transparent;
  border: none;
  padding: 0.75rem 1rem;
  font-family: var(--font-primary);
  font-size: 1rem;
  font-weight: 500;
  color: #6b6b6b;
  cursor: pointer;
  border-radius: 0.5rem 0.5rem 0 0;
  transition: color 0.2s ease, background-color 0.2s ease;
  border-bottom: 2px solid transparent;
  margin-bottom: 0.25rem;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1 1 auto;
  min-width: 0;
  justify-content: center;
}

.tab-btn:hover {
  background: #e8f4ed;
  color: #1f5f3f;
}

.tab-btn.active {
  background: transparent;
  color: #1f5f3f;
  border-bottom: 2px solid #1f5f3f;
  font-weight: 600;
}

.tab-content {
  min-height: 400px;
}

/* Mobile Tabs */
@media (max-width: 768px) {
  .admin-tabs {
    padding: 0.5rem 0.5rem 0.25rem 0.5rem;
  }

  .tab-btn {
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    flex: 1 1 calc(50% - 0.125rem);
  }
}

@media (max-width: 480px) {
  .tab-btn {
    padding: 0.5rem 0.25rem;
    font-size: 0.75rem;
    flex: 1 1 100%;
  }
}

/* ===== STATUS BADGES ===== */

.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 1rem;
  font-size: 14px;
  font-weight: 500;
  color: #4a4a4a;
}

.status-setup {
  background-color: #fff3cd;
  color: #856404;
}

.status-active {
  background-color: #d1e7dd;
  color: #0f5132;
}

.status-completed {
  background-color: #d1e7dd;
  color: #0f5132;
}

/* ===== CHECKLISTS ===== */

.checklist {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.checklist-item {
  display: flex;
  align-items: center;
  padding: 12px;
  background: #ffffff;
  border: 1px solid #e5e3e0;
  border-radius: 8px;
  transition: background-color 0.2s ease;
}

.checklist-item:hover {
  background: rgba(241, 240, 238, 0.5);
}

.checklist-status {
  margin-right: 12px;
  font-size: 1.2rem;
}

.checklist-label {
  font-size: 16px;
  color: #2d2d2d;
}

/* ===== PROGRESS INDICATORS ===== */

.progress-indicators {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-top: var(--space-4);
}

.progress-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.progress-label {
  font-weight: var(--font-medium);
  color: var(--text-bark);
}

.progress-value {
  color: var(--text-mist);
}

/* ===== MESSAGES ===== */

.error-message {
  background: var(--error-light);
  color: var(--error-red);
  padding: var(--component-padding-md);
  border-radius: var(--radius-lg);
  border: 1px solid var(--error-red);
  font-size: var(--text-sm);
  margin-top: var(--space-3);
}

.success-message {
  background: var(--success-light);
  color: var(--success-green);
  padding: var(--component-padding-md);
  border-radius: var(--radius-lg);
  border: 1px solid var(--success-green);
  font-size: var(--text-sm);
  margin-top: var(--space-3);
}

.warning-message {
  background: var(--warning-light);
  color: var(--warning-amber);
  padding: var(--component-padding-md);
  border-radius: var(--radius-lg);
  border: 1px solid var(--warning-amber);
  font-size: var(--text-sm);
  margin-top: var(--space-3);
}

/* ===== LOADING STATES ===== */

.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(254, 254, 254, 0.95) 0%, rgba(251, 249, 247, 0.95) 50%, rgba(247, 245, 243, 0.95) 100%);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.loading-content {
  text-align: center;
}

.winter-spinner {
  font-size: var(--text-5xl);
  animation: gentle-spin 3s ease-in-out infinite;
  margin-bottom: var(--space-4);
  filter: drop-shadow(0 4px 8px rgba(31, 95, 63, 0.2));
  transform-origin: center center;
}

@keyframes gentle-spin {
  0% {
    transform: rotate(0deg);
  }

  50% {
    transform: rotate(180deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

.loading-text {
  color: var(--text-bark);
  font-size: var(--text-lg);
  font-weight: var(--font-medium);
}

/* ===== MODALS ===== */

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  backdrop-filter: blur(4px);
}

.modal-content {
  max-width: 90vw;
  max-height: 90vh;
  width: 600px;
  margin: var(--space-4);
  animation: modal-appear var(--duration-normal) var(--ease-warm);
}

@keyframes modal-appear {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(-20px);
  }

  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-size: var(--text-2xl);
  font-weight: var(--font-semibold);
  color: var(--text-pine);
}

.modal-body {
  margin: var(--space-6) 0;
}

.modal-footer {
  display: flex;
  gap: var(--space-4);
  justify-content: flex-end;
}

/* ===== WICHTEL COMPONENTS ===== */

/* Form Hints and Info */
.form-hint {
  font-size: 0.8125rem;
  color: #6b6b6b;
  margin-top: 4px;
}

.form-info {
  background: #f0f7f3;
  border: 1px solid rgba(31, 95, 63, 0.2);
  border-radius: 8px;
  padding: 12px 16px;
  margin: 20px 0;
  font-size: 0.875rem;
  color: #2a4a35;
}

/* Status Badges Additional */
.status-registered {
  background-color: #d1e7dd;
  color: #0f5132;
}

/* Waiting Card */
.waiting-card .card-content {
  padding: 2rem;
}

.waiting-animation {
  margin: 1.5rem 0;
}

.waiting-icon {
  font-size: 4rem;
  display: inline-block;
  animation: gentle-bounce 2s ease-in-out infinite;
}

.waiting-message {
  font-size: 1.1rem;
  line-height: 1.7;
  color: #2d2d2d;
  margin: 1.5rem 0;
}

.status-info {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 1rem;
  margin-top: 1.5rem;
}

.status-info p {
  margin: 0.5rem 0;
  font-size: 0.9375rem;
}

/* Draw Animation Card */
.draw-animation-card .card-content {
  padding: 2rem;
}

.animation-title {
  font-size: 1.75rem;
  color: #1f5f3f;
  margin-bottom: 2rem;
}

.draw-animation-container {
  margin: 2rem 0;
}

/* Slot Machine */
.slot-machine {
  display: flex;
  justify-content: center;
  margin-bottom: 2rem;
}

.slot-window {
  width: 280px;
  height: 80px;
  background: linear-gradient(180deg, #1f5f3f 0%, #15432a 100%);
  border-radius: 12px;
  overflow: hidden;
  position: relative;
  box-shadow: inset 0 4px 12px rgba(0, 0, 0, 0.3), 0 4px 16px rgba(31, 95, 63, 0.3);
  border: 3px solid #d4a744;
}

.slot-window::before,
.slot-window::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  height: 20px;
  z-index: 2;
  pointer-events: none;
}

.slot-window::before {
  top: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.4) 0%, transparent 100%);
}

.slot-window::after {
  bottom: 0;
  background: linear-gradient(0deg, rgba(0,0,0,0.4) 0%, transparent 100%);
}

.slot-reel {
  display: flex;
  flex-direction: column;
  transition: transform 0.1s ease-out;
}

.slot-reel.spinning {
  animation: slot-spin 6s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.slot-name {
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  font-weight: 600;
  color: #ffffff;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

@keyframes slot-spin {
  0% {
    transform: translateY(0);
  }
  10% {
    transform: translateY(-200px);
  }
  25% {
    transform: translateY(-600px);
  }
  50% {
    transform: translateY(-1200px);
  }
  75% {
    transform: translateY(-800px);
  }
  90% {
    transform: translateY(-160px);
  }
  100% {
    transform: translateY(-80px);
  }
}

/* Draw Result */
.draw-result {
  padding: 2rem;
}

.result-reveal {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.result-label {
  font-size: 1.125rem;
  color: #6b6b6b;
}

.result-name {
  font-size: 2.5rem;
  font-weight: 700;
  color: #1f5f3f;
  text-shadow: 0 2px 4px rgba(31, 95, 63, 0.2);
}

.reveal-animation {
  animation: revealBounce 0.8s ease-out;
}

@keyframes revealBounce {
  0% {
    opacity: 0;
    transform: scale(0.5);
  }
  60% {
    opacity: 1;
    transform: scale(1.1);
  }
  100% {
    transform: scale(1);
  }
}

/* Assignment Card */
.assignment-card .card-content {
  padding: 1.5rem;
}

.wichtel-reveal {
  background: linear-gradient(135deg, #e8f4ed 0%, #f0f7f3 100%);
  border-radius: 12px;
  padding: 2rem;
  margin-bottom: 1.5rem;
  text-align: center;
  border: 2px solid rgba(31, 95, 63, 0.15);
}

.wichtel-name-display {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.wichtel-label {
  font-size: 1rem;
  color: #6b6b6b;
}

.wichtel-name {
  font-size: 2rem;
  font-weight: 700;
  color: #1f5f3f;
}

/* Wichtel Preferences */
.wichtel-preferences {
  background: #f8f9fa;
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.wichtel-preferences h3 {
  font-size: 1.125rem;
  color: #1f5f3f;
  margin: 0 0 1rem 0;
}

.pref-item {
  display: flex;
  gap: 1rem;
  padding: 1rem;
  background: #ffffff;
  border-radius: 8px;
  margin-bottom: 0.75rem;
  border: 1px solid #e5e3e0;
}

.pref-item:last-child {
  margin-bottom: 0;
}

.pref-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}

.pref-content {
  flex: 1;
}

.pref-content strong {
  display: block;
  font-size: 0.875rem;
  color: #2a4a35;
  margin-bottom: 0.25rem;
}

.pref-content p {
  margin: 0;
  font-size: 0.9375rem;
  color: #2d2d2d;
  line-height: 1.5;
}

.no-prefs {
  text-align: center;
  color: #6b6b6b;
  font-style: italic;
  padding: 1rem;
}

/* Wichtel Reminder */
.wichtel-reminder {
  background: linear-gradient(135deg, rgba(212, 167, 68, 0.1) 0%, rgba(212, 167, 68, 0.05) 100%);
  border: 1px solid rgba(212, 167, 68, 0.3);
  border-radius: 8px;
  padding: 1rem 1.5rem;
}

.wichtel-reminder p {
  margin: 0.5rem 0;
  font-size: 0.9375rem;
}

.wichtel-reminder p:first-child {
  margin-top: 0;
}

.wichtel-reminder p:last-child {
  margin-bottom: 0;
}

/* Button Sizes */
.btn-lg {
  padding: 1rem 2rem;
  font-size: 1.125rem;
  min-height: 3.5rem;
}

/* Utility Classes */
.text-center {
  text-align: center;
}

/* Error Card */
.error-card {
  border-color: var(--error-red);
}

.error-card .error-message {
  background: transparent;
  border: none;
  padding: 0;
  margin: 0 0 1rem 0;
  font-size: 1rem;
}

/* ===== LANDING PAGE ===== */

.status-overview {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.status-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
  border-bottom: 1px solid #e5e3e0;
}

.status-item:last-child {
  border-bottom: none;
}

.status-label {
  font-weight: 500;
  color: #2a4a35;
}

.status-value {
  color: #6b6b6b;
}

.landing-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.status-hint {
  font-size: 0.8125rem;
  color: #6b6b6b;
  text-align: center;
  margin: 0.5rem 0 0 0;
}

/* ===== WICHTEL SECTION ===== */

.wichtel-section {
  max-width: 600px;
  margin: 0 auto;
}

.section-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.section-header h2 {
  font-size: 1.5rem;
  color: #1f5f3f;
  margin: 0;
}

/* Wichtel Info Box */
.wichtel-info-box {
  background: linear-gradient(135deg, #e8f4ed 0%, #f0f7f3 100%);
  border: 1px solid rgba(31, 95, 63, 0.2);
  border-radius: 12px;
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}

.wichtel-info-box h4 {
  font-size: 1rem;
  color: #1f5f3f;
  margin: 0 0 0.75rem 0;
}

.wichtel-info-box p {
  font-size: 0.9375rem;
  line-height: 1.6;
  color: #2d2d2d;
  margin: 0 0 0.75rem 0;
}

.wichtel-info-box ul {
  margin: 0;
  padding-left: 1.25rem;
}

.wichtel-info-box li {
  font-size: 0.875rem;
  line-height: 1.6;
  color: #2d2d2d;
  margin-bottom: 0.25rem;
}

.wichtel-info-box li:last-child {
  margin-bottom: 0;
}

/* Form intro text */
.form-intro {
  font-size: 0.9375rem;
  color: #2d2d2d;
  margin-bottom: 1.25rem;
}

/* Draw intro text */
.draw-intro {
  font-size: 1rem;
  color: #2d2d2d;
  margin-bottom: 1.5rem;
}

/* Status pending red (for registration ausstehend) */
.status-pending-red {
  color: #c41e3a !important;
  font-weight: 600;
}

/* Status ready green (for Auslosung bereit) */
.status-ready-green {
  color: #228b22 !important;
  font-weight: 600;
}

/* Registration urgency warning */
.registration-warning {
  background: linear-gradient(135deg, rgba(196, 30, 58, 0.1) 0%, rgba(196, 30, 58, 0.05) 100%);
  border: 1px solid rgba(196, 30, 58, 0.3);
  border-radius: 8px;
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
  color: #c41e3a;
  font-weight: 500;
}

.registration-warning p {
  margin: 0;
  font-size: 0.9375rem;
}

/* Wichtel stats in admin tab */
.wichtel-stats {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin-top: 0.5rem;
}

.wichtel-stats .stat-item {
  font-size: 0.875rem;
  color: var(--text-mist, #666);
  padding: 0.25rem 0.75rem;
  background: rgba(0, 0, 0, 0.05);
  border-radius: 1rem;
}