/* =====================================================
   JobsLMS - Main Stylesheet
   ===================================================== */

:root {
  --primary: #1a1a2e;
  --primary-mid: #16213e;
  --accent: #e94560;
  --accent2: #0f3460;
  --gold: #f5a623;
  --text: #2d2d2d;
  --text-muted: #6c757d;
  --bg: #f8f9ff;
  --white: #ffffff;
  --card-shadow: 0 4px 24px rgba(26,26,46,0.08);
  --radius: 14px;
  --radius-sm: 8px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Plus Jakarta Sans', sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
}

/* ---- Navbar ---- */
.jlms-navbar {
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent2) 100%);
  padding: 12px 0;
  box-shadow: 0 2px 20px rgba(0,0,0,0.2);
}
.brand-logo { font-family: 'Fraunces', serif; font-size: 1.6rem; font-weight: 700; color: #fff !important; letter-spacing: -0.5px; }
.brand-accent { color: var(--accent); }
.navbar-nav .nav-link { font-weight: 500; font-size: 0.9rem; letter-spacing: 0.3px; padding: 6px 14px !important; border-radius: 6px; transition: var(--transition); }
.navbar-nav .nav-link:hover, .navbar-nav .nav-link.active { background: rgba(255,255,255,0.12); color: #fff !important; }
.btn-accent { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.btn-accent:hover { background: #c73652; border-color: #c73652; color: #fff; }

/* ---- Hero Section ---- */
.hero-section {
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent2) 60%, #1a3a6e 100%);
  padding: 90px 0 70px;
  position: relative;
  overflow: hidden;
}
.hero-section::before {
  content: '';
  position: absolute; top: -50%; left: -50%;
  width: 200%; height: 200%;
  background: radial-gradient(ellipse at center, rgba(233,69,96,0.08) 0%, transparent 60%);
  animation: heroGlow 8s ease-in-out infinite alternate;
}
@keyframes heroGlow { 0% { transform: translate(0,0); } 100% { transform: translate(50px, 30px); } }
.hero-section .hero-title { font-family: 'Fraunces', serif; font-size: clamp(2rem, 5vw, 3.5rem); font-weight: 700; color: #fff; line-height: 1.15; }
.hero-section .hero-subtitle { color: rgba(255,255,255,0.8); font-size: 1.1rem; font-weight: 400; }
.hero-badge { display: inline-block; background: rgba(233,69,96,0.15); border: 1px solid rgba(233,69,96,0.4); color: #ff8fa3; padding: 5px 14px; border-radius: 20px; font-size: 0.8rem; font-weight: 600; letter-spacing: 1px; text-transform: uppercase; margin-bottom: 16px; }
.hero-stats { display: flex; gap: 30px; flex-wrap: wrap; margin-top: 30px; }
.hero-stat { text-align: center; }
.hero-stat .stat-num { font-size: 1.8rem; font-weight: 800; color: var(--gold); font-family: 'Fraunces', serif; }
.hero-stat .stat-label { font-size: 0.75rem; color: rgba(255,255,255,0.6); text-transform: uppercase; letter-spacing: 0.5px; }

/* ---- Cards ---- */
.jlms-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  border: 1px solid rgba(26,26,46,0.06);
  transition: var(--transition);
  overflow: hidden;
}
.jlms-card:hover { transform: translateY(-4px); box-shadow: 0 12px 40px rgba(26,26,46,0.14); }

/* ---- Tool Cards ---- */
.tool-card {
  display: block;
  text-decoration: none;
  color: inherit;
  background: var(--white);
  border-radius: var(--radius);
  padding: 28px 24px;
  box-shadow: var(--card-shadow);
  border: 1px solid rgba(26,26,46,0.06);
  transition: var(--transition);
  height: 100%;
}
.tool-card:hover { transform: translateY(-5px); box-shadow: 0 16px 48px rgba(26,26,46,0.15); color: inherit; border-color: var(--accent); }
.tool-card .tool-icon { width: 56px; height: 56px; border-radius: 14px; display: flex; align-items: center; justify-content: center; font-size: 1.5rem; margin-bottom: 16px; }
.tool-card .tool-title { font-weight: 700; font-size: 1rem; margin-bottom: 8px; }
.tool-card .tool-desc { color: var(--text-muted); font-size: 0.85rem; line-height: 1.5; }
.tool-card .tool-badge { display: inline-block; padding: 2px 10px; border-radius: 20px; font-size: 0.7rem; font-weight: 600; margin-top: 12px; }

/* ---- Section Titles ---- */
.section-title { font-family: 'Fraunces', serif; font-size: clamp(1.6rem, 3vw, 2.2rem); font-weight: 700; color: var(--primary); line-height: 1.2; }
.section-subtitle { color: var(--text-muted); font-size: 1rem; }
.section-badge { display: inline-block; background: rgba(233,69,96,0.1); color: var(--accent); padding: 4px 14px; border-radius: 20px; font-size: 0.75rem; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; margin-bottom: 12px; }

/* ---- Blog Cards ---- */
.blog-card { background: var(--white); border-radius: var(--radius); overflow: hidden; box-shadow: var(--card-shadow); transition: var(--transition); border: 1px solid rgba(26,26,46,0.06); height: 100%; }
.blog-card:hover { transform: translateY(-4px); box-shadow: 0 12px 40px rgba(26,26,46,0.14); }
.blog-card img { width: 100%; height: 200px; object-fit: cover; }
.blog-card .blog-body { padding: 20px; }
.blog-card .blog-cat { display: inline-block; padding: 3px 10px; border-radius: 4px; font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 10px; }
.blog-card .blog-title { font-weight: 700; font-size: 1rem; color: var(--text); text-decoration: none; line-height: 1.4; }
.blog-card .blog-title:hover { color: var(--accent); }
.blog-meta { font-size: 0.78rem; color: var(--text-muted); margin-top: 12px; }

/* ---- Forms ---- */
.form-control, .form-select { border-radius: var(--radius-sm); border: 1.5px solid #e2e8f0; padding: 10px 16px; font-size: 0.9rem; transition: var(--transition); }
.form-control:focus, .form-select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(233,69,96,0.1); }
.btn-primary { background: var(--primary); border-color: var(--primary); font-weight: 600; border-radius: var(--radius-sm); padding: 10px 24px; transition: var(--transition); }
.btn-primary:hover { background: var(--accent2); border-color: var(--accent2); }
.btn-danger { background: var(--accent); border-color: var(--accent); font-weight: 600; }

/* ---- Newsletter ---- */
.newsletter-section { background: linear-gradient(135deg, #f0f4ff, #fff0f3); border-top: 1px solid #e8eaf6; }

/* ---- Footer ---- */
.site-footer { background: var(--primary); color: rgba(255,255,255,0.75); }
.site-footer h5, .site-footer h6 { color: #fff; }
.footer-links li { margin-bottom: 6px; }
.footer-links a { color: rgba(255,255,255,0.6); text-decoration: none; font-size: 0.87rem; transition: var(--transition); }
.footer-links a:hover { color: var(--accent); }
.social-links { display: flex; gap: 10px; }
.social-link { width: 36px; height: 36px; background: rgba(255,255,255,0.1); border-radius: 50%; display: flex; align-items: center; justify-content: center; color: rgba(255,255,255,0.7); text-decoration: none; transition: var(--transition); font-size: 0.85rem; }
.social-link:hover { background: var(--accent); color: #fff; }
.footer-policy-links a { text-decoration: none; }
.footer-policy-links a:hover { color: var(--accent) !important; }

/* ---- Admin ---- */
.admin-sidebar { width: 260px; background: var(--primary); min-height: 100vh; position: fixed; top: 0; left: 0; z-index: 1000; transition: var(--transition); }
.admin-content { margin-left: 260px; padding: 24px; min-height: 100vh; background: #f1f5f9; }
.admin-nav-link { display: flex; align-items: center; gap: 12px; padding: 12px 20px; color: rgba(255,255,255,0.65); text-decoration: none; font-size: 0.9rem; font-weight: 500; border-left: 3px solid transparent; transition: var(--transition); }
.admin-nav-link:hover, .admin-nav-link.active { color: #fff; background: rgba(255,255,255,0.08); border-left-color: var(--accent); }
.admin-nav-link i { width: 20px; text-align: center; }
.stat-card { background: var(--white); border-radius: var(--radius); padding: 24px; box-shadow: var(--card-shadow); border-left: 4px solid var(--accent); }
.stat-card .stat-icon { width: 50px; height: 50px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 1.4rem; }

/* ---- CV Builder ---- */
.cv-builder-wrap { display: grid; grid-template-columns: 380px 1fr; gap: 24px; min-height: 80vh; }
.cv-form-panel { background: var(--white); border-radius: var(--radius); padding: 24px; box-shadow: var(--card-shadow); overflow-y: auto; max-height: calc(100vh - 100px); position: sticky; top: 80px; }
.cv-preview-panel { background: var(--white); border-radius: var(--radius); padding: 24px; box-shadow: var(--card-shadow); }
.cv-steps .step-btn { background: none; border: none; padding: 8px 16px; border-radius: 20px; font-size: 0.8rem; font-weight: 600; cursor: pointer; color: var(--text-muted); transition: var(--transition); }
.cv-steps .step-btn.active { background: var(--accent); color: #fff; }
.cv-template-thumb { width: 100%; border: 2px solid transparent; border-radius: 8px; cursor: pointer; transition: var(--transition); overflow: hidden; }
.cv-template-thumb.selected { border-color: var(--accent); }

/* ---- Responsive ---- */
@media (max-width: 768px) {
  .cv-builder-wrap { grid-template-columns: 1fr; }
  .cv-form-panel { position: static; max-height: none; }
  .admin-sidebar { transform: translateX(-100%); }
  .admin-content { margin-left: 0; }
  .admin-sidebar.open { transform: translateX(0); }
  .hero-stats { gap: 20px; }
}

/* ---- Utilities ---- */
.bg-primary-gradient { background: linear-gradient(135deg, var(--primary), var(--accent2)); }
.text-accent { color: var(--accent) !important; }
.rounded-xl { border-radius: var(--radius) !important; }
.shadow-card { box-shadow: var(--card-shadow) !important; }
.animate-fade-up { animation: fadeUp 0.6s ease both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

/* ---- CV Templates ---- */
#cv-output { font-family: 'Plus Jakarta Sans', sans-serif; font-size: 11pt; color: #222; background: #fff; padding: 30px; min-height: 297mm; }
.cv-modern-header { background: var(--primary); color: #fff; padding: 30px; margin: -30px -30px 24px; }
.cv-modern-header h1 { font-family: 'Fraunces', serif; font-size: 1.8rem; font-weight: 700; margin: 0; }
.cv-modern-header .cv-jobtitle { color: var(--gold); font-size: 1rem; margin-top: 4px; }
.cv-section-title { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 2px; color: var(--accent); font-weight: 700; margin: 20px 0 8px; border-bottom: 1.5px solid var(--accent); padding-bottom: 4px; }
.cv-entry-title { font-weight: 700; font-size: 0.95rem; }
.cv-entry-subtitle { color: #555; font-size: 0.85rem; }
.cv-entry-date { font-size: 0.8rem; color: #888; }
.cv-skill-bar { height: 6px; background: #eee; border-radius: 3px; margin-top: 4px; }
.cv-skill-fill { height: 100%; background: var(--accent); border-radius: 3px; }

/* ===== FOOTER FIX - Proper visibility on dark background ===== */
.site-footer { background: var(--primary); color: rgba(255,255,255,0.75); }
.site-footer h5,
.site-footer h6 { color: #fff !important; }
.site-footer p  { color: rgba(255,255,255,0.7) !important; }

.footer-links li  { margin-bottom: 7px; }
.footer-links a   { color: rgba(255,255,255,0.65) !important; text-decoration: none; font-size: 0.87rem; transition: var(--transition); }
.footer-links a:hover { color: #e94560 !important; }

.site-footer .text-muted { color: rgba(255,255,255,0.6) !important; }
.site-footer small,
.site-footer .small { color: rgba(255,255,255,0.55) !important; }

.footer-policy-links a         { color: rgba(255,255,255,0.45) !important; text-decoration: none; font-size: 0.8rem; }
.footer-policy-links a:hover   { color: #e94560 !important; }

.site-footer hr { border-color: rgba(255,255,255,0.12) !important; }

.social-link {
  width: 36px; height: 36px;
  background: rgba(255,255,255,0.1);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,0.7) !important;
  text-decoration: none;
  transition: var(--transition);
  font-size: 0.85rem;
}
.social-link:hover { background: var(--accent); color: #fff !important; }
/* ===== END FOOTER FIX ===== */


/* ============================================================
   ADMIN SIDEBAR — Mobile Responsive Fix
   ============================================================ */

/* Desktop: always visible */
@media (min-width: 992px) {
  .admin-sidebar {
    transform: translateX(0) !important;
    position: fixed;
    top: 0; left: 0;
    width: 240px;
    height: 100vh;
    z-index: 1000;
    overflow-y: auto;
  }
  .admin-content {
    margin-left: 240px;
  }
  #sidebarOverlay { display: none !important; }
  #adminSidebarToggle { display: none !important; }
  #sidebarCloseBtn { display: none !important; }
}

/* Mobile: hidden by default, slide in on open */
@media (max-width: 991px) {
  .admin-sidebar {
    position: fixed;
    top: 0; left: 0;
    width: 260px;
    height: 100vh;
    z-index: 9999;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
  }
  .admin-sidebar.sidebar-open {
    transform: translateX(0);
    box-shadow: 4px 0 30px rgba(0,0,0,0.35);
  }
  .admin-content {
    margin-left: 0 !important;
    padding: 16px;
  }
}

/* Dark overlay behind sidebar on mobile */
#sidebarOverlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 9998;
  transition: opacity 0.3s ease;
  opacity: 0;
}
#sidebarOverlay.overlay-show {
  display: block;
  opacity: 1;
}

/* Hamburger toggle button */
#adminSidebarToggle {
  position: fixed;
  top: 14px;
  left: 14px;
  z-index: 9997;
  width: 42px;
  height: 42px;
  background: #1a1a2e;
  border: none;
  border-radius: 10px;
  color: #fff;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 12px rgba(0,0,0,0.3);
  transition: 0.2s;
}
#adminSidebarToggle:hover { background: #e94560; }

/* Close X button inside sidebar */
#sidebarCloseBtn {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(255,255,255,0.1);
  border: none;
  color: rgba(255,255,255,0.7);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  transition: 0.2s;
}
#sidebarCloseBtn:hover { background: #e94560; color: #fff; }

/* Admin topbar spacing on mobile */
@media (max-width: 991px) {
  .admin-content > *:first-child {
    margin-top: 54px !important;
  }
  .admin-stat-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}
/* ============================================================ */

/* ============================================================
   NAVBAR DROPDOWN — Mobile Fix
   ============================================================ */

/* Make navbar NOT clip its children */
.jlms-navbar {
  overflow: visible !important;
}
.jlms-navbar .container {
  overflow: visible !important;
}

/* Dropdown menu base */
.navbar .dropdown-menu {
  border: none;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(26,26,46,0.18);
  padding: 8px 0;
  min-width: 220px;
  animation: dropFade 0.18s ease;
  z-index: 99999 !important;
}
@keyframes dropFade {
  from { opacity:0; transform:translateY(-6px); }
  to   { opacity:1; transform:translateY(0); }
}

.navbar .dropdown-item {
  font-size: 0.87rem;
  font-weight: 500;
  padding: 9px 18px;
  color: #333;
  border-radius: 0;
  transition: 0.15s;
  display: flex;
  align-items: center;
}
.navbar .dropdown-item:hover {
  background: #f0f4ff;
  color: #1a1a2e;
}
.navbar .dropdown-item.text-danger:hover {
  background: #fff5f5;
  color: #dc2626 !important;
}
.navbar .dropdown-divider {
  margin: 4px 0;
  border-color: #f1f5f9;
}

/* ---- MOBILE: Full-width dropdown, no clipping ---- */
@media (max-width: 991px) {

  /* Navbar collapses vertically — let it grow */
  .jlms-navbar .navbar-collapse {
    background: rgba(15,52,96,0.97);
    border-top: 1px solid rgba(255,255,255,0.1);
    padding: 10px 0 14px;
    margin-top: 4px;
    border-radius: 0 0 12px 12px;
    overflow: visible !important;
    /* no max-height restriction */
  }

  /* Nav links on mobile */
  .jlms-navbar .navbar-nav .nav-link {
    color: rgba(255,255,255,0.85) !important;
    padding: 10px 20px !important;
    border-radius: 0 !important;
    border-left: 3px solid transparent;
  }
  .jlms-navbar .navbar-nav .nav-link:hover,
  .jlms-navbar .navbar-nav .nav-link.active {
    background: rgba(255,255,255,0.08) !important;
    border-left-color: #e94560;
    color: #fff !important;
  }

  /* Tools dropdown on mobile — inline, not floating */
  .jlms-navbar .dropdown-menu {
    background: rgba(255,255,255,0.06);
    border-radius: 8px;
    box-shadow: none;
    border: 1px solid rgba(255,255,255,0.1);
    margin: 4px 16px 4px 16px;
    padding: 4px 0;
    animation: none;
    position: static !important;   /* crucial — not absolute */
    float: none;
    width: auto;
  }
  .jlms-navbar .dropdown-menu .dropdown-item {
    color: rgba(255,255,255,0.75);
    font-size: 0.83rem;
    padding: 8px 20px;
  }
  .jlms-navbar .dropdown-menu .dropdown-item:hover {
    background: rgba(255,255,255,0.1);
    color: #fff;
  }
  .jlms-navbar .dropdown-menu .dropdown-divider {
    border-color: rgba(255,255,255,0.1);
  }

  /* Auth buttons row on mobile */
  .jlms-navbar .d-flex.gap-2 {
    padding: 8px 16px 4px;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 8px !important;
  }
  .jlms-navbar .d-flex.gap-2 .btn {
    width: 100%;
    text-align: center;
  }

  /* USER DROPDOWN — the key fix */
  /* On mobile the user dropdown button */
  .jlms-navbar .dropdown {
    width: 100%;
  }
  .jlms-navbar .dropdown > button,
  .jlms-navbar .dropdown > .btn {
    width: 100%;
    justify-content: space-between;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    color: #fff;
    border-radius: 8px;
    padding: 10px 16px;
    font-size: 0.88rem;
  }

  /* User dropdown menu on mobile — full width, visible, not clipped */
  .jlms-navbar .dropdown .dropdown-menu {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 6px 24px rgba(0,0,0,0.15);
    border: 1px solid #e2e8f0;
    margin: 6px 0 0 0 !important;
    padding: 6px 0;
    position: static !important;
    width: 100%;
    overflow: visible;
    display: none;      /* hidden by default, shown by Bootstrap */
  }
  .jlms-navbar .dropdown .dropdown-menu.show {
    display: block !important;
  }
  .jlms-navbar .dropdown .dropdown-menu .dropdown-item {
    color: #333 !important;
    padding: 10px 18px;
    font-size: 0.87rem;
  }
  .jlms-navbar .dropdown .dropdown-menu .dropdown-item:hover {
    background: #f0f4ff !important;
    color: #1a1a2e !important;
  }
  .jlms-navbar .dropdown .dropdown-menu .dropdown-item.text-danger {
    color: #dc2626 !important;
  }
  .jlms-navbar .dropdown .dropdown-menu .dropdown-item.text-danger:hover {
    background: #fff5f5 !important;
  }
  /* User info header inside dropdown */
  .jlms-navbar .dropdown .dropdown-menu .px-3.py-2 {
    background: #f8f9ff;
    border-bottom: 1px solid #eef0f8;
    border-radius: 10px 10px 0 0;
  }
}

/* ---- DESKTOP: Keep dropdown floating above content ---- */
@media (min-width: 992px) {
  .jlms-navbar .dropdown-menu {
    position: absolute !important;
    top: calc(100% + 6px) !important;
    left: auto !important;
    right: 0 !important;
    background: #fff;
  }
  .jlms-navbar .navbar-nav .dropdown-menu {
    left: 0 !important;
    right: auto !important;
    min-width: 230px;
  }
}
/* ============================================================ */

/* ============================================================
   NAVBAR 