/* ============================================================
   JOBWALA24.XYZ - Clean Professional Stylesheet
   Works WITH Bootstrap 5, never against it.
   NO global element overrides (h1-h6, p, a, ul, button, etc.)
   ============================================================ */

/* --- Variables --- */
:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-light: #3b82f6;
  --primary-bg: #dbeafe;
  --primary-rgb: 37, 99, 235;
  --accent: #047857;
  --dark: #1e293b;
  --text: #334155;
  --text-light: #64748b;
  --text-dark: #0f172a;
  --border: #e2e8f0;
  --bg-light: #f8fafc;
  --bg-gray: #f1f5f9;
  --radius: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-full: 50px;
  --shadow: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -1px rgba(0,0,0,0.04);
  --shadow-lg: 0 10px 25px -3px rgba(0,0,0,0.08), 0 4px 6px -2px rgba(0,0,0,0.04);
  --shadow-xl: 0 20px 50px -12px rgba(0,0,0,0.15);
  --transition: all 0.3s ease;
}

/* --- Base (minimal, Bootstrap-friendly) --- */
html { scroll-padding-top: 80px; scroll-behavior: smooth; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  color: #1e293b;
  line-height: 1.6;
  -webkit-tap-highlight-color: rgba(37, 99, 235, 0.15);
}
img { max-width: 100%; height: auto; }

