/* ============================================
   JobGuard – Job Review & Scam Awareness Portal
   Premium • Mobile-First • Accessible
   ============================================ */

:root {
  --primary: #0d47a1;
  --primary-light: #1565c0;
  --primary-dark: #002171;
  --accent: #0288d1;
  --bg-light: #f5f7fa;
  --bg-card: rgba(255, 255, 255, 0.92);
  --bg-glass: rgba(255, 255, 255, 0.88);
  --text: #1e293b;
  --text-muted: #64748b;
  --border: rgba(13, 71, 161, 0.1);
  --shadow: 0 2px 12px rgba(13, 71, 161, 0.06);
  --shadow-md: 0 4px 20px rgba(13, 71, 161, 0.08);
  --shadow-lg: 0 12px 40px rgba(13, 71, 161, 0.12);
  --trust-high: #2e7d32;
  --trust-medium: #ed6c02;
  --trust-low: #c62828;
  --radius: 10px;
  --radius-lg: 14px;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --tap-min: 44px; /* min touch target */
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  font-size: 0.9375rem; /* 15px – readable on mobile */
  color: var(--text);
  background: var(--bg-light);
  line-height: 1.58;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Typography – fluid, never too big on mobile */
h1, .hero-title {
  font-size: clamp(1.35rem, 4vw + 0.5rem, 2.25rem);
  font-weight: 700;
  color: var(--primary-dark);
  line-height: 1.25;
  letter-spacing: -0.02em;
}
h2, .section-title {
  font-size: clamp(1.2rem, 2.5vw + 0.5rem, 1.5rem);
  font-weight: 700;
  color: var(--primary-dark);
  margin-bottom: 1rem;
  letter-spacing: -0.01em;
}
h3, h4, h5, h6 {
  font-size: clamp(1rem, 1.5vw + 0.5rem, 1.25rem);
  font-weight: 600;
  color: var(--primary-dark);
}
.card-title, .card .card-title {
  font-size: clamp(1rem, 1.2vw + 0.5rem, 1.125rem);
  font-weight: 600;
  margin-bottom: 0.35rem;
}
.card-text, .card-glass .card-text {
  font-size: 0.875rem;
  line-height: 1.55;
}
.hero-subtitle {
  font-size: clamp(0.9375rem, 1.5vw + 0.4rem, 1.0625rem);
  color: var(--text-muted);
  max-width: 560px;
  margin: 0 auto 1.25rem;
  line-height: 1.55;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.2s ease;
}
a:hover { color: var(--primary-light); }
a:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}
button:focus-visible,
.btn:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* Navbar – compact on mobile, premium on desktop */
.navbar-custom {
  background: var(--bg-glass) !important;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow);
  padding: 0.5rem 0;
}
.navbar-custom .navbar-brand {
  font-weight: 700;
  font-size: 1.125rem;
  color: var(--primary-dark) !important;
  display: inline-flex;
  align-items: center;
}
.navbar-custom .nav-link {
  color: var(--text) !important;
  font-weight: 500;
  font-size: 0.9375rem;
  padding: 0.5rem 0.75rem !important;
  border-radius: var(--radius);
  min-height: var(--tap-min);
  display: inline-flex;
  align-items: center;
}
.navbar-custom .nav-link:hover {
  background: rgba(13, 71, 161, 0.06);
  color: var(--primary) !important;
}
.navbar-custom .btn-primary {
  background: var(--primary);
  border: none;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.875rem;
  padding: 0.5rem 1rem;
  min-height: var(--tap-min);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, transform 0.15s;
}
.navbar-custom .btn-primary:hover {
  background: var(--primary-dark);
  color: #fff;
}
.navbar-custom .navbar-toggler {
  padding: 0.4rem 0.5rem;
  border-radius: var(--radius);
  border-color: var(--border);
}
.navbar-custom .navbar-collapse {
  margin-top: 0.5rem;
}
.navbar-custom .navbar-collapse .btn-primary {
  width: 100%;
  margin-top: 0.25rem;
}
@media (min-width: 992px) {
  .navbar-custom .navbar-collapse .btn-primary {
    width: auto;
    margin-top: 0;
  }
}

/* Main content – safe area below fixed nav */
main {
  padding-top: 4.5rem; /* space for fixed navbar */
  min-height: 50vh;
}

