/* ============================================
   RESPONSIVE CSS - Kirkland Nike SB Dunk Low Drop Tracker
   Mobile-First Approach
   ============================================ */

/* ============================================
   BASE / MOBILE FIRST (320px - 767px)
   ============================================ */

/* Typography Scaling */
html {
  font-size: 14px; /* Base font size for mobile */
}

/* Container Padding */
.container {
  width: 100%;
  margin: 0 auto;
  padding: 0 16px;
}

/* Hero Section - Mobile */
.hero-image {
  width: 100%;
  max-width: 400px;
  height: auto;
  display: block;
  margin: 0 auto;
}

.hero .title {
  font-size: 32px; /* Down from 48px */
  letter-spacing: 1.5px;
  text-align: center;
  margin: 20px 0 10px;
}

.hero .subtitle {
  font-size: 18px;
  text-align: center;
  margin-bottom: 20px;
}

/* Countdown Timer - Mobile (2x2 Grid) */
.countdown {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: repeat(2, 1fr);
  gap: 10px;
  max-width: 300px;
  margin: 20px auto;
  padding: 20px 10px;
}

.countdown-unit {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 15px 10px;
}

.countdown-number {
  font-size: 48px; /* Down from 72px */
  font-weight: 900;
  line-height: 1;
  margin-bottom: 5px;
}

.countdown-label {
  font-size: 12px; /* Down from 14px */
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.predicted-date {
  text-align: center;
  font-size: 18px;
  margin-top: 20px;
}

/* Price Sign - Mobile */
.costco-price-sign {
  width: 90%;
  max-width: 90%;
  margin: 30px auto;
  padding: 30px 20px;
  background-color: #FFFFFF;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.costco-price-sign .item-number {
  font-size: 28px; /* Down from 36px */
  color: #1A1A1A;
  font-weight: 400;
  margin-bottom: 8px;
  letter-spacing: 1px;
}

.costco-price-sign .product-name {
  font-size: 22px; /* Down from 28px */
  font-weight: 700;
  color: #2A2A2A;
  text-transform: uppercase;
  line-height: 1.2;
  margin-bottom: 25px;
  letter-spacing: 0.5px;
}

.costco-price-sign .price-section,
.costco-price-sign .price-display {
  text-align: right;
  margin-top: 30px;
}

.costco-price-sign .price-label {
  font-size: 16px; /* Down from 18px */
  color: #4A4A4A;
  text-transform: uppercase;
  font-variant: small-caps;
  letter-spacing: 1px;
  margin-bottom: 5px;
}

.costco-price-sign .price-amount {
  font-size: 80px; /* Down from 120px */
  font-weight: 700;
  color: #000000;
  line-height: 1;
  letter-spacing: -2px;
}

.price-disclaimer {
  text-align: center;
  font-size: 12px;
  color: #666;
  font-style: italic;
  margin-top: 10px;
}

/* Confidence Section - Mobile */
.confidence-section {
  margin: 30px auto;
  padding: 0 16px;
  max-width: 100%;
}

.confidence-bar {
  width: 100%;
  height: 16px;
  background-color: #E5E5E5;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 10px;
}

.confidence-fill {
  height: 100%;
  transition: width 0.3s ease;
}

.confidence-text {
  font-size: 14px;
  text-align: center;
  margin: 0;
}

/* Source Cards - Mobile (Single Column) */
.sources-section {
  margin: 40px 0;
  padding: 0 16px;
}

.sources-section h2 {
  font-size: 24px; /* Down from 32px */
  font-weight: 700;
  text-transform: uppercase;
  text-align: center;
  margin-bottom: 20px;
}

.sources-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-top: 20px;
}

.source-card {
  background-color: #FFFFFF;
  border: 2px solid #333333;
  padding: 20px;
  min-height: 120px;
  transition: all 0.3s ease;
}

.source-card .source-name {
  font-size: 18px; /* Down from 20px */
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 10px;
  letter-spacing: 0.5px;
}

.source-card .source-date {
  font-size: 20px; /* Down from 24px */
  font-weight: 700;
  margin-bottom: 8px;
}

.source-card .source-meta {
  font-size: 14px;
  color: #666;
  margin-bottom: 5px;
}

.source-card a {
  display: inline-block;
  color: #E31837;
  text-decoration: none;
  font-weight: 700;
  font-size: 14px;
  margin-top: 10px;
  min-height: 44px;
  min-width: 44px;
  padding: 12px 20px;
  line-height: 1.4;
}

.source-card a:hover {
  text-decoration: underline;
}

