/* BuildPro - Mobile-First App CSS */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Space+Grotesk:wght@400;500;600;700&display=swap');

:root {
  --primary: #FF6B35;
  --primary-dark: #E85A24;
  --primary-light: #FF8A5B;
  --secondary: #1A1A2E;
  --secondary-light: #2D2D44;
  --accent: #FFD700;
  --bg: #F5F5F0;
  --bg-card: #FFFFFF;
  --text: #1A1A2E;
  --text-muted: #8A8A9A;
  --text-light: #C8C8D8;
  --border: #E8E8F0;
  --success: #22C55E;
  --warning: #F59E0B;
  --danger: #EF4444;
  --info: #3B82F6;
  --shadow: 0 4px 20px rgba(26,26,46,0.08);
  --shadow-lg: 0 8px 40px rgba(26,26,46,0.15);
  --radius: 16px;
  --radius-sm: 10px;
  --radius-xs: 6px;
  --nav-height: 64px;
  --bottom-nav: 72px;
  --font-main: 'Plus Jakarta Sans', sans-serif;
  --font-display: 'Space Grotesk', sans-serif;
}

/* Dynamic CSS variables from admin */
body[data-primary] { --primary: attr(data-primary); }

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-main);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  max-width: 480px;
  margin: 0 auto;
  position: relative;
  overflow-x: hidden;
  padding-bottom: calc(var(--bottom-nav) + env(safe-area-inset-bottom) + 6px);
}

/* ====================== TYPOGRAPHY ====================== */
h1, h2, h3, h4, h5, h6 { font-family: var(--font-display); font-weight: 700; line-height: 1.2; }
h1 { font-size: 28px; } h2 { font-size: 22px; } h3 { font-size: 18px; }
h4 { font-size: 16px; } h5 { font-size: 14px; }
p { line-height: 1.6; }
a { color: var(--primary); text-decoration: none; }
small { font-size: 12px; }

/* ====================== HEADER ====================== */
.app-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--bg-card);
  height: var(--nav-height);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 16px;
  border-bottom: 1px solid var(--border);
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

.header-logo {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--font-display); font-weight: 800;
  font-size: 20px; color: var(--text);
}
.header-logo img { width: 32px; height: 32px; object-fit: contain; border-radius: 8px; }
.header-logo span.accent { color: var(--primary); }

.header-actions { display: flex; align-items: center; gap: 8px; }
.header-icon-btn {
  position: relative; width: 40px; height: 40px;
  border-radius: 50%; border: none; background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--text); font-size: 18px;
  transition: background 0.2s;
}
.header-icon-btn:hover { background: var(--border); }
.badge {
  position: absolute; top: 0; right: 0;
  background: var(--danger); color: #fff;
  font-size: 9px; font-weight: 700;
  width: 18px; height: 18px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--bg-card);
}

