/**
 * @file
 * Updated Styles for Bake It Better Weekly Winners Accordion
 * Monthly accordions with integrated weekly sections
 */

/* Main Container */
.bakeitbetter-winners-accordion {
  max-width: 100%;
  margin: 2rem 0;
}

/* Month Accordion Container */
.accordion-month {
  margin-bottom: 1.5rem;
  border: 2px solid #e0e0e0;
  border-radius: 12px;
  overflow: hidden;
  background: #ffffff;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
  transition: box-shadow 0.3s ease, transform 0.2s ease;
}

.accordion-month:hover {
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1);
}

/* Month Header Button */
.accordion-header {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem 2rem;
  background: linear-gradient(135deg, #f5f5f5 0%, #e9ecef 100%);
  border: none;
  cursor: pointer;
  font-size: 1.4rem;
  font-weight: 700;
  color: #2c3e50;
  text-align: left;
  transition: all 0.3s ease;
  position: relative;
}

.accordion-header::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 5px;
  background: #d32f2f;
  transition: width 0.3s ease;
}

.accordion-header:hover {
  background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
}

.accordion-header:hover::before {
  width: 8px;
}

.accordion-header:focus {
  outline: 3px solid #0066cc;
  outline-offset: -3px;
}

.accordion-header[aria-expanded="true"] {
  background: linear-gradient(135deg, #dee2e6 0%, #ced4da 100%);
  border-bottom: 2px solid #e0e0e0;
}

.accordion-header[aria-expanded="true"]::before {
  width: 8px;
  background: #b71c1c;
}

/* Month Label */
.month-label {
  flex: 1;
  color: #d32f2f;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding-left: 0.5rem;
}

/* Accordion Icon */
.accordion-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  transition: transform 0.3s ease;
  color: #666;
  background: rgba(255, 255, 255, 0.5);
  border-radius: 50%;
}

.accordion-header[aria-expanded="true"] .accordion-icon {
  transform: rotate(180deg);
  background: rgba(255, 255, 255, 0.8);
}

/* Accordion Content Area */
.accordion-content {
  padding: 0;
  max-height: 0;
  overflow: hidden;
  background: #fafafa;
  transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1), padding 0.4s ease;
}

.accordion-content:not([hidden]) {
  max-height: 8000px;
  padding: 2rem;
  transition: max-height 0.5s cubic-bezier(0.4, 0, 0.2, 1), padding 0.5s ease;
}

/* Week Section - Better Integration */
.week-section {
  margin-bottom: 2.5rem;
  padding: 1.5rem;
  background: #ffffff;
  border-radius: 8px;
  border-left: 4px solid #d32f2f;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.week-section:hover {
  transform: translateX(4px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.08);
}

.week-section:last-child {
  margin-bottom: 0;
}

/* Week Header with Date Range */
.week-header {
  font-size: 1.2rem;
  font-weight: 700;
  color: #2c3e50;
  margin: 0 0 1.25rem 0;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid #e9ecef;
}

.week-header .week-label {
  color: #d32f2f;
  font-weight: 800;
}

.selection-date {
  font-size: 0.95rem;
  font-weight: 500;
  color: #6c757d;
  padding: 0.25rem 0.75rem;
  background: #f8f9fa;
  border-radius: 20px;
  border: 1px solid #dee2e6;
}

/* Winners List */
.winners-list {
  margin-top: 1.25rem;
}

.winners-grid {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
  counter-reset: winner-counter;
}

/* Winner Item with Number */
.winner-item {
  background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
  border: 1px solid #dee2e6;
  border-radius: 8px;
  padding: 1rem 1rem 1rem 3rem;
  position: relative;
  transition: all 0.3s ease;
  counter-increment: winner-counter;
}

.winner-item::before {
  content: counter(winner-counter);
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  background: #d32f2f;
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.875rem;
}

.winner-item:hover {
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1);
  transform: translateY(-3px);
  border-color: #d32f2f;
}

/* Winner Info */
.winner-info {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.winner-name {
  font-weight: 700;
  font-size: 1.05rem;
  color: #2c3e50;
  line-height: 1.4;
}

.winner-email {
  font-size: 0.9rem;
  color: #6c757d;
  word-break: break-word;
  font-family: 'Courier New', monospace;
}

/* No Winners Message */
.no-winners {
  font-style: italic;
  color: #999;
  padding: 2rem;
  text-align: center;
  background: #f8f9fa;
  border-radius: 8px;
  border: 2px dashed #dee2e6;
}

/* Header Title for Section */
.winners-section-title {
  font-size: 1.75rem;
  font-weight: 800;
  color: #2c3e50;
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 3px solid #d32f2f;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Responsive Design */
@media (max-width: 992px) {
  .winners-grid {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  }
}

@media (max-width: 768px) {
  .accordion-header {
    padding: 1.25rem 1.5rem;
    font-size: 1.2rem;
  }

  .accordion-content:not([hidden]) {
    padding: 1.5rem;
  }

  .winners-grid {
    grid-template-columns: 1fr;
  }

  .week-header {
    font-size: 1.1rem;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .selection-date {
    font-size: 0.85rem;
  }

  .week-section {
    padding: 1rem;
  }

  .month-label {
    font-size: 1.1rem;
  }
}

@media (max-width: 480px) {
  .accordion-header {
    padding: 1rem;
    font-size: 1.1rem;
  }

  .accordion-header::before {
    width: 4px;
  }

  .winner-item {
    padding: 0.875rem 0.875rem 0.875rem 2.5rem;
  }

  .winner-item::before {
    width: 24px;
    height: 24px;
    font-size: 0.75rem;
    left: 0.5rem;
  }
}

/* Print Styles */
@media print {
  .bakeitbetter-winners-accordion {
    margin: 0;
  }

  .accordion-month {
    margin-bottom: 2rem;
    border: 1px solid #333;
    box-shadow: none;
    page-break-inside: avoid;
  }

  .accordion-header {
    background: transparent !important;
    border-bottom: 2px solid #333;
    padding: 1rem;
  }

  .accordion-header::before {
    display: none;
  }

  .accordion-icon {
    display: none;
  }

  .accordion-content {
    display: block !important;
    max-height: none !important;
    padding: 1rem !important;
  }

  .week-section {
    page-break-inside: avoid;
    margin-bottom: 1.5rem;
  }

  .winner-item {
    break-inside: avoid;
    box-shadow: none;
    page-break-inside: avoid;
  }

  .month-label {
    color: #000 !important;
  }
}

/* Dark Mode Support (Optional) */
@media (prefers-color-scheme: dark) {
  .bakeitbetter-winners-accordion {
    color: #e0e0e0;
  }

  .accordion-month {
    background: #1e1e1e;
    border-color: #404040;
  }

  .accordion-header {
    background: linear-gradient(135deg, #2d2d2d 0%, #252525 100%);
    color: #e0e0e0;
  }

  .accordion-header[aria-expanded="true"] {
    background: linear-gradient(135deg, #252525 0%, #1e1e1e 100%);
  }

  .accordion-content {
    background: #1a1a1a;
  }

  .week-section {
    background: #2d2d2d;
    border-left-color: #d32f2f;
  }

  .week-header {
    color: #e0e0e0;
    border-bottom-color: #404040;
  }

  .winner-item {
    background: linear-gradient(135deg, #2d2d2d 0%, #252525 100%);
    border-color: #404040;
  }

  .winner-name {
    color: #e0e0e0;
  }

  .winner-email {
    color: #a0a0a0;
  }

  .selection-date {
    background: #252525;
    border-color: #404040;
    color: #a0a0a0;
  }
}