/* ============================================
   GearInspector.com - Main Stylesheet
   Built on Bootstrap 5.3+
   Version: 1.0
   ============================================ */

/* ---------- CSS Variables (Light & Dark Mode) ---------- */
:root {
  --gi-primary: #0d6efd;
  --gi-primary-dark: #0a58ca;
  --gi-accent: #ff6b35;
  --gi-success: #198754;
  --gi-danger: #dc3545;
  --gi-warning: #ffc107;
  --gi-dark: #212529;
  --gi-light: #f8f9fa;
  --gi-border: #dee2e6;
  --gi-text: #212529;
  --gi-text-secondary: #6c757d;
  --gi-bg: #ffffff;
  --gi-card-bg: #ffffff;
  --gi-card-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  --gi-rating-star: #ffc107;
  --gi-transition: all 0.3s ease;
  --gi-radius: 0.5rem;
  --gi-font: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

/* Dark Mode Overrides */
[data-bs-theme="dark"] {
  --gi-primary: #3d8bfd;
  --gi-primary-dark: #6ea8fe;
  --gi-accent: #ff8c5a;
  --gi-dark: #f8f9fa;
  --gi-light: #2b3035;
  --gi-border: #495057;
  --gi-text: #e9ecef;
  --gi-text-secondary: #adb5bd;
  --gi-bg: #1a1d20;
  --gi-card-bg: #212529;
  --gi-card-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* ---------- Global Reset & Base ---------- */
* {
  box-sizing: border-box;
}

body {
  font-family: var(--gi-font);
  background-color: var(--gi-bg);
  color: var(--gi-text);
  transition: background-color 0.3s ease, color 0.3s ease;
  line-height: 1.7;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

main {
  flex: 1;
}

a {
  color: var(--gi-primary);
  text-decoration: none;
  transition: var(--gi-transition);
}

a:hover {
  color: var(--gi-primary-dark);
  text-decoration: underline;
}

/* ---------- Typography ---------- */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  margin-bottom: 1rem;
  line-height: 1.3;
}

h1 {
  font-size: 2.25rem;
}

h2 {
  font-size: 1.75rem;
  border-bottom: 2px solid var(--gi-border);
  padding-bottom: 0.5rem;
  margin-bottom: 1.5rem;
}

h3 {
  font-size: 1.35rem;
}

/* ---------- Header & Navigation ---------- */
.navbar {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--gi-border);
  transition: var(--gi-transition);
}

.navbar-brand {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--gi-primary) !important;
}

.navbar .nav-link {
  font-weight: 500;
  color: var(--gi-text) !important;
  padding: 0.5rem 1rem;
  border-radius: var(--gi-radius);
  transition: var(--gi-transition);
}

.navbar .nav-link:hover {
  background-color: rgba(13, 110, 253, 0.08);
  color: var(--gi-primary) !important;
}

/* Mega Menu */
.mega-menu {
  min-width: 480px;
  border: none;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
  border-radius: var(--gi-radius);
  margin-top: 0.5rem;
}

.mega-menu .dropdown-item {
  padding: 0.5rem 1rem;
  border-radius: 0.25rem;
  font-weight: 500;
}

.mega-menu .dropdown-item:hover {
  background-color: rgba(13, 110, 253, 0.05);
  color: var(--gi-primary);
}

/* Sticky Header */
.sticky-top {
  z-index: 1030;
  transition: box-shadow 0.3s ease;
}

.sticky-top.scrolled {
  box-shadow: 0 2px 15px rgba(0, 0, 0, 0.1);
}

/* ---------- Buttons ---------- */
.btn {
  font-weight: 600;
  border-radius: var(--gi-radius);
  padding: 0.5rem 1.25rem;
  transition: var(--gi-transition);
}

.btn-primary {
  background-color: var(--gi-primary);
  border-color: var(--gi-primary);
}