/* ====================== BOTTOM NAV ====================== */
.bottom-nav {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%) translateZ(0);
  width: 100%; max-width: 480px; z-index: 100;
  background: #ffffff;
  background: var(--bg-card, #ffffff);
  border-top: 1px solid var(--border);
  display: flex; align-items: flex-start;
  padding-top: 6px;
  padding-bottom: calc(env(safe-area-inset-bottom) + 6px);
  box-shadow: 0 -4px 20px rgba(0,0,0,0.08);
  will-change: transform;
  -webkit-transform: translateX(-50%) translateZ(0);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.bottom-nav-item {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: flex-start;
  gap: 3px; color: var(--text-muted);
  font-size: 10px; font-weight: 600;
  cursor: pointer; padding: 4px 2px 0;
  text-decoration: none; transition: color 0.2s;
  min-width: 0;
}
.bottom-nav-item i { font-size: 19px; line-height: 1; }
.bottom-nav-item span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.bottom-nav-item.active { color: var(--primary); }
.bottom-nav-item.active i { transform: scale(1.1); }

.nav-center-btn {
  width: 50px; height: 50px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 22px;
  box-shadow: 0 4px 16px rgba(255,107,53,0.4);
  margin-top: -18px;
  border: 3px solid var(--bg-card);
  flex-shrink: 0;
}

/* ====================== CONTAINERS ====================== */
.container { padding: 16px; }
.page-content { min-height: calc(100vh - var(--nav-height) - var(--bottom-nav)); }

/* ====================== CARDS ====================== */
.card {
  background: var(--bg-card); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden;
}
.card-body { padding: 16px; }
.card-header { padding: 16px; border-bottom: 1px solid var(--border); }

/* ====================== BUTTONS ====================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px; padding: 14px 24px; border-radius: var(--radius-sm);
  font-family: var(--font-main); font-size: 15px; font-weight: 600;
  cursor: pointer; border: none; transition: all 0.2s; text-decoration: none;
  white-space: nowrap;
}
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff; box-shadow: 0 4px 16px rgba(255,107,53,0.35);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(255,107,53,0.45); }
.btn-secondary { background: var(--secondary); color: #fff; }
.btn-outline {
  background: transparent; color: var(--primary);
  border: 2px solid var(--primary);
}
.btn-outline:hover { background: var(--primary); color: #fff; }
.btn-ghost { background: var(--bg); color: var(--text); }
.btn-ghost:hover { background: var(--border); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-success { background: var(--success); color: #fff; }
.btn-sm { padding: 8px 16px; font-size: 13px; border-radius: var(--radius-xs); }
.btn-block { width: 100%; }
.btn-icon { padding: 12px; border-radius: 50%; }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* ====================== FORMS ====================== */
.form-group { margin-bottom: 16px; }
.form-label {
  display: block; font-size: 13px; font-weight: 600;
  color: var(--text-muted); margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.5px;
}
.form-control {
  width: 100%; padding: 14px 16px;
  border: 2px solid var(--border); border-radius: var(--radius-sm);
  font-family: var(--font-main); font-size: 15px; color: var(--text);
  background: var(--bg-card); transition: border-color 0.2s, box-shadow 0.2s;
  -webkit-appearance: none; appearance: none;
}
.form-control:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(255,107,53,0.12);
}
.form-control::placeholder { color: var(--text-light); }
.input-group { position: relative; }
.input-group .form-control { padding-left: 44px; }
.input-group .input-icon {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  color: var(--text-muted); font-size: 18px;
}
.input-group .input-icon-right {
  position: absolute; right: 14px; top: 50%; transform: translateY(-50%);
  color: var(--text-muted); font-size: 18px; cursor: pointer;
}

