/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Merriweather:wght@400;700&display=swap');

/* Bootstrap CSS variable overrides */
:root {
  --bs-body-bg: #F9FAFB;
  --bs-primary: #212529;
  --bs-primary-rgb: 33, 37, 41;
  --bs-link-color: #212529;
  --bs-link-hover-color: #000;
  --bs-border-radius: 12px;
}

/* ==========================================================================
   Global Link Styling
   ========================================================================== */

/* Base anchor styling - remove blue links */
a {
  color: inherit;
  text-decoration: none;
  transition: color 0.15s ease, text-decoration 0.15s ease;
}

a:hover {
  color: #000;
  text-decoration: underline;
}

/* Exclude Bootstrap buttons from link styling */
a.btn,
a.btn:hover {
  text-decoration: none;
  color: revert-layer;
}

/* Ensure button colors are not overridden by global anchor styles */
a.btn-dark,
a.btn-dark:hover {
  color: #fff;
}

a.btn-primary,
a.btn-primary:hover {
  color: #fff;
}

a.btn-outline-dark {
  color: #212529;
}

a.btn-outline-dark:hover {
  color: #fff;
}

a.btn-outline-primary {
  color: #212529;
}

a.btn-outline-primary:hover {
  color: #fff;
}

a.btn-outline-secondary {
  color: var(--bs-secondary);
}

a.btn-outline-secondary:hover {
  color: #fff;
}

/* ==========================================================================
   Button Overrides (Remove Bootstrap Blue)
   ========================================================================== */

.btn-primary {
  --bs-btn-bg: #212529;
  --bs-btn-border-color: #212529;
  --bs-btn-hover-bg: #000;
  --bs-btn-hover-border-color: #000;
  --bs-btn-active-bg: #000;
  --bs-btn-active-border-color: #000;
}

.btn-outline-primary {
  --bs-btn-color: #212529;
  --bs-btn-border-color: #212529;
  --bs-btn-hover-color: #fff;
  --bs-btn-hover-bg: #212529;
  --bs-btn-hover-border-color: #212529;
  --bs-btn-active-color: #fff;
  --bs-btn-active-bg: #212529;
  --bs-btn-active-border-color: #212529;
}

/* ==========================================================================
   Navbar Styling
   ========================================================================== */

/* Logo sizing - constrained on mobile for space */
.navbar-logo {
  height: 40px;
  width: auto;
}

@media (min-width: 992px) {
  .navbar-logo {
    height: 48px;
  }
}

/* Mobile Add Source button - icon only in a circle */
.btn-add-mobile {
  width: 38px;
  height: 38px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 1.1rem;
}

/* ==========================================================================
   Nav Tabs Overrides (Remove Bootstrap Blue)
   ========================================================================== */

.nav-tabs {
  --bs-nav-tabs-link-active-color: #212529;
  --bs-nav-tabs-link-active-border-color: #dee2e6 #dee2e6 #fff;
}

.nav-tabs .nav-link {
  color: #6c757d;
}

.nav-tabs .nav-link:hover {
  color: #212529;
}

.nav-tabs .nav-link.active {
  color: #212529;
  font-weight: 500;
}

/* ==========================================================================
   Pagination Styling (Rounded Pills)
   ========================================================================== */

.pagination {
  --bs-pagination-padding-x: 0.75rem;
  --bs-pagination-padding-y: 0.5rem;
  --bs-pagination-font-size: 0.875rem;
  --bs-pagination-color: #6c757d;
  --bs-pagination-bg: transparent;
  --bs-pagination-border-width: 0;
  --bs-pagination-border-color: transparent;
  --bs-pagination-border-radius: 50rem;
  --bs-pagination-hover-color: #000;
  --bs-pagination-hover-bg: #f8f9fa;
  --bs-pagination-hover-border-color: transparent;
  --bs-pagination-focus-color: #000;
  --bs-pagination-focus-bg: #f8f9fa;
  --bs-pagination-focus-box-shadow: none;
  --bs-pagination-active-color: #fff;
  --bs-pagination-active-bg: #000;
  --bs-pagination-active-border-color: #000;
  --bs-pagination-disabled-color: #adb5bd;
  --bs-pagination-disabled-bg: transparent;
  --bs-pagination-disabled-border-color: transparent;
  gap: 0.25rem;
}

.pagination .page-link {
  border-radius: 50rem !important;
  min-width: 2.25rem;
  text-align: center;
}

.pagination .page-item:first-child .page-link,
.pagination .page-item:last-child .page-link {
  border-radius: 50rem !important;
}

/* ==========================================================================
   Typography
   ========================================================================== */

html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem rgba(33, 37, 41, 0.25);
}

html {
  position: relative;
  min-height: 100%;
}

body {
  font-family: 'Inter', sans-serif;
  margin-bottom: 60px;
}

/* Serif typography */
h1, h2, h3, .font-serif {
  font-family: 'Merriweather', serif;
}

