html {
  scroll-behavior: smooth;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: #121417;
  color: #e6edf3;
  line-height: 1.6;
  padding: 20px;
  max-width: 800px;
  margin: 0 auto;
}

header {
  text-align: center;
  padding: 30px 0;
  border-bottom: 1px solid #30363d;
  margin-bottom: 30px;
}

/* Unified Blue Headings */
h1, h2, h3,
header h1,
.card-header h2,
.card-header h3,
.section-title,
.category-title {
  color: #58a6ff;
}

header p {
  color: #8b949e;
  font-size: 1.05rem;
}

.review-card {
  background-color: #1c2128;
  border: 1px solid #30363d;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 24px;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.card-header h2 {
  font-size: 1.4rem;
  color: #ffffff;
}

.badge {
  padding: 4px 10px;
  border-radius: 20px;
  font-weight: bold;
  font-size: 0.85rem;
}

.badge.bad {
  background-color: #da3633;
  color: #ffffff;
}

.badge.moderate {
  background-color: #d29922;
  color: #ffffff;
}

/* Green score bubble */
.badge.good {
  background-color: #238636;
  color: #ffffff;
}

/* Green status text */
.recommended {
  color: #3fb950;
  font-weight: bold;
}

.meta {
  font-size: 0.85rem;
  color: #8b949e;
  margin-bottom: 14px;
}

.uninstalled {
  color: #f85149;
  font-weight: bold;
}

.monitored {
  color: #e3b341;
  font-weight: bold;
}

.breakdown {
  display: flex;
  flex-direction: column;
  background-color: #22272e;
  border-radius: 6px;
  padding: 12px 16px;
  margin-bottom: 14px;
  font-size: 0.95rem;
  gap: 8px;
}

.breakdown .metric {
  margin-bottom: 6px;
}

.breakdown .metric:last-child {
  margin-bottom: 0;
}

.review-body {
  color: #adbac7;
}

footer {
  text-align: center;
  padding: 30px 0;
  color: #8b949e;
  font-size: 0.85rem;
  border-top: 1px solid #30363d;
}

/* Navigation Tabs */
.category-nav {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.nav-btn {
  text-decoration: none;
  color: #c9d1d9;
  background-color: #21262d;
  border: 1px solid #30363d;
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 500;
  transition: background-color 0.2s, border-color 0.2s;
}

.nav-btn:hover {
  background-color: #30363d;
  border-color: #58a6ff;
  color: #ffffff;
}

.nav-btn.alert {
  border-color: #da3633;
  color: #f85149;
}

.nav-btn.alert:hover {
  background-color: #da3633;
  color: #ffffff;
}

/* Section Dividers & Read More Links */
.section-title {
  color: #58a6ff;
  font-size: 1.3rem;
  margin: 28px 0 14px;
  border-bottom: 1px solid #21262d;
  padding-bottom: 6px;
}

.summary-snippet {
  color: #adbac7;
  font-size: 0.95rem;
  margin-bottom: 12px;
}

.read-more {
  display: inline-block;
  color: #58a6ff;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: bold;
}

.read-more:hover {
  text-decoration: underline;
}

/* Back button link */
.back-link {
  color: #58a6ff;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
}

.back-link:hover {
  text-decoration: underline;
}

/* Compact homepage review cards */
.review-card.compact {
  padding: 16px;
  margin-bottom: 16px;
}

.last-updated {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 0.8rem;
  color: #8b949e;
  margin-top: 8px;
  letter-spacing: 0.3px;
}

/* 1. Category Dividers & Spacing */
.section-title,
.category-title {
  color: #58a6ff;
  font-size: 1.3rem;
  margin: 36px 0 16px;
  border-bottom: 1px solid #30363d;
  padding-bottom: 8px;
}

/* 2. Card App Names (White without inflating font size) */
.card-header h2,
.card-header h3 {
  color: #ffffff;
  font-size: 1.25rem;
  margin: 0;
}

/* 3. Ensure inner card links inherit the blue */
.card-header a {
  color: #58a6ff;
  text-decoration: none;
}

/* News & Update Wire */
.news-wire {
  background-color: #161b22;
  border: 1px solid #30363d;
  border-left: 4px solid #58a6ff;
  border-radius: 6px;
  padding: 14px 18px;
  margin: 20px auto 28px;
  text-align: left;
}

.news-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.news-tag {
  font-size: 0.75rem;
  font-weight: bold;
  letter-spacing: 0.5px;
  background-color: #1f6feb;
  color: #ffffff;
  padding: 2px 8px;
  border-radius: 4px;
  text-transform: uppercase;
}

.news-date {
  font-size: 0.8rem;
  color: #8b949e;
  font-family: ui-monospace, monospace;
}

.news-list {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 0.9rem;
  color: #c9d1d9;
  line-height: 1.5;
}

.news-list li {
  margin-bottom: 6px;
  position: relative;
  padding-left: 14px;
}

.news-list li:last-child {
  margin-bottom: 0;
}

.news-list li::before {
  content: "•";
  color: #58a6ff;
  position: absolute;
  left: 0;
}

footer .disclaimer {
  font-size: 0.8rem;
  color: #8b949e;
  max-width: 700px;
  margin: 12px auto 0;
  line-height: 1.4;
  text-align: center;
}

/* ===================================================
   ACCESSIBILITY & RESPONSIVE TOUCH TARGET UPGRADE
   =================================================== */

/* 1. Fluid Typography for Main Headers */
header h1 {
  font-size: 2.2rem;
  line-height: 1.25;
  overflow-wrap: break-word;
}

@media (max-width: 600px) {
  header h1 {
    font-size: 1.5rem;
  }
}

/* 2. Responsive Card Headers (Prevents text squish on zoom) */
.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap; /* Drops badge underneath if title or text size expands */
  gap: 8px 12px;
}

