/* ============================================================
   LEXARA — UI Components  (css/components.css)
   ============================================================ */

/* ── Layout helpers ── */
.wrap          { max-width: var(--max-w); margin: 0 auto; padding: 0 28px; }
.pt-nav        { padding-top: var(--nav-h); }
.section       { padding: 88px 0; }
.section-sm    { padding: 56px 0; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.grid-3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 24px; }
.grid-4 { display: grid; grid-template-columns: repeat(4,1fr); gap: 20px; }

.flex          { display: flex; }
.flex-center   { display: flex; align-items: center; justify-content: center; }
.flex-between  { display: flex; align-items: center; justify-content: space-between; }
.flex-wrap     { flex-wrap: wrap; }
.align-start   { align-items: flex-start; }
.gap-6  { gap: 6px; }  .gap-8  { gap: 8px; }
.gap-12 { gap: 12px; } .gap-16 { gap: 16px; }
.gap-20 { gap: 20px; } .gap-24 { gap: 24px; }

/* ── Typography helpers ── */
.text-center  { text-align: center; }
.text-gold    { color: var(--gold); }
.text-muted   { color: var(--grey-400); }
.text-white   { color: var(--white); }
.text-green   { color: var(--green); }
.text-red     { color: var(--red); }
.text-sm      { font-size: .875rem; }
.text-xs      { font-size: .78rem; }
.text-lg      { font-size: 1.05rem; }
.fw-400 { font-weight: 400; }
.fw-500 { font-weight: 500; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.italic { font-style: italic; }

.section-label {
  font-size: .72rem; font-weight: 600;
  letter-spacing: .16em; text-transform: uppercase;
  color: var(--gold); display: block; margin-bottom: 12px;
}
.section-title { font-size: clamp(1.9rem, 3.5vw, 2.8rem); margin-bottom: 8px; }
.rule {
  display: block; width: 40px; height: 2px;
  background: var(--gold); border-radius: 2px; margin-top: 14px;
}
.rule.center { margin: 14px auto 0; }

/* ── Divider ── */
.divider { height: 1px; background: rgba(255,255,255,.07); margin: 24px 0; }

/* ── Card ── */
.card {
  background: var(--navy-2);
  border: var(--border);
  border-radius: var(--r-xl);
  transition: var(--trans);
}
.card:hover { border-color: rgba(201,168,76,.25); box-shadow: var(--shadow-lg); }
.card-pad { padding: 28px; }
.card-sm  { padding: 20px; }

/* ── Highlight box ── */
.highlight-box {
  background: rgba(201,168,76,.08);
  border: var(--border-gold);
  border-radius: var(--r-md);
  padding: 16px;
}

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 26px; border-radius: var(--r-md);
  font-size: .9rem; font-weight: 500;
  cursor: pointer; border: none; transition: var(--trans);
  white-space: nowrap;
}
.btn-lg  { padding: 15px 36px; font-size: 1rem; }
.btn-sm  { padding: 8px 18px;  font-size: .82rem; }
.btn-xs  { padding: 6px 14px;  font-size: .78rem; }
.btn-full { width: 100%; justify-content: center; }

.btn-primary {
  background: var(--gold); color: var(--navy); font-weight: 600;
}
.btn-primary:hover {
  background: var(--gold-lt);
  transform: translateY(-1px);
  box-shadow: var(--shadow-gold);
}
.btn-outline {
  background: transparent; color: var(--white);
  border: 1.5px solid rgba(255,255,255,.22);
}
.btn-outline:hover { border-color: var(--gold); color: var(--gold); }

.btn-ghost {
  background: rgba(255,255,255,.06); color: var(--white);
}
.btn-ghost:hover { background: rgba(255,255,255,.11); }

.btn-danger {
  background: rgba(239,68,68,.15); color: #f87171;
  border: 1px solid rgba(239,68,68,.25);
}
.btn-danger:hover { background: rgba(239,68,68,.28); }

