:root {
  --blue: #4C6EF5;
  --panel-bg: #ffffff;
  --muted: #6b7280;
  --orange: #ff8a1f;
  --accent-blue: #3B5BDB;
  --card-shadow: 0 8px 24px rgba(11, 18, 36, 0.06);
}

/* Global typography */
html,
body,
* {
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif !important;
  font-feature-settings: "liga", "kern";
  -webkit-font-smoothing: antialiased;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--blue);
  color: #071127;
  min-height: 100vh;
}

/* ========== TOP NAV ========== */
.topnav {
  padding: 18px 24px;
  background: var(--blue);
  color: white;
  box-shadow: 0 6px 0 rgba(0, 0, 0, 0.05);
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.logo {
  height: 70px;
  left: 0;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
}

.topnav .nav-inner {
  max-width: 1180px;
  margin: 0 auto;
  display: flex;
  justify-content: center;
}

/* Menu */
.menu {
  list-style: none;
  display: flex;
  gap: 28px;
  position: relative;
}

.menu li {
  cursor: pointer;
}

.menu li.active {
  font-weight: 700;
  text-decoration: underline;
}

/* ========== MAIN LAYOUT ========== */
.page {
  max-width: 1180px;
  margin: 28px auto;
  padding: 0 20px;
}

.panel {
  background: var(--panel-bg);
  border-radius: 18px;
  padding: 28px;
  box-shadow: var(--card-shadow);
  min-height: 460px;
}

.panel.narrow {
  max-width: 640px;
  margin-left: auto;
  margin-right: auto;
}

/* ========== POST JOB: TWO COLUMN LAYOUT ========== */
.post-panel {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}

.post-left {
  flex: 1 1 60%;
}

.post-right {
  flex: 0 0 300px;
  background: white;
  border-radius: 12px;
  padding: 12px;
  min-height: 300px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.04);
}

/* ========== TABS (Orders) ========== */
.tabs-row {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
}

.tab {
  padding: 8px 14px;
  border-radius: 6px;
  border: 1px solid #e9e9eb;
  background: transparent;
  cursor: pointer;
}

.tab.active {
  background: black;
  color: white;
}

/* ========== JOB TILES (Orders) ========== */
.job-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin-top: 12px;
}

.job-tile {
  width: 320px;
  padding: 12px;
  border-radius: 10px;
  border: 2px solid transparent;
  background: white;
}

.row-top {
  display: flex;
  gap: 12px;
}

.img {
  width: 80px;
  height: 80px;
  background: #e6e9ee;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.title {
  font-weight: 700;
}

.subtitle {
  font-size: 13px;
  color: var(--muted);
}

.desc {
  font-size: 13px;
  margin-top: 4px;
}

/* categories */
.job-tile.ongoing {
  border-color: var(--orange);
}

.job-tile.previous {
  border-color: var(--accent-blue);
}

/* ========== FORMS ========== */
label {
  margin-top: 12px;
  display: block;
  font-weight: 600;
}

input,
textarea,
select {
  width: 100%;
  padding: 8px;
  margin-top: 6px;
  border: 1px solid #e6eef2;
  border-radius: 6px;
}

.row {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}

.btn {
  padding: 8px 12px;
  background: #1f9d95;
  color: white;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
}

.btn.ghost {
  background: transparent;
  color: #1f9d95;
  border: 1px solid rgba(31, 157, 149, 0.3);
}

/* ========== ACTIVE LISTINGS (Post view) ========== */
.active-listings {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.active-job {
  border: 1px solid #f0f3f4;
  padding: 10px;
  border-radius: 8px;
}

.app-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px solid #eee;
}

.app-row:last-child {
  border-bottom: none;
}

.small {
  color: var(--muted);
  font-size: 13px;
}

/* ========== MODAL (unused) ========== */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.32);
  display: flex;
  justify-content: center;
  align-items: center;
}

.modal-content {
  width: 520px;
  background: white;
  border-radius: 10px;
  padding: 18px;
}

.hidden {
  display: none;
}

/* ========== ORDERS HEADER ========== */
.orders-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  width: 100%;
}

.orders-title {
  font-size: 26px;
  font-weight: bold;
  margin: 0;
}

.orders-select {
  padding: 6px 10px;
  font-size: 15px;
  border: 1px solid #ccc;
  border-radius: 6px;
  background-color: #fff;
  width: auto;
  max-width: fit-content;
  cursor: pointer;
  white-space: nowrap;
}

/* ========== HOME VIEW ========== */
.home-panel {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.home-hero h1 {
  margin: 0 0 8px;
  font-size: 28px;
}

.home-hero p {
  margin: 0 0 16px;
  color: var(--muted);
}

.home-cta-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.btn.primary {
  background: #1f9d95;
  color: white;
}

.home-stats-row {
  display: block;
  flex-wrap: column;
  gap: 16px;
}

.home-stat-card {
  flex: 150px;
  background: #f3f4ff;
  border-radius: 12px;
  padding: 12px;
  box-shadow: 0 4px 12px rgba(11, 18, 36, 0.04);
}

.home-stat-number {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 4px;
}

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

/* ====== HOME VIEW LAYOUT + MAP ====== */
.home-header-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.home-title {
  margin: 0;
  font-size: 32px;
}

.home-greeting {
  margin: 0;
  font-size: 18px;
  color: var(--muted);
}

.home-greeting span {
  font-weight: 600;
}

.home-layout {
  margin-top: 24px;
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 24px;
}

.home-column { }

.home-subtitle {
  margin: 0 0 12px;
  font-size: 20px;
}

.home-map-box {
  height: 360px;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(11, 18, 36, 0.08);
}

/* Leaflet map must fill the box */
#map {
  width: 100%;
  height: 100%;
}

