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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  padding: 20px;
  background-attachment: fixed;
}

.container {
  max-width: 1600px;
  margin: 0 auto;
}

h1 {
  text-align: center;
  color: white;
  margin-bottom: 30px;
  font-size: clamp(1.8rem, 5vw, 2.5rem);
  text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.3);
  font-weight: 700;
  letter-spacing: -0.5px;
}

.tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  justify-content: center;
  flex-wrap: wrap;
}

.tab-button {
  padding: 15px 40px;
  border: none;
  background: rgba(255, 255, 255, 0.15);
  color: white;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  border-radius: 12px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(10px);
  border: 2px solid rgba(255, 255, 255, 0.2);
  position: relative;
  overflow: hidden;
}

.tab-button::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.tab-button:hover::before {
  width: 300px;
  height: 300px;
}

.tab-button:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.tab-button.active {
  background: white;
  color: #667eea;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  border-color: white;
}

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

.tab-content.active {
  display: block;
}

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

.filters {
  background: white;
  border-radius: 16px;
  padding: 25px;
  margin-bottom: 25px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
}

.filter-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  align-items: end;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.filter-label {
  font-weight: 600;
  color: #333;
  font-size: 0.95rem;
  letter-spacing: 0.3px;
}

select {
  padding: 12px 15px;
  border: 2px solid #e1e4e8;
  border-radius: 10px;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  background: white;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23667eea' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 40px;
}

select:hover {
  border-color: #667eea;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.1);
}

select:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

.stats {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
  margin-top: 15px;
}

.stat-badge {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  padding: 10px 18px;
  border-radius: 25px;
  font-size: 0.9rem;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
  transition: transform 0.2s;
}

.stat-badge:hover {
  transform: scale(1.05);
}

.category-card {
  background: white;
  border-radius: 16px;
  padding: 25px;
  margin-bottom: 25px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12);
  transition: box-shadow 0.3s;
}

.category-card:hover {
  box-shadow: 0 15px 50px rgba(0, 0, 0, 0.18);
}

.category-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 3px solid #667eea;
  flex-wrap: wrap;
  gap: 15px;
}

.category-name {
  font-size: 1.5rem;
  color: #333;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.category-url {
  color: #667eea;
  text-decoration: none;
  font-size: 0.9rem;
  transition: all 0.3s;
  font-weight: 500;
}

