/**
 * Rewards Dashboard Styles
 * Styling for the rewards points widget and modals
 */

/* ============================================================================
   Container & Layout
   ============================================================================ */

.rewards-widget {
  background: linear-gradient(135deg, #f8fcf8, #eef6ef);
  border: 2px solid #3c7a4d;
  border-radius: 12px;
  padding: 1.5rem;
  margin: 1rem 0;
  box-shadow: 0 4px 12px rgba(60, 122, 77, 0.1);
}

.rewards-widget.error {
  background: #fee;
  border-color: #c33;
}

/* ============================================================================
   Header
   ============================================================================ */

.rewards-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid rgba(60, 122, 77, 0.2);
}

.rewards-header h3 {
  color: #2c6a3d;
  margin: 0;
  font-size: 1.3rem;
}

.rewards-info-btn {
  background: transparent;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 50%;
  transition: background 0.3s;
}

.rewards-info-btn:hover {
  background: rgba(60, 122, 77, 0.1);
}

/* ============================================================================
   Points Balance (Large Display)
   ============================================================================ */

.points-balance-large {
  text-align: center;
  margin: 2rem 0;
  padding: 2rem;
  background: white;
  border-radius: 10px;
  border: 2px solid #d7e8da;
}

.points-number {
  font-size: 3.5rem;
  font-weight: bold;
  color: #2c6a3d;
  line-height: 1;
  margin-bottom: 0.5rem;
}

.points-label {
  font-size: 0.9rem;
  color: #5d6f62;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* ============================================================================
   Streaks Section
   ============================================================================ */

.streaks-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin: 1.5rem 0;
}

.streak-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: white;
  border: 1px solid #d7e8da;
  border-radius: 8px;
  transition: transform 0.3s, box-shadow 0.3s;
}

.streak-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(60, 122, 77, 0.1);
}

.streak-icon {
  font-size: 1.8rem;
}

.streak-info {
  flex: 1;
}

.streak-label {
  font-size: 0.8rem;
  color: #5d6f62;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.streak-value {
  font-size: 1.4rem;
  font-weight: bold;
  color: #2c6a3d;
}

/* ============================================================================
   Progress Section
   ============================================================================ */

.progress-section {
  background: white;
  border: 1px solid #d7e8da;
  border-radius: 8px;
  padding: 1rem;
  margin: 1.5rem 0;
  text-align: center;
}

.level-display {
  display: flex;
  justify-content: center;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.level-label {
  font-size: 0.9rem;
  color: #5d6f62;
  font-weight: 600;
}

.level-value {
  font-size: 2rem;
  font-weight: bold;
  color: #2c6a3d;
}

.next-milestone {
  font-size: 0.85rem;
  color: #5d6f62;
  margin-top: 0.5rem;
}

/* ============================================================================
   Recent Activity
   ============================================================================ */

.recent-activity {
  margin: 1.5rem 0;
}

.recent-activity h4 {
  color: #2c6a3d;
  margin-bottom: 1rem;
  font-size: 1rem;
}

.activity-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 250px;
  overflow-y: auto;
}

.activity-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem;
  background: white;
  border-left: 3px solid #3c7a4d;
  border-radius: 4px;
  font-size: 0.85rem;
}

.activity-date {
  color: #5d6f62;
  font-weight: 600;
  min-width: 80px;
}

.activity-details {
  flex: 1;
  margin: 0 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.activity-type {
  color: #2c6a3d;
  font-weight: 600;
}

.activity-breakdown {
  color: #5d6f62;
  font-size: 0.75rem;
}

.activity-points {
  color: #2c6a3d;
  font-weight: bold;
  font-size: 1rem;
  min-width: 60px;
  text-align: right;
}

.empty-state,
.loading {
  text-align: center;
  color: #5d6f62;
  padding: 1rem;
  font-style: italic;
}

/* ============================================================================
   Action Buttons
   ============================================================================ */

.rewards-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 1.5rem;
}