/* Utility class for balanced text wrapping */
.text-balance {
  text-wrap: balance;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
  text-align: start;
}

/* Paste zone for image uploads */
.border-dashed {
  border-style: dashed !important;
}

#paste-zone {
  cursor: pointer;
  transition: border-color 0.2s ease;
}

#paste-zone:hover {
  border-color: #6c757d !important;
}

/* Feed Card hover effect */
.feed-card,
.home-card {
  border: 1px solid transparent;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.feed-card:hover,
.home-card:hover {
  background-color: #f8f9fa !important;
  border-color: #e9ecef;
}

/* Expert Card - prominent info card style */
.expert-card {
  border: 1px solid #e9ecef;
  border-radius: 0.75rem;
  background-color: #fff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.expert-card:hover {
  border-color: #dee2e6;
  box-shadow: 0 0.25rem 0.75rem rgba(0, 0, 0, 0.05);
}

.expert-card .expert-card-header {
  border-bottom: 1px solid #f0f0f0;
  padding: 0.75rem 1rem;
  background-color: #fafbfc;
  border-radius: 0.75rem 0.75rem 0 0;
}

.expert-card .expert-card-body {
  padding: 1rem;
}

.expert-card .expert-name-link {
  color: inherit;
  text-decoration: none;
  transition: color 0.15s ease;
}

.expert-card .expert-name-link:hover {
  color: #0d6efd;
}

.expert-card .expert-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.5rem 0.75rem;
  background-color: #f8f9fa;
  border-radius: 0.5rem;
  min-width: 5rem;
}

.expert-card .expert-stat-value {
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.2;
}

.expert-card .expert-stat-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #6c757d;
}

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

/* Stat Link - Interactive stats in author card */
.stat-link {
  text-decoration: none;
  color: inherit;
  transition: background-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
  background-color: transparent;
}

.stat-link:hover {
  background-color: #f0f4f8;
  text-decoration: none;
  color: inherit;
  transform: translateY(-2px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.stat-link:hover .fs-4 {
  color: #0d6efd !important;
}

/* Author Card - Clickable elements hover effects */
.author-avatar-link {
  display: inline-block;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.author-avatar-link:hover {
  transform: scale(1.05);
}

.author-avatar-link:hover img,
.author-avatar-link:hover > div {
  box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.1);
}

.author-name-link {
  transition: color 0.15s ease;
}

.author-name-link:hover {
  color: #0d6efd !important;
  text-decoration: none;
}

.author-social-link {
  transition: color 0.15s ease, transform 0.15s ease;
  display: inline-block;
}

.author-social-link:hover {
  color: #000 !important;
  transform: scale(1.15);
}

/* Screenshot Thumbnail with fade overlay */
.screenshot-thumbnail-wrapper {
  position: relative;
  max-height: 200px;
  overflow: hidden;
  border-radius: 0.5rem;
  border: 1px solid #e9ecef;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.screenshot-thumbnail-wrapper:hover {
  border-color: #dee2e6;
  box-shadow: 0 0.25rem 0.75rem rgba(0, 0, 0, 0.08);
}

.screenshot-thumbnail-wrapper:focus {
  outline: 2px solid #0d6efd;
  outline-offset: 2px;
}

.screenshot-thumbnail {
  width: 100%;
  height: auto;
  display: block;
}

.screenshot-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 80px;
  background: linear-gradient(to bottom, rgba(255,255,255,0) 0%, rgba(255,255,255,0.9) 60%, rgba(255,255,255,1) 100%);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 12px;
  font-size: 0.85rem;
  color: #495057;
  font-weight: 500;
}

.screenshot-overlay i {
  margin-right: 6px;
}

/* Timeline */
.timeline {
  position: relative;
  padding-left: 24px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 7px;
  top: 4px;
  bottom: 4px;
  width: 2px;
  background-color: #e9ecef;
  border-radius: 1px;
}

.timeline-item {
  position: relative;
  padding-bottom: 16px;
}

.timeline-item:last-child {
  padding-bottom: 0;
}

.timeline-marker {
  position: absolute;
  left: -24px;
  top: 4px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background-color: #dee2e6;
  border: 3px solid #fff;
  box-shadow: 0 0 0 2px #e9ecef;
}

.timeline-marker.bg-success {
  background-color: #198754;
  box-shadow: 0 0 0 2px rgba(25, 135, 84, 0.2);
}

.timeline-marker.bg-warning {
  background-color: #ffc107;
  box-shadow: 0 0 0 2px rgba(255, 193, 7, 0.2);
}

.timeline-marker.bg-danger {
  background-color: #dc3545;
  box-shadow: 0 0 0 2px rgba(220, 53, 69, 0.2);
}

.timeline-content {
  padding-top: 0;
}

/* Subtle section links (View all, headers) - keep underline disabled */
a.text-decoration-none:hover {
  text-decoration: none;
}