/* Layout component handles the positioning and padding for .home-content */

.home-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  font-size: 1.2rem;
  color: #6b7280;
}

.home-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 50vh;
  text-align: center;
  color: #6b7280;
}

.home-error h2 {
  color: #dc2626;
  margin-bottom: 1rem;
}

.home-error p {
  margin-bottom: 1.5rem;
}

.empty-state {
  text-align: center;
  padding: 2rem;
  color: #6b7280;
  background: #f9fafb;
  border-radius: 8px;
  border: 2px dashed #d1d5db;
}

.empty-state p {
  margin-bottom: 1rem;
  font-size: 1rem;
}

/* Stats Section */
.stats-section {
  margin-bottom: 2rem;
}

.stats-section h2 {
  font-size: 1.5rem;
  font-weight: bold;
  color: #1f2937;
  margin-bottom: 1.5rem;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
}

.stat-card {
  background: white;
  padding: 1.5rem;
  border-radius: 20px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  text-align: center;
  border-left: 4px solid #800000;
}

.stat-number {
  font-size: 2.5rem;
  font-weight: bold;
  color: #800000;
  margin-bottom: 0.5rem;
}

.stat-label {
  color: #6b7280;
  font-size: 0.875rem;
  font-weight: 500;
}

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

.section-header h2 {
  font-size: 1.5rem;
  font-weight: bold;
  color: #1f2937;
}

.action-btn {
  background: #800000;
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s;
}

.action-btn:hover {
  background: #600000;
}

/* Goals Section */
.goals-section {
  margin-bottom: 2rem;
}

/* Goal Tabs */
.goal-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  border-bottom: 2px solid #f3f4f6;
  overflow-x: visible;
  border-bottom: 4px solid #800000;
}

.goal-tab {
  background: none;
  border: none;
  padding: 0.75rem 1rem;
  border-radius: 8px 8px 0 0;
  font-size: 0.875rem;
  font-weight: 500;
  color: #6b7280;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  position: relative;
}

.goal-tab:hover {
  background: #f9fafb;
  color: #374151;
}

.goal-tab.active {
  background: #800000;
  color: white;
  font-weight: 600;
}

.goal-tab.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 2px;
  background: #800000;
}

.goal-count {
  font-size: 0.75rem;
  background: rgba(255, 255, 255, 0.2);
  padding: 0.125rem 0.375rem;
  border-radius: 10px;
  font-weight: 500;
}

.goal-tab:not(.active) .goal-count {
  background: #e5e7eb;
  color: #6b7280;
}

.goals-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
}

.goal-card {
  background: white;
  padding: 1.5rem;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.goal-card:hover {
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.goal-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
  gap: 1rem;
}

.goal-card-header h4 {
  font-size: 1.1rem;
  font-weight: 600;
  color: #1f2937;
  margin: 0;
  flex: 1;
}

.goal-status-badge {
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.25rem 0.5rem;
  border-radius: 12px;
  text-transform: uppercase;
  letter-spacing: 0.025em;
  white-space: nowrap;
}

.goal-status-badge.active {
  background: #dcfce7;
  color: #166534;
}

.goal-status-badge.completed {
  background: #dbeafe;
  color: #1e40af;
}

.goal-status-badge.inactive {
  background: #f3f4f6;
  color: #6b7280;
}

.goal-status-badge.restarted {
  background: #fef3c7;
  color: #92400e;
}


.goal-progress {
  display: flex;
  flex-direction: column;
  margin-top: 8px;
  gap: 0.5rem;
}

.progress-bar {
  width: 100%;
  height: 8px;
  background: #e5e7eb;
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: #800000;
  border-radius: 4px;
  transition: width 0.3s ease;
}

.progress-text {
  font-size: 0.875rem;
  color: #6b7280;
  text-align: right;
}

/* Challenges Section */
.challenges-section {
  margin-bottom: 2rem;
}

.challenges-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
}