.card-header h2,
.card-header h3 {
  flex: 1 1 auto;
  min-width: 180px;
}

/* Keep score badges pill-shaped and intact */
.badge {
  white-space: nowrap;
  flex-shrink: 0;
}

/* 3. Transform "Back to Index" into a Dedicated Nav Button */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background-color: #21262d;
  color: #c9d1d9;
  border: 1px solid #30363d;
  border-radius: 6px;
  padding: 8px 14px;
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  min-height: 44px; /* Meets mobile touch target requirements */
  transition: background-color 0.2s, border-color 0.2s, color 0.2s;
  margin-bottom: 12px;
}

.back-link:hover,
.back-link:active {
  background-color: #30363d;
  border-color: #58a6ff;
  color: #58a6ff;
}

/* Read More & Action Navigation Buttons */
.read-more {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  
  /* Right-align on wide containers */
  margin-left: auto;
  
  /* Retain signature terminal blue text */
  color: #58a6ff;
  background-color: #21262d;
  border: 1px solid #30363d;
  border-radius: 6px;
  
  padding: 8px 14px;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  min-height: 44px; /* Accessible touch target */
  transition: background-color 0.2s, border-color 0.2s, color 0.2s;
}

/* Hover and active states */
.read-more:hover,
.read-more:active {
  background-color: #30363d;
  border-color: #58a6ff;
  color: #ffffff;
}

/* Container helper to ensure right alignment across browsers */
.review-card > div:last-child {
  display: flex;
  justify-content: flex-end;
}

.read-more:hover,
.read-more:active {
  background-color: #30363d;
  border-color: #58a6ff;
  color: #ffffff;
}

/* =========================================
   Back to Index Button Transformation
   ========================================= */
.back-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: #21262d;
  color: #58a6ff;
  border: 1px solid #30363d;
  border-radius: 6px;
  padding: 8px 16px;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  min-height: 44px; /* Accessible 44px mobile touch target */
  margin-bottom: 12px;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.back-link:hover,
.back-link:active {
  background-color: #30363d;
  border-color: #58a6ff;
  color: #ffffff;
}