/* Currency prefix inputs */
.price-input-wrap { position: relative; display: flex; align-items: stretch; }
.price-input-wrap .currency-prefix {
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-secondary, #f3f4f6); border: 1.5px solid var(--border, #e5e7eb);
  border-right: none; border-radius: var(--radius-sm, 8px) 0 0 var(--radius-sm, 8px);
  padding: 0 13px; font-size: 15px; font-weight: 700;
  color: var(--text-muted, #6b7280); white-space: nowrap; min-width: 44px;
  user-select: none;
}
.price-input-wrap .form-control {
  border-radius: 0 var(--radius-sm, 8px) var(--radius-sm, 8px) 0 !important;
  flex: 1;
}
.form-error { color: var(--danger); font-size: 12px; margin-top: 4px; }
.form-hint { color: var(--text-muted); font-size: 12px; margin-top: 4px; }

/* ====================== ALERTS ====================== */
.alert {
  padding: 14px 16px; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 500; margin-bottom: 16px;
  display: flex; align-items: flex-start; gap: 10px;
}
.alert-success { background: #dcfce7; color: #166534; border-left: 4px solid var(--success); }
.alert-danger { background: #fee2e2; color: #991b1b; border-left: 4px solid var(--danger); }
.alert-warning { background: #fef3c7; color: #92400e; border-left: 4px solid var(--warning); }
.alert-info { background: #dbeafe; color: #1e40af; border-left: 4px solid var(--info); }

/* ====================== HERO / BANNER ====================== */
.hero-section {
  background: linear-gradient(135deg, var(--secondary) 0%, var(--secondary-light) 100%);
  padding: 32px 20px; color: #fff; position: relative; overflow: hidden;
}
.hero-section::before {
  content: ''; position: absolute; top: -50px; right: -50px;
  width: 200px; height: 200px; border-radius: 50%;
  background: rgba(255,107,53,0.15);
}
.hero-section::after {
  content: ''; position: absolute; bottom: -60px; left: -30px;
  width: 150px; height: 150px; border-radius: 50%;
  background: rgba(255,215,0,0.08);
}
.hero-title { font-size: 26px; line-height: 1.3; margin-bottom: 10px; }
.hero-subtitle { font-size: 14px; opacity: 0.8; margin-bottom: 20px; }
.hero-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,0.15); backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.2);
  padding: 6px 12px; border-radius: 50px; font-size: 12px; font-weight: 600;
  margin-bottom: 16px;
}

/* ====================== SEARCH BAR ====================== */
.search-bar-wrap { padding: 16px; background: var(--bg-card); }
.search-bar {
  display: flex; align-items: center; gap: 10px;
  background: var(--bg); border-radius: var(--radius-sm);
  padding: 12px 16px; border: 2px solid transparent;
  transition: border-color 0.2s;
}
.search-bar:focus-within { border-color: var(--primary); background: var(--bg-card); }
.search-bar i { color: var(--text-muted); font-size: 18px; }
.search-bar input {
  flex: 1; border: none; background: transparent;
  font-family: var(--font-main); font-size: 15px; color: var(--text);
}
.search-bar input:focus { outline: none; }
.search-bar input::placeholder { color: var(--text-muted); }

/* ====================== CATEGORIES ====================== */
.section-title {
  font-family: var(--font-display); font-size: 18px; font-weight: 700;
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px;
}
.section-title a { font-size: 13px; color: var(--primary); font-weight: 600; font-family: var(--font-main); }

.categories-scroll {
  display: flex; gap: 12px; overflow-x: auto; padding-bottom: 8px;
  scrollbar-width: none;
}
.categories-scroll::-webkit-scrollbar { display: none; }

.category-chip {
  flex-shrink: 0; display: flex; flex-direction: column; align-items: center;
  gap: 6px; padding: 12px 16px; border-radius: var(--radius-sm);
  background: var(--bg-card); box-shadow: var(--shadow);
  cursor: pointer; text-decoration: none; color: var(--text);
  transition: all 0.2s; min-width: 80px;
}
.category-chip:hover, .category-chip.active {
  background: var(--primary); color: #fff;
  box-shadow: 0 4px 16px rgba(255,107,53,0.3);
}
.category-chip i { font-size: 24px; }
.category-chip span { font-size: 11px; font-weight: 600; text-align: center; line-height: 1.2; }

/* ====================== PROFESSIONAL CARD ====================== */
.pro-card {
  background: var(--bg-card); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden;
  cursor: pointer; transition: transform 0.2s, box-shadow 0.2s;
  text-decoration: none; color: var(--text); display: block;
}
.pro-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }

.pro-card-img {
  width: 100%; height: 160px; object-fit: cover;
  background: linear-gradient(135deg, var(--bg), var(--border));
  position: relative;
}
.pro-card-img img { width: 100%; height: 100%; object-fit: cover; }
.pro-card-badge {
  position: absolute; top: 10px; left: 10px;
  background: var(--primary); color: #fff;
  font-size: 10px; font-weight: 700; padding: 3px 8px; border-radius: 50px;
}
.pro-card-verified {
  position: absolute; top: 10px; right: 10px;
  background: var(--success); color: #fff;
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-size: 14px;
}

/* Availability pill — overlays bottom-right of the card image */
.pro-card-avail {
  position: absolute;
  bottom: 10px;
  right: 10px;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 50px;
  border: 2px solid rgba(255,255,255,0.8);
  backdrop-filter: blur(6px);
  letter-spacing: 0.3px;
  text-transform: capitalize;
  white-space: nowrap;
}
.pro-card-avail.available   { background: rgba(34,197,94,0.9);  color: #fff; }
.pro-card-avail.busy        { background: rgba(245,158,11,0.9); color: #fff; }
.pro-card-avail.unavailable { background: rgba(239,68,68,0.85); color: #fff; }

.pro-card-body { padding: 14px; }
.pro-card-header { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.pro-avatar {
  width: 48px; height: 48px; border-radius: 50%; object-fit: cover;
  border: 3px solid var(--bg-card); box-shadow: 0 2px 8px rgba(0,0,0,0.12);
  flex-shrink: 0;
}
.pro-name { font-weight: 700; font-size: 15px; margin-bottom: 2px; }
.pro-title { font-size: 12px; color: var(--text-muted); }

.pro-stats { display: flex; gap: 12px; margin-bottom: 10px; }
.pro-stat { display: flex; align-items: center; gap: 4px; font-size: 12px; color: var(--text-muted); }
.pro-stat i { font-size: 12px; }
.pro-stat .star { color: var(--warning); }

.pro-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.pro-tag {
  font-size: 11px; font-weight: 600; padding: 4px 10px;
  border-radius: 50px; background: rgba(255,107,53,0.1); color: var(--primary);
}

.pro-card-footer {
  padding: 10px 14px; border-top: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.pro-rate { font-family: var(--font-display); font-weight: 700; font-size: 16px; color: var(--primary); }
.pro-rate small { font-size: 10px; color: var(--text-muted); font-weight: 500; font-family: var(--font-main); }
.pro-rate-type {
  font-size: 10px; font-weight: 600; color: var(--text-muted);
  background: var(--bg); padding: 2px 7px; border-radius: 50px;
  border: 1px solid var(--border);
}

/* Grid layouts */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid-1 { display: grid; grid-template-columns: 1fr; gap: 12px; }

/* ====================== PROFILE / DETAIL ====================== */
.profile-cover {
  width: 100%; height: 180px;
  background: linear-gradient(135deg, var(--secondary), var(--secondary-light));
  position: relative;
}
.profile-cover img { width: 100%; height: 100%; object-fit: cover; }
.profile-avatar-wrap {
  position: absolute; bottom: -52px; left: 20px;
}
.profile-avatar {
  width: 100px; height: 100px; border-radius: 50%;
  object-fit: cover; object-position: top center;
  border: 4px solid var(--bg-card);
  box-shadow: 0 4px 16px rgba(0,0,0,0.18);
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease;
  display: block;
}
.profile-avatar:hover {
  transform: scale(1.05);
  box-shadow: 0 8px 28px rgba(0,0,0,0.22);
}

/* ── Image lightbox ── */
#img-lightbox {
  display: none;
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(0,0,0,0.92);
  align-items: center; justify-content: center;
  padding: 20px;
  cursor: zoom-out;
}
#img-lightbox.open { display: flex; }
#img-lightbox img {
  max-width: 92vw; max-height: 88vh;
  border-radius: 16px;
  object-fit: contain;
  box-shadow: 0 24px 80px rgba(0,0,0,0.6);
  animation: lbIn .22s cubic-bezier(0.4,0,0.2,1);
}
@keyframes lbIn {
  from { opacity:0; transform:scale(.88); }
  to   { opacity:1; transform:scale(1); }
}
#img-lightbox-close {
  position: absolute; top: 16px; right: 20px;
  width: 40px; height: 40px; border-radius: 50%;
  background: rgba(255,255,255,0.15);
  color: #fff; font-size: 20px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; border: none;
  transition: background .18s;
}
#img-lightbox-close:hover { background: rgba(255,255,255,0.28); }
.availability-dot {
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--success); border: 3px solid var(--bg-card);
  position: absolute; bottom: 2px; right: 2px;
}
.availability-dot.busy { background: var(--warning); }
.availability-dot.unavailable { background: var(--danger); }

/* ====================== RATING STARS ====================== */
.stars { display: flex; gap: 2px; }
.stars i { font-size: 14px; }
.star-fill { color: var(--warning); }
.star-empty { color: var(--border); }

/* ====================== TABS ====================== */
.tabs { display: flex; border-bottom: 2px solid var(--border); margin-bottom: 20px; }
.tab-btn {
  flex: 1; padding: 12px 8px; text-align: center;
  font-size: 13px; font-weight: 600; color: var(--text-muted);
  cursor: pointer; border: none; background: none;
  border-bottom: 2px solid transparent; margin-bottom: -2px;
  transition: all 0.2s;
}
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* ====================== MESSAGES ====================== */
.conversation-item {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; border-bottom: 1px solid var(--border);
  cursor: pointer; text-decoration: none; color: var(--text);
  transition: background 0.15s;
}
.conversation-item:hover { background: var(--bg); }
.conv-avatar { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.conv-info { flex: 1; min-width: 0; }
.conv-name { font-weight: 700; font-size: 15px; margin-bottom: 3px; }
.conv-preview { font-size: 13px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.conv-time { font-size: 11px; color: var(--text-muted); }
.conv-unread {
  background: var(--primary); color: #fff;
  font-size: 10px; font-weight: 700;
  width: 20px; height: 20px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}

.chat-wrap {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.chat-messages {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 16px;
  -webkit-overflow-scrolling: touch;
  display: flex; flex-direction: column; gap: 12px;
}

/* Typing dots animation */
.typing-dots { display: inline-flex; gap: 4px; align-items: center; }
.typing-dots span {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--text-muted); opacity: 0.6;
  animation: typingBounce 1.2s infinite ease-in-out;
}
.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typingBounce {
  0%,80%,100% { transform: translateY(0); opacity:0.4; }
  40% { transform: translateY(-6px); opacity:1; }
}

/* Quote cards inside chat bubbles */
.quote-card {
  background: linear-gradient(135deg,rgba(255,107,53,0.08),rgba(255,140,80,0.04));
  border: 2px solid rgba(255,107,53,0.3);
  border-radius: 14px; padding: 14px;
  max-width: 280px; font-size: 13px;
  color: var(--text);
}
.quote-card.accepted {
  background: linear-gradient(135deg,rgba(34,197,94,0.08),rgba(34,197,94,0.03));
  border-color: rgba(34,197,94,0.35);
}
/* Quote cards inherit text color from bubble — override for sent (white) bubbles */
.chat-bubble.sent .quote-card { color: var(--text); }
/* Card-type bubbles (quote request / quotation) reset bubble background so the card shows properly */
.chat-bubble.has-card {
  background: transparent !important;
  padding: 0 !important;
  box-shadow: none !important;
  color: var(--text) !important;
}
.chat-bubble.has-card .chat-time {
  padding: 4px 4px 0;
  color: var(--text-muted) !important;
  opacity: 0.8;
}
.chat-bubble {
  max-width: 80%; border-radius: var(--radius-sm);
  padding: 12px 14px; font-size: 14px; line-height: 1.5;
  position: relative;
}
.chat-bubble.sent {
  align-self: flex-end; background: var(--primary); color: #fff;
  border-bottom-right-radius: 4px;
}
.chat-bubble.received {
  align-self: flex-start; background: var(--bg-card); color: var(--text);
  box-shadow: var(--shadow); border-bottom-left-radius: 4px;
}
.chat-time { font-size: 10px; opacity: 0.7; margin-top: 4px; text-align: right; }
.chat-input-bar {
  padding: 12px 16px; background: var(--bg-card);
  border-top: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px;
}
.chat-input {
  flex: 1; border: 2px solid var(--border); border-radius: 24px;
  padding: 10px 16px; font-family: var(--font-main); font-size: 15px;
  background: var(--bg);
}
.chat-input:focus { outline: none; border-color: var(--primary); }
.chat-send-btn {
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--primary); color: #fff;
  border: none; cursor: pointer; font-size: 18px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; transition: background 0.2s;
}
.chat-keyword-warning {
  background: #fef3c7; border: 1px solid #f59e0b;
  padding: 10px 14px; border-radius: var(--radius-xs);
  font-size: 13px; color: #92400e; margin-bottom: 10px;
  display: none;
}

/* ====================== ONBOARDING / AUTH ====================== */
.auth-wrap {
  min-height: 100vh; display: flex; flex-direction: column;
  padding: 0; background: var(--bg);
}
.auth-hero {
  background: linear-gradient(160deg, var(--secondary), var(--secondary-light));
  padding: 50px 24px 40px; text-align: center; color: #fff;
  position: relative; overflow: hidden;
}
.auth-hero-deco {
  position: absolute; width: 300px; height: 300px; border-radius: 50%;
  background: rgba(255,107,53,0.12); top: -80px; right: -80px;
}
.auth-hero-logo { font-family: var(--font-display); font-size: 40px; font-weight: 800; margin-bottom: 8px; }
.auth-hero-logo span { color: var(--primary); }
.auth-hero-tag { opacity: 0.8; font-size: 14px; }

.role-select { padding: 24px 20px; }
.role-card {
  background: var(--bg-card); border-radius: var(--radius); padding: 20px;
  box-shadow: var(--shadow); display: flex; align-items: center; gap: 16px;
  cursor: pointer; border: 2px solid transparent;
  transition: all 0.2s; text-decoration: none; color: var(--text);
  margin-bottom: 14px;
}
.role-card:hover, .role-card.selected {
  border-color: var(--primary);
  box-shadow: 0 4px 20px rgba(255,107,53,0.2);
}
.role-icon {
  width: 56px; height: 56px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; flex-shrink: 0;
}
.role-icon.client { background: rgba(59,130,246,0.12); color: var(--info); }
.role-icon.pro { background: rgba(255,107,53,0.12); color: var(--primary); }
.role-title { font-weight: 700; font-size: 17px; margin-bottom: 4px; }
.role-desc { font-size: 13px; color: var(--text-muted); }
.role-arrow { margin-left: auto; color: var(--text-muted); font-size: 18px; }

/* Payment card */
.payment-card {
  background: linear-gradient(135deg, var(--secondary), #2D2D44);
  border-radius: var(--radius); padding: 24px; color: #fff; margin: 16px 0;
  position: relative; overflow: hidden;
}
.payment-card::before {
  content: ''; position: absolute; top: -40px; right: -40px;
  width: 120px; height: 120px; border-radius: 50%;
  background: rgba(255,107,53,0.2);
}
.payment-amount { font-family: var(--font-display); font-size: 36px; font-weight: 800; }
.payment-label { opacity: 0.7; font-size: 13px; margin-bottom: 4px; }

/* ====================== UTILITY ====================== */
.flex { display: flex; } .flex-col { flex-direction: column; }
.items-center { align-items: center; } .justify-between { justify-content: space-between; }
.justify-center { justify-content: center; } .gap-8 { gap: 8px; }
.gap-12 { gap: 12px; } .gap-16 { gap: 16px; }
.text-center { text-align: center; } .text-muted { color: var(--text-muted); }
.text-primary { color: var(--primary); } .text-success { color: var(--success); }
.text-danger { color: var(--danger); } .text-warning { color: var(--warning); }
.font-bold { font-weight: 700; } .font-semibold { font-weight: 600; }
.text-sm { font-size: 13px; } .text-xs { font-size: 11px; } .text-lg { font-size: 18px; }
.mt-4 { margin-top: 4px; } .mt-8 { margin-top: 8px; } .mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; } .mt-20 { margin-top: 20px; } .mt-24 { margin-top: 24px; }
.mb-4 { margin-bottom: 4px; } .mb-8 { margin-bottom: 8px; } .mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; } .mb-20 { margin-bottom: 20px; }
.p-16 { padding: 16px; } .p-20 { padding: 20px; }
.w-full { width: 100%; } .hidden { display: none; }
.divider { border: none; border-top: 1px solid var(--border); margin: 20px 0; }
.truncate { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }

/* Status badges */
.status-badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 700; padding: 4px 10px;
  border-radius: 50px; text-transform: uppercase; letter-spacing: 0.5px;
}
.status-active { background: #dcfce7; color: #166534; }
.status-pending { background: #fef3c7; color: #92400e; }
.status-suspended { background: #fee2e2; color: #991b1b; }
.status-inactive { background: var(--border); color: var(--text-muted); }

/* Loading spinner */
.spinner {
  width: 40px; height: 40px; border-radius: 50%;
  border: 4px solid var(--border);
  border-top-color: var(--primary);
  animation: spin 0.8s linear infinite;
  margin: 40px auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Empty state */
.empty-state {
  text-align: center; padding: 60px 24px;
}
.empty-state i { font-size: 64px; color: var(--text-light); margin-bottom: 16px; display: block; }
.empty-state h3 { margin-bottom: 8px; }
.empty-state p { color: var(--text-muted); font-size: 14px; }

/* Toast */
.toast-container {
  position: fixed; top: 80px; right: 16px; z-index: 9999;
  display: flex; flex-direction: column; gap: 8px;
  max-width: calc(480px - 32px);
}
.toast {
  background: var(--secondary); color: #fff;
  padding: 14px 18px; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 500;
  animation: slideIn 0.3s ease; box-shadow: var(--shadow-lg);
  display: flex; align-items: center; gap: 10px;
}
.toast.success { background: var(--success); }
.toast.danger { background: var(--danger); }
.toast.warning { background: var(--warning); color: var(--text); }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* Bottom sheet / modal */
.overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5);
  z-index: 500; display: none;
}
.overlay.active { display: block; }
.bottom-sheet {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 480px; background: var(--bg-card);
  border-radius: var(--radius) var(--radius) 0 0;
  z-index: 600; padding: 20px;
  transform: translateX(-50%) translateY(100%);
  transition: transform 0.3s ease;
  padding-bottom: calc(20px + env(safe-area-inset-bottom));
}
.bottom-sheet.active { transform: translateX(-50%) translateY(0); }
.sheet-handle {
  width: 40px; height: 4px; background: var(--border);
  border-radius: 2px; margin: 0 auto 20px;
}

/* Map container */
.map-container { width: 100%; height: 250px; border-radius: var(--radius); overflow: hidden; }

/* Portfolio grid */
.portfolio-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 4px; }
.portfolio-item {
  aspect-ratio: 1; overflow: hidden; cursor: pointer; border-radius: 4px;
}
.portfolio-item img { width: 100%; height: 100%; object-fit: cover; }

/* Notification item */
.notif-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 16px; border-bottom: 1px solid var(--border);
  cursor: pointer; transition: background 0.15s;
}
.notif-item:hover { background: var(--bg); }
.notif-item.unread { background: rgba(255,107,53,0.04); }
.notif-icon {
  width: 44px; height: 44px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; flex-shrink: 0;
}
.notif-title { font-weight: 600; font-size: 14px; margin-bottom: 3px; }
.notif-body { font-size: 13px; color: var(--text-muted); line-height: 1.4; }
.notif-time { font-size: 11px; color: var(--text-light); margin-top: 4px; }
.unread-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--primary); margin-top: 6px; flex-shrink: 0;
}