/* Product Detail Images - Mobile Carousel */
.product-details {
  margin: 40px 0;
  padding: 0;
}

.detail-carousel {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  gap: 20px;
  max-width: 100%;
  padding: 0 16px;
}

.detail-carousel img {
  scroll-snap-align: center;
  max-width: 300px;
  width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Footer - Mobile */
.footer {
  margin: 40px 0 60px;
  padding: 20px 16px;
  text-align: center;
}

.footer .update-info,
.footer .disclaimer {
  font-size: 12px;
  color: #666;
  margin: 5px 0;
}

/* Touch Device Optimizations */
@media (hover: none) {
  /* Remove hover effects on touch devices */
  .source-card:hover {
    transform: none !important;
    box-shadow: none !important;
    background-color: #FFFFFF !important;
  }

  .detail-carousel img:hover {
    transform: none !important;
  }
}

/* Touch-Friendly Tap Targets */
.refresh-button,
button,
.source-card a {
  min-height: 44px;
  min-width: 44px;
  padding: 12px 20px;
}


/* ============================================
   TABLET (768px - 1199px)
   ============================================ */

@media (min-width: 768px) {
  /* Typography Scaling */
  html {
    font-size: 16px;
  }

  /* Container Padding */
  .container {
    padding: 0 32px;
  }

  /* Hero Section - Tablet */
  .hero-image {
    max-width: 500px;
  }

  .hero .title {
    font-size: 42px;
    letter-spacing: 2px;
  }

  .hero .subtitle {
    font-size: 22px;
  }

  /* Countdown Timer - Tablet (Single Row) */
  .countdown {
    display: flex;
    flex-direction: row;
    justify-content: center;
    gap: 30px;
    max-width: none;
    padding: 30px 20px;
  }

  .countdown-unit {
    padding: 20px 15px;
  }

  .countdown-number {
    font-size: 64px;
  }

  .countdown-label {
    font-size: 14px;
  }

  .predicted-date {
    font-size: 24px;
  }

  /* Price Sign - Tablet */
  .costco-price-sign {
    max-width: 500px;
    padding: 40px 30px;
  }

  .costco-price-sign .item-number {
    font-size: 32px;
  }

  .costco-price-sign .product-name {
    font-size: 26px;
  }

  .costco-price-sign .price-label {
    font-size: 18px;
  }

  .costco-price-sign .price-amount {
    font-size: 100px;
  }

  .price-disclaimer {
    font-size: 14px;
  }

  /* Confidence Section - Tablet */
  .confidence-bar {
    height: 20px;
  }

  .confidence-text {
    font-size: 16px;
  }

  /* Source Cards - Tablet (2 Columns) */
  .sources-section h2 {
    font-size: 28px;
  }

  .sources-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }

  .source-card .source-name {
    font-size: 19px;
  }

  .source-card .source-date {
    font-size: 22px;
  }

  /* Product Detail Images - Tablet */
  .detail-carousel {
    justify-content: center;
    padding: 0 32px;
  }

  .detail-carousel img {
    max-width: 400px;
  }

  /* Footer - Tablet */
  .footer {
    margin-bottom: 40px;
    padding: 20px 32px;
  }

  .footer .update-info,
  .footer .disclaimer {
    font-size: 14px;
  }
}


/* ============================================
   DESKTOP (1200px+)
   ============================================ */

@media (min-width: 1200px) {
  /* Typography Scaling */
  html {
    font-size: 16px;
  }

  /* Container Padding */
  .container {
    max-width: 1400px;
    padding: 0 40px;
  }

  /* Hero Section - Desktop */
  .hero-image {
    max-width: 600px;
  }

  .hero .title {
    font-size: 48px;
    letter-spacing: 2px;
  }

  .hero .subtitle {
    font-size: 24px;
  }

  /* Countdown Timer - Desktop (Full Size) */
  .countdown {
    gap: 40px;
    padding: 40px 20px;
  }

  .countdown-unit {
    padding: 25px 20px;
  }

  .countdown-number {
    font-size: 72px;
  }

  .countdown-label {
    font-size: 14px;
  }

  .predicted-date {
    font-size: 28px;
  }

  /* Price Sign - Desktop */
  .costco-price-sign {
    max-width: 450px;
    padding: 40px 30px;
  }

  .costco-price-sign .item-number {
    font-size: 36px;
  }

  .costco-price-sign .product-name {
    font-size: 28px;
  }

  .costco-price-sign .price-label {
    font-size: 18px;
  }

  .costco-price-sign .price-amount {
    font-size: 120px;
  }

  /* Confidence Section - Desktop */
  .confidence-bar {
    height: 24px;
    max-width: 600px;
    margin: 0 auto 10px;
  }

  .confidence-text {
    font-size: 18px;
  }

  /* Source Cards - Desktop (3 Columns) */
  .sources-section h2 {
    font-size: 32px;
  }

  .sources-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
  }

  .source-card {
    padding: 24px;
  }

  .source-card .source-name {
    font-size: 20px;
  }

  .source-card .source-date {
    font-size: 24px;
  }

  /* Hover Effects - Desktop Only */
  .source-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    background-color: #F5F5F5;
    transition: all 0.3s ease;
  }

  .detail-carousel img:hover {
    transform: scale(1.02);
    transition: transform 0.3s ease;
  }

  /* Product Detail Images - Desktop */
  .detail-carousel {
    justify-content: center;
    gap: 30px;
  }

  .detail-carousel img {
    max-width: 450px;
  }

  /* Footer - Desktop */
  .footer .update-info,
  .footer .disclaimer {
    font-size: 14px;
  }
}


