/* =====================================================
   JobPortal - Main Stylesheet
   Clean, Modern Job Board Design
   ===================================================== */

/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=Syne:wght@400;600;700;800&display=swap');

/* =====================================================
   CSS VARIABLES - Light Theme
   ===================================================== */
:root {
  --primary:        #2563eb;
  --primary-dark:   #1d4ed8;
  --primary-light:  #dbeafe;
  --secondary:      #0ea5e9;
  --accent:         #f59e0b;
  --success:        #10b981;
  --danger:         #ef4444;
  --warning:        #f59e0b;
  --info:           #3b82f6;

  --bg-body:        #f8fafc;
  --bg-card:        #ffffff;
  --bg-header:      #ffffff;
  --bg-hero:        linear-gradient(135deg, #1e3a8a 0%, #2563eb 50%, #0ea5e9 100%);
  --bg-footer:      #0f172a;

  --text-primary:   #0f172a;
  --text-secondary: #475569;
  --text-muted:     #94a3b8;
  --text-light:     #f8fafc;

  --border-color:   #e2e8f0;
  --border-radius:  12px;
  --border-radius-sm: 8px;
  --border-radius-lg: 20px;

  --shadow-sm:   0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow:      0 4px 16px rgba(0,0,0,.08);
  --shadow-lg:   0 12px 40px rgba(0,0,0,.12);
  --shadow-card: 0 2px 8px rgba(0,0,0,.06);

  --transition: all .25s cubic-bezier(.4,0,.2,1);
  --font-main:  'Plus Jakarta Sans', sans-serif;
  --font-head:  'Syne', sans-serif;
}

/* =====================================================
   DARK THEME
   ===================================================== */
[data-theme="dark"] {
  --bg-body:      #0f172a;
  --bg-card:      #1e293b;
  --bg-header:    #1e293b;
  --text-primary: #f1f5f9;
  --text-secondary:#cbd5e1;
  --text-muted:   #64748b;
  --border-color: #334155;
  --shadow-card:  0 2px 8px rgba(0,0,0,.3);
  --shadow:       0 4px 16px rgba(0,0,0,.4);
}

/* =====================================================
   BASE
   ===================================================== */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-main);
  font-size: 15px;
  background-color: var(--bg-body);
  color: var(--text-primary);
  line-height: 1.6;
  transition: background-color .3s ease, color .3s ease;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-head);
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

a { color: var(--primary); transition: var(--transition); }
a:hover { color: var(--primary-dark); }
img { max-width: 100%; height: auto; }

/* =====================================================
   HEADER / NAVBAR
   ===================================================== */
.site-header {
  background: var(--bg-header);
  border-bottom: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  z-index: 1000;
  transition: var(--transition);
}

.navbar { padding: 12px 0; }

.logo-icon {
  width: 38px; height: 38px;
  background: var(--bg-hero);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: white; font-size: 18px;
}

.logo-text {
  font-family: var(--font-head);
  font-size: 22px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.5px;
}

.navbar .nav-link {
  color: var(--text-secondary) !important;
  font-weight: 500;
  font-size: 14px;
  padding: 8px 14px !important;
  border-radius: 8px;
  transition: var(--transition);
}

.navbar .nav-link:hover,
.navbar .nav-link.active {
  color: var(--primary) !important;
  background: var(--primary-light);
}

.dropdown-menu {
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-lg);
  padding: 8px;
  background: var(--bg-card);
}

.dropdown-menu-animated {
  animation: dropIn .2s ease;
}

@keyframes dropIn {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.dropdown-item {
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 13.5px;
  color: var(--text-secondary);
  transition: var(--transition);
}

.dropdown-item:hover {
  background: var(--primary-light);
  color: var(--primary);
}

.btn-icon {
  width: 36px; height: 36px;
  padding: 0;
  display: flex; align-items: center; justify-content: center;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: transparent;
  color: var(--text-secondary);
  transition: var(--transition);
}

.btn-icon:hover { background: var(--primary-light); color: var(--primary); border-color: var(--primary); }

/* =====================================================
   HERO SECTION
   ===================================================== */
.hero-section {
  background: var(--bg-hero);
  color: white;
  padding: 80px 0 60px;
  position: relative;
  overflow: hidden;
}

.hero-section::before {
  content: '';
  position: absolute; inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.hero-section::after {
  content: '';
  position: absolute;
  bottom: -2px; left: 0; right: 0;
  height: 60px;
  background: var(--bg-body);
  clip-path: ellipse(55% 100% at 50% 100%);
}

.hero-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,.15);
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 100px;
  padding: 6px 16px;
  font-size: 13px;
  font-weight: 600;
  backdrop-filter: blur(8px);
  margin-bottom: 20px;
}

.hero-title {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 800;
  color: white;
  line-height: 1.1;
  margin-bottom: 16px;
}

.hero-title span {
  background: linear-gradient(90deg, #fbbf24, #f59e0b);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: 17px;
  color: rgba(255,255,255,.8);
  max-width: 560px;
  margin-bottom: 32px;
}

.hero-stats {
  display: flex; gap: 32px;
  margin-top: 32px;
}

.hero-stat-item strong {
  display: block;
  font-family: var(--font-head);
  font-size: 24px;
  font-weight: 800;
  color: white;
}

.hero-stat-item span {
  font-size: 13px;
  color: rgba(255,255,255,.7);
}

/* Search Form */
.hero-search-form {
  background: white;
  border-radius: var(--border-radius-lg);
  padding: 8px;
  box-shadow: 0 20px 60px rgba(0,0,0,.2);
  display: flex; gap: 8px;
  flex-wrap: wrap;
}

.hero-search-form .form-control,
.hero-search-form .form-select {
  border: 1px solid var(--border-color);
  border-radius: 10px;
  height: 50px;
  font-size: 14px;
  color: var(--text-primary);
  background: white;
  flex: 1; min-width: 160px;
}

.hero-search-form .form-control:focus,
.hero-search-form .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}

.hero-search-form .btn-search {
  height: 50px;
  padding: 0 28px;
  font-weight: 700;
  font-size: 15px;
  border-radius: 10px;
  white-space: nowrap;
  background: var(--primary);
  border-color: var(--primary);
  color: white;
  transition: var(--transition);
}

.hero-search-form .btn-search:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(37,99,235,.35);
}

/* Popular searches */
.popular-searches {
  margin-top: 16px;
  color: rgba(255,255,255,.75);
  font-size: 13px;
}

.popular-searches a {
  color: rgba(255,255,255,.9);
  text-decoration: none;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 100px;
  padding: 3px 12px;
  font-size: 12px;
  transition: var(--transition);
}

.popular-searches a:hover {
  background: rgba(255,255,255,.25);
}

/* =====================================================
   SECTION HEADER
   ===================================================== */
.section-header {
  margin-bottom: 36px;
}

.section-label {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 1.5px;
  color: var(--primary);
  margin-bottom: 8px;
}

.section-label::before, .section-label::after {
  content: ''; flex: 1;
  height: 1px; background: var(--primary);
  opacity: .4; width: 20px;
}

.section-title {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 8px;
}

/* =====================================================
   CATEGORY CARDS
   ===================================================== */
.category-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 24px 20px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  display: block;
  height: 100%;
}

.category-card:hover {
  border-color: var(--primary);
  box-shadow: 0 8px 30px rgba(37,99,235,.12);
  transform: translateY(-4px);
  background: var(--bg-card);
}

.category-icon {
  width: 56px; height: 56px;
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px;
  margin: 0 auto 14px;
  transition: var(--transition);
}

.category-card:hover .category-icon {
  transform: scale(1.1);
}

.category-name {
  font-weight: 700;
  font-size: 14px;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.category-count {
  font-size: 12px;
  color: var(--text-muted);
}

/* Category colors */
.cat-blue   { background: #dbeafe; color: #2563eb; }
.cat-green  { background: #d1fae5; color: #059669; }
.cat-orange { background: #ffedd5; color: #ea580c; }
.cat-purple { background: #ede9fe; color: #7c3aed; }
.cat-red    { background: #fee2e2; color: #dc2626; }
.cat-teal   { background: #ccfbf1; color: #0d9488; }
.cat-pink   { background: #fce7f3; color: #db2777; }
.cat-yellow { background: #fef3c7; color: #d97706; }

/* =====================================================
   JOB CARDS
   ===================================================== */
.job-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 22px;
  transition: var(--transition);
  height: 100%;
  position: relative;
  display: flex; flex-direction: column;
}

.job-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow);
  transform: translateY(-3px);
}

.job-card.featured-job {
  border-color: var(--accent);
  background: linear-gradient(135deg, var(--bg-card) 0%, rgba(245,158,11,.04) 100%);
}

.featured-ribbon {
  position: absolute;
  top: 12px; right: 12px;
  background: var(--accent);
  color: white;
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 1px;
  padding: 3px 8px;
  border-radius: 6px;
}

.company-logo {
  width: 52px; height: 52px;
  border-radius: 12px;
  object-fit: contain;
  background: var(--bg-body);
  border: 1px solid var(--border-color);
  padding: 4px;
  flex-shrink: 0;
}

.company-logo-placeholder {
  width: 52px; height: 52px;
  border-radius: 12px;
  background: var(--primary-light);
  display: flex; align-items: center; justify-content: center;
  color: var(--primary);
  font-size: 20px;
  font-weight: 800;
  flex-shrink: 0;
}

.job-card-title {
  font-weight: 700;
  font-size: 16px;
  color: var(--text-primary);
  margin-bottom: 4px;
  line-height: 1.3;
}

.job-card-title a {
  color: inherit; text-decoration: none;
}

.job-card-title a:hover { color: var(--primary); }

.job-company {
  font-size: 13.5px;
  color: var(--text-secondary);
  font-weight: 500;
}

.job-meta {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin: 14px 0;
}

.job-meta-item {
  display: flex; align-items: center; gap: 4px;
  font-size: 12.5px;
  color: var(--text-muted);
}

.job-meta-item i { font-size: 13px; }

/* Badges */
.badge-type {
  font-size: 11px; font-weight: 600;
  padding: 4px 10px;
  border-radius: 100px;
}

.badge-fulltime  { background: #d1fae5; color: #065f46; }
.badge-parttime  { background: #e0f2fe; color: #0369a1; }
.badge-remote    { background: #f3e8ff; color: #6d28d9; }
.badge-contract  { background: #fff7ed; color: #c2410c; }
.badge-internship{ background: #fce7f3; color: #9d174d; }
.badge-freelance { background: #f0fdf4; color: #15803d; }
.badge-other     { background: #f1f5f9; color: #475569; }

[data-theme="dark"] .badge-fulltime  { background: rgba(16,185,129,.15); color: #34d399; }
[data-theme="dark"] .badge-parttime  { background: rgba(14,165,233,.15); color: #38bdf8; }
[data-theme="dark"] .badge-remote    { background: rgba(124,58,237,.15); color: #a78bfa; }
[data-theme="dark"] .badge-contract  { background: rgba(249,115,22,.15); color: #fb923c; }

.salary-badge {
  background: var(--primary-light);
  color: var(--primary);
  font-size: 12px; font-weight: 600;
  padding: 4px 10px; border-radius: 100px;
}

.job-card-footer {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--border-color);
  display: flex; align-items: center; justify-content: space-between;
}

.time-ago {
  font-size: 12px;
  color: var(--text-muted);
}

.bookmark-btn {
  width: 32px; height: 32px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: transparent;
  color: var(--text-muted);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: var(--transition);
  font-size: 15px;
}

.bookmark-btn:hover, .bookmark-btn.active {
  background: var(--primary-light);
  color: var(--primary);
  border-color: var(--primary);
}

/* =====================================================
   FILTERS SIDEBAR
   ===================================================== */
.filter-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 20px;
  margin-bottom: 20px;
}

.filter-title {
  font-size: 14px; font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-color);
  display: flex; align-items: center; gap: 8px;
}

.filter-check { margin-bottom: 10px; }

.filter-check label {
  font-size: 13.5px;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex; align-items: center; justify-content: space-between;
}

.filter-check label .count-badge {
  background: var(--bg-body);
  color: var(--text-muted);
  font-size: 11px;
  padding: 1px 7px;
  border-radius: 100px;
  border: 1px solid var(--border-color);
}

/* =====================================================
   JOB DETAIL PAGE
   ===================================================== */
.job-detail-header {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  padding: 36px;
  margin-bottom: 24px;
}

.job-detail-title {
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.job-detail-company-logo {
  width: 80px; height: 80px;
  border-radius: 16px;
  object-fit: contain;
  background: var(--bg-body);
  border: 1px solid var(--border-color);
  padding: 8px;
}

.apply-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 24px;
  position: sticky; top: 80px;
}

.job-description h1, .job-description h2,
.job-description h3, .job-description h4 {
  font-size: 1.1rem; margin-top: 1.5rem;
}

.job-description ul, .job-description ol {
  padding-left: 1.4rem;
}

.job-description li { margin-bottom: 6px; }

/* =====================================================
   FORMS
   ===================================================== */
.auth-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  padding: clamp(28px, 5vw, 48px);
  box-shadow: var(--shadow);
  max-width: 460px;
  margin: 0 auto;
}

.form-label {
  font-size: 13.5px; font-weight: 600;
  color: var(--text-primary); margin-bottom: 6px;
}

.form-control, .form-select {
  border: 1.5px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  padding: 10px 14px;
  font-size: 14px;
  background: var(--bg-card);
  color: var(--text-primary);
  transition: var(--transition);
}

.form-control:focus, .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,.1);
  background: var(--bg-card);
  color: var(--text-primary);
}

[data-theme="dark"] .form-control,
[data-theme="dark"] .form-select {
  background: #0f172a;
  color: var(--text-primary);
  border-color: var(--border-color);
}

[data-theme="dark"] .form-control:focus,
[data-theme="dark"] .form-select:focus {
  background: #0f172a;
}

/* =====================================================
   BUTTONS
   ===================================================== */
.btn {
  border-radius: var(--border-radius-sm);
  font-weight: 600;
  font-size: 14px;
  transition: var(--transition);
}

.btn-primary {
  background: var(--primary);
  border-color: var(--primary);
}

.btn-primary:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(37,99,235,.3);
}

.btn-lg { padding: 13px 28px; font-size: 15px; border-radius: 10px; }
.btn-xl { padding: 16px 36px; font-size: 16px; border-radius: 12px; }

/* =====================================================
   PAGINATION
   ===================================================== */
.pagination { gap: 4px; }

.page-link {
  border-radius: 8px !important;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  background: var(--bg-card);
  padding: 8px 14px;
  font-size: 13.5px; font-weight: 500;
  transition: var(--transition);
}

.page-item.active .page-link {
  background: var(--primary);
  border-color: var(--primary);
}

.page-link:hover {
  background: var(--primary-light);
  color: var(--primary);
  border-color: var(--primary);
}

/* =====================================================
   ADS / PROMO SECTIONS
   ===================================================== */
.ad-banner {
  background: linear-gradient(135deg, #1e3a8a, #2563eb);
  border-radius: var(--border-radius);
  padding: 28px;
  color: white;
  text-align: center;
  position: relative; overflow: hidden;
}

.ad-banner::before {
  content: '';
  position: absolute; top: -30px; right: -30px;
  width: 120px; height: 120px;
  border-radius: 50%;
  background: rgba(255,255,255,.08);
}

/* =====================================================
   FOOTER
   ===================================================== */
.site-footer {
  background: var(--bg-footer);
  color: #94a3b8;
  margin-top: 80px;
}

.footer-heading {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #e2e8f0;
  margin-bottom: 16px;
}

.footer-links { margin: 0; padding: 0; }
.footer-links li { margin-bottom: 8px; }
.footer-links a {
  color: #94a3b8;
  text-decoration: none;
  font-size: 13.5px;
  transition: var(--transition);
}

.footer-links a:hover { color: white; padding-left: 4px; }

.footer-subscribe-form .form-control {
  background: rgba(255,255,255,.07);
  border-color: rgba(255,255,255,.12);
  color: white;
  font-size: 13px;
}

.footer-subscribe-form .form-control::placeholder { color: #64748b; }
.footer-subscribe-form .form-control:focus {
  background: rgba(255,255,255,.1);
  border-color: var(--primary);
  color: white;
}

/* =====================================================
   ALERTS
   ===================================================== */
.alert { border-radius: var(--border-radius-sm); border: none; font-size: 14px; }
.alert-success { background: #d1fae5; color: #065f46; }
.alert-danger   { background: #fee2e2; color: #991b1b; }
.alert-warning  { background: #fef3c7; color: #92400e; }
.alert-info     { background: #e0f2fe; color: #075985; }

[data-theme="dark"] .alert-success { background: rgba(16,185,129,.15); color: #6ee7b7; }
[data-theme="dark"] .alert-danger  { background: rgba(239,68,68,.15);  color: #fca5a5; }

/* =====================================================
   STATS / COUNTER CARDS
   ===================================================== */
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 24px;
  text-align: center;
  transition: var(--transition);
}

.stat-card:hover { box-shadow: var(--shadow); transform: translateY(-3px); }

.stat-value {
  font-family: var(--font-head);
  font-size: 2.4rem; font-weight: 800;
  color: var(--primary);
  line-height: 1;
  margin-bottom: 4px;
}

.stat-label { font-size: 13px; color: var(--text-muted); }

/* =====================================================
   SECTION SPACING
   ===================================================== */
.section-py { padding: 72px 0; }
.section-py-sm { padding: 48px 0; }

/* =====================================================
   SEARCH PAGE
   ===================================================== */
.search-header {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  padding: 24px 0;
}

.results-count {
  font-size: 14px;
  color: var(--text-muted);
}

.results-count strong { color: var(--text-primary); }

/* =====================================================
   EMPTY STATE
   ===================================================== */
.empty-state {
  text-align: center;
  padding: 60px 20px;
}

.empty-state-icon {
  width: 80px; height: 80px;
  background: var(--primary-light);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 32px; color: var(--primary);
  margin: 0 auto 20px;
}

/* =====================================================
   RESPONSIVE
   ===================================================== */
@media (max-width: 768px) {
  .hero-section { padding: 50px 0 40px; }
  .hero-stats { flex-wrap: wrap; gap: 16px; }
  .hero-search-form { flex-direction: column; }
  .hero-search-form .form-control,
  .hero-search-form .form-select { min-width: 100%; }
  .section-py { padding: 48px 0; }
  .job-detail-header { padding: 20px; }
  .apply-card { position: static; }
}

/* =====================================================
   LOADING STATES
   ===================================================== */
.skeleton {
  background: linear-gradient(90deg, var(--bg-body) 25%, var(--border-color) 50%, var(--bg-body) 75%);
  background-size: 200% 100%;
  animation: skeleton-load 1.5s infinite;
  border-radius: 6px;
}

@keyframes skeleton-load {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* =====================================================
   ADMIN PANEL OVERRIDES (when loaded in admin pages)
   ===================================================== */
.admin-body {
  background: #f1f5f9;
}

[data-theme="dark"] .admin-body {
  background: #0f172a;
}