/* Hero – balanced on all screens */
.hero-section {
  min-height: min(72vh, 480px);
  background: linear-gradient(145deg, #e8f0fa 0%, #f8fafc 45%, #eef2f7 100%);
  position: relative;
  overflow: hidden;
  padding: 1.5rem 0 2rem;
}
.hero-section::before {
  content: '';
  position: absolute;
  top: -40%;
  right: -15%;
  width: 70%;
  height: 140%;
  background: radial-gradient(circle, rgba(13, 71, 161, 0.05) 0%, transparent 65%);
  pointer-events: none;
}
.hero-section .container {
  position: relative;
  z-index: 1;
}
.hero-section .py-5 {
  padding-top: 1.5rem !important;
  padding-bottom: 1.5rem !important;
}

/* Search bar – stacks on mobile, touch-friendly */
.search-box {
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 0.4rem;
  max-width: 560px;
  margin: 0 auto 1.5rem;
  width: 100%;
}
.search-box .form-control {
  border: none;
  background: transparent;
  font-size: 0.9375rem;
  padding: 0.65rem 0.85rem;
  min-height: var(--tap-min);
}
.search-box .form-control::placeholder {
  color: var(--text-muted);
  opacity: 0.9;
}
.search-box .form-control:focus {
  box-shadow: none;
  outline: none;
}
.search-box .btn-search {
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  padding: 0.65rem 1.25rem;
  font-weight: 600;
  font-size: 0.875rem;
  min-height: var(--tap-min);
  white-space: nowrap;
  transition: background 0.2s;
}
.search-box .btn-search:hover {
  background: var(--primary-dark);
  color: #fff;
}
@media (max-width: 480px) {
  .search-box {
    flex-wrap: wrap;
    gap: 0.4rem;
  }
  .search-box .form-control {
    flex: 1 1 auto;
    min-width: 0;
  }
  .search-box .btn-search {
    flex: 1 1 100%;
    margin-top: 0.15rem;
  }
}

/* Cards – readable, premium feel */
.card-glass {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.card-glass:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}
.card-glass .card-body {
  padding: 1rem 1.25rem;
}
@media (min-width: 768px) {
  .card-glass .card-body {
    padding: 1.25rem 1.5rem;
  }
}
.card-glass .card-text {
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* Buttons – touch-friendly */
.btn {
  min-height: var(--tap-min);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  transition: transform 0.15s, box-shadow 0.15s;
}
.btn:active {
  transform: scale(0.98);
}
.btn-sm {
  min-height: 36px;
  padding: 0.35rem 0.75rem;
  font-size: 0.8125rem;
}
.btn-outline-primary {
  border-width: 1.5px;
}

/* Trust score ring */
.trust-ring {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.125rem;
  background: var(--bg-card);
  border: 3px solid var(--trust-high);
  color: var(--trust-high);
  box-shadow: var(--shadow);
}
.trust-ring.medium { border-color: var(--trust-medium); color: var(--trust-medium); }
.trust-ring.low { border-color: var(--trust-low); color: var(--trust-low); }
@media (min-width: 768px) {
  .trust-ring {
    width: 80px;
    height: 80px;
    font-size: 1.25rem;
  }
}

/* Star ratings */
.stars {
  color: #f59e0b;
  letter-spacing: 1px;
  font-size: 0.9rem;
}
.stars .bi-star-fill,
.stars .bi-star-half { color: #f59e0b; }

/* Scam ticker – no overflow on mobile */
.scam-ticker-wrap {
  background: linear-gradient(90deg, #ffebee 0%, #fff3e0 100%);
  border: 1px solid rgba(198, 40, 40, 0.12);
  border-radius: var(--radius);
  overflow: hidden;
  padding: 0.5rem 0;
  margin: 0 -0.25rem; /* slight bleed for full-width feel */
}
.scam-ticker-wrap .small {
  font-size: 0.75rem;
  padding-left: 0.75rem;
  padding-right: 0.75rem;
}
.scam-ticker {
  display: flex;
  animation: ticker 45s linear infinite;
  white-space: nowrap;
}
.scam-ticker span {
  padding: 0 1.25rem;
  color: var(--text);
  font-weight: 500;
  font-size: 0.8125rem;
}
@media (min-width: 576px) {
  .scam-ticker span { font-size: 0.875rem; padding: 0 2rem; }
}
.scam-ticker .alert-badge {
  background: var(--trust-low);
  color: #fff;
  padding: 0.18rem 0.45rem;
  border-radius: 6px;
  font-size: 0.7rem;
  margin-right: 0.4rem;
  font-weight: 600;
}
@keyframes ticker {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* Callout boxes (blog) */
.callout-warning,
.callout-danger,
.callout-info {
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 0.875rem 1rem;
  margin: 1.25rem 0;
  font-size: 0.875rem;
  line-height: 1.5;
}
.callout-warning {
  background: linear-gradient(135deg, #fff8e1 0%, #ffecb3 100%);
  border-left: 4px solid #f59e0b;
  font-weight: 500;
  color: #92400e;
}
.callout-danger {
  background: linear-gradient(135deg, #ffebee 0%, #ffcdd2 100%);
  border-left: 4px solid #c62828;
  font-weight: 500;
  color: #b71c1c;
}
.callout-info {
  background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
  border-left: 4px solid var(--primary);
  color: var(--primary-dark);
}
@media (min-width: 768px) {
  .callout-warning, .callout-danger, .callout-info {
    padding: 1rem 1.25rem;
    margin: 1.5rem 0;
  }
}

/* Blog article – readable line length and spacing */
article .col-lg-8 {
  padding-left: 0.5rem;
  padding-right: 0.5rem;
}
article h1 {
  margin-bottom: 0.5rem;
}
article .text-muted.mb-4 {
  margin-bottom: 1rem !important;
}
article p, article li {
  font-size: 0.9375rem;
  line-height: 1.6;
}
@media (min-width: 768px) {
  article .col-lg-8 {
    padding-left: 1rem;
    padding-right: 1rem;
  }
  article p, article li {
    font-size: 1rem;
  }
}

/* Blog reading progress bar */
.read-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary) 0%, var(--accent) 100%);
  z-index: 1031;
  width: 0%;
  transition: width 0.1s ease;
}

/* Footer – compact on mobile */
.footer-custom {
  background: var(--primary-dark);
  color: rgba(255,255,255,0.88);
  padding: 2rem 0 1.25rem;
  font-size: 0.875rem;
}
.footer-custom h5 {
  font-size: 1rem;
  margin-bottom: 0.75rem;
}
.footer-custom h6 {
  font-size: 0.8125rem;
  margin-bottom: 0.5rem;
  color: rgba(255,255,255,0.95);
}
.footer-custom a {
  color: rgba(255,255,255,0.9);
  padding: 0.2rem 0;
  display: inline-block;
}
.footer-custom a:hover {
  color: #fff;
  text-decoration: underline;
}
.footer-custom .small {
  font-size: 0.8125rem;
  line-height: 1.5;
}
.footer-custom hr {
  border-color: rgba(255,255,255,0.2);
  margin: 1.5rem 0 1rem;
}
@media (min-width: 768px) {
  .footer-custom {
    padding: 2.5rem 0 1.5rem;
  }
}

/* Review listing – filters and spacing */
.filter-pills {
  gap: 0.5rem;
}
.filter-pills .btn {
  border-radius: 2rem;
  font-weight: 500;
  font-size: 0.8125rem;
  padding: 0.45rem 0.85rem;
  min-height: 36px;
}
.filter-pills .btn-outline-primary.active {
  background: var(--primary);
  color: #fff;
}

/* Report form */
.report-form .form-control,
.report-form .form-select {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  font-size: 0.9375rem;
  min-height: var(--tap-min);
}
.report-form .form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(13, 71, 161, 0.12);
}

/* Utility */
.section-title {
  font-size: clamp(1.2rem, 2.5vw + 0.5rem, 1.5rem);
  font-weight: 700;
  color: var(--primary-dark);
  margin-bottom: 1rem;
}
.bg-section {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}
@media (min-width: 768px) {
  .bg-section { padding: 2rem; }
}

/* Badges – consistent size */
.badge {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.3rem 0.55rem;
}

/* Page headings (reviews, blog, etc.) */
main h1 {
  margin-bottom: 0.35rem;
}
main .text-muted.mb-4 {
  font-size: 0.9375rem;
  margin-bottom: 1.25rem !important;
}

/* Container padding on mobile */
@media (max-width: 576px) {
  .container {
    padding-left: 1rem;
    padding-right: 1rem;
  }
}

/* Section CTAs – full width on mobile for easier tap */
@media (max-width: 576px) {
  .section .text-center .btn-primary,
  .section .text-center .btn-outline-primary {
    width: 100%;
    max-width: 280px;
  }
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