.btn {
  padding: 0.75rem 1rem;
  border: none;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  font-size: 0.9rem;
}

.btn-primary {
  background: #2c6a3d;
  color: white;
}

.btn-primary:hover:not(:disabled) {
  background: #1f4d2b;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(44, 106, 61, 0.3);
}

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

.btn-secondary {
  background: #d7e8da;
  color: #2c6a3d;
  border: 1px solid #3c7a4d;
}

.btn-secondary:hover:not(:disabled) {
  background: #c0dcc7;
  transform: translateY(-2px);
}

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

/* ============================================================================
   Modal Styles
   ============================================================================ */

.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modal-overlay.active {
  display: flex;
}

.modal-content {
  background: white;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  max-width: 500px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  animation: slideUp 0.3s ease;
}

.modal-content.large {
  max-width: 700px;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  border-bottom: 2px solid #d7e8da;
}

.modal-header h3 {
  margin: 0;
  color: #2c6a3d;
}

.close-btn {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #5d6f62;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.3s;
}

.close-btn:hover {
  background: #f0f0f0;
}

.modal-body {
  padding: 1.5rem;
}

/* ============================================================================
   Info Modal
   ============================================================================ */

.rewards-info-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.rewards-info-modal.active {
  display: flex;
}

.rewards-info-modal .modal-content {
  max-width: 500px;
  width: 90%;
}

.rewards-info-modal .modal-body {
  padding: 1.5rem;
}

.rewards-info-modal p {
  margin: 0.75rem 0;
  color: #4b5e51;
  line-height: 1.6;
}

.rewards-info-modal ul {
  margin: 0.75rem 0;
  margin-left: 1.5rem;
  color: #4b5e51;
}

.rewards-info-modal li {
  margin: 0.5rem 0;
}

/* ============================================================================
   History Table
   ============================================================================ */

.history-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.history-table thead {
  background: #f0f0f0;
  border-bottom: 2px solid #d7e8da;
}

.history-table th {
  padding: 0.75rem;
  text-align: left;
  color: #2c6a3d;
  font-weight: 600;
}

.history-table td {
  padding: 0.75rem;
  border-bottom: 1px solid #e0e0e0;
  color: #4b5e51;
}

.history-table tr:hover {
  background: #f9f9f9;
}

.total-points {
  color: #2c6a3d;
  font-weight: bold;
}

/* ============================================================================
   Redemption Options
   ============================================================================ */

.current-balance {
  text-align: center;
  padding: 1rem;
  background: #eef6ef;
  border-radius: 8px;
  margin-bottom: 1.5rem;
  color: #2c6a3d;
  font-size: 1rem;
}

.current-balance strong {
  font-size: 1.3rem;
}

.redemption-options {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

.option-card {
  padding: 1rem;
  border: 2px solid #d7e8da;
  border-radius: 8px;
  background: white;
  transition: all 0.3s;
}

.option-card:hover {
  border-color: #3c7a4d;
  box-shadow: 0 4px 12px rgba(60, 122, 77, 0.1);
}

.option-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.option-header h4 {
  margin: 0;
  color: #2c6a3d;
}

.cost {
  background: #2c6a3d;
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
}

.option-description {
  color: #5d6f62;
  font-size: 0.9rem;
  margin: 0.5rem 0;
}

.redeem-btn {
  width: 100%;
  margin-top: 0.75rem;
}

/* ============================================================================
   Responsive Design
   ============================================================================ */

@media (max-width: 600px) {
  .rewards-widget {
    padding: 1rem;
  }

  .points-number {
    font-size: 2.5rem;
  }

  .streaks-section {
    grid-template-columns: 1fr;
  }

  .rewards-actions {
    grid-template-columns: 1fr;
  }

  .modal-content {
    width: 95%;
  }

  .activity-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .activity-points {
    align-self: flex-end;
  }
}