/* Icon buttons */
.icon-btn {
  width: 32px; height: 32px; border-radius: var(--r-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: .75rem; cursor: pointer; border: none; transition: var(--trans);
}
.icon-btn-gold  { background: var(--gold-dim); color: var(--gold); }
.icon-btn-gold:hover  { background: rgba(201,168,76,.3); }
.icon-btn-blue  { background: rgba(59,130,246,.13); color: #60a5fa; }
.icon-btn-blue:hover  { background: rgba(59,130,246,.28); }
.icon-btn-red   { background: rgba(239,68,68,.12); color: #f87171; }
.icon-btn-red:hover   { background: rgba(239,68,68,.26); }
.icon-btn-grey  { background: rgba(255,255,255,.07); color: var(--grey-400); }
.icon-btn-grey:hover  { background: rgba(255,255,255,.13); color: var(--white); }

/* ── Badges ── */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px; border-radius: var(--r-pill);
  font-size: .72rem; font-weight: 600; letter-spacing: .04em;
}
.badge-gold   { background: var(--gold-dim); color: var(--gold-lt); border: var(--border-gold); }
.badge-green  { background: rgba(34,197,94,.12); color: #4ade80; border: 1px solid rgba(34,197,94,.22); }
.badge-blue   { background: rgba(59,130,246,.12); color: #93c5fd; border: 1px solid rgba(59,130,246,.2); }
.badge-red    { background: rgba(239,68,68,.12); color: #f87171; border: 1px solid rgba(239,68,68,.2); }
.badge-grey   { background: rgba(255,255,255,.07); color: var(--grey-400); border: var(--border); }
.badge-amber  { background: rgba(245,158,11,.12); color: #fbbf24; border: 1px solid rgba(245,158,11,.22); }

/* ── Chip tags ── */
.chip {
  display: inline-flex; align-items: center;
  padding: 5px 12px; border-radius: var(--r-pill);
  font-size: .78rem; font-weight: 500;
  background: rgba(201,168,76,.1); color: var(--gold-lt);
  border: var(--border-gold);
}

/* ── Stars ── */
.stars { color: var(--gold); font-size: .82rem; letter-spacing: 1px; }

/* ── Avatar ── */
.avatar {
  border-radius: 50%; object-fit: cover;
  border: 2px solid rgba(201,168,76,.3);
  background: var(--navy-4);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 600; color: var(--gold);
  flex-shrink: 0;
}
.avatar-xs { width: 28px; height: 28px; font-size: .7rem; }
.avatar-sm { width: 38px; height: 38px; font-size: .85rem; }
.avatar-md { width: 52px; height: 52px; font-size: 1.1rem; }
.avatar-lg { width: 80px; height: 80px; font-size: 1.6rem; }
.avatar-xl { width: 110px; height: 110px; font-size: 2rem; }

/* Online dot */
.online-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 6px rgba(34,197,94,.55);
  flex-shrink: 0;
}

/* Verified */
.verified {
  display: inline-flex; align-items: center; gap: 4px;
  color: var(--gold); font-size: .78rem; font-weight: 500;
}

/* ── Form fields ── */
.field          { margin-bottom: 18px; }
.field label {
  display: block; font-size: .78rem; font-weight: 500;
  color: var(--grey-400); letter-spacing: .06em;
  text-transform: uppercase; margin-bottom: 7px;
}
.field input,
.field select,
.field textarea {
  width: 100%; background: var(--navy-3);
  border: 1.5px solid rgba(255,255,255,.1);
  border-radius: var(--r-md); color: var(--white);
  padding: 12px 16px; font-size: .9rem; transition: var(--trans);
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--gold);
  background: var(--navy-4);
  box-shadow: 0 0 0 3px rgba(201,168,76,.1);
}
.field input::placeholder,
.field textarea::placeholder { color: var(--grey-600); }
.field select option           { background: var(--navy-3); }
.field textarea                { resize: vertical; min-height: 100px; }

/* ── Tabs ── */
.tabs {
  display: flex;
  border-bottom: 1px solid rgba(255,255,255,.07);
  margin-bottom: 28px;
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab-btn {
  padding: 12px 20px; font-size: .875rem;
  color: var(--grey-400); cursor: pointer;
  border: none; border-bottom: 2px solid transparent;
  background: none; white-space: nowrap; transition: var(--trans);
}
.tab-btn:hover   { color: var(--white); }
.tab-btn.active  { color: var(--gold); border-bottom-color: var(--gold); }
.tab-pane        { display: none; }
.tab-pane.active { display: block; animation: pageIn .25s ease; }

/* ── Progress bar ── */
.progress { height: 6px; background: rgba(255,255,255,.08); border-radius: 3px; overflow: hidden; }
.progress-fill {
  height: 100%; border-radius: 3px;
  background: linear-gradient(90deg, var(--gold), var(--gold-lt));
  transition: width .8s ease;
}

/* ── Table ── */
.table-wrap {
  background: var(--navy-2); border: var(--border);
  border-radius: var(--r-xl); overflow: hidden;
  overflow-x: auto;
}
.table { width: 100%; border-collapse: collapse; min-width: 600px; }
.table th {
  background: rgba(255,255,255,.03);
  padding: 12px 18px;
  font-size: .72rem; font-weight: 600;
  letter-spacing: .08em; text-transform: uppercase;
  color: var(--grey-600); text-align: left;
  border-bottom: var(--border);
  white-space: nowrap;
}
.table td {
  padding: 14px 18px; font-size: .875rem;
  color: var(--grey-200);
  border-bottom: 1px solid rgba(255,255,255,.04);
  vertical-align: middle;
}
.table tr:last-child td { border-bottom: none; }
.table tr:hover td     { background: rgba(255,255,255,.02); }

/* ── Modal ── */
.modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.72); backdrop-filter: blur(6px);
  z-index: 1100; justify-content: center; align-items: center;
  padding: 20px;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--navy-2); border: 1px solid rgba(255,255,255,.1);
  border-radius: var(--r-xl); width: 100%; max-width: 560px;
  max-height: 90vh; overflow-y: auto;
  animation: pageIn .25s ease;
}
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px 26px; border-bottom: var(--border);
}
.modal-head h3 { font-size: 1.2rem; }
.modal-close {
  background: none; border: none; color: var(--grey-400);
  font-size: 1.1rem; cursor: pointer; padding: 4px;
  transition: var(--trans);
}
.modal-close:hover { color: var(--white); }
.modal-body   { padding: 26px; }
.modal-footer {
  display: flex; gap: 10px; justify-content: flex-end;
  padding: 18px 26px; border-top: var(--border);
}

/* ── Toast ── */
.toast {
  position: fixed; bottom: 28px; right: 28px; z-index: 2000;
  background: var(--navy-3); border: var(--border-gold);
  border-radius: var(--r-md); padding: 14px 20px;
  display: flex; align-items: center; gap: 12px;
  box-shadow: var(--shadow-lg); font-size: .875rem; color: var(--white);
  max-width: 340px; transition: var(--trans);
}
.toast.hidden { transform: translateY(100px); opacity: 0; pointer-events: none; }
.toast i { color: var(--green); font-size: 1rem; flex-shrink: 0; }

/* ── Stat card ── */
.stat-card {
  background: var(--navy-2); border: var(--border);
  border-radius: var(--r-xl); padding: 20px;
}
.stat-icon {
  width: 44px; height: 44px; border-radius: var(--r-md);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 14px; font-size: 1rem;
}
.icon-gold  { background: var(--gold-dim); color: var(--gold); }
.icon-blue  { background: rgba(59,130,246,.14); color: #60a5fa; }
.icon-green { background: rgba(34,197,94,.14);  color: #4ade80; }
.icon-red   { background: rgba(239,68,68,.14);  color: #f87171; }
.stat-value {
  font-family: var(--font-display);
  font-size: 1.7rem; font-weight: 700; color: var(--white); line-height: 1;
}
.stat-label { font-size: .78rem; color: var(--grey-400); margin-top: 4px; }

/* ── Lawyer card (grid) ── */
.lawyer-card {
  background: var(--navy-2); border: var(--border);
  border-radius: var(--r-xl); padding: 24px;
  cursor: pointer; transition: var(--trans);
}
.lawyer-card:hover {
  border-color: rgba(201,168,76,.35);
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}
.lawyer-fee          { font-size: 1.15rem; font-weight: 700; color: var(--gold); }
.lawyer-fee span     { font-size: .78rem; color: var(--grey-400); font-weight: 400; }
.lawyer-avail-label  { font-size: .7rem; color: var(--green); font-weight: 500; }

/* ── Pagination ── */
.pagination { display: flex; align-items: center; gap: 6px; justify-content: center; margin-top: 36px; }
.page-btn {
  width: 38px; height: 38px; border-radius: var(--r-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: .875rem; cursor: pointer;
  background: var(--navy-2); border: var(--border);
  color: var(--grey-400); transition: var(--trans);
}
.page-btn:hover,
.page-btn.active { background: var(--gold); border-color: var(--gold); color: var(--navy); }

/* ── Responsive ── */
@media (max-width: 1024px) {
  .grid-4  { grid-template-columns: repeat(2,1fr); }
}
@media (max-width: 768px) {
  .wrap    { padding: 0 18px; }
  .grid-2,
  .grid-3  { grid-template-columns: 1fr; }
  .grid-4  { grid-template-columns: 1fr 1fr; }
  .section { padding: 56px 0; }
  .section-sm { padding: 36px 0; }
  .btn-lg  { padding: 13px 28px; font-size: .95rem; }
  .hide-mobile { display: none !important; }
  .show-mobile { display: flex !important; }
}
@media (max-width: 480px) {
  .grid-4  { grid-template-columns: 1fr; }
  .grid-2  { grid-template-columns: 1fr; }
}
