/* Custom Styles for NaukariDisha Government Jobs Portal */
:root {
  --portal-primary: #0f2c59;
  --portal-primary-hover: #0a1f40;
  --portal-accent: #d97706;
  --portal-accent-hover: #b45309;
  --portal-success: #15803d;
  --portal-danger: #dc2626;
  --portal-info: #0284c7;
  --portal-bg-light: #f8fafc;
  --portal-card-border: #e2e8f0;
}

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background-color: var(--portal-bg-light);
  color: #1e293b;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header & Navbar */
.top-bar-notice {
  background: #1e293b;
  color: #f1f5f9;
  font-size: 0.85rem;
  padding: 6px 0;
}

.portal-navbar {
  background-color: var(--portal-primary);
  box-shadow: 0 4px 12px rgba(15, 44, 89, 0.15);
}

.portal-navbar .navbar-brand {
  font-size: 1.5rem;
  font-weight: 700;
  color: #ffffff !important;
  letter-spacing: -0.5px;
}

.portal-navbar .nav-link {
  color: #e2e8f0 !important;
  font-weight: 500;
  padding: 0.5rem 0.85rem;
  transition: all 0.2s ease;
}

.portal-navbar .nav-link:hover,
.portal-navbar .nav-link.active {
  color: #ffffff !important;
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

/* Hero & Announcement Banner */
.hero-search-section {
  background: linear-gradient(135deg, #0f2c59 0%, #1e40af 100%);
  color: white;
  padding: 2.5rem 0;
  border-bottom: 4px solid var(--portal-accent);
}

.ticker-wrap {
  background-color: #fef3c7;
  border-left: 4px solid var(--portal-accent);
  padding: 8px 16px;
  border-radius: 4px;
}

/* Home 3-Column Tables (Sarkari Style) */
.sarkari-column-card {
  border: 2px solid var(--portal-primary);
  border-radius: 6px;
  overflow: hidden;
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  height: 100%;
}

.sarkari-column-header {
  background: var(--portal-primary);
  color: #ffffff;
  padding: 10px 15px;
  font-weight: 700;
  font-size: 1.1rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.sarkari-list-group .list-group-item {
  border-left: none;
  border-right: none;
  padding: 10px 14px;
  font-size: 0.92rem;
  transition: background-color 0.15s;
}

.sarkari-list-group .list-group-item:hover {
  background-color: #f1f5f9;
}

.sarkari-list-group .list-group-item:last-child {
  border-bottom: none;
}

/* Job Cards & Badges */
.job-card {
  border: 1px solid var(--portal-card-border);
  border-radius: 8px;
  transition: transform 0.2s, box-shadow 0.2s;
  background: #ffffff;
}

.job-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
  border-color: #cbd5e1;
}

.badge-featured {
  background-color: #f59e0b;
  color: #ffffff;
}

.badge-closing {
  background-color: #ef4444;
  color: #ffffff;
  animation: pulse-red 2s infinite;
}

@keyframes pulse-red {
  0% { opacity: 1; }
  50% { opacity: 0.7; }
  100% { opacity: 1; }
}

/* Job Details Page Specifications Box */
.specs-table-box {
  background-color: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  overflow: hidden;
}

.specs-table-box th {
  background-color: #f1f5f9;
  color: #334155;
  width: 35%;
}

/* Category Icons */
.category-card {
  border: 1px solid var(--portal-card-border);
  border-radius: 8px;
  background: white;
  padding: 1rem;
  text-align: center;
  transition: all 0.2s ease;
  text-decoration: none;
  color: inherit;
  display: block;
}

.category-card:hover {
  border-color: var(--portal-primary);
  background-color: #f0fdf4;
  color: var(--portal-primary);
  transform: translateY(-3px);
}

.category-card i {
  font-size: 2.2rem;
  color: var(--portal-primary);
  margin-bottom: 0.5rem;
}

/* Admin Dashboard Styling */
.admin-sidebar {
  background-color: #0f172a;
  color: #94a3b8;
  min-height: calc(100vh - 60px);
}

.admin-sidebar .nav-link {
  color: #94a3b8;
  padding: 0.75rem 1.25rem;
  font-weight: 500;
  border-radius: 6px;
  margin-bottom: 4px;
}

.admin-sidebar .nav-link:hover,
.admin-sidebar .nav-link.active {
  color: #ffffff;
  background-color: #1e293b;
}

.stat-card {
  border-radius: 10px;
  padding: 1.25rem;
  color: white;
  box-shadow: 0 4px 10px rgba(0,0,0,0.06);
}

.stat-card-blue { background: linear-gradient(135deg, #2563eb, #1d4ed8); }
.stat-card-green { background: linear-gradient(135deg, #16a34a, #15803d); }
.stat-card-amber { background: linear-gradient(135deg, #d97706, #b45309); }
.stat-card-purple { background: linear-gradient(135deg, #9333ea, #7e22ce); }
.stat-card-red { background: linear-gradient(135deg, #dc2626, #b91c1c); }

/* Footer */
footer {
  margin-top: auto;
  background-color: #0f172a;
  color: #94a3b8;
}

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

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

/* ==========================================================================
   DYNAMIC JOB POST & RICH-TEXT PORTAL ENHANCEMENTS
   ========================================================================== */

.section-card {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.section-card:hover {
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06) !important;
}

.rich-content-body {
  line-height: 1.7;
  color: #1e293b;
  font-size: 0.95rem;
}

.rich-content-body h1,
.rich-content-body h2,
.rich-content-body h3,
.rich-content-body h4,
.rich-content-body h5,
.rich-content-body h6 {
  font-weight: 700;
  color: #0f172a;
  margin-top: 1.25rem;
  margin-bottom: 0.75rem;
}

.rich-content-body p {
  margin-bottom: 1rem;
}

.rich-content-body ul,
.rich-content-body ol {
  padding-left: 1.5rem;
  margin-bottom: 1rem;
}

.rich-content-body li {
  margin-bottom: 0.35rem;
}

/* Modern Clean Sarkari Tables */
.rich-content-body table {
  width: 100% !important;
  max-width: 100%;
  border-collapse: collapse;
  margin-top: 0.75rem;
  margin-bottom: 1.25rem;
  font-size: 0.92rem;
  background-color: #ffffff;
  border-radius: 6px;
  overflow: hidden;
}

.rich-content-body th,
.rich-content-body td {
  border: 1px solid #e2e8f0;
  padding: 10px 14px;
  vertical-align: middle;
}

.rich-content-body th {
  background-color: #f1f5f9;
  color: #0f172a;
  font-weight: 600;
  text-align: left;
}

.rich-content-body tr:nth-child(even) td {
  background-color: #f8fafc;
}

.rich-content-body tr:hover td {
  background-color: #f1f5f9;
}

/* ==========================================================================
   MOBILE JOB DETAILS CONTINUOUS EXPERIENCE (< 768px)
   ========================================================================== */
@media (max-width: 767.98px) {
  /* Prevent horizontal page blowouts */
  html, body {
    overflow-x: hidden;
  }

  /* Safe bottom offset for the fixed bottom CTA bar */
  .has-mobile-bottom-cta {
    padding-bottom: calc(75px + env(safe-area-inset-bottom, 0px)) !important;
  }

  /* Mobile Job Hero */
  .mobile-job-hero {
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid var(--portal-card-border);
    padding: 1.25rem 1rem;
    margin-bottom: 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  }

  .mobile-job-hero .job-title {
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.35;
    color: #0f172a;
    margin-bottom: 0.75rem;
  }

  .mobile-job-hero .job-org {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--portal-primary);
  }

  .mobile-meta-badge-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 0.6rem;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px dashed #e2e8f0;
    font-size: 0.82rem;
  }

  .mobile-meta-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    background-color: #f1f5f9;
    color: #475569;
    padding: 0.25rem 0.55rem;
    border-radius: 6px;
    font-weight: 500;
  }

  .mobile-meta-chip.chip-danger {
    background-color: #fef2f2;
    color: #dc2626;
    font-weight: 600;
  }

  .mobile-meta-chip.chip-success {
    background-color: #f0fdf4;
    color: #16a34a;
    font-weight: 600;
  }

  /* Mobile Primary Actions Group */
  .mobile-primary-actions {
    margin-bottom: 1rem;
  }

  .mobile-btn-apply-main {
    font-size: 1.05rem;
    font-weight: 700;
    padding: 0.85rem 1rem;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(15, 44, 89, 0.18);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
  }

  .mobile-secondary-actions-row {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 0.5rem;
    margin-top: 0.5rem;
  }

  /* Mobile Job Overview Card */
  .mobile-job-overview-card {
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid var(--portal-card-border);
    overflow: hidden;
    margin-bottom: 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  }

  .mobile-overview-header {
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    padding: 0.65rem 1rem;
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #475569;
    display: flex;
    align-items: center;
    gap: 0.4rem;
  }

  .mobile-overview-table {
    margin-bottom: 0;
    font-size: 0.88rem;
  }

  .mobile-overview-table th {
    width: 40%;
    color: #64748b;
    font-weight: 500;
    padding: 0.55rem 0.85rem;
    background-color: #fcfdfe;
    border-color: #f1f5f9;
    vertical-align: middle;
  }

  .mobile-overview-table td {
    color: #0f172a;
    font-weight: 600;
    padding: 0.55rem 0.85rem;
    border-color: #f1f5f9;
    vertical-align: middle;
  }

  /* Mobile Sticky Quick Jump Navigation */
  .mobile-quick-nav-container {
    position: sticky;
    top: 56px;
    z-index: 1020;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-bottom: 1px solid #e2e8f0;
    padding: 0.5rem 0;
    margin-left: -0.75rem;
    margin-right: -0.75rem;
    margin-bottom: 1.25rem;
  }

  .mobile-quick-nav {
    display: flex;
    overflow-x: auto;
    white-space: nowrap;
    gap: 0.4rem;
    padding: 0 0.75rem;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .mobile-quick-nav::-webkit-scrollbar {
    display: none;
  }

  .mobile-nav-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.35rem 0.75rem;
    font-size: 0.78rem;
    font-weight: 600;
    color: #334155;
    background-color: #f1f5f9;
    border-radius: 20px;
    text-decoration: none;
    transition: all 0.15s ease;
    border: 1px solid #e2e8f0;
    flex-shrink: 0;
  }

  .mobile-nav-pill:hover,
  .mobile-nav-pill:active,
  .mobile-nav-pill.active {
    background-color: var(--portal-primary);
    color: #ffffff;
    border-color: var(--portal-primary);
  }

  /* Continuous Mobile Content Sections */
  .mobile-section-block {
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid var(--portal-card-border);
    padding: 1.1rem 1rem;
    margin-bottom: 1rem;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
    scroll-margin-top: 110px;
  }

  .mobile-section-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e2e8f0;
  }

  .mobile-section-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
  }

  .mobile-section-header i {
    font-size: 1.15rem;
  }

  /* Table styling within mobile sections */
  .mobile-section-block .table-responsive {
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
  }

  .mobile-section-block table {
    margin-bottom: 0;
    font-size: 0.85rem;
    min-width: 100%;
  }

  .mobile-section-block th,
  .mobile-section-block td {
    padding: 8px 10px;
  }

  /* Mobile Important Links Cards */
  .mobile-link-card-group {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
  }

  .mobile-link-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 1rem;
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    text-decoration: none;
    color: #0f172a;
    font-weight: 600;
    font-size: 0.92rem;
    transition: all 0.2s ease;
  }

  .mobile-link-card:active,
  .mobile-link-card:hover {
    background-color: #f1f5f9;
    border-color: #cbd5e1;
    color: #0f2c59;
    transform: translateX(2px);
  }

  .mobile-link-card.card-apply {
    background-color: #eff6ff;
    border-color: #bfdbfe;
    color: #1d4ed8;
  }

  .mobile-link-card.card-pdf {
    background-color: #fef2f2;
    border-color: #fecaca;
    color: #b91c1c;
  }

  .mobile-link-card.card-result {
    background-color: #fffbeb;
    border-color: #fde68a;
    color: #b45309;
  }

  .mobile-link-card.card-admit {
    background-color: #f0fdf4;
    border-color: #bbf7d0;
    color: #15803d;
  }

  .mobile-link-icon-wrap {
    display: flex;
    align-items: center;
    gap: 0.65rem;
  }

  /* Sticky Mobile Bottom CTA Bar */
  .mobile-sticky-cta {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1030;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-top: 1px solid rgba(226, 232, 240, 0.9);
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.08);
    padding: 0.6rem 0.85rem;
    padding-bottom: max(0.6rem, env(safe-area-inset-bottom, 0px));
    display: flex;
    align-items: center;
    gap: 0.5rem;
  }

  .mobile-sticky-cta .btn-sticky-save {
    flex: 0 0 auto;
    padding: 0.65rem 0.85rem;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 8px;
  }

  .mobile-sticky-cta .btn-sticky-pdf {
    flex: 0 0 auto;
    padding: 0.65rem 0.85rem;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 8px;
  }

  .mobile-sticky-cta .btn-sticky-apply {
    flex: 1 1 auto;
    padding: 0.65rem 1rem;
    font-size: 0.95rem;
    font-weight: 700;
    border-radius: 8px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* Mobile Social Share Bar */
  .mobile-share-bar {
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid var(--portal-card-border);
    padding: 0.85rem 1rem;
    margin-bottom: 1rem;
  }

  .mobile-share-btn-group {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 0.4rem;
    margin-top: 0.5rem;
  }

  .mobile-share-btn {
    font-size: 0.78rem;
    font-weight: 600;
    padding: 0.45rem 0.5rem;
    border-radius: 6px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    text-decoration: none;
  }

  /* FAQ accordion on mobile */
  .mobile-faq-accordion .accordion-button {
    font-size: 0.92rem;
    font-weight: 600;
    padding: 0.85rem 1rem;
  }

  .mobile-faq-accordion .accordion-body {
    font-size: 0.88rem;
    line-height: 1.6;
    padding: 0.85rem 1rem;
  }
}

/* Print Styles */
@media print {
  header, footer, .btn, .admin-sidebar, .breadcrumb, #btnBookmark, .mobile-sticky-cta, .mobile-quick-nav-container, .mobile-share-bar {
    display: none !important;
  }
  .container {
    max-width: 100% !important;
    padding: 0 !important;
  }
  .card {
    border: 1px solid #ccc !important;
    box-shadow: none !important;
  }
}

/* ==========================================================================
   ADMIN CMS NAVIGATION & DASHBOARD STYLING
   ========================================================================== */
.admin-cms-navbar {
  border-bottom: 1px solid #e2e8f0;
  z-index: 1020;
}

.admin-cms-navbar .dropdown-menu {
  min-width: 250px;
  border-radius: 10px;
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.admin-sidebar-offcanvas {
  width: 320px !important;
}

.admin-sidebar-offcanvas .offcanvas-body {
  overflow-y: auto;
}

.admin-sidebar-group .list-group-item {
  border-color: #f1f5f9;
  font-size: 0.92rem;
  transition: all 0.15s ease-in-out;
}

.admin-sidebar-group .list-group-item:hover {
  background-color: #f8fafc;
  color: #0f2c59;
}

.admin-sidebar-group .list-group-item.active {
  background-color: #0d6efd;
  color: #ffffff !important;
  border-color: #0d6efd;
}

.admin-sidebar-group .list-group-item.active i {
  color: #ffffff !important;
}

.hover-elevate {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.hover-elevate:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08) !important;
}

.text-purple {
  color: #7c3aed !important;
}

.bg-purple {
  background-color: #7c3aed !important;
}