* { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
}

body { 
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background: #ffffff;
  margin: 0;
  padding: 0;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  color: #333;
}

/* Mobile-first header */
header { 
  padding: 10px 15px;
  background: linear-gradient(135deg, #abc32f 0%, #8fa927 100%);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 10px rgba(171, 195, 47, 0.25);
}

.header-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo {
  font-size: 24px;
  line-height: 1;
}

.logo img {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  transition: transform 0.2s ease;
}

.logo img:hover {
  transform: scale(1.05);
}

.header-title {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

h1 { 
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.5px;
}

.header-subtitle {
  font-size: 10px;
  opacity: 0.85;
  font-weight: 400;
}

.header-right {
  display: flex;
  gap: 8px;
  align-items: center;
}

.header-nav {
  display: flex;
  gap: 6px;
}

.nav-link {
  padding: 6px 10px;
  font-size: 13px;
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.25);
  color: white;
  text-decoration: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 4px;
  font-weight: 500;
}

.share-btn {
  padding: 8px 12px;
  font-size: 16px;
  background: rgba(255,255,255,0.25);
  border: 1px solid rgba(255,255,255,0.4);
  color: white;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 40px;
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.share-btn:hover {
  background: rgba(255,255,255,0.35);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  border-color: rgba(255,255,255,0.6);
}

.share-btn:active {
  transform: translateY(0);
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.nav-link:hover {
  background: rgba(255,255,255,0.25);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.nav-link:active {
  transform: translateY(0);
}

.menu-btn {
  display: none;
  background: rgba(255,255,255,0.25);
  border: 1px solid rgba(255,255,255,0.4);
  color: white;
  font-size: 18px;
  cursor: pointer;
  padding: 8px 12px;
  border-radius: 8px;
  transition: all 0.3s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  font-weight: 600;
}

.menu-btn:hover {
  background: rgba(255,255,255,0.35);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  border-color: rgba(255,255,255,0.6);
}

.mobile-menu {
  display: none;
  position: fixed;
  top: 46px;
  right: 0;
  left: 0;
  background: #abc32f;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
  z-index: 99;
  animation: slideDown 0.3s ease-out;
}

.mobile-menu.show {
  display: block;
}

.mobile-menu-content {
  padding: 15px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mobile-menu .nav-link {
  width: 100%;
  justify-content: center;
  padding: 12px;
}

/* Responsive adjustments */
@media (max-width: 640px) {
  header {
    padding: 8px 12px;
  }

  h1 {
    font-size: 14px;
  }

  .header-subtitle {
    display: none;
  }

  .logo {
    font-size: 20px;
  }

  .share-btn {
    padding: 4px 8px;
    font-size: 16px;
  }

  .header-nav {
    display: none;
  }

  .menu-btn {
    display: block;
  }
}

@media (min-width: 641px) and (max-width: 768px) {
  h1 {
    font-size: 17px;
  }

  .nav-link {
    padding: 8px 10px;
    font-size: 12px;
  }
}

/* Install PWA Banner */
#installBanner {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #fff;
  padding: 15px;
  box-shadow: 0 -2px 10px rgba(0,0,0,0.2);
  z-index: 1000;
  animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

#installBanner .banner-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1200px;
  margin: 0 auto;
  gap: 15px;
}

#installBanner .banner-text {
  flex: 1;
}

#installBanner .banner-text h3 {
  font-size: 16px;
  margin-bottom: 5px;
  color: #333;
}

#installBanner .banner-text p {
  font-size: 14px;
  color: #666;
}

#installBanner .banner-buttons {
  display: flex;
  gap: 10px;
}

#installBtn, #dismissBanner {
  padding: 10px 20px;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
}

#installBtn {
  background: #abc32f;
  color: white;
}

#dismissBanner {
  background: #e9ecef;
  color: #666;
}

#login { 
  text-align: center;
  margin: 40px 15px;
  padding: 0 15px;
}

button { 
  background: #fc4c02;
  color: white;
  border: none;
  padding: 14px 28px;
  font-size: 16px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
  font-weight: 500;
  min-height: 44px; /* iOS touch target */
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

button:hover { 
  background: #e64500;
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0,0,0,0.2);
}

button:active { 
  transform: translateY(0);
}

button:disabled { 
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

#status { 
  text-align: center;
  margin: 15px;
  font-weight: bold;
  color: #333;
  background: #f8f9fa;
  padding: 12px;
  border-radius: 8px;
  max-width: 800px;
  margin: 15px auto;
  border: 1px solid #e0e0e0;
}