.home-list-box {
  min-height: 200px;
  padding: 20px 24px;
  border-radius: 18px;
  background: #f3f4ff;
  box-shadow: 0 8px 24px rgba(11, 18, 36, 0.04);
  display: flex;
  align-items: center;
}

.home-list-header {
  display: flex;
  align-items: center;
  gap: 16px;
}

.home-list-count {
  font-size: 40px;
  font-weight: 700;
  color: #111827;
  line-height: 1;
}

.home-list-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.home-list-title {
  font-size: 16px;
  font-weight: 600;
  color: #111827;
}

.home-list-subtitle {
  font-size: 13px;
  color: var(--muted);
}

/* Responsive */
@media (max-width: 900px) {
  .home-layout {
    grid-template-columns: 1fr;
  }

  .home-map-box {
    height: 260px;
  }
}

/* ========== PROFILE PAGE ========== */

.profile-page {
  background: #ffffff;
  border-radius: 18px;
  padding: 32px 40px 40px;
  box-shadow: var(--card-shadow);
}

.profile-header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  column-gap: 32px;
  align-items: center;
}

.profile-photo-wrap {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  overflow: hidden;
}

.profile-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-header-main {
  display: flex;
  flex-direction: column;
}

.profile-title {
  margin: 0 0 8px;
  font-size: 20px;
}

.profile-edit-link {
  font-size: 20px;
  text-decoration: underline;
  margin-bottom: 8px;
  color: #111827;
}

.profile-name-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 6px;
}

.profile-name {
  margin: 0;
  font-size: 30px;
}

.profile-rating-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: #e5e7eb;
  font-weight: 600;
}

.profile-rating-icon {
  font-size: 18px;
}

.profile-tagline {
  margin: 0;
  margin-top: 4px;
  font-size: 16px;
  color: #6b7280;
}

.profile-logout-btn {
  border: none;
  background: transparent;
  font-size: 20px;
  cursor: pointer;
}

.profile-main-row {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  column-gap: 80px;
  margin-top: 48px;
}

.profile-stats .profile-section-title {
  margin: 0 0 24px;
  font-size: 28px;
}

.profile-stat-line {
  display: flex;
  justify-content: space-between;
  font-size: 22px;
  margin-bottom: 16px;
}

.profile-stat-label {
  font-weight: 400;
}

.profile-stat-number {
  font-weight: 600;
}

.profile-genres .profile-section-title {
  margin: 0 0 24px;
  font-size: 28px;
}

.profile-genre-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 1fr auto;
  align-items: center;
  column-gap: 16px;
  margin-bottom: 24px;
  font-size: 18px;
}

.profile-genre-label {
  white-space: nowrap;
}

.profile-genre-bar {
  height: 14px;
  border-radius: 999px;
  background: #e5e7eb;
  overflow: hidden;
}

.profile-genre-fill {
  height: 100%;
  background: #374151;
}

.profile-genre-percent {
  font-size: 16px;
}

/* Responsive profile */
@media (max-width: 900px) {
  .profile-header {
    grid-template-columns: 1fr;
    row-gap: 16px;
  }

  .profile-main-row {
    grid-template-columns: 1fr;
    row-gap: 32px;
  }

  .profile-title {
    font-size: 32px;
  }
}

/* ========== FIND JOBS VIEW ========== */

#job-search {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
}

#job-search .job-tile {
  width: 100%;
}

.job-panel {
  background: white;
  border-radius: 30px;
  padding: 32px 40px;
  box-shadow: var(--card-shadow);
  margin: 0 auto;
  max-width: 1200px;
}

.layout {
  display: flex;
  gap: 28px;
  align-items: flex-start;
}

.filters-panel {
  width: 260px;
  padding: 20px;
  background: #f4f6ff;
  border-radius: 16px;
  box-shadow: var(--card-shadow);
  text-align: left;
  margin: 0;
}

.filters-panel h2 {
  margin-top: 0;
}

.filters-panel select,
.filters-panel input {
  margin-bottom: 12px;
}

.job-type-filter div {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}

.job-type-filter div label {
  margin: 0;
  cursor: pointer;
  display: inline-block;
  margin-bottom: 10px;
  margin-top: 10px;
}

input[type="checkbox"] {
  width: auto;
  margin: 0;
}

.job-card {
  background: #ede9ff;
  color: black;
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: var(--card-shadow);
  border: 2px solid #ccc;
  transition: 0.2s ease;
}

.job-card:hover {
  border-color: var(--accent-blue);
}

.request-btn {
  padding: 8px 40px;
  background-color: #3b5bdb;
  border: none;
  border-radius: 6px;
  color: white;
  cursor: pointer;
}

.request-btn:hover {
  background: #24cac7;
}

@media (max-width: 740px) {
  .layout {
    flex-direction: column;
  }

  .filters-panel {
    width: 100%;
  }

  #job-search {
    grid-template-columns: 1fr;
  }
}

/* ========== LOCATION AUTOCOMPLETE (Post view) ========== */

.location-field {
  position: relative;
}

.location-suggestions {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  margin-top: 4px;
  background: #ffffff;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  box-shadow: 0 8px 24px rgba(11, 18, 36, 0.12);
  max-height: 220px;
  overflow-y: auto;
  z-index: 1000;
}

.location-suggestion-option {
  padding: 8px 10px;
  font-size: 14px;
  cursor: pointer;
}

.location-suggestion-option:hover {
  background: #f3f4ff;
}