/* Stat card */
.stat-card {
  background: var(--bg-card); border-radius: var(--radius);
  padding: 16px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 8px;
}
.stat-value { font-family: var(--font-display); font-size: 28px; font-weight: 800; color: var(--primary); }
.stat-label { font-size: 13px; color: var(--text-muted); }
.stat-icon { font-size: 28px; align-self: flex-end; opacity: 0.2; margin-top: -20px; }

/* Review card */
.review-card { background: var(--bg-card); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); margin-bottom: 12px; }
.review-header { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.review-avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }
.review-meta { flex: 1; }
.review-name { font-weight: 700; font-size: 14px; }
.review-date { font-size: 11px; color: var(--text-muted); }

/* Job card */
.job-card { background: var(--bg-card); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); margin-bottom: 12px; cursor: pointer; transition: box-shadow 0.2s; }
.job-card:hover { box-shadow: var(--shadow-lg); }
.job-title { font-weight: 700; font-size: 16px; margin-bottom: 6px; }
.job-meta { display: flex; flex-wrap: wrap; gap: 10px; font-size: 12px; color: var(--text-muted); margin-bottom: 10px; }
.job-meta i { color: var(--primary); }
.job-budget { font-family: var(--font-display); font-weight: 700; color: var(--success); font-size: 16px; }