/* ============================================
   LARGE DESKTOP (1600px+)
   ============================================ */

@media (min-width: 1600px) {
  /* Container Max Width */
  .container {
    max-width: 1400px; /* Don't exceed */
  }

  /* Source Cards - 4 Columns (if many sources) */
  .sources-grid.many-sources {
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
  }

  /* Product Detail Images - Larger */
  .detail-carousel img {
    max-width: 500px;
  }
}


/* ============================================
   LANDSCAPE ORIENTATION (TABLETS & PHONES)
   ============================================ */

@media (max-width: 1199px) and (orientation: landscape) {
  /* Countdown - Compact for landscape */
  .countdown {
    padding: 20px 10px;
  }

  .countdown-number {
    font-size: 48px;
  }

  /* Reduce hero image size */
  .hero-image {
    max-width: 350px;
  }

  /* Compact price sign */
  .costco-price-sign {
    padding: 25px 20px;
  }
}


/* ============================================
   SMALL MOBILE (max-width: 375px)
   ============================================ */

@media (max-width: 375px) {
  html {
    font-size: 13px;
  }

  .container {
    padding: 0 12px;
  }

  .hero .title {
    font-size: 28px;
  }

  .countdown-number {
    font-size: 42px;
  }

  .countdown-label {
    font-size: 11px;
  }

  .costco-price-sign .price-amount {
    font-size: 70px;
  }

  .sources-grid {
    gap: 12px;
  }

  .source-card {
    padding: 16px;
  }
}


/* ============================================
   PRINT STYLES
   ============================================ */

@media print {
  .container {
    max-width: 100%;
    padding: 0;
  }

  .detail-carousel,
  .refresh-button,
  .footer .update-info {
    display: none;
  }

  .source-card {
    page-break-inside: avoid;
  }

  body {
    font-size: 12pt;
  }
}


/* ============================================
   ACCESSIBILITY ENHANCEMENTS
   ============================================ */

/* Screen Reader Only */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* Focus Indicators */
a:focus,
button:focus {
  outline: 3px solid #E31837;
  outline-offset: 2px;
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .countdown-number {
    transition: none;
  }

  .source-card:hover {
    transform: none;
  }
}


/* ============================================
   HIGH CONTRAST MODE
   ============================================ */

@media (prefers-contrast: high) {
  .source-card {
    border-width: 3px;
  }

  .confidence-bar {
    border: 2px solid #000;
  }

  a {
    text-decoration: underline;
  }
}


/* ============================================
   DARK MODE (OPTIONAL - PHASE 2)
   ============================================ */

@media (prefers-color-scheme: dark) {
  /* Uncomment to enable dark mode support
  body {
    background-color: #1A1A1A;
    color: #FFFFFF;
  }

  .costco-price-sign,
  .source-card {
    background-color: #2A2A2A;
    border-color: #666;
  }

  .confidence-bar {
    background-color: #3A3A3A;
  }
  */
}


/* ============================================
   UTILITY CLASSES
   ============================================ */

/* Text Alignment */
.text-center {
  text-align: center;
}

.text-left {
  text-align: left;
}

.text-right {
  text-align: right;
}

/* Display Utilities */
.hidden {
  display: none;
}

.visible {
  display: block;
}

/* Spacing Utilities */
.mt-small {
  margin-top: 10px;
}

.mt-medium {
  margin-top: 20px;
}

.mt-large {
  margin-top: 40px;
}

.mb-small {
  margin-bottom: 10px;
}

.mb-medium {
  margin-bottom: 20px;
}

.mb-large {
  margin-bottom: 40px;
}