.category-url:hover {
  text-decoration: underline;
  color: #764ba2;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}

.product-card {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border-radius: 14px;
  padding: 20px;
  position: relative;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.product-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
}

.rank-badge {
  position: absolute;
  top: -12px;
  right: -12px;
  background: linear-gradient(135deg, #ff7733, #ff5500);
  color: white;
  padding: 8px 16px;
  border-radius: 25px;
  font-weight: 700;
  font-size: 0.9rem;
  box-shadow: 0 6px 15px rgba(255, 119, 51, 0.4);
  z-index: 10;
}

.product-title {
  font-size: 1rem;
  color: #333;
  margin-bottom: 10px;
  line-height: 1.5;
  min-height: 60px;
  font-weight: 600;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.seller-info {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  color: #666;
  font-size: 0.9rem;
  flex-wrap: wrap;
}

.official-badge {
  background: linear-gradient(135deg, #ffd700, #ffed4e);
  color: #333;
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(255, 215, 0, 0.3);
}

.rating-section {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.rating {
  background: linear-gradient(135deg, #ffd700, #ffed4e);
  padding: 5px 12px;
  border-radius: 8px;
  font-weight: 700;
  color: #333;
  box-shadow: 0 2px 6px rgba(255, 215, 0, 0.3);
}

.sold-count {
  color: #666;
  font-size: 0.9rem;
  font-weight: 500;
}

.price-section {
  margin: 15px 0;
}

.previous-price {
  text-decoration: line-through;
  color: #999;
  font-size: 0.9rem;
  font-weight: 500;
}

.current-price {
  font-size: 1.8rem;
  color: #00a650;
  font-weight: 800;
  margin: 5px 0;
  letter-spacing: -0.5px;
}

.discount-badge {
  display: inline-block;
  background: linear-gradient(135deg, #e6f7ef, #c8f0dd);
  color: #00a650;
  padding: 5px 12px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.85rem;
  margin-left: 8px;
  box-shadow: 0 2px 6px rgba(0, 166, 80, 0.2);
}

.installment {
  color: #666;
  font-size: 0.9rem;
  margin-top: 6px;
  font-weight: 500;
}

.shipping-info {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 15px;
  padding-top: 15px;
  border-top: 2px solid #e9ecef;
  flex-wrap: wrap;
}

.full-badge {
  background: linear-gradient(135deg, #3483fa, #2968d8);
  color: white;
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(52, 131, 250, 0.3);
}

.shipping-text {
  color: #00a650;
  font-weight: 700;
}

.shopee-category {
  background: white;
  border-radius: 16px;
  padding: 25px;
  margin-bottom: 25px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12);
  transition: box-shadow 0.3s;
}

.shopee-category:hover {
  box-shadow: 0 15px 50px rgba(0, 0, 0, 0.18);
}

.shopee-header {
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 3px solid #ee4d2d;
}

.l1-category {
  font-size: 1.8rem;
  color: #ee4d2d;
  font-weight: 700;
  margin-bottom: 5px;
  letter-spacing: -0.5px;
}

.l2-category {
  font-size: 1.3rem;
  color: #555;
  font-weight: 600;
  letter-spacing: -0.3px;
}

.shopee-products {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 15px;
  margin-top: 20px;
}

.shopee-product {
  background: linear-gradient(135deg, #fff5f5 0%, #ffe8e8 100%);
  border-radius: 12px;
  padding: 18px;
  border-left: 5px solid #ee4d2d;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid rgba(238, 77, 45, 0.1);
}

.shopee-product:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(238, 77, 45, 0.2);
  border-left-width: 6px;
}

.shopee-product-name {
  font-size: 1rem;
  color: #333;
  font-weight: 600;
  margin-bottom: 12px;
  line-height: 1.4;
}

.shopee-units {
  font-size: 1.3rem;
  color: #ee4d2d;
  font-weight: 800;
  letter-spacing: -0.3px;
}

.shopee-units-label {
  font-size: 0.85rem;
  color: #666;
  font-weight: 500;
}

.no-data {
  text-align: center;
  padding: 60px 40px;
  color: #666;
  font-size: 1.2rem;
  font-weight: 500;
  background: white;
  border-radius: 16px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

@media (max-width: 768px) {
  body {
    padding: 15px;
  }

  h1 {
    margin-bottom: 20px;
  }

  .tabs {
    gap: 8px;
  }

  .tab-button {
    padding: 12px 24px;
    font-size: 1rem;
  }

  .filters,
  .category-card,
  .shopee-category {
    padding: 20px;
    margin-bottom: 20px;
  }

  .filter-row {
    grid-template-columns: 1fr;
    gap: 15px;
  }

  .product-grid {
    grid-template-columns: 1fr;
    gap: 15px;
  }

  .shopee-products {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .current-price {
    font-size: 1.5rem;
  }

  .category-name {
    font-size: 1.3rem;
  }

  .l1-category {
    font-size: 1.5rem;
  }

  .l2-category {
    font-size: 1.1rem;
  }
}

@media (max-width: 480px) {
  .product-card,
  .shopee-product {
    padding: 15px;
  }

  .rank-badge {
    top: -8px;
    right: -8px;
    padding: 6px 12px;
    font-size: 0.8rem;
  }
}

/* Smooth scrolling */
html {
  scroll-behavior: smooth;
}

/* Selection styling */
::selection {
  background: #667eea;
  color: white;
}

::-moz-selection {
  background: #667eea;
  color: white;
}