/* Ensure ALL text on light backgrounds is dark and readable */
h1, h2, h3, h4, h5, h6 { color: #1e293b; }
p, li, td, th, label, span, small, div { color: inherit; }
a { color: #2563eb; }
a:hover { color: #1d4ed8; }

/* White text on dark/colored backgrounds - override the dark defaults above */
.bg-primary, .bg-primary *:not(.form-control):not(.form-select):not(.btn-light):not(.badge) { color: #fff; }
.bg-dark, .bg-dark * { color: #cbd5e1; }
.bg-dark h1, .bg-dark h2, .bg-dark h3, .bg-dark h4, .bg-dark h5, .bg-dark h6 { color: #fff; }
.bg-dark a:not(.btn) { color: #94a3b8; }
.bg-dark a:not(.btn):hover { color: #fff; }
.text-white, .text-white * { color: #fff !important; }
.text-white-50 { color: rgba(255,255,255,.5) !important; }
.text-muted { color: #6c757d !important; }
.text-dark { color: #1e293b !important; }
.text-primary { color: #2563eb !important; }
.text-success { color: #047857 !important; }
.text-danger { color: #dc3545 !important; }
.text-warning { color: #ffc107 !important; }

/* Badges should keep their own color */
.badge { color: inherit; }
.badge.bg-primary { color: #fff !important; }
.badge.bg-success { color: #fff !important; }
.badge.bg-danger { color: #fff !important; }
.badge.bg-info { color: #000 !important; }
.badge.bg-warning { color: #000 !important; }
.badge.bg-secondary { color: #fff !important; }
.badge.text-dark { color: #1e293b !important; }
.badge.text-primary { color: #2563eb !important; }

/* Form elements always dark text on white bg */
.form-control, .form-select, input, textarea, select {
  color: #1e293b !important;
  background-color: #fff;
}
.form-label { color: #334155; }
.form-check-label { color: #334155; }

::selection {
  background-color: rgba(37, 99, 235, 0.15);
  color: var(--primary-dark);
}

/* --- Sticky Header --- */
.site-header {
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: box-shadow 0.3s;
  z-index: 1050;
}
.site-header.scrolled {
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

/* --- Hero Section --- */
.hero-section {
  background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 50%, #3b82f6 100%);
  position: relative;
  overflow: hidden;
}
.hero-section::before {
  content: '';
  position: absolute;
  top: -50%; right: -10%;
  width: 500px; height: 500px;
  background: rgba(255,255,255,0.05);
  border-radius: 50%;
  pointer-events: none;
}
.hero-section .form-control,
.hero-section .form-select {
  color: #1e293b !important;
  background: #fff;
}
.hero-section .btn-light {
  color: var(--primary) !important;
}

/* --- CTA Section --- */
.cta-section {
  background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 50%, #3b82f6 100%);
  position: relative;
  overflow: hidden;
}
.cta-section .form-control {
  color: #1e293b !important;
}
.cta-section .btn-light {
  color: var(--primary) !important;
}

/* --- Job Cards --- */
.job-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  height: 100%;
}
.job-card:hover {
  border-color: rgba(37,99,235,0.3);
  box-shadow: var(--shadow-lg);
  transform: translateY(-3px);
}
.job-card { transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease; }

/* --- Blog Cards --- */
.blog-card {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  overflow: hidden;
}
.blog-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-3px);
}
.blog-card img {
  transition: transform 0.5s ease;
}
.blog-card:hover img {
  transform: scale(1.05);
}

/* --- Category Cards --- */
.category-card {
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}
.category-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
  border-color: var(--primary) !important;
}

/* --- Job Type Badges --- */
.badge-full-time { background: #dbeafe; color: #1d4ed8; }
.badge-part-time { background: #fef3c7; color: #b45309; }
.badge-contract { background: #fce7f3; color: #be185d; }
.badge-internship { background: #d1fae5; color: #065f46; }
.badge-remote { background: #ede9fe; color: #6d28d9; }

/* --- Apply Button --- */
.btn-apply {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 0.75rem 2rem;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 1rem;
  transition: var(--transition);
}
.btn-apply:hover {
  background: #065f46;
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(4,120,87,0.3);
}

/* --- Skill Tags --- */
.skill-tag {
  display: inline-block;
  background: var(--primary-bg);
  color: var(--primary);
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 500;
  margin: 0.25rem;
}

/* --- Job Info Grid --- */
.job-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
}
.job-info-item {
  background: var(--bg-light);
  padding: 1rem;
  border-radius: var(--radius);
  text-align: center;
}
.job-info-item .label {
  font-size: 0.8rem;
  color: var(--text-light);
  display: block;
  margin-bottom: 0.25rem;
}
.job-info-item .value {
  font-weight: 600;
  color: var(--text-dark);
  font-size: 0.92rem;
}

/* --- Rich Content (Blog posts, Job descriptions, Legal pages) --- */
.article-content, .blog-content, .content-body,
.job-detail-body, .job-description {
  font-size: 1.05rem;
  line-height: 1.85;
  color: #334155;
}
.article-content h2, .blog-content h2, .content-body h2,
.job-description h2 { margin-top: 2rem; margin-bottom: 0.75rem; color: #1e293b; }
.article-content h3, .blog-content h3, .content-body h3,
.job-description h3 { margin-top: 1.5rem; margin-bottom: 0.6rem; color: #1e293b; }
.article-content p, .blog-content p, .content-body p,
.job-description p { margin-bottom: 1.25rem; color: #334155; }
.article-content ul, .article-content ol,
.blog-content ul, .blog-content ol,
.content-body ul, .content-body ol,
.job-detail-body ul, .job-detail-body ol,
.job-description ul, .job-description ol {
  padding-left: 1.5rem;
  margin-bottom: 1.25rem;
}
.article-content ul, .blog-content ul, .content-body ul,
.job-detail-body ul, .job-description ul { list-style: disc; }
.article-content ol, .blog-content ol, .content-body ol,
.job-detail-body ol, .job-description ol { list-style: decimal; }
.article-content li, .blog-content li, .content-body li,
.job-detail-body li, .job-description li {
  margin-bottom: 0.5rem;
  line-height: 1.7;
  color: #334155;
}
.article-content blockquote, .blog-content blockquote {
  border-left: 4px solid var(--primary);
  background: var(--bg-light);
  padding: 1.25rem 1.5rem;
  margin: 1.5rem 0;
  border-radius: 0 var(--radius) var(--radius) 0;
  font-style: italic;
  color: var(--text-light);
}
.article-content code, .blog-content code {
  background: var(--bg-gray);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-size: 0.9em;
}
.article-content pre, .blog-content pre {
  background: var(--dark);
  color: #e2e8f0;
  padding: 1.25rem;
  border-radius: var(--radius-lg);
  overflow-x: auto;
}

/* --- Author Box --- */
.author-box {
  background: var(--bg-light);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
}

/* --- Comments --- */
.comment-item {
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--border);
}
.comment-item:last-child { border-bottom: none; }
.comment-form {
  background: var(--bg-light);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
}

/* --- Filter Sidebar --- */
.filter-sidebar {
  position: sticky;
  top: 80px;
}

/* --- Company Grid --- */
.company-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 1rem;
}

/* --- Share Buttons --- */
.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 500;
  color: #fff !important;
  transition: var(--transition);
  border: none;
  cursor: pointer;
}
.share-btn:hover { opacity: 0.9; transform: translateY(-2px); color: #fff !important; }
.share-btn.whatsapp { background: #25D366; }
.share-btn.twitter { background: #1DA1F2; }
.share-btn.facebook { background: #1877F2; }
.share-btn.linkedin { background: #0A66C2; }
.share-btn.copy-link { background: #64748b; }

/* --- Step Numbers (How It Works) --- */
.step-number {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  font-weight: 800;
}

/* --- Pagination Enhancement --- */
.pagination .page-item.active .page-link {
  background-color: var(--primary);
  border-color: var(--primary);
}

/* --- Back to Top --- */
.back-to-top {
  position: fixed;
  bottom: 2rem; right: 2rem;
  width: 48px; height: 48px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  border: none;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  cursor: pointer;
  box-shadow: var(--shadow-lg);
  transition: var(--transition);
  z-index: 99;
}
.back-to-top.visible { display: flex; }
.back-to-top:hover { background: var(--primary-dark); transform: translateY(-3px); }

/* --- Cookie Consent --- */
.cookie-consent {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--dark);
  color: #fff;
  padding: 1rem 2rem;
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  z-index: 9999;
  font-size: 0.9rem;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.2);
}
.cookie-consent.show { display: flex; }
.cookie-consent .btn-accept {
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 0.5rem 1.5rem;
  border-radius: var(--radius);
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

/* --- Toast Notification --- */
.toast-notification {
  position: fixed;
  top: 20px; right: 20px;
  padding: 0.85rem 1.5rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 500;
  z-index: 10000;
  box-shadow: var(--shadow-xl);
  max-width: 380px;
}

/* --- Animations --- */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* --- Search Autocomplete --- */
.search-autocomplete {
  position: absolute;
  top: 100%; left: 0; right: 0;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  z-index: 100;
  display: none;
  max-height: 300px;
  overflow-y: auto;
}
.search-autocomplete.show { display: block; }
.search-autocomplete-item {
  padding: 0.7rem 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.search-autocomplete-item:hover { background: var(--bg-gray); }

/* --- Loading Spinner --- */
.loading-spinner {
  display: inline-block;
  width: 24px; height: 24px;
  border: 3px solid #e2e8f0;
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* --- Ad Container --- */
.ad-container {
  background: transparent;
  border: none;
  border-radius: var(--radius);
  padding: 0;
  text-align: center;
  margin: 1.5rem 0;
  min-height: 100px;
  display: block;
  color: var(--text-light);
  font-size: 0.85rem;
}
/* Empty ad containers (AdSense disabled) collapse */
.ad-container:empty { display: none; }
/* Mobile: hide low-priority sidebar/below-fold ads for density compliance */
@media (max-width: 767.98px) {
  .ad-low-priority { display: none !important; }
}

/* --- Hero/CTA explicit white text --- */
.hero-section, .hero-section h1, .hero-section h2, .hero-section h3,
.hero-section h4, .hero-section h5, .hero-section h6,
.hero-section p, .hero-section span, .hero-section label { color: #fff; }
.hero-section .opacity-75 { color: rgba(255,255,255,0.85); opacity: 1 !important; }

.cta-section, .cta-section h1, .cta-section h2, .cta-section h3,
.cta-section h4, .cta-section h5, .cta-section h6,
.cta-section p, .cta-section span { color: #fff; }
.cta-section .opacity-75 { color: rgba(255,255,255,0.85); opacity: 1 !important; }

/* --- Page header (blue bar) --- */
.page-header.bg-primary h1,
.page-header.bg-primary h2,
.page-header.bg-primary p,
.page-header.bg-primary span { color: #fff; }

/* --- Footer explicit colors (WCAG AA: 4.5:1 contrast on #1e293b) --- */
.site-footer { color: #a0aec0; }
.site-footer h4, .site-footer h5, .site-footer h6 { color: #fff; }
.site-footer p, .site-footer li, .site-footer span, .site-footer small { color: #a0aec0; }
.site-footer a { color: #a0aec0; }
.site-footer a:hover { color: #fff !important; }
.footer-link { color: #cbd5e1 !important; }
.footer-link:hover { color: #fff !important; }
.footer-text { color: #cbd5e1 !important; }

/* --- Cards text visibility --- */
.card-title, .card-title a { color: #1e293b; }
.card-title a:hover { color: #2563eb; }
.card-text { color: #64748b; }
.card-footer { color: #64748b; }

/* --- Admin panel text --- */
.admin-content { color: #1e293b; }
.admin-content h1, .admin-content h2, .admin-content h3,
.admin-content h4, .admin-content h5, .admin-content h6 { color: #1e293b; }
.admin-sidebar { color: #94a3b8; }
.admin-sidebar a { color: #94a3b8; }
.admin-sidebar a:hover, .admin-sidebar a.active { color: #fff; }

/* --- Table text --- */
.table th { color: #64748b; }
.table td { color: #1e293b; }
.table a { color: #2563eb; }

/* --- Skip to Content (accessibility) --- */
.skip-to-content {
  position: absolute;
  top: -100px;
  left: 0;
  background: var(--primary);
  color: #fff;
  padding: 0.75rem 1.5rem;
  z-index: 10000;
  font-weight: 600;
  text-decoration: none;
  transition: top 0.2s;
}
.skip-to-content:focus {
  top: 0;
  color: #fff;
}

/* --- Focus Visible (accessibility) --- */
:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 2px;
}
.job-card:focus-within,
.category-card:focus-within,
.blog-card:focus-within {
  outline: 3px solid var(--primary);
  outline-offset: 2px;
}

/* --- Reduced Motion (accessibility) --- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .fade-in { opacity: 1; transform: none; }
}

/* --- Responsive --- */
@media (max-width: 767.98px) {
  .hero-section { padding: 2.5rem 0 !important; }
  .filter-sidebar { position: static; }
  .cookie-consent { flex-direction: column; text-align: center; }
  .job-info-grid { grid-template-columns: repeat(2, 1fr); }

  /* Mobile touch targets (min 48px) */
  .nav-link, .btn-sm, .share-btn, .badge,
  .list-inline-item a, .breadcrumb-item a {
    min-height: 48px;
    display: inline-flex;
    align-items: center;
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
  }
  .site-footer a {
    display: inline-block;
    min-height: 48px;
    line-height: 48px;
  }
  .cookie-consent .btn-accept,
  .cookie-consent .btn-decline {
    min-height: 48px;
    min-width: 80px;
  }
  .page-link {
    min-width: 48px;
    min-height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  button, [role="button"], input, select, textarea {
    min-height: 48px;
  }
}

@media (max-width: 575.98px) {
  .job-info-grid { grid-template-columns: 1fr 1fr; }
  .company-grid { grid-template-columns: repeat(2, 1fr); }
}

/* --- Tablet breakpoint --- */
@media (min-width: 768px) and (max-width: 1023.98px) {
  .job-info-grid { grid-template-columns: repeat(3, 1fr); }
}

/* --- Large desktop: prevent ultra-wide text lines --- */
@media (min-width: 1440px) {
  .article-content, .blog-content, .content-body,
  .job-detail-body, .job-description {
    max-width: 65ch;
  }
}

/* --- Newsletter Popup --- */
.newsletter-popup {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 10001;
  align-items: center;
  justify-content: center;
}
.newsletter-popup.show {
  display: flex;
}
.newsletter-popup-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.5);
}
.newsletter-popup-content {
  position: relative;
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 2rem;
  max-width: 420px;
  width: 90%;
  box-shadow: var(--shadow-xl);
  animation: popupSlideIn 0.3s ease;
}
@keyframes popupSlideIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
.newsletter-popup-close {
  position: absolute;
  top: 0.5rem;
  right: 0.75rem;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-light);
  cursor: pointer;
  line-height: 1;
  padding: 0.5rem;
  min-width: 48px;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.newsletter-popup-close:hover { color: var(--text-dark); }

/* --- Print --- */
@media print {
  .site-header, .site-footer, .back-to-top, .cookie-consent,
  .toast-notification, .ad-container, .share-buttons { display: none !important; }
}