#tabs { 
  display: none;
  margin: 15px auto;
  max-width: 1200px;
  padding: 0 15px;
}

.tab-buttons { 
  text-align: center;
  margin-bottom: 20px;
  background: #f8f9fa;
  padding: 10px;
  border-radius: 12px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  overflow-x: auto;
}

.tab-buttons button { 
  background: #fff;
  border: 1px solid #ddd;
  color: #333;
  padding: 12px 20px;
  border-radius: 8px;
  cursor: pointer;
  flex: 1;
  min-width: 120px;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.tab-buttons button.active { 
  background: linear-gradient(135deg, #abc32f 0%, #8fa927 100%);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 8px rgba(16, 185, 129, 0.3);
}

.tab-buttons button:hover { 
  background: #e9ecef;
  transform: translateY(-2px);
}

.tab-buttons button.active:hover { 
  background: linear-gradient(135deg, #5568d3 0%, #653a8d 100%);
}

.tab { 
  display: none;
  animation: fadeIn 0.4s ease-out;
}

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

.challenge { 
  background: #fff;
  margin: 15px 0;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
  transition: all 0.3s ease;
  border-left: 5px solid #abc32f;
  position: relative;
  animation: slideInUp 0.4s ease-out;
  animation-fill-mode: backwards;
}

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

.challenge:nth-child(1) { animation-delay: 0.05s; }
.challenge:nth-child(2) { animation-delay: 0.1s; }
.challenge:nth-child(3) { animation-delay: 0.15s; }
.challenge:nth-child(4) { animation-delay: 0.2s; }
.challenge:nth-child(5) { animation-delay: 0.25s; }

.challenge:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}

.challenge:active { 
  transform: scale(0.98);
}

.challenge.completed { 
  border-left-color: #28a745;
}

.challenge.missed { 
  border-left-color: #dc3545;
}

.challenge.ended { 
  border-left-color: #6c757d;
  opacity: 0.8;
}

.challenge.future { 
  border-left-color: #ffc107;
}

.challenge h3 { 
  margin-top: 0;
  color: #333;
  font-size: 18px;
  margin-bottom: 10px;
  line-height: 1.4;
}

.challenge-dates {
  font-size: 13px;
  color: #6c757d;
  margin-bottom: 6px;
}

.challenge p { 
  margin: 8px 0;
  color: #555;
  line-height: 1.6;
  font-size: 14px;
}

.challenge-timer {
  font-size: 14px;
  font-weight: 600;
  margin: 5px 0 10px 0;
  padding: 6px 10px;
  border-radius: 4px;
  text-align: center;
  display: inline-block;
  min-width: 120px;
}

.timer-countdown {
  background: linear-gradient(135deg, #abc32f 0%, #8fa927 100%);
  color: white;
}

.timer-expired {
  background: #dc3545;
  color: white;
}

.timer-ago {
  background: #6c757d;
  color: white;
}

.view-btn { 
  background: #007bff;
  padding: 12px 20px;
  border: none;
  color: white;
  border-radius: 8px;
  cursor: pointer;
  margin: 15px 0 10px 0;
  transition: all 0.3s ease;
  width: 100%;
  font-size: 15px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.view-btn:hover { 
  background: #0056b3;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}

.criteria-table-container {
  margin: 15px 0;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.criteria-table-container table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  background: #fff;
}

.criteria-table-container th,
.criteria-table-container td {
  padding: 8px 12px;
  text-align: left;
  border-bottom: 1px solid #e9ecef;
}

.criteria-table-container th {
  background: #f8f9fa;
  font-weight: 600;
  color: #495057;
}

.challenge-progress {
  margin-top: 15px;
  padding: 15px 0;
  border-top: 2px solid #f8f9fa;
}

.progress-text {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 8px;
  color: #333;
}

.progress-bar {
  height: 8px;
  background: #e9ecef;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 10px;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #abc32f 0%, #8fa927 100%);
  transition: width 0.5s ease;
  border-radius: 4px;
}

.status-badge {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
}

.status-badge.completed {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.status-badge.ongoing {
  background: #fff3cd;
  color: #856404;
  border: 1px solid #ffeaa7;
}

.status-badge.future {
  background: #cce5ff;
  color: #004085;
  border: 1px solid #b3d7ff;
}

.status-badge.missed {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

.challenge-actions-bottom {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px solid #e9ecef;
}

.action-icon {
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  color: #6c757d;
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 4px;
}

.action-icon:hover {
  background: #e9ecef;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.hide-challenge {
  background: #fff3cd !important;
  border-color: #ffeaa7 !important;
  color: #856404 !important;
}

/* App Loading Screen */
.app-loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #abc32f 0%, #8fa927 100%);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  transition: opacity 0.5s ease-out, visibility 0.5s ease-out;
}

.app-loader.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loader-content {
  text-align: center;
  color: white;
}

.loader-logo {
  width: 120px;
  height: 120px;
  margin-bottom: 30px;
  border-radius: 20px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
  animation: logoFloat 2s ease-in-out infinite;
}

@keyframes logoFloat {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-10px); }
}

.loader-title {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 10px;
  letter-spacing: -0.5px;
}

.loader-subtitle {
  font-size: 16px;
  opacity: 0.9;
  margin-bottom: 30px;
}

.loader-spinner {
  width: 50px;
  height: 50px;
  border: 4px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loader-status {
  margin-top: 20px;
  font-size: 14px;
  opacity: 0.8;
  min-height: 20px;
}

/* Offline indicator */
.offline-indicator {
  display: none;
  position: fixed;
  top: 60px;
  left: 50%;
  transform: translateX(-50%);
  background: #dc3545;
  color: white;
  padding: 10px 20px;
  border-radius: 8px;
  z-index: 1000;
  font-size: 14px;
  animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
  from { 
    transform: translate(-50%, -100%);
    opacity: 0;
  }
  to { 
    transform: translate(-50%, 0);
    opacity: 1;
  }
}

.offline-indicator.show {
  display: block;
}

/* Toast Notification */
.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: linear-gradient(135deg, #abc32f 0%, #8fa927 100%);
  color: white;
  padding: 12px 24px;
  border-radius: 30px;
  box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4);
  z-index: 1001;
  font-size: 14px;
  font-weight: 500;
  transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  display: flex;
  align-items: center;
  gap: 8px;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
}

.toast::before {
  content: '✓';
  display: inline-block;
  width: 20px;
  height: 20px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  text-align: center;
  line-height: 20px;
}

/* Tablet and Desktop */
@media (min-width: 768px) {
  h1 { 
    font-size: 28px;
  }
  
  header { 
    padding: 30px 20px;
  }
  
  .challenge { 
    margin: 20px auto;
    padding: 25px;
  }
  
  .challenge h3 { 
    font-size: 22px;
  }
  
  .challenge p { 
    font-size: 15px;
  }
  
  .challenge:nth-child(1) { animation-delay: 0.05s; }
  .challenge:nth-child(2) { animation-delay: 0.1s; }
  .challenge:nth-child(3) { animation-delay: 0.15s; }
  .challenge:nth-child(4) { animation-delay: 0.2s; }
  .challenge:nth-child(5) { animation-delay: 0.25s; }
  
  .challenge:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
  }
  
  .challenge.hidden {
    display: none;
  }
  
  .challenge-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
  }
  
  .challenge-title {
    flex: 1;
  }
  
  .challenge-content {
    margin-top: 15px;
  }
}

/* Loading state for tabs */
.tab.loading {
  opacity: 0.6;
  pointer-events: none;
}

/* Skeleton loading animation */
.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
}

@keyframes loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skeleton-card {
  height: 80px;
  margin: 5px;
}

/* Pulse animation for loading states */
.pulse {
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* Pull to Refresh */
.ptr-indicator {
  position: fixed;
  top: 60px;
  left: 50%;
  transform: translateX(-50%) translateY(-100%);
  background: linear-gradient(135deg, #abc32f 0%, #8fa927 100%);
  color: white;
  padding: 10px 20px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 600;
  z-index: 1000;
  opacity: 0;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(171, 195, 47, 0.4);
}

.ptr-indicator.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* Share Button */
.share-btn {
  background: #25D366;
  color: white;
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 500;
  margin: 15px auto;
  display: block;
  transition: all 0.3s ease;
}

.share-btn:hover {
  background: #128C7E;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3);
}

/* Share Icon Button */
.share-icon-btn {
  background: #25D366;
  color: white;
  padding: 10px;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  font-size: 16px;
  transition: all 0.3s ease;
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.share-icon-btn:hover {
  background: #128C7E;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3);
}

/* Modal Styles */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(4px);
  z-index: 1000;
  animation: fadeIn 0.3s ease-out;
}

.modal-overlay.show {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-content {
  background: white;
  border-radius: 16px;
  max-width: 800px;
  width: 100%;
  max-height: 90vh;
  overflow: hidden;
  animation: slideIn 0.3s ease-out;
  box-shadow: 0 20px 40px rgba(0,0,0,0.3);
}

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

.modal-header {
  padding: 24px 24px 16px;
  border-bottom: 2px solid #f8f9fa;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(135deg, #abc32f 0%, #8fa927 100%);
  color: white;
}

.modal-header h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
}

.modal-close {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  font-size: 24px;
  cursor: pointer;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.1);
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  max-height: calc(90vh - 160px);
}

.modal-footer {
  padding: 16px 24px 24px;
  border-top: 1px solid #e9ecef;
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

.modal-footer button {
  padding: 10px 20px;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  background: white;
  color: #6c757d;
}

.modal-footer button:hover {
  background: #f8f9fa;
  transform: translateY(-1px);
}

.modal-footer button.primary {
  background: linear-gradient(135deg, #abc32f 0%, #8fa927 100%);
  color: white;
  border-color: transparent;
}

.modal-footer button.primary:hover {
  background: linear-gradient(135deg, #8fa927 0%, #7a9023 100%);
}

/* Summary Tab Styles */
.summary-accordion {
  margin-bottom: 20px;
}

.accordion-tab {
  background: white;
  border-radius: 12px;
  margin-bottom: 15px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  transition: all 0.3s ease;
}

.accordion-tab:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

.accordion-header {
  padding: 20px 24px;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.3s ease;
  border-bottom: 2px solid transparent;
}

.accordion-tab.active .accordion-header {
  background: linear-gradient(135deg, #abc32f 0%, #8fa927 100%);
  color: white;
  border-bottom-color: rgba(255,255,255,0.2);
}

.accordion-title {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 18px;
  font-weight: 600;
}

.accordion-icon {
  font-size: 16px;
  transition: transform 0.3s ease;
}

.accordion-tab.active .accordion-icon {
  transform: rotate(180deg);
}

.accordion-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.accordion-tab.active .accordion-content {
  max-height: 2000px;
}

.accordion-body {
  padding: 24px;
}

.monthly-summary {
  background: white;
}

.ride-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-bottom: 30px;
}

.stat-card {
  background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
  padding: 20px;
  border-radius: 12px;
  text-align: center;
  border: 2px solid #e9ecef;
  transition: all 0.3s ease;
}

.stat-card:hover {
  border-color: #abc32f;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(171, 195, 47, 0.2);
}

.stat-value {
  display: block;
  font-size: 28px;
  font-weight: 700;
  color: #abc32f;
  margin-bottom: 5px;
}

.stat-label {
  display: block;
  font-size: 14px;
  color: #6c757d;
  font-weight: 500;
}

.distance-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 15px;
  margin-top: 25px;
}

.distance-milestone {
  background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
  border: 2px solid #e9ecef;
  border-radius: 12px;
  padding: 16px 12px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.distance-milestone:hover {
  border-color: #abc32f;
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(171, 195, 47, 0.25);
}

.distance-milestone.clickable:hover {
  background: linear-gradient(135deg, #abc32f 0%, #8fa927 100%);
  color: white;
}

.distance-milestone.clickable:hover .distance-count,
.distance-milestone.clickable:hover .distance-label {
  color: white;
}

.distance-milestone::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(171, 195, 47, 0.1), transparent);
  transition: left 0.5s ease;
}

.distance-milestone:hover::before {
  left: 100%;
}

.distance-milestone.animate {
  animation: countUp 0.6s ease-out;
  animation-fill-mode: both;
}

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

.distance-label {
  display: block;
  font-size: 14px;
  color: #666;
  font-weight: 500;
  margin-bottom: 8px;
}

.distance-count {
  display: block;
  font-size: 32px;
  font-weight: 700;
  background: linear-gradient(135deg, #abc32f 0%, #8fa927 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  transition: transform 0.3s ease;
}

/* Share Buttons in Summary */
.share-buttons {
  display: flex;
  gap: 10px;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 2px solid #e9ecef;
}

.share-action-btn {
  flex: 1;
  padding: 12px 20px;
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.3s ease;
}

.share-whatsapp {
  background: #25D366;
  color: white;
}

.share-whatsapp:hover {
  background: #1da851;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(37, 211, 102, 0.4);
}

.share-copy {
  background: #abc32f;
  color: white;
}

.share-copy:hover {
  background: #8fa927;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

/* Responsive adjustments for summary tab */
@media (min-width: 768px) {
  .ride-stats {
    grid-template-columns: repeat(4, 1fr);
  }

  .distance-grid {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 18px;
  }
}