.btn-primary:hover {
  background-color: var(--gi-primary-dark);
  border-color: var(--gi-primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(13, 110, 253, 0.3);
}

.btn-success {
  background-color: var(--gi-success);
  border-color: var(--gi-success);
}

.btn-accent {
  background-color: var(--gi-accent);
  border-color: var(--gi-accent);
  color: #fff;
}

.btn-outline-primary:hover {
  transform: translateY(-1px);
}

.btn-lg {
  padding: 0.75rem 2rem;
  font-size: 1.1rem;
}

/* ---------- Cards ---------- */
.card {
  border: 1px solid var(--gi-border);
  border-radius: var(--gi-radius);
  box-shadow: var(--gi-card-shadow);
  transition: var(--gi-transition);
  background-color: var(--gi-card-bg);
  overflow: hidden;
}

.card:hover {
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
  transform: translateY(-3px);
}

.card-img-top {
  height: 200px;
  object-fit: contain;
  padding: 1rem;
  background-color: #f8f9fa;
}

[data-bs-theme="dark"] .card-img-top {
  background-color: #2b3035;
}

.card-body {
  padding: 1.25rem;
}

.card-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.card-footer {
  border-top: 1px solid var(--gi-border);
  padding: 1rem 1.25rem;
}

/* Product Card (Special) */
.product-card {
  height: 100%;
}

.product-card .card-img-top {
  height: 180px;
}

.product-card .rating {
  font-size: 0.95rem;
}

.product-card .pros-cons {
  font-size: 0.85rem;
  line-height: 1.5;
}

.product-card .btn {
  font-size: 0.9rem;
}

/* ---------- Hero Section ---------- */
.hero {
  background: linear-gradient(135deg, #0d6efd, #6610f2);
  color: #fff;
  border-radius: var(--gi-radius);
  overflow: hidden;
  position: relative;
}

.hero h1 {
  font-size: 2.5rem;
  font-weight: 800;
}

.hero .lead {
  font-size: 1.2rem;
  opacity: 0.9;
}

/* ---------- Star Ratings ---------- */
.star-rating {
  display: inline-flex;
  gap: 2px;
  color: var(--gi-rating-star);
}

.star-rating i {
  font-size: 1rem;
}

.star-rating.large i {
  font-size: 1.5rem;
}

/* Rating Box (Review Page) */
.review-rating-box {
  background: var(--gi-card-bg);
  border: 2px solid var(--gi-primary);
  border-radius: var(--gi-radius);
}

.review-rating-box h2 {
  border-bottom: none;
  margin-bottom: 0.5rem;
}

/* ---------- Table of Contents (TOC) ---------- */
.toc {
  background: var(--gi-light);
  border: 1px solid var(--gi-border);
  border-radius: var(--gi-radius);
  padding: 1.25rem 1.5rem;
  margin-bottom: 2rem;
  position: sticky;
  top: 90px;
  z-index: 10;
}

.toc h4 {
  margin-bottom: 1rem;
  font-size: 1.1rem;
}

.toc ul {
  list-style: none;
  padding-left: 0;
  margin-bottom: 0;
}

.toc ul li {
  padding: 0.25rem 0;
}

.toc ul li a {
  color: var(--gi-text);
  font-weight: 500;
  font-size: 0.95rem;
}

.toc ul li a:hover {
  color: var(--gi-primary);
  padding-left: 5px;
}

/* ---------- Breadcrumb ---------- */
.breadcrumb {
  background: transparent;
  padding: 0.75rem 0;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.breadcrumb-item a {
  color: var(--gi-text-secondary);
}

.breadcrumb-item.active {
  color: var(--gi-text);
  font-weight: 600;
}

/* ---------- Comparison Table ---------- */
.comparison-table {
  width: 100%;
  border-collapse: collapse;
}

.comparison-table th,
.comparison-table td {
  padding: 0.75rem;
  border: 1px solid var(--gi-border);
  text-align: left;
}

.comparison-table th {
  background-color: var(--gi-light);
  font-weight: 700;
}

.comparison-table .winner-row {
  background-color: rgba(25, 135, 84, 0.1);
}

/* ---------- Accordion (FAQ) ---------- */
.accordion-button:not(.collapsed) {
  background-color: rgba(13, 110, 253, 0.05);
  color: var(--gi-primary);
  font-weight: 600;
}

.accordion-button:focus {
  box-shadow: none;
  border-color: var(--gi-primary);
}

/* ---------- Newsletter Form ---------- */
.newsletter-form .input-group {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  border-radius: var(--gi-radius);
  overflow: hidden;
}

.newsletter-form input {
  border: 1px solid var(--gi-border);
  padding: 0.75rem 1rem;
}

.newsletter-form button {
  font-weight: 600;
}

/* ---------- Sidebar ---------- */
.sidebar {
  position: sticky;
  top: 90px;
}

.sidebar .card {
  margin-bottom: 1.5rem;
}

.sidebar .list-group-item {
  border: none;
  padding: 0.5rem 1rem;
  color: var(--gi-text);
}

.sidebar .list-group-item:hover {
  background-color: rgba(13, 110, 253, 0.05);
  color: var(--gi-primary);
}

/* ---------- Reading Progress Bar ---------- */
.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 4px;
  background: linear-gradient(90deg, #0d6efd, #6610f2);
  z-index: 9999;
  transition: width 0.1s linear;
}

/* ---------- Author Box ---------- */
.author-box {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem;
  background: var(--gi-light);
  border-radius: var(--gi-radius);
  margin: 2rem 0;
}

.author-box img {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  object-fit: cover;
}

.author-box h5 {
  margin-bottom: 0.25rem;
}

/* ---------- Back to Top Button ---------- */
.back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 44px;
  height: 44px;
  background-color: var(--gi-primary);
  color: #fff;
  border: none;
  border-radius: 50%;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: var(--gi-transition);
  z-index: 999;
  box-shadow: 0 4px 12px rgba(13, 110, 253, 0.4);
}

.back-to-top.show {
  opacity: 1;
  visibility: visible;
}

.back-to-top:hover {
  background-color: var(--gi-primary-dark);
  transform: translateY(-3px);
}

/* ---------- Footer ---------- */
footer {
  background-color: var(--gi-dark) !important;
  color: #adb5bd !important;
  margin-top: auto;
}

footer h5, footer h6 {
  color: #f8f9fa;
  font-weight: 700;
  margin-bottom: 1rem;
}

footer a {
  color: #adb5bd;
  font-size: 0.9rem;
  transition: var(--gi-transition);
}

footer a:hover {
  color: #f8f9fa;
  text-decoration: none;
}

footer hr {
  border-color: #495057;
  opacity: 0.5;
}

/* ---------- Search Page ---------- */
.search-filter-card {
  background: var(--gi-light);
  border-radius: var(--gi-radius);
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.search-filter-card label {
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.25rem;
}

/* ---------- Calculator / Tools Pages ---------- */
.calculator-card {
  background: var(--gi-card-bg);
  border: 1px solid var(--gi-border);
  border-radius: var(--gi-radius);
  padding: 2rem;
  box-shadow: var(--gi-card-shadow);
}

.calculator-card .result-box {
  background: var(--gi-light);
  border-radius: var(--gi-radius);
  padding: 1rem 1.5rem;
  margin-top: 1.5rem;
}

/* ---------- Social Share Buttons ---------- */
.share-buttons {
  display: flex;
  gap: 0.5rem;
  margin: 1.5rem 0;
}

.share-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  color: #fff;
  font-size: 1rem;
  transition: var(--gi-transition);
}

.share-btn:hover {
  transform: translateY(-2px);
  opacity: 0.9;
  color: #fff;
}

.share-btn.facebook { background: #1877f2; }
.share-btn.twitter { background: #000; }
.share-btn.pinterest { background: #e60023; }
.share-btn.email { background: #6c757d; }

/* ---------- Skeleton Loading (Optional) ---------- */
.skeleton {
  background: linear-gradient(90deg, var(--gi-light) 25%, var(--gi-border) 50%, var(--gi-light) 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
  border-radius: 0.25rem;
}

@keyframes loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ---------- Print Styles ---------- */
@media print {
  header, footer, .sidebar, .share-buttons, .newsletter-form {
    display: none !important;
  }
  body {
    font-size: 12pt;
    color: #000;
    background: #fff;
  }
  a {
    color: #000;
  }
}

/* ---------- Responsive Adjustments ---------- */
@media (max-width: 992px) {
  .hero h1 {
    font-size: 1.8rem;
  }
  .hero .lead {
    font-size: 1rem;
  }
  .mega-menu {
    min-width: 100%;
  }
  .sidebar {
    position: static;
    margin-top: 2rem;
  }
}

@media (max-width: 768px) {
  h1 { font-size: 1.75rem; }
  h2 { font-size: 1.4rem; }
  .card-img-top { height: 160px; }
  .review-rating-box .row > div {
    margin-bottom: 1rem;
  }
  .toc {
    position: static;
  }
  .author-box {
    flex-direction: column;
    text-align: center;
  }
}

@media (max-width: 576px) {
  .container {
    padding-left: 1rem;
    padding-right: 1rem;
  }
  .navbar-brand {
    font-size: 1.25rem;
  }
  .btn-lg {
    width: 100%;
  }
  .hero {
    padding: 2rem 1rem !important;
  }
}