/* ==================== BOOTSTRAP OVERRIDES ==================== */
:root {
  --bs-primary: #0d9488;
  --bs-primary-rgb: 13, 148, 136;
  --bs-secondary: #7c3aed;
  --bs-secondary-rgb: 124, 58, 237;
  --bs-success: #10b981;
  --bs-warning: #f59e0b;
}

/* ==================== TRUST BAR ==================== */
.trust-bar {
  background: linear-gradient(135deg, #0d9488, #7c3aed);
  color: white;
  padding: 8px 0;
  text-align: center;
  font-size: 13px;
  font-weight: 500;
}

.trust-bar i {
  opacity: 0.9;
}

/* ==================== NAVBAR CUSTOMIZATION ==================== */
.navbar-brand {
  font-size: 24px;
  color: #1e293b !important;
}

.navbar-brand span {
  color: var(--bs-primary);
}

.navbar {
  border-bottom: 1px solid #e5e7eb;
}

/* ==================== EVIDENCE BADGE ==================== */
.evidence-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #ecfdf5;
  color: #065f46;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

/* ==================== ARTICLE BODY CONTAINMENT ==================== */
.article-body {
  background: white;
  border-radius: 8px;
  padding: 2rem;
  overflow: hidden;
}

.article-body h2 {
  color: #0d9488;
  border-bottom: 2px solid #e5e7eb;
  padding-bottom: 0.5rem;
  margin-top: 2rem;
  margin-bottom: 1rem;
  font-weight: 700;
}

.article-body h3 {
  color: #1e293b;
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
  font-weight: 600;
}

.article-body p {
  margin-bottom: 1rem;
  line-height: 1.8;
}

.article-body ul,
.article-body ol {
  margin-bottom: 1rem;
  padding-left: 1.5rem;
}

.article-body li {
  margin-bottom: 0.5rem;
  line-height: 1.7;
}

.article-body a {
  color: #0d9488;
  text-decoration: underline;
}

.article-body a:hover {
  color: #0f766e;
}

/* ==================== QUICK ANSWER CONTAINMENT ==================== */
.quick-answer-content {
  overflow: hidden;
}

.quick-answer-content * {
  color: white !important;
}

.quick-answer-content a {
  color: #fbbf24 !important;
  text-decoration: underline;
}

.quick-answer-content p {
  margin-bottom: 0.75rem;
}

.quick-answer-content ul,
.quick-answer-content ol {
  margin-left: 1.5rem;
  margin-bottom: 0.75rem;
}

.quick-answer-content li {
  margin-bottom: 0.5rem;
}

.quick-answer-content strong {
  font-weight: 700;
}

/* ==================== TABLE OF CONTENTS ==================== */
.toc-nav ul {
  list-style: none;
  padding-left: 0;
}

.toc-nav li {
  margin-bottom: 0.5rem;
}

.toc-nav a {
  text-decoration: none;
  color: #64748b;
  font-size: 14px;
  display: block;
  padding: 4px 0;
  transition: color 0.2s;
}

.toc-nav a:hover {
  color: #0d9488;
}

.toc-nav ul ul {
  padding-left: 1rem;
  margin-top: 0.5rem;
}

/* ==================== CARD HOVER EFFECTS ==================== */
.card {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12) !important;
}

/* ==================== AMAZON PRODUCT STYLING ==================== */
.btn-warning {
  background: linear-gradient(to bottom, #f7c948, #f0a500);
  border-color: #c98a00;
  color: #111;
  font-weight: 600;
}

.btn-warning:hover {
  background: linear-gradient(to bottom, #f0a500, #d89500);
  border-color: #b07800;
  color: #000;
}

/* ==================== RESPONSIVE ADJUSTMENTS ==================== */
@media (max-width: 768px) {
  .article-body {
    padding: 1.5rem 1rem;
  }

  .trust-bar {
    font-size: 11px;
    padding: 6px 0;
  }

  .navbar-brand {
    font-size: 20px;
  }
}

/* ==================== STICKY SIDEBAR ==================== */
.sticky-top {
  position: -webkit-sticky;
  position: sticky;
}

/* ==================== UTILITIES ==================== */
.shadow-sm {
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08) !important;
}

.text-primary {
  color: #0d9488 !important;
}

.bg-primary {
  background-color: #0d9488 !important;
}

.text-secondary {
  color: #7c3aed !important;
}

.bg-secondary {
  background-color: #7c3aed !important;
}

.border-primary {
  border-color: #0d9488 !important;
}

.border-secondary {
  border-color: #7c3aed !important;
}

.btn-primary {
  background-color: #0d9488;
  border-color: #0d9488;
}

.btn-primary:hover {
  background-color: #0f766e;
  border-color: #0f766e;
}

.btn-outline-primary {
  color: #0d9488;
  border-color: #0d9488;
}

.btn-outline-primary:hover {
  background-color: #0d9488;
  border-color: #0d9488;
  color: white;
}

.btn-secondary {
  background-color: #7c3aed;
  border-color: #7c3aed;
}

.btn-secondary:hover {
  background-color: #6d28d9;
  border-color: #6d28d9;
}

.btn-outline-secondary {
  color: #7c3aed;
  border-color: #7c3aed;
}

.btn-outline-secondary:hover {
  background-color: #7c3aed;
  border-color: #7c3aed;
  color: white;
}

/* ==================== SVG SAFETY NET ==================== */
/* Prevent any SVG (chevrons, icons) from growing giant if CSS loads late */
.article-content svg,
.article-body svg {
  max-width: 24px !important;
  max-height: 24px !important;
}

.paa-icon {
  width: 20px !important;
  height: 20px !important;
  max-width: 20px !important;
  max-height: 20px !important;
  flex-shrink: 0;
}

/* ==================== PRODUCT CARDS ==================== */
.products-section {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 2px solid #e5e7eb;
}

.products-section h2 {
  color: #0d9488;
  font-weight: 700;
  margin-bottom: 1.5rem;
}

.product-card {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  overflow: hidden;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.product-card img {
  width: 100%;
  height: 220px;
  object-fit: contain;
  padding: 1rem;
  background: #fff;
}

.product-card .card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 1rem;
}

.product-card .card-body h5 {
  font-size: 0.95rem;
  font-weight: 600;
  color: #1e293b;
  margin-bottom: 1rem;
}

.product-card .btn-amazon {
  display: block;
  text-align: center;
  background: linear-gradient(to bottom, #f7c948, #f0a500);
  border: 1px solid #c98a00;
  color: #111;
  font-weight: 600;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  text-decoration: none;
  transition: background 0.2s;
}

.product-card .btn-amazon:hover {
  background: linear-gradient(to bottom, #f0a500, #d89500);
  color: #000;
}

/* ==================== MOBILE OVERFLOW FIXES ==================== */
/* Prevent horizontal overflow on mobile */
body {
  overflow-x: hidden;
}

/* Break long URLs on mobile */
.article-content a {
  word-break: break-word;
  overflow-wrap: break-word;
}

/* Handle code blocks on mobile */
.article-content pre,
.article-content code {
  max-width: 100%;
  overflow-x: auto;
  word-break: break-word;
  white-space: pre-wrap;
}

/* Ensure images don't overflow */
.article-content img {
  max-width: 100%;
  height: auto;
}

/* ==================== TABLES ==================== */
.article-content .table-wrapper {
  overflow-x: auto;
  margin: 1.5rem 0;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.article-content table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
  min-width: 500px;
}

.article-content table thead th {
  background: linear-gradient(135deg, #0d9488, #0f766e);
  color: #fff;
  font-weight: 600;
  text-align: left;
  padding: 0.75rem 1rem;
  white-space: nowrap;
  border: none;
}

.article-content table thead th:first-child {
  border-radius: 8px 0 0 0;
}

.article-content table thead th:last-child {
  border-radius: 0 8px 0 0;
}

.article-content table tbody td {
  padding: 0.65rem 1rem;
  border-bottom: 1px solid #e5e7eb;
  vertical-align: top;
}

.article-content table tbody tr:nth-child(even) {
  background: #f8fafb;
}

.article-content table tbody tr:hover {
  background: #ecfdf5;
}

.article-content table tbody tr:last-child td:first-child {
  border-radius: 0 0 0 8px;
}

.article-content table tbody tr:last-child td:last-child {
  border-radius: 0 0 8px 0;
}

@media (max-width: 768px) {
  .article-content table {
    font-size: 0.85rem;
  }
  .article-content table thead th,
  .article-content table tbody td {
    padding: 0.5rem 0.65rem;
  }
}

/* ==================== FAQ / PAA SECTION ==================== */
.paa-item {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  margin-bottom: 0.75rem;
  overflow: hidden;
  transition: box-shadow 0.2s ease;
}

.paa-item:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.paa-question {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  background: #f8fafb;
  cursor: pointer;
  font-weight: 600;
  color: #1e293b;
  user-select: none;
  gap: 0.75rem;
}

.paa-question:hover {
  background: #ecfdf5;
}

.paa-question .paa-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  transition: transform 0.25s ease;
  color: #0d9488;
}

.paa-item.active .paa-question .paa-icon {
  transform: rotate(180deg);
}

.paa-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.paa-item.active .paa-answer {
  max-height: 1000px;
}

.paa-answer-inner {
  padding: 1rem 1.25rem;
  color: #475569;
  line-height: 1.7;
  border-top: 1px solid #e5e7eb;
}

/* ==================== REFERENCES SECTION ==================== */
.references-list {
  counter-reset: ref-counter;
  list-style: none;
  padding: 0;
  margin: 1rem 0;
}

.references-list li {
  counter-increment: ref-counter;
  position: relative;
  padding: 0.65rem 0.75rem 0.65rem 2.5rem;
  margin-bottom: 0.5rem;
  font-size: 0.88rem;
  line-height: 1.6;
  color: #475569;
  background: #f8fafb;
  border-radius: 6px;
  border-left: 3px solid #0d9488;
}

.references-list li::before {
  content: counter(ref-counter);
  position: absolute;
  left: 0.65rem;
  top: 0.65rem;
  font-weight: 700;
  font-size: 0.8rem;
  color: #0d9488;
}

.references-list li a {
  color: #0d9488;
  text-decoration: none;
  font-weight: 600;
}

.references-list li a:hover {
  text-decoration: underline;
}