/* Section */
.section { padding: 20px 16px; }
.section + .section { padding-top: 0; }

/* Safe area */
.safe-bottom { padding-bottom: env(safe-area-inset-bottom); }

/* Scroll horizontal */
.scroll-x { overflow-x: auto; scrollbar-width: none; }
.scroll-x::-webkit-scrollbar { display: none; }

/* Filter pills */
.filter-pills { display: flex; gap: 8px; overflow-x: auto; padding: 12px 16px; scrollbar-width: none; }
.filter-pills::-webkit-scrollbar { display: none; }
.filter-pill {
  flex-shrink: 0; padding: 8px 16px; border-radius: 50px;
  font-size: 13px; font-weight: 600; cursor: pointer;
  border: 2px solid var(--border); background: var(--bg-card);
  color: var(--text-muted); transition: all 0.2s;
}
.filter-pill.active { border-color: var(--primary); background: var(--primary); color: #fff; }

/* Skeleton loader */
.skeleton { background: linear-gradient(90deg, var(--border) 25%, var(--bg) 50%, var(--border) 75%); background-size: 200% 100%; animation: skeleton 1.5s infinite; border-radius: 8px; }
@keyframes skeleton { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* Scroll top btn */
/* ====================== COPYRIGHT FOOTER ====================== */
.site-copyright {
  text-align: center;
  font-size: 11px;
  color: var(--text-muted, #8A8A9A);
  padding: 16px 16px calc(var(--bottom-nav) + env(safe-area-inset-bottom) + 20px);
  border-top: 1px solid var(--border, #E8E8F0);
  margin-top: 32px;
  line-height: 1.6;
}
.site-copyright a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
}
.site-copyright a:hover { text-decoration: underline; }

.scroll-top {
  position: fixed; bottom: calc(var(--bottom-nav) + 16px); right: 16px;
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--primary); color: #fff; border: none;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 18px; box-shadow: var(--shadow-lg);
  transition: opacity 0.3s; z-index: 1100; opacity: 0;
}
.scroll-top.visible { opacity: 1; }

/* ====================== PC / DESKTOP LAYOUT MODE ====================== */

/* PC topbar: always hidden by default, shown only on desktop in pc-mode */
.pc-topbar { display: none !important; }

@media (min-width: 769px) {
  body.pc-mode {
    max-width: var(--pc-max-width, 1200px);
    background: var(--bg);
    padding-bottom: 0;
  }
  /* Show PC topbar, hide mobile header and bottom nav */
  body.pc-mode .pc-topbar  { display: flex !important; }
  body.pc-mode .app-header { display: none !important; visibility: hidden !important; height: 0 !important; overflow: hidden !important; }
  body.pc-mode .bottom-nav { display: none !important; }

  /* PC Sidebar navigation */
  body.pc-mode .pc-sidebar {
    display: flex;
    flex-direction: column;
    width: 240px;
    min-height: calc(100vh - 72px);
    background: var(--bg-card);
    border-right: 1px solid var(--border);
    position: sticky;
    top: 72px;
    align-self: flex-start;
    padding: 20px 0;
    box-shadow: 2px 0 8px rgba(0,0,0,0.04);
  }

  body.pc-mode .pc-sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.2s;
    border-left: 3px solid transparent;
  }
  body.pc-mode .pc-sidebar-link:hover { color: var(--text); background: var(--bg); }
  body.pc-mode .pc-sidebar-link.active { color: var(--primary); border-left-color: var(--primary); background: rgba(255,107,53,0.06); }
  body.pc-mode .pc-sidebar-link i { width: 20px; font-size: 18px; }
  body.pc-mode .pc-sidebar-section { padding: 8px 20px; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: var(--text-light); margin-top: 12px; }

  /* Main layout wrapper */
  body.pc-mode .pc-layout {
    display: flex;
    flex-direction: row;
    min-height: calc(100vh - 72px);
    align-items: flex-start;
    max-width: var(--pc-max-width, 1200px);
    margin: 0 auto;
  }
  body.pc-mode .pc-sidebar {
    order: -1; /* sidebar always left */
    flex-shrink: 0;
  }
  body.pc-mode .pc-main {
    flex: 1;
    min-width: 0;
    padding: 24px 32px;
    order: 0;
  }
  /* page-content is pc-main — keep min-height */
  body.pc-mode .page-content { min-height: calc(100vh - 72px); }

  /* Wider grids on PC */
  body.pc-mode .grid-2 { grid-template-columns: repeat(3, 1fr); }
  body.pc-mode .pro-card-img { height: 200px; }

  /* Search page splits */
  body.pc-mode .search-pc-layout {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 24px;
    align-items: start;
  }
  body.pc-mode .search-filters-sidebar {
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 16px;
    position: sticky;
    top: 96px;
  }
  body.pc-mode .filter-pills { flex-wrap: wrap; padding: 0; }
  body.pc-mode .filter-pill { flex-shrink: 1; }

  /* Hero wider */
  body.pc-mode .hero-section { padding: 56px 48px; }
  body.pc-mode .hero-title { font-size: 36px; }

  /* Chat handled by chat-specific CSS in chat.php */

  /* Remove mobile constraints */
  body.pc-mode .auth-wrap { max-width: 480px; margin: 40px auto; border-radius: var(--radius); box-shadow: var(--shadow-lg); overflow: hidden; }

  /* Topbar PC logout/profile */
  body.pc-mode .pc-topbar-user {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    background: var(--bg);
    text-decoration: none;
    color: var(--text);
    font-size: 13px;
    font-weight: 600;
  }
  body.pc-mode .pc-topbar-user img { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; }
}

/* Mobile: restore mobile header/nav, hide pc-topbar and sidebar */
@media (max-width: 768px) {
  .pc-topbar               { display: none !important; }  /* never on mobile */
  body.pc-mode .app-header { display: flex !important; }  /* restore mobile header */
  body.pc-mode .bottom-nav { display: flex !important; }  /* restore bottom nav */
  body.pc-mode .pc-sidebar { display: none !important; }
  body.pc-mode .pc-layout  { display: block; }
  body.pc-mode .pc-main    { padding: 0; }
  body.pc-mode {
    max-width: 480px;
    padding-bottom: calc(var(--bottom-nav) + env(safe-area-inset-bottom));
  }
}
