/* Base styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #f0f2f5;
  color: #1a1a1a;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.main-content {
  flex: 1;
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
  padding: 40px 20px;
}

/* Logo styles */
.logo {
  display: block;
  width: 120px;
  height: 120px;
  margin: 0 auto 24px;
  border-radius: 20px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
}

/* Typography */
h1 {
  font-size: 1.75rem;
  font-weight: 600;
  text-align: center;
  margin-bottom: 24px;
  color: #1a1a1a;
}

/* Converter container */
.converter-container {
  background: #fff;
  padding: 24px;
  border-radius: 16px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  margin-bottom: 32px;
}

.converter-switch {
  text-align: center;
  margin-bottom: 24px;
}

.converter-switch a {
  color: #007bff;
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.2s ease;
}

.converter-switch a:hover {
  text-decoration: underline;
}

/* Form elements */
.input-group {
  margin-bottom: 24px;
}

label {
  display: block;
  margin-bottom: 8px;
  font-size: 1rem;
  font-weight: 500;
  color: #4a4a4a;
}

input[type="number"] {
  width: 100%;
  padding: 16px;
  font-size: 1.2rem;
  border: 2px solid #e0e0e0;
  border-radius: 12px;
  transition: all 0.2s ease;
  -webkit-appearance: none;
}

input[type="number"]:focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

button {
  width: 100%;
  padding: 16px;
  font-size: 1.1rem;
  font-weight: 600;
  color: #fff;
  background: #007bff;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

button:active {
  transform: translateY(1px);
  background: #0056b3;
}

/* Results */
.result {
  display: none;
  margin-top: 24px;
  font-size: 1.3rem;
  text-align: center;
  padding: 16px;
  border-radius: 12px;
  background: #f8f9fa;
}

.result.show {
  display: block;
}

.result span {
  font-weight: 600;
  color: #007bff;
}

/* History section */
.history-section {
  margin-top: 32px;
}

.history-title {
  font-size: 1.1rem;
  color: #4a4a4a;
  margin-bottom: 16px;
}

.history-list {
  background: #fff;
  border-radius: 12px;
  padding: 16px;
  max-height: 200px;
  overflow-y: auto;
  border: 1px solid #e0e0e0;
}

.history-item {
  padding: 8px;
  border-bottom: 1px solid #e0e0e0;
}

.history-item:last-child {
  border-bottom: none;
}

/* Social proof */
.social-proof {
  background: #fff;
  padding: 24px;
  border-radius: 16px;
  text-align: center;
  margin-bottom: 32px;
}

.stats {
  display: flex;
  justify-content: space-around;
  margin-top: 16px;
}

.stat-item {
  text-align: center;
}

.stat-number {
  font-size: 1.5rem;
  font-weight: 600;
  color: #007bff;
}

.stat-label {
  font-size: 0.9rem;
  color: #666;
}

/* Content sections */
.section.minor {
  margin: 32px 0;
}

.subtitle-minor {
  font-size: 1.25rem;
  color: #333;
  margin-bottom: 16px;
}

.subtext-minor {
  color: #666;
  margin-bottom: 16px;
}

ul {
  list-style-position: inside;
  margin-bottom: 16px;
}

li {
  margin-bottom: 8px;
  color: #444;
}

hr {
  border: none;
  border-top: 1px solid #e0e0e0;
  margin: 32px 0;
}

/* Footer */
footer {
  background: #fff;
  border-top: 1px solid #e0e0e0;
  padding: 24px 20px;
  text-align: center;
}

.footer-content {
  max-width: 800px;
  margin: 0 auto;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 32px;
  margin-bottom: 24px;
}

.footer-section {
  text-align: left;
}

.footer-section h3 {
  color: #444;
  font-size: 1rem;
  margin-bottom: 12px;
  font-weight: 600;
}

.footer-section-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer-links a {
  color: #666;
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.2s ease;
}

.footer-links a:hover {
  color: #007bff;
}

.copyright {
  color: #888;
  font-size: 0.85rem;
  padding-top: 16px;
  border-top: 1px solid #eee;
}

/* Responsive adjustments */
@media (max-width: 600px) {
  .footer-links {
    flex-direction: column;
    gap: 24px;
  }

  .footer-section {
    width: 100%;
  }

  .footer-section-links {
    gap: 12px;
  }
}

@media (max-width: 380px) {
  .main-content {
    padding: 20px;
  }

  .logo {
    width: 96px;
    height: 96px;
    margin-bottom: 20px;
  }

  h1 {
    font-size: 1.5rem;
  }

  .converter-container {
    padding: 20px;
  }

  input[type="number"] {
    font-size: 1.1rem;
    padding: 14px;
  }

  button {
    font-size: 1rem;
    padding: 14px;
  }

  .result {
    font-size: 1.2rem;
  }
}

/* Interactive visualization */
.visualization-container {
  background: #fff;
  padding: 24px;
  border-radius: 16px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  margin-bottom: 32px;
  text-align: center;
}

.visualization-container h2 {
  font-size: 1.25rem;
  margin-bottom: 20px;
  color: #333;
}

.temperature-scale {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px 0;
}

.scale-container {
  width: 100%;
  max-width: 500px;
  margin-bottom: 20px;
}

.scale-bar {
  height: 16px;
  background: linear-gradient(to right, #00c6ff, #0072ff, #ff8c00, #ff0000);
  border-radius: 8px;
  position: relative;
  margin: 0 10px 10px;
}

.temperature-marker {
  position: absolute;
  width: 20px;
  height: 20px;
  background-color: #fff;
  border: 2px solid #007bff;
  border-radius: 50%;
  top: -2px;
  left: 30%; /* Default position */
  transform: translateX(-50%);
  cursor: pointer;
  transition: left 0.3s ease;
  z-index: 2;
}

.marker-value {
  position: absolute;
  top: -30px;
  left: 50%;
  transform: translateX(-50%);
  background: #007bff;
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.8rem;
  white-space: nowrap;
}

.scale-labels {
  display: flex;
  justify-content: space-between;
  padding: 0 10px;
  font-size: 0.8rem;
  color: #666;
}

.temp-fact {
  display: flex;
  align-items: flex-start;
  background: #f8f9fa;
  padding: 16px;
  border-radius: 12px;
  margin-top: 10px;
  text-align: left;
  transition: background-color 0.3s ease;
}

.fact-icon {
  font-size: 1.5rem;
  margin-right: 12px;
  flex-shrink: 0;
}

.fact-text {
  font-size: 0.95rem;
  color: #444;
  line-height: 1.4;
}

/* Quiz section */
.quiz-container {
  background: #fff;
  padding: 24px;
  border-radius: 16px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  margin-bottom: 32px;
}

.quiz-container h2 {
  font-size: 1.25rem;
  margin-bottom: 16px;
  color: #333;
  text-align: center;
}

.quiz-question {
  margin-bottom: 16px;
  font-weight: 500;
}

.quiz-options {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-bottom: 16px;
}

.quiz-option {
  border: 2px solid #e0e0e0;
  padding: 12px 16px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.quiz-option:hover {
  border-color: #007bff;
  background-color: #f0f7ff;
}

.quiz-option.selected {
  border-color: #007bff;
  background-color: #e6f2ff;
}

.quiz-option.correct {
  border-color: #28a745;
  background-color: #d4edda;
}

.quiz-option.incorrect {
  border-color: #dc3545;
  background-color: #f8d7da;
}

.quiz-feedback {
  margin-top: 16px;
  padding: 12px;
  border-radius: 8px;
  display: none;
}

.quiz-feedback.correct {
  background-color: #d4edda;
  color: #155724;
  display: block;
}

.quiz-feedback.incorrect {
  background-color: #f8d7da;
  color: #721c24;
  display: block;
}

.quiz-next {
  margin-top: 16px;
  display: none;
}

.quiz-next.show {
  display: block;
}

/* User preference section */
.preferences-container {
  background: #fff;
  padding: 24px;
  border-radius: 16px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  margin-bottom: 32px;
}

.preferences-container h2 {
  font-size: 1.25rem;
  margin-bottom: 16px;
  color: #333;
  text-align: center;
}

.preference-option {
  margin-bottom: 16px;
}

.preference-option label {
  font-weight: 500;
  display: block;
  margin-bottom: 8px;
}

.toggle-container {
  position: relative;
  display: inline-block;
  width: 60px;
  height: 30px;
}

.toggle-input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: .4s;
  border-radius: 30px;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 22px;
  width: 22px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
}

.toggle-input:checked + .toggle-slider {
  background-color: #007bff;
}

.toggle-input:checked + .toggle-slider:before {
  transform: translateX(30px);
}

.preference-description {
  margin-top: 8px;
  color: #666;
  font-size: 0.9rem;
}

/* Popular conversions section */
.popular-conversions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 16px;
}

.quick-convert-btn {
  padding: 8px 16px;
  background-color: #f0f7ff;
  border: 1px solid #cce5ff;
  border-radius: 20px;
  color: #007bff;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.quick-convert-btn:hover {
  background-color: #007bff;
  color: white;
}

/* Amazon Affiliate Products Styles */
.products-container {
  background: #fff;
  padding: 24px;
  border-radius: 16px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  margin-bottom: 32px;
}

.products-container h2 {
  font-size: 1.25rem;
  margin-bottom: 16px;
  color: #333;
  text-align: center;
}

.product-intro {
  text-align: center;
  color: #666;
  margin-bottom: 24px;
  font-size: 0.95rem;
}

/* Updated product grid for mobile */
.product-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-bottom: 20px;
}

.product-card {
  border: 1px solid #e0e0e0;
  border-radius: 16px;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  position: relative;
}

.product-card:active {
  transform: scale(0.98);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.product-image-container {
  height: 180px;
  overflow: hidden;
  background: #f9f9f9;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.product-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 12px;
}

/* Amazon prime badge */
.amazon-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 4px;
  padding: 3px 6px;
  font-size: 0.65rem;
  font-weight: 600;
  color: #232F3E;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* Deal label */
.deal-label {
  position: absolute;
  top: 8px;
  left: 8px;
  background: #B12704;
  color: white;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 3px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
  z-index: 1;
}

.product-details {
  padding: 16px;
}

.product-title {
  font-size: 1.1rem;
  margin-bottom: 8px;
  color: #333;
  font-weight: 600;
  line-height: 1.3;
}

.product-description {
  color: #666;
  font-size: 0.9rem;
  margin-bottom: 16px;
  line-height: 1.4;
}

/* Star rating styles */
.product-rating {
  display: flex;
  align-items: center;
  margin-bottom: 12px;
}

.stars {
  color: #FFA41C;
  letter-spacing: -1px;
  margin-right: 6px;
  font-size: 0.95rem;
}

.rating-count {
  color: #007185;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: color 0.2s ease;
}

.rating-count:hover,
.rating-count:active {
  color: #005B70;
  text-decoration: underline;
}

/* Price display styling */
.product-price {
  display: flex;
  align-items: baseline;
  margin-bottom: 14px;
}

.current-price {
  color: #B12704;
  font-size: 1.1rem;
  font-weight: 700;
  margin-right: 8px;
}

.original-price {
  color: #888;
  font-size: 0.85rem;
  text-decoration: line-through;
}

.savings {
  color: #007600;
  font-size: 0.85rem;
  font-weight: 500;
  margin-left: auto;
}

.product-button {
  display: block;
  width: 100%;
  background: #FF9900;
  color: white;
  padding: 12px 16px;
  border-radius: 100px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  text-align: center;
  transition: background-color 0.2s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  -webkit-tap-highlight-color: rgba(0,0,0,0); /* Remove default mobile tap highlight */
}

.product-button:hover, .product-button:active {
  background: #E68A00;
  color: white;
}

/* Make the entire card tappable for mobile */
.product-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.03);
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
  border-radius: 16px;
}

.product-card:active::after {
  opacity: 1;
}

.category-title {
  margin: 32px 0 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid #007bff;
  color: #333;
}

.affiliate-disclosure {
  background: #f8f9fa;
  padding: 12px;
  border-radius: 8px;
  font-size: 0.8rem;
  color: #666;
  text-align: center;
  margin-top: 20px;
}

/* Enhanced button for "View All Products" */
.text-center .product-button {
  max-width: 280px;
  margin: 0 auto;
  background-color: #007bff;
}

.text-center .product-button:hover, .text-center .product-button:active {
  background: #0056b3;
}

@media (min-width: 768px) {
  .product-grid {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  }
  
  .product-button {
    display: inline-block;
    width: auto;
    padding: 10px 20px;
  }
}

@media (max-width: 480px) {
  .products-container {
    padding: 16px;
  }
  
  .product-image-container {
    height: 160px;
  }
  
  .product-title {
    font-size: 1rem;
  }
  
  .product-description {
    font-size: 0.85rem;
    margin-bottom: 12px;
  }
}

/* Utility classes */
.text-center {
  text-align: center;
}

/* Remove Amazon native ad styles as we're using static SiteStripe links */
/* Amazon Native Shopping Ads Styles */
.amazon-products-container {
  margin: 20px 0;
  padding: 15px;
  background: #fcfcfc;
  border-radius: 10px;
  border: 1px solid #eee;
}

/* Override Amazon widget styles to match our site */
.amazon-products-container iframe {
  width: 100% !important;
  margin: 0 auto !important;
}

/* Style for Amazon ads to match our site theme */
.amazon-products-container .amzn-ad-container {
  background: transparent !important;
  padding: 0 !important;
}

/* Make Amazon title style match our styling */
#amzn-native-ad-0 .amzn-native-header,
#amzn-native-ad-1 .amzn-native-header,
#amazon-auto-links .amzn-native-header {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
  font-size: 1.1rem !important;
  color: #333 !important;
  font-weight: 500 !important;
}