/* Reset and base styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Inter', sans-serif;
  line-height: 1.6;
  color: #1a1a1a;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  background-attachment: fixed;
  min-height: 100vh;
}


/* Header */
header {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  padding: 24px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
  margin-bottom: 24px;
  border-radius: 0 0 16px 16px;
}

header h1 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 8px;
  text-align: center;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.02em;
}

.tagline {
  text-align: center;
  font-size: 1.1rem;
  color: #666;
  margin-bottom: 20px;
  font-weight: 500;
}

.date-navigation {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

.nav-btn {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  padding: 12px 20px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.3s ease;
  box-shadow: 0 2px 10px rgba(102, 126, 234, 0.3);
}

.nav-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4);
}

.nav-btn:disabled {
  background: #ccc;
  cursor: not-allowed;
}

.date-selector {
  padding: 12px 16px;
  border: 2px solid transparent;
  border-radius: 8px;
  font-size: 14px;
  background: white;
  min-width: 150px;
  transition: all 0.3s ease;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.date-selector:focus {
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Controls */
.controls {
  display: flex;
  gap: 16px;
  margin-bottom: 24px;
  padding: 0 20px;
  flex-wrap: wrap;
  align-items: center;
  max-width: 1600px;
  margin-left: auto;
  margin-right: auto;
}

.search-input, .sort-selector {
  padding: 12px 16px;
  border: 2px solid transparent;
  border-radius: 8px;
  font-size: 14px;
  transition: all 0.3s ease;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.search-input:focus, .sort-selector:focus {
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
  outline: none;
}

.search-input {
  flex: 1;
  min-width: 200px;
  max-width: 400px;
}

.sort-selector {
  min-width: 180px;
  background: white;
}

/* Loading and error states */
.loading, .error {
  text-align: center;
  padding: 40px 20px;
  font-size: 18px;
}

.error {
  color: #d32f2f;
  background: #ffebee;
  margin: 20px;
  border-radius: 4px;
}

.loading {
  color: #666;
}

/* Content area */
.content {
  padding: 0 20px;
  position: relative;
  z-index: 1;
}

/* Category sections */
.category-section {
  margin-bottom: 40px;
}

.category-title {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 24px;
  color: white;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
  text-transform: capitalize;
}

/* Deal cards grid */
.deals-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

/* Deal card */
.deal-card {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
  transition: all 0.3s ease;
  position: relative;
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

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

.deal-card.hidden {
  display: none;
}

/* Deal image */
.deal-image {
  width: 100%;
  height: 200px;
  object-fit: contain;
  border-radius: 12px;
  margin-bottom: 16px;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  transition: transform 0.3s ease;
  overflow: hidden;
}

.deal-card:hover .deal-image {
  transform: scale(1.01);
}

/* Discount badge */
.discount-badge {
  position: absolute;
  top: 16px;
  right: 16px;
  background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
  color: white;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  box-shadow: 0 2px 10px rgba(238, 90, 36, 0.4);
  animation: pulse 2s infinite;
  z-index: 10;
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

/* Deal content */
.deal-title {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 8px;
  color: #232f3e;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.deal-description {
  font-size: 14px;
  color: #666;
  margin-bottom: 12px;
  line-height: 1.4;
}

/* Price section */
.deal-price {
  margin-bottom: 16px;
}

.current-price {
  font-size: 20px;
  font-weight: bold;
  color: #e31c5f;
}

.original-price {
  font-size: 14px;
  color: #666;
  text-decoration: line-through;
  margin-left: 8px;
}

/* View button */
.view-btn {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  padding: 14px 20px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  text-align: center;
  transition: all 0.3s ease;
  margin-top: auto;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
  position: relative;
  overflow: hidden;
}

.view-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left 0.5s;
}

.view-btn:hover::before {
  left: 100%;
}

.view-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
  text-decoration: none;
  color: white;
}

/* Place indicator */
.deal-place {
  position: absolute;
  top: 16px;
  left: 16px;
  background: rgba(0,0,0,0.8);
  color: white;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  z-index: 10;
  backdrop-filter: blur(10px);
  box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

/* Glass effect for mobile */
@media (max-width: 480px) {
  body {
    background: linear-gradient(180deg, #667eea 0%, #764ba2 100%);
  }
}

/* Responsive design */
@media (max-width: 768px) {
  header {
    padding: 20px 16px;
    border-radius: 0 0 12px 12px;
  }

  header h1 {
    font-size: 2rem;
    margin-bottom: 8px;
  }

  .tagline {
    font-size: 1rem;
  }
  
  .date-navigation {
    flex-direction: column;
    gap: 12px;
  }
  
  .nav-btn {
    width: 100%;
    max-width: 200px;
  }
  
  .date-selector {
    width: 100%;
    max-width: 200px;
  }
  
  .controls {
    flex-direction: column;
    padding: 0 16px;
  }
  
  .search-input, .sort-selector {
    width: 100%;
  }
  
  .content {
    padding: 0 16px;
  }
  
  .deals-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  
  .category-title {
    font-size: 1.25rem;
  }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .deals-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1025px) and (max-width: 1400px) {
  .deals-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1401px) {
  .deals-grid {
    grid-template-columns: repeat(4, 1fr);
  }
  
  .content {
    max-width: 1600px;
    margin: 0 auto;
  }
}

/* Loading animation */
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.loading::after {
  content: "";
  display: inline-block;
  width: 24px;
  height: 24px;
  border: 3px solid rgba(102, 126, 234, 0.3);
  border-top: 3px solid #667eea;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-left: 12px;
}

/* Focus styles for accessibility */
.nav-btn:focus,
.view-btn:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.3);
}

/* Smooth transitions */
.deal-card,
.nav-btn,
.view-btn {
  transition: all 0.2s ease;
}