:root {
  --teal: #0E3B3D;
  --teal-hover: #12494b;
  --gold: #B98B2E;
  --gold-hover: #cf9d35;
  --sand: #F6F1E7;
  --sand-2: #F0EADC;
  --ink: #1C1C1A;
  --muted: #5a5648;
  --faint: #8a8574;
  --border: #e5e0d5;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: 'Inter', sans-serif;
  background: var(--sand);
  color: var(--ink);
}
h1, h2, h3 { font-family: 'Fraunces', serif; margin: 0; }
a { color: inherit; text-decoration: none; }
.wrap { max-width: 1100px; margin: 0 auto; padding: 0 24px; }

/* --- Site-wide left sidebar (mirrors the admin panel's layout) --- */
.site-shell { display: flex; min-height: 100vh; }
.site-sidebar { width: 220px; background: var(--teal); color: #fff; flex-shrink: 0; padding: 20px 0; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.site-sidebar .logo { font-family: 'Fraunces', serif; font-size: 22px; padding: 0 20px 18px; display: block; border-bottom: 1px solid rgba(255,255,255,.15); margin-bottom: 8px; }
.site-sidebar .logo span { color: var(--gold); }
.site-sidebar nav { display: flex; flex-direction: column; }
.site-sidebar nav a { display: block; padding: 10px 20px; font-size: 14px; color: #d9e6e4; }
.site-sidebar nav a.active, .site-sidebar nav a:hover { background: rgba(255,255,255,.08); color: #fff; }
.site-sidebar .divider { margin: 10px 20px; border-top: 1px solid rgba(255,255,255,.15); }
.site-sidebar .sidebar-signin { background: var(--gold); color: var(--teal); margin: 4px 20px; padding: 8px 14px; border-radius: 3px; font-weight: 500; text-align: center; }
.site-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
@media (max-width: 800px) {
  .site-shell { flex-direction: column; }
  .site-sidebar { width: 100%; height: auto; position: static; padding: 12px 0; }
  .site-sidebar nav { flex-direction: row; flex-wrap: wrap; }
  .site-sidebar nav a { padding: 8px 12px; }
  .site-sidebar .divider { display: none; }
}

.logo { font-family: 'Fraunces', serif; font-size: 24px; }
.logo span { color: var(--gold); }
.link-btn { font-size: 14px; }
.link-btn:hover { color: var(--gold); }
.btn-gold, .btn-gold-lg { background: var(--gold); color: var(--teal); font-weight: 500; padding: 8px 16px; border-radius: 3px; border: none; cursor: pointer; font-size: 14px; }
.btn-gold:hover, .btn-gold-lg:hover { background: var(--gold-hover); }
.btn-gold-lg { padding: 10px 24px; font-size: 15px; }
.btn-outline-light { border: 1px solid rgba(255,255,255,.4); padding: 7px 14px; border-radius: 3px; font-size: 14px; }
.btn-dark { background: var(--teal); color: #fff; padding: 10px 20px; border: none; border-radius: 3px; cursor: pointer; font-size: 14px; }
.btn-dark:hover { background: var(--teal-hover); }
.btn-outline-dark { border: 1px solid var(--teal); color: var(--teal); padding: 9px 18px; border-radius: 3px; background: #fff; cursor: pointer; font-size: 14px; }
.btn-outline-dark:hover { background: var(--teal); color: #fff; }

/* --- Floating chat widget --- */
.chat-widget { position: fixed; right: 20px; bottom: 20px; z-index: 100; }
.chat-bubble { width: 52px; height: 52px; border-radius: 50%; background: var(--teal); color: #fff; border: none; font-size: 22px; cursor: pointer; box-shadow: 0 4px 14px rgba(0,0,0,.25); position: relative; }
.chat-bubble:hover { background: var(--teal-hover); }
.chat-badge { position: absolute; top: -4px; right: -4px; background: var(--gold); color: var(--teal); font-size: 11px; font-weight: 600; border-radius: 50%; width: 18px; height: 18px; display: flex; align-items: center; justify-content: center; }
.chat-panel { display: none; flex-direction: column; position: absolute; bottom: 64px; right: 0; width: 300px; max-height: 380px; background: #fff; border-radius: 6px; box-shadow: 0 10px 30px rgba(0,0,0,.2); overflow: hidden; }
.chat-panel-header { background: var(--teal); color: #fff; padding: 12px 14px; display: flex; justify-content: space-between; align-items: center; font-size: 14px; font-weight: 500; }
.chat-panel-header button { background: none; border: none; color: #fff; font-size: 18px; cursor: pointer; line-height: 1; }
.chat-panel-body { overflow-y: auto; flex: 1; }
.chat-convo { display: block; padding: 10px 14px; border-bottom: 1px solid #f0ede3; font-size: 13px; }
.chat-convo:hover { background: var(--sand-2); }
.chat-convo-name { font-weight: 500; color: var(--ink); }
.chat-convo-preview { color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.chat-empty { padding: 16px 14px; color: var(--faint); font-size: 13px; }
.chat-panel-footer { display: block; text-align: center; padding: 10px; font-size: 13px; color: var(--teal); border-top: 1px solid var(--border); background: var(--sand-2); }

.flash { margin-top: 16px; padding: 10px 16px; border-radius: 3px; font-size: 14px; }
.flash-info { background: var(--sand-2); color: var(--teal); }
.flash-error { background: #fdecea; color: #b3261e; }
.flash-success { background: #e6f4ea; color: #1e7b34; }

.hero { background: var(--teal); color: #fff; padding: 56px 24px 64px; }
.hero h1 { font-size: 40px; max-width: 560px; line-height: 1.2; color: #fff; }
.hero p { color: #c8ded9; max-width: 480px; margin-top: 10px; }

.search-bar { background: #fff; border-radius: 4px; box-shadow: 0 8px 24px rgba(0,0,0,.15); padding: 8px; display: flex; gap: 8px; max-width: 700px; margin-top: 32px; flex-wrap: wrap; position: relative; }
.search-bar .field { flex: 1; display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-right: 1px solid var(--border); min-width: 200px; position: relative; }
.search-bar .field:last-of-type { border-right: none; }
.search-bar input { border: none; outline: none; font-size: 14px; width: 100%; font-family: inherit; }
.suggestions { position: absolute; top: 100%; left: 0; right: 0; background: #fff; border: 1px solid var(--border); border-radius: 3px; box-shadow: 0 8px 20px rgba(0,0,0,.12); z-index: 20; max-height: 220px; overflow-y: auto; }
.suggestions button { display: block; width: 100%; text-align: left; padding: 8px 12px; font-size: 14px; border: none; background: none; cursor: pointer; }
.suggestions button:hover { background: var(--sand-2); }

.stats-bar { background: #fff; border-radius: 4px; box-shadow: 0 4px 16px rgba(0,0,0,.08); display: grid; grid-template-columns: repeat(3,1fr); margin-top: -32px; position: relative; }
.stats-bar div { padding: 20px; text-align: center; border-right: 1px solid #f0ede3; }
.stats-bar div:last-child { border-right: none; }
.stats-bar .num { font-family: 'Fraunces', serif; font-size: 24px; color: var(--teal); }
.stats-bar .label { font-size: 12px; color: var(--faint); margin-top: 4px; }

.section { max-width: 1100px; margin: 0 auto; padding: 40px 24px; }
.section h2 { font-size: 24px; margin-bottom: 20px; }

.job-grid, .candidate-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
@media (max-width: 700px) { .job-grid, .candidate-grid { grid-template-columns: 1fr; } }

.card { background: #fff; border: 1px solid var(--border); border-radius: 4px; padding: 18px; transition: .15s; }
.card:hover { border-color: var(--gold); box-shadow: 0 4px 14px rgba(0,0,0,.06); }
.card h3 { font-size: 17px; }
.job-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; color: var(--faint); margin-top: 10px; }
.badge { font-size: 10px; font-weight: 500; padding: 2px 8px; border-radius: 3px; background: var(--sand-2); color: var(--teal); }
.badge-full { background: var(--teal); color: #fff; }
.skill-chip { font-size: 11px; background: var(--sand-2); color: var(--muted); padding: 3px 8px; border-radius: 3px; margin: 3px 3px 0 0; display: inline-block; }

.detail-box { background: #fff; border: 1px solid var(--border); border-radius: 4px; padding: 28px; max-width: 760px; margin: 32px auto; }
.gated { background: var(--sand-2); border-radius: 3px; padding: 14px 16px; font-size: 14px; }
.gated .title { display: flex; align-items: center; gap: 8px; font-weight: 500; }

.form-box { background: #fff; border: 1px solid var(--border); border-radius: 4px; padding: 26px; max-width: 480px; margin: 32px auto; }
.form-box label { display: block; margin-bottom: 14px; font-size: 14px; }
.form-box label span { display: block; font-weight: 500; margin-bottom: 5px; }
.form-box input[type=text], .form-box input[type=email], .form-box input[type=password], .form-box input[type=tel], .form-box textarea, .form-box select {
  width: 100%; border: 1px solid var(--border); border-radius: 3px; padding: 9px 11px; font-size: 14px; font-family: inherit;
}
.form-box textarea { min-height: 90px; resize: vertical; }
.form-row { display: flex; gap: 12px; }
.form-row > label { flex: 1; }
.form-actions { display: flex; justify-content: space-between; align-items: center; margin-top: 18px; padding-top: 16px; border-top: 1px solid #f0ede3; }

.back-link { display: inline-flex; align-items: center; gap: 4px; font-size: 14px; color: var(--muted); margin-bottom: 16px; }
.back-link:hover { color: var(--teal); }

.post-card { background: #fff; border: 1px solid var(--border); border-radius: 4px; padding: 18px; margin-bottom: 14px; }
.post-actions { display: flex; gap: 20px; margin-top: 12px; padding-top: 10px; border-top: 1px solid #f0ede3; font-size: 13px; color: var(--faint); }
.post-actions form { display: inline; }
.post-actions button { background: none; border: none; cursor: pointer; font-size: 13px; color: inherit; display: inline-flex; align-items: center; gap: 5px; }
.liked { color: var(--gold); }

.msg-layout { display: flex; height: 60vh; background: #fff; border: 1px solid var(--border); border-radius: 4px; overflow: hidden; }
.conv-list { width: 240px; border-right: 1px solid var(--border); overflow-y: auto; flex-shrink: 0; }
.conv-list a { display: block; padding: 12px 14px; border-bottom: 1px solid #f0ede3; font-size: 13px; }
.conv-list a.active, .conv-list a:hover { background: var(--sand-2); }
.thread { flex: 1; display: flex; flex-direction: column; }
.thread-messages { flex: 1; overflow-y: auto; padding: 18px; }
.bubble { max-width: 70%; padding: 8px 12px; border-radius: 3px; font-size: 14px; margin-bottom: 10px; }
.bubble.me { background: var(--teal); color: #fff; margin-left: auto; }
.bubble.them { background: var(--sand-2); }
.thread-input { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--border); }
.thread-input input { flex: 1; border: 1px solid var(--border); border-radius: 3px; padding: 8px 12px; font-family: inherit; }

.upload-drop { border: 2px dashed var(--border); border-radius: 3px; padding: 24px; text-align: center; font-size: 13px; color: var(--faint); cursor: pointer; }
.upload-drop.filled { border-color: var(--teal); background: rgba(240,234,220,.4); color: var(--teal); }
.upload-drop.error { border-color: #e6b0ab; background: #fdecea; color: #b3261e; }
.error-text { color: #b3261e; font-size: 12px; margin-top: 6px; }

/* ---------------------------------------------------------------------
 * Added: sidebar profile-switcher widget (job seeker <-> employer)
 * ------------------------------------------------------------------- */
.sidebar-widget { padding: 12px 20px 14px; border-bottom: 1px solid rgba(255,255,255,.15); margin-bottom: 8px; }
.sidebar-widget-top { display: flex; align-items: center; justify-content: space-between; font-size: 12px; color: #d9e6e4; }
.sidebar-widget-top strong { color: #fff; }
.sidebar-bell { position: relative; text-decoration: none; font-size: 15px; }
.sidebar-bell-count { position: absolute; top: -6px; right: -10px; background: var(--gold); color: var(--teal); border-radius: 10px; font-size: 10px; font-weight: 600; padding: 1px 5px; line-height: 1.4; }
.sidebar-widget-switch { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.sidebar-widget-switch form { display: inline; }
.sidebar-widget-switch button.btn-outline-light { background: none; color: #fff; cursor: pointer; font-size: 12px; padding: 5px 10px; }
.sidebar-widget-switch button.btn-outline-light:hover { background: rgba(255,255,255,.1); }
.sidebar-widget-switch button.btn-outline-light:disabled { opacity: .5; cursor: default; background: rgba(255,255,255,.12); }
.sidebar-widget-friends { display: block; margin-top: 10px; font-size: 12px; color: #d9e6e4; }
.sidebar-widget-friends:hover { color: #fff; }

/* ---------------------------------------------------------------------
 * Added: role-tinted mode — employer view gets a gold sidebar accent
 * instead of teal, so switching profiles feels like a different "side"
 * of the site. Candidate mode keeps the original teal (no change).
 * ------------------------------------------------------------------- */
.mode-company .site-sidebar { background: #3d2f10; }
.mode-company .site-sidebar .logo span { color: #6fbfae; }
.mode-company .site-sidebar nav a.active, .mode-company .site-sidebar nav a:hover { background: rgba(255,255,255,.08); }
.mode-company .site-sidebar .sidebar-signin { background: var(--teal); color: #fff; }
.mode-company .btn-gold, .mode-company .btn-gold-lg { background: var(--teal); color: #fff; }
.mode-company .btn-gold:hover, .mode-company .btn-gold-lg:hover { background: var(--teal-hover); }

/* ---------------------------------------------------------------------
 * Added: LinkedIn-style cover banner for candidate.php / company.php
 * ------------------------------------------------------------------- */
.cover-banner { border-radius: 4px 4px 0 0; height: 96px; margin: -28px -28px 0; background: linear-gradient(120deg, var(--teal), var(--teal-hover)); }
.cover-banner.cover-company { background: linear-gradient(120deg, #7a5b1e, var(--gold)); }
.cover-header { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-top: -36px; }
.cover-avatar { width: 72px; height: 72px; border-radius: 8px; border: 3px solid #fff; background: #fff; object-fit: contain; box-shadow: 0 2px 8px rgba(0,0,0,.1); }
.cover-avatar-fallback { width: 72px; height: 72px; border-radius: 8px; border: 3px solid #fff; background: var(--sand-2); display: flex; align-items: center; justify-content: center; font-size: 28px; font-weight: 700; color: var(--teal); box-shadow: 0 2px 8px rgba(0,0,0,.1); }

/* ---------------------------------------------------------------------
 * Added: company-authored posts in the feed
 * ------------------------------------------------------------------- */
.post-company-badge { display: inline-block; font-size: 10px; font-weight: 600; letter-spacing: .02em; text-transform: uppercase; background: var(--sand-2); color: var(--teal); padding: 2px 6px; border-radius: 3px; margin-left: 6px; vertical-align: middle; }
.post-author-link { color: inherit; text-decoration: none; }
.post-author-link:hover { text-decoration: underline; }

/* ---------------------------------------------------------------------
 * Added: referral progress bar (invite.php)
 * ------------------------------------------------------------------- */
.progress-track { background: var(--sand-2); border-radius: 20px; height: 10px; overflow: hidden; }
.progress-fill { background: var(--gold); height: 100%; border-radius: 20px; transition: width .3s ease; }

/* ---------------------------------------------------------------------
 * Patch 8 — bolder, more colorful visual refresh: gradients, shadows,
 * rounded cards, more visual energy. Everything below restyles a
 * selector already defined above (nothing removed, nothing renamed),
 * built on top of the existing teal/gold palette rather than replacing it.
 * ------------------------------------------------------------------- */
:root {
  --teal-glow: rgba(14, 59, 61, .18);
  --gold-glow: rgba(185, 139, 46, .35);
  --radius-lg: 14px;
  --radius-md: 10px;
}

/* Softer gradient wash behind the whole page instead of a flat backdrop. */
body { background: linear-gradient(180deg, #FBF7ED 0%, var(--sand) 280px); }

/* Rounder, punchier buttons with a gradient fill and a lift on hover. */
.btn-gold, .btn-gold-lg {
  background: linear-gradient(135deg, var(--gold), #d9a53f);
  border-radius: 999px;
  box-shadow: 0 6px 16px var(--gold-glow);
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.btn-gold:hover, .btn-gold-lg:hover {
  background: linear-gradient(135deg, var(--gold-hover), #e3b04f);
  transform: translateY(-2px);
  box-shadow: 0 10px 22px var(--gold-glow);
}
.btn-dark {
  background: linear-gradient(135deg, var(--teal), var(--teal-hover));
  border-radius: 999px;
  box-shadow: 0 6px 16px var(--teal-glow);
  transition: transform .15s ease, box-shadow .15s ease;
}
.btn-dark:hover { background: linear-gradient(135deg, var(--teal-hover), #175b5d); transform: translateY(-2px); box-shadow: 0 10px 22px var(--teal-glow); }
.btn-outline-dark, .btn-outline-light { border-radius: 999px; transition: transform .15s ease, box-shadow .15s ease; }
.btn-outline-dark:hover, .btn-outline-light:hover { transform: translateY(-1px); }
.mode-company .btn-gold, .mode-company .btn-gold-lg { background: linear-gradient(135deg, var(--teal), var(--teal-hover)); box-shadow: 0 6px 16px var(--teal-glow); }
.mode-company .btn-gold:hover, .mode-company .btn-gold-lg:hover { background: linear-gradient(135deg, var(--teal-hover), #175b5d); }

/* Hero: richer gradient with a soft glow accent instead of a flat block. */
.hero {
  background: linear-gradient(135deg, var(--teal) 0%, #145255 55%, #1b6a63 100%);
  position: relative;
  overflow: hidden;
}
.hero::after {
  content: "";
  position: absolute;
  top: -90px; right: -90px;
  width: 320px; height: 320px;
  background: radial-gradient(circle, var(--gold-glow), transparent 70%);
  pointer-events: none;
}
.hero h1, .hero p, .hero .search-bar, .hero .stats-bar { position: relative; z-index: 1; }

.search-bar { border-radius: var(--radius-lg); box-shadow: 0 16px 40px rgba(0,0,0,.22); }
.stats-bar { border-radius: var(--radius-lg); box-shadow: 0 10px 28px rgba(0,0,0,.1); }
.stats-bar .num { font-size: 28px; }

/* Cards: rounder corners, an always-on soft shadow, a real lift on hover. */
.card, .post-card, .form-box, .detail-box {
  border-radius: var(--radius-lg);
  box-shadow: 0 3px 14px rgba(20,20,10,.05);
}
.card { transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
.card:hover { transform: translateY(-3px); box-shadow: 0 14px 32px rgba(20,20,10,.12); }
.card h3 { font-weight: 600; }

.badge-full {
  background: linear-gradient(135deg, var(--gold), #d9a53f);
  color: var(--teal);
  box-shadow: 0 3px 10px var(--gold-glow);
}
.badge { border-radius: 999px; }
.skill-chip { border-radius: 999px; background: linear-gradient(135deg, var(--sand-2), #e9e0c9); }

.gated { border-radius: var(--radius-md); background: linear-gradient(135deg, var(--sand-2), #ece3cd); }

.chat-bubble { background: linear-gradient(135deg, var(--gold), var(--teal)); box-shadow: 0 8px 22px rgba(0,0,0,.28); transition: transform .15s ease; }
.chat-bubble:hover { transform: scale(1.06); }
.chat-panel { border-radius: var(--radius-md); }

.progress-fill { background: linear-gradient(90deg, var(--gold), var(--gold-hover)); }

.cover-banner { border-radius: var(--radius-lg) var(--radius-lg) 0 0; height: 120px; }
.cover-banner.cover-company { background: linear-gradient(120deg, #7a5b1e, var(--gold), #e3c26b); }
.cover-banner:not(.cover-company) { background: linear-gradient(120deg, var(--teal), #1b6a63, var(--gold-hover)); }
.cover-avatar, .cover-avatar-fallback { box-shadow: 0 4px 14px rgba(0,0,0,.18); }

.sidebar-widget { border-radius: var(--radius-md); margin: 0 10px 10px; background: rgba(255,255,255,.05); border-bottom: none; padding: 12px 14px 14px; }

@media (max-width: 700px) {
  .hero h1 { font-size: 30px; }
}