/* Homepage Challenge Cards - Copy Goal Card Structure Exactly */
.home-challenge-card {
  background: white;
  padding: 1.5rem;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.home-challenge-card:hover {
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.home-challenge-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
  gap: 1rem;
}

.home-challenge-header h4 {
  font-size: 1.1rem;
  font-weight: 600;
  color: #1f2937;
  margin: 0;
  flex: 1;
}

.home-challenge-badge {
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.25rem 0.5rem;
  border-radius: 12px;
  text-transform: uppercase;
  letter-spacing: 0.025em;
  white-space: nowrap;
}

.home-challenge-badge.joined {
  background: #dcfce7;
  color: #166534;
}

.home-challenge-badge.available {
  background: #f3f4f6;
  color: #6b7280;
}

.home-challenge-progress {
  display: flex;
  flex-direction: column;
  margin-top: 8px;
  gap: 0.5rem;
}

.home-challenge-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.875rem;
  color: #6b7280;
  margin-top: 0.5rem;
}

/* Spacer to align meta info for challenges without progress */
.home-challenge-spacer {
  height: 2.75rem;
  /* Match height of progress section */
}

.participants,
.days-left {
  font-size: 0.875rem;
  color: #6b7280;
}

.join-btn {
  background: #059669;
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s;
  width: 100%;
  margin-top: 0.5rem;
}

.join-btn:hover {
  background: #047857;
}

.join-btn:disabled {
  background: #9ca3af;
  cursor: not-allowed;
}

/* Forum Section */
.forum-section {
  margin-bottom: 2rem;
}

.forum-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

.thread-card {
  background: #fbfbfb;
  padding: 1.5rem;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  border-left: 4px solid #800000;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.thread-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.thread-card h3 {
  font-size: 1.125rem;
  font-weight: 600;
  color: #1f2937;
  margin-bottom: 0.75rem;
}

.thread-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
  color: #6b7280;
}

.thread-meta span {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.thread-date {
  font-size: 0.75rem;
  color: #9ca3af;
}

/* Responsive Design */
@media (max-width: 768px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .goals-grid,
  .challenges-grid,
  .forum-grid {
    grid-template-columns: 1fr;
  }


  .goal-tabs {
    gap: 0.25rem;
  }

  .goal-tab {
    padding: 0.5rem 0.75rem;
    font-size: 0.8rem;
  }

  .goal-card-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .goal-status-badge {
    align-self: flex-start;
  }

  .quote-section {
    padding: 2rem 1.5rem;
  }

  .quote-section::after {
    font-size: 3rem;
    left: 1rem;
  }

  .quote-text {
    font-size: 1.25rem;
  }
}

@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .section-header {
    flex-direction: column;
    gap: 1rem;
    align-items: stretch;
  }

  .goal-tabs {
    flex-wrap: wrap;
    gap: 0.25rem;
  }

  .goal-tab {
    flex: 1;
    min-width: fit-content;
    justify-content: center;
  }

  .quote-section {
    padding: 1.5rem 1rem;
    margin-bottom: 2rem;
  }

  .quote-section::after {
    font-size: 2.5rem;
    left: 0.5rem;
  }

  .quote-text {
    font-size: 1.125rem;
    margin-bottom: 1rem;
  }

  .quote-author {
    font-size: 0.875rem;
  }
}

/* Quote Section */
.quote-section {
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  color: #1f2937;
  padding: 1.5rem 2.5rem;
  border-radius: 16px;
  margin-bottom: 1.5rem;
  text-align: center;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05), 0 10px 15px rgba(0, 0, 0, 0.1);
  border: 1px solid #e5e7eb;
  position: relative;
  overflow: hidden;
}

.quote-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #800000, #a00000, #800000);
}

.quote-section::after {
  content: '"';
  position: absolute;
  top: 1rem;
  left: 2rem;
  font-size: 4rem;
  color: #800000;
  opacity: 0.1;
  font-family: serif;
  line-height: 1;
}

.quote-text {
  font-size: 1.375rem;
  font-style: italic;
  font-weight: 400;
  margin-bottom: 1.5rem;
  line-height: 1.6;
  color: #374151;
  position: relative;
  z-index: 1;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.quote-author {
  font-size: 0.95rem;
  font-weight: 600;
  color: #800000;
  position: relative;
  z-index: 1;
  letter-spacing: 0.025em;
}