/* =========================================
   DEALCHECKR - COMPLETE STYLESHEET
   ========================================= */

/* 1. GLOBAL RESET & IOS FIXES */
body {
  --z-nav: 1000;
  --z-content: 10;
  overscroll-behavior-y: none;
  -webkit-tap-highlight-color: transparent;
}

/* 2. MAIN CONTAINER */
.dcr-box {
  max-width: 800px;
  margin: 20px auto;
  margin-top: max(20px, env(safe-area-inset-top));
  padding: 30px;
  background: #ffffff;
  border-radius: 24px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.08);
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
  border: 1px solid rgba(0, 0, 0, 0.05);
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
  will-change: transform;
}

.dcr-box * {
  box-sizing: border-box;
}

/* 3. TYPOGRAPHY */
.dcr-box h2 {
  margin: 0 0 10px 0;
  color: #1a1a1a;
  text-align: center;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.dcr-subtitle {
  text-align: center;
  color: #666;
  margin-bottom: 25px;
  font-size: 15px;
  line-height: 1.5;
}

.dcr-disclosure {
  background: #F7F9FA;
  padding: 12px 16px;
  margin-bottom: 25px;
  border-radius: 12px;
  font-size: 12px;
  color: #555;
  text-align: center;
  border: 1px solid #E8EAED;
}

/* 4. INPUT & MAIN BUTTON */
.dcr-input-wrapper {
  position: relative;
  margin-bottom: 20px;
  transition: opacity 0.3s ease;
}

.dcr-input {
  width: 100%;
  padding: 18px 20px;
  border: 2px solid #E3E6EA;
  border-radius: 16px;
  font-size: 16px;
  background: #FAFBFC;
  color: #1a1a1a;
  transition: all 0.2s ease;
  -webkit-appearance: none;
  font-family: inherit;
}

.dcr-input:focus {
  outline: none;
  background: #ffffff;
  border-color: #2563EB;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.dcr-input::placeholder {
  color: #9CA3AF;
}

.dcr-btn {
  width: 100%;
  padding: 18px;
  background: #2563EB;
  color: white;
  border: none;
  border-radius: 16px;
  font-size: 17px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 15px rgba(37, 99, 235, 0.3);
  font-family: inherit;
}

.dcr-btn:hover {
  background: #1D4ED8;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.4);
}

.dcr-btn:active {
  transform: scale(0.98);
}

.dcr-btn-secondary {
  background: #ffffff;
  color: #555;
  border: 2px solid #E3E6EA;
  box-shadow: none;
  margin-top: 15px;
}

.dcr-btn-secondary:hover {
  background: #F9FAFB;
  border-color: #D1D5DB;
}

/* 5. SEARCH HISTORY STRIP */
.dcr-history {
  display: none;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: -8px 0 20px;
  padding: 12px 14px;
  background: #FAFBFC;
  border: 1px solid #E3E6EA;
  border-radius: 12px;
  font-size: 12px;
}

.dcr-history-label {
  color: #6B7280;
  font-weight: 600;
  margin-right: 2px;
}

.dcr-history-chips {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  flex: 1;
}

.dcr-history-chip {
  appearance: none;
  border: 1px solid #E3E6EA;
  background: #ffffff;
  color: #2563EB;
  font-family: monospace;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 9px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.dcr-history-chip:hover {
  background: #EBF5FF;
  border-color: #2563EB;
}

.dcr-history-clear {
  appearance: none;
  border: none;
  background: none;
  color: #9CA3AF;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  padding: 4px;
}

.dcr-history-clear:hover {
  color: #DC2626;
}

/* 6. IOS CONNECT CARD */
.dcr-ios-step {
  display: none;
  background: #EBF8FF;
  border: 2px solid #BEE3F8;
  border-radius: 16px;
  padding: 25px;
  text-align: center;
  margin-bottom: 20px;
}

.dcr-ios-msg h3 {
  color: #2B6CB0 !important;
  font-size: 22px !important;
  margin: 0 0 8px 0 !important;
  font-weight: 700 !important;
}

.dcr-ios-subtitle {
  color: #2C5282 !important;
  font-size: 15px !important;
  margin: 0 0 20px 0 !important;
  font-weight: 500 !important;
}

.dcr-ios-steps {
  background: rgba(255, 255, 255, 0.7);
  border-radius: 12px;
  padding: 15px;
  margin: 20px 0;
  text-align: left;
}

.dcr-step {
  color: #2C5282;
  font-size: 14px;
  margin: 10px 0;
  line-height: 1.5;
  padding-left: 8px;
}

.dcr-step strong {
  color: #2B6CB0;
  font-weight: 700;
}

a.dcr-ios-connect-btn {
  display: block;
  background: #27ae60;
  color: white;
  text-decoration: none;
  padding: 18px;
  border-radius: 16px;
  font-weight: 700;
  font-size: 18px;
  margin: 20px 0;
  transition: all 0.2s ease;
  box-shadow: 0 4px 15px rgba(39, 174, 96, 0.3);
}

a.dcr-ios-connect-btn:active {
  transform: scale(0.97);
  background: #229954;
}

.dcr-ios-alt {
  margin-top: 25px;
  padding-top: 20px;
  border-top: 2px dashed #BEE3F8;
}

.dcr-ios-alt-text {
  font-size: 13px;
  color: #2C5282;
  margin-bottom: 12px;
  font-weight: 500;
}

.dcr-copy-wrapper {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.dcr-results-input {
  flex: 1;
  padding: 12px;
  border: 2px solid #BEE3F8;
  border-radius: 10px;
  font-size: 12px;
  background: white;
  color: #2C5282;
  font-family: monospace;
}

.dcr-results-input:focus {
  outline: none;
  border-color: #2B6CB0;
}

.dcr-copy-btn {
  padding: 12px 20px;
  background: #2B6CB0;
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.dcr-copy-btn:active {
  transform: scale(0.95);
  background: #2C5282;
}

/* 7. LOADING STATE */
.dcr-loading {
  display: none;
  text-align: center;
  padding: 40px 20px;
  margin-top: 20px;
}

.dcr-spinner {
  border: 3px solid #f3f3f3;
  border-top: 3px solid #2563EB;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 15px;
}

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

.dcr-loading-text {
  font-size: 16px;
  color: #555;
  font-weight: 500;
  margin-top: 10px;
  line-height: 1.6;
}

.dcr-loading-text small {
  display: block;
  font-size: 13px;
  color: #888;
  margin-top: 8px;
  font-weight: 400;
}

/* 8. ERROR MESSAGES */
.dcr-error {
  background: #FEF2F2;
  color: #DC2626;
  padding: 15px 20px;
  border-radius: 12px;
  margin-top: 15px;
  display: none;
  text-align: center;
  border: 1px solid #FECACA;
  font-weight: 500;
  font-size: 14px;
}

/* 9. ASIN DISPLAY */
.dcr-asin-display {
  display: none;
  text-align: center;
  padding: 12px 16px;
  margin-top: 15px;
  background: #EBF5FF;
  border-radius: 10px;
  color: #1E40AF;
  font-size: 14px;
  border: 1px solid #BFDBFE;
}

.dcr-asin-display strong {
  font-weight: 700;
  letter-spacing: 0.5px;
  color: #1E3A8A;
}

/* 10. RESULTS SECTION */
.dcr-results {
  display: none;
  margin-top: 30px;
  padding-top: 30px;
  border-top: 2px dashed #E5E7EB;
}

.dcr-results h3 {
  text-align: center;
  color: #059669;
  font-size: 22px;
  font-weight: 600;
  margin-bottom: 20px;
}

.dcr-chart-container {
  position: relative;
  margin: 20px 0;
}

.dcr-chart {
  width: 100%;
  border-radius: 12px;
  border: 1px solid #E5E7EB;
  display: block;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  cursor: pointer;
  transition: transform 0.2s ease;
}

.dcr-chart:hover {
  transform: scale(1.02);
}

.dcr-chart-hint {
  text-align: center;
  color: #9CA3AF;
  font-size: 12px;
  margin-top: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* 11. ACTION LINKS */
.dcr-links {
  display: flex;
  gap: 12px;
  margin: 20px 0;
}

.dcr-link {
  flex: 1;
  padding: 16px;
  text-align: center;
  text-decoration: none;
  border-radius: 12px;
  font-weight: 600;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.dcr-link:active {
  transform: scale(0.97);
}

.dcr-buy {
  background: #FFD814;
  color: #111;
  border: 1px solid #FCD200;
  box-shadow: 0 2px 5px rgba(213, 217, 217, 0.5);
}

.dcr-buy:hover {
  background: #F7CA00;
}

.dcr-keepa {
  background: #ffffff;
  color: #333;
  border: 2px solid #E3E6EA;
  width: 55px;
  flex: none;
  font-size: 20px;
}

.dcr-keepa:hover {
  background: #F9FAFB;
  border-color: #D1D5DB;
}

.dcr-keepa-icon {
  display: inline-block;
}

/* 12. SHARE SECTION */
.dcr-share {
  margin-top: 25px;
  padding-top: 20px;
  border-top: 1px dashed #E5E7EB;
  text-align: center;
}

.dcr-share-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.dcr-share-btn {
  padding: 10px 18px;
  background: #F7F9FA;
  color: #555;
  border-radius: 20px;
  text-decoration: none;
  font-size: 13px;
  border: 1px solid #E3E6EA;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.2s ease;
  display: inline-block;
}

.dcr-share-btn:hover {
  background: #E5E7EB;
  transform: translateY(-1px);
}

/* 13. FULLSCREEN MODAL */
.dcr-fullscreen-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.98);
  z-index: 99999;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(5px);
}

.dcr-fullscreen-modal.active {
  display: flex !important;
}

.dcr-fullscreen-content {
  max-width: 95%;
  max-height: 95%;
  position: relative;
}

.dcr-fullscreen-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.dcr-fullscreen-close {
  position: fixed;
  top: 20px;
  right: 20px;
  background: #1a1a1a;
  color: white;
  border: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 28px;
  cursor: pointer;
  z-index: 100000;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: all 0.2s ease;
}

.dcr-fullscreen-close:hover {
  background: #333;
  transform: scale(1.05);
}

/* 14. COUNTER & TOAST */
.dcr-counter {
  text-align: center;
  margin-top: 30px;
  padding: 20px;
  background: #FFFBEB;
  border-radius: 12px;
  border: 1px solid #FDE68A;
  color: #92400E;
  font-size: 14px;
}

.dcr-counter-number {
  font-weight: 700;
  color: #78350F;
}

.dcr-copy-toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  background: #10B981;
  color: white;
  padding: 12px 24px;
  border-radius: 50px;
  display: none;
  z-index: 9999;
  font-weight: 600;
  box-shadow: 0 5px 20px rgba(16, 185, 129, 0.4);
  font-size: 14px;
}

/* 15. RESPONSIVE STYLES */
@media (max-width: 600px) {
  .dcr-box {
    padding: 20px;
    margin: 15px;
  }

  .dcr-box h2 {
    font-size: 24px;
  }

  .dcr-ios-step {
    padding: 25px 20px;
  }

  .dcr-ios-step h3 {
    font-size: 20px;
  }

  .dcr-links {
    flex-direction: row;
  }

  .dcr-fullscreen-close {
    top: 10px;
    right: 10px;
    width: 40px;
    height: 40px;
    font-size: 24px;
  }
}
