/* Hangagrams Archives Specific Styles */
/* Following design system principles from common.css */

/* Archives container */
.archives-container {
  max-width: 600px;
  margin: 0 auto;
  padding: 20px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header section using design system */
.archives-header {
  text-align: center;
  margin: 40px 0 30px 0;
  color: var(--primary-color, #667eea);
}

.archives-header h1 {
  font-size: 2.5em;
  margin: 0 0 10px 0;
  font-weight: 700;
  color: var(--primary-color, #667eea);
  font-family: var(--font-family-base, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif);
}

.archives-header p {
  font-size: 1.1em;
  color: #666;
  margin: 0;
}

/* Calendar container with design system styling */
.calendar-container {
  background: white;
  border-radius: 16px;
  padding: 30px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.1);
  margin-bottom: 30px;
  border: 2px solid rgb(220, 210, 240);
}

.calendar-instructions {
  text-align: center;
  color: #666;
  margin-bottom: 20px;
  font-size: 1em;
  line-height: 1.6;
}

#calendar-input {
  width: 100%;
  padding: 15px;
  font-size: 1.1em;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  cursor: pointer;
  text-align: center;
  background: white;
  transition: all 0.3s ease;
  font-family: var(--font-family-base, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif);
}

#calendar-input:hover {
  border-color: var(--primary-color, #667eea);
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
}

#calendar-input:focus {
  outline: 2px solid var(--primary-color, #667eea);
  outline-offset: 2px;
}

/* Status message */
.status-message {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 8px;
  padding: 15px;
  margin: 20px 0;
  text-align: center;
  color: #666;
  display: none;
  font-family: var(--font-family-base, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif);
}

.status-message.loading {
  display: block;
  color: var(--primary-color, #667eea);
  background: #f0f4ff;
}

.status-message.error {
  display: block;
  color: #e74c3c;
  background: #fee;
}

.status-message.success {
  display: block;
  color: #27ae60;
  background: #efe;
}

/* Legend with accessibility improvements */
.calendar-legend {
  display: flex;
  justify-content: center;
  gap: 30px;
  margin-top: 20px;
  flex-wrap: wrap;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9em;
  color: #666;
  padding: 8px;
  min-height: 44px; /* Accessibility touch target */
  cursor: default;
}

.legend-dot {
  width: 20px; /* Increased from 12px for better visibility */
  height: 20px;
  border-radius: 50%;
  border: 2px solid #ccc;
  flex-shrink: 0;
}

.legend-dot.available {
  background: white;
  border-color: var(--primary-color, #667eea);
}

.legend-dot.completed {
  background: #27ae60;
  border-color: #27ae60;
}

.legend-dot.today {
  background: #f39c12;
  border-color: #f39c12;
}

/* Flatpickr customizations to match design system */
.flatpickr-calendar {
  box-shadow: 0 10px 30px rgba(0,0,0,0.15) !important;
  border: 2px solid rgb(220, 210, 240) !important;
  border-radius: 12px !important;
  font-family: var(--font-family-base, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif) !important;
}

.flatpickr-day {
  border-radius: 8px !important;
  margin: 2px !important;
  font-weight: 500 !important;
  min-height: 36px !important; /* Better touch target */
  line-height: 36px !important;
}

.flatpickr-day.selected {
  background: var(--primary-color, #667eea) !important;
  border-color: var(--primary-color, #667eea) !important;
}

.flatpickr-day.today {
  background: #f39c12 !important;
  color: white !important;
  border-color: #f39c12 !important;
  font-weight: bold !important;
}

.flatpickr-day.completed {
  background: #27ae60 !important;
  color: white !important;
  border-color: #27ae60 !important;
  position: relative;
}

.flatpickr-day.completed::after {
  content: '✓';
  position: absolute;
  top: 2px;
  right: 4px;
  font-size: 12px;
  color: white;
  font-weight: bold;
}

.flatpickr-months {
  background: var(--primary-color, #667eea) !important;
  border-radius: 10px 10px 0 0 !important;
  padding: 10px !important;
}

.flatpickr-current-month {
  color: white !important;
}

.flatpickr-prev-month,
.flatpickr-next-month {
  fill: white !important;
  padding: 10px !important; /* Better touch target */
}

.flatpickr-prev-month:hover svg,
.flatpickr-next-month:hover svg {
  fill: rgba(255, 255, 255, 0.8) !important;
}

/* Back button using design system */
.btn-back-archives {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  background: white;
  color: var(--primary-color, #667eea);
  border: 2px solid var(--primary-color, #667eea);
  border-radius: 8px;
  font-size: 1em;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.3s ease;
  margin: 20px auto;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  min-height: 44px; /* Accessibility touch target */
  font-family: var(--font-family-base, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif);
}

.btn-back-archives:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
  background: var(--primary-color, #667eea);
  color: white;
}

.btn-back-archives:focus {
  outline: 2px solid var(--primary-color, #667eea);
  outline-offset: 2px;
}

/* Mobile responsive improvements */
@media (max-width: 768px) {
  .archives-container {
    padding: 15px;
  }
  
  .archives-header h1 {
    font-size: 2em;
  }
  
  .calendar-container {
    padding: 20px;
    border-radius: 12px;
  }
}

@media (max-width: 480px) {
  .archives-container {
    padding: 10px;
  }
  
  .archives-header {
    margin: 20px 0;
  }
  
  .archives-header h1 {
    font-size: 1.75em;
  }
  
  .archives-header p {
    font-size: 1em;
  }
  
  .calendar-container {
    padding: 15px;
  }
  
  .calendar-legend {
    gap: 15px;
    font-size: 0.85em;
  }
  
  #calendar-input {
    font-size: 1em;
    padding: 12px;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .calendar-container {
    border: 3px solid #000;
  }
  
  .legend-dot {
    border-width: 3px;
  }
  
  .flatpickr-day.completed::after {
    font-weight: 900;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  .btn-back-archives,
  #calendar-input,
  .flatpickr-day {
    transition: none !important;
  }
  
  .btn-back-archives:hover {
    transform: none;
  }
}

/* Print styles */
@media print {
  .archives-header {
    color: black;
  }
  
  #game-topbar,
  .btn-back-archives {
    display: none;
  }
}