/* services.css — styles spécifiques page Mes services */

/* ── Shell ── */
.services-shell { }

/* ── Page header ── */
.svc-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.svc-page-kicker {
  text-transform: uppercase;
  letter-spacing: .12em;
  font-size: 11px;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 4px;
}
.svc-page-title {
  margin: 0;
  font-size: 22px;
  font-weight: 800;
}
.svc-plan-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.svc-plan-pill {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 999px;
  background: #f1f5f9;
  border: 1px solid var(--border);
  color: var(--muted);
}
.svc-plan-pill--essential { background:#f0f9ff; color:#0284c7; border-color:#bae6fd; }
.svc-plan-pill--pro       { background:var(--primary-bg); color:var(--primary); border-color:rgba(94,92,230,.25); }
.svc-plan-pill--company   { background:#faf5ff; color:#7c3aed; border-color:#ddd6fe; }
.svc-act-count {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}

/* ── Tabs with icons ── */
.svc-tabs { margin-bottom: 20px; }
.svc-tabs .tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.svc-tabs .tab svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

/* ── Search bar ── */
.svc-search-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 8px 14px;
  margin-bottom: 16px;
  box-shadow: 0 1px 3px rgba(15,23,42,.05);
}
.svc-search-bar > svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--muted);
}
.svc-search-input {
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  background: transparent !important;
  font-size: 14px;
  width: 100%;
  padding: 0 !important;
  height: auto !important;
}
.svc-act-limit-badge {
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  background: var(--bg);
  border: 1px solid var(--border-light);
  padding: 3px 10px;
  border-radius: 999px;
  white-space: nowrap;
}

/* ── Empty state ── */
.svc-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 32px 20px;
  border: 1px dashed var(--border);
  border-radius: var(--r-lg);
  color: var(--muted);
  text-align: center;
  margin-bottom: 12px;
}
.svc-empty-state svg {
  width: 32px;
  height: 32px;
  opacity: .4;
}
.svc-empty-state p {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
}
.svc-empty-state p span {
  font-size: 12px;
  opacity: .7;
}

/* ── Field hint ── */
.services-shell .field-hint {
  font-size: 12px;
  color: var(--muted);
  margin-top: 5px;
  line-height: 1.5;
}

/* ── Provider toggle ── */
.svc-toggle-label {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
}
.svc-toggle-label input[type="checkbox"] {
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--primary);
  cursor: pointer;
}
.svc-toggle-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.svc-toggle-hint {
  font-size: 12px;
  color: var(--muted);
  font-weight: 400;
}

/* ── Availability grid ── */
.svc-avail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (max-width: 560px) {
  .svc-avail-grid { grid-template-columns: 1fr; }
}

.svc-check-label {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--bg);
  cursor: pointer;
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.svc-check-label:hover {
  border-color: var(--primary);
  background: var(--primary-bg);
}
.svc-check-label input[type="checkbox"] {
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
  cursor: pointer;
}
.svc-check-label input[type="checkbox"]:checked ~ .svc-check-body {
  color: var(--primary);
  font-weight: 600;
}
.svc-check-label:has(input:checked) {
  border-color: var(--primary);
  background: var(--primary-bg);
  box-shadow: 0 0 0 3px rgba(94,92,230,.10);
}
.svc-check-body {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.3;
}
.svc-check-icon {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  color: var(--primary);
}
.svc-check-label--disabled {
  opacity: .55;
  cursor: not-allowed;
  pointer-events: none;
}
.pref-chip--locked {
  opacity: .45;
  cursor: not-allowed !important;
  pointer-events: none;
  filter: grayscale(.5);
}
.svc-chip-lock {
  font-size: 11px;
  color: var(--muted);
  font-weight: 500;
  margin-left: 4px;
}

/* ── Preferences chips (Mes activités) ── */
.svc-prefs-section {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border-light);
}
.svc-prefs-title {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: .04em;
}
.svc-prefs-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.pref-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--panel-alt);
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  transition: border-color .15s, background .15s, color .15s, box-shadow .15s;
  user-select: none;
}
.pref-chip svg {
  width: 14px; height: 14px;
  flex-shrink: 0;
  color: var(--muted);
  transition: color .15s;
}
.pref-chip input[type="checkbox"] { display: none; }
.pref-chip:hover {
  border-color: var(--primary);
  background: var(--primary-bg);
  color: var(--primary);
}
.pref-chip:hover svg { color: var(--primary); }
.pref-chip--on,
.pref-chip:has(input:checked) {
  border-color: var(--primary);
  background: var(--primary-bg);
  color: var(--primary);
  font-weight: 600;
  box-shadow: 0 0 0 3px rgba(94,92,230,.10);
}
.pref-chip--on svg,
.pref-chip:has(input:checked) svg { color: var(--primary); }

/* ── Inactive notice ── */
.svc-inactive-notice {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border: 1px dashed var(--border);
  border-radius: var(--r-lg);
  background: var(--bg);
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 16px;
}
.svc-inactive-notice svg {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  color: var(--primary);
  opacity: .7;
}

/* ── Save button area ── */
.svc-actions {
  margin-top: 16px;
  display: flex;
  gap: 10px;
}

/* ── Services meta ── */
.services-meta {
  margin: 12px 0 8px;
  font-size: 13px;
}


/* ── Activity search box ── */
.helpbox {
  position: relative;
}
.help-suggest {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 200;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--sh-md);
  max-height: 220px;
  overflow-y: auto;
  margin-top: 4px;
}
.help-suggest .row {
  padding: 9px 14px;
  font-size: 13px;
  cursor: pointer;
  transition: background .1s;
}
.help-suggest .row:hover {
  background: var(--primary-bg);
  color: var(--primary);
}

/* ── Keyword chip row ── */
.kwpicked { display: flex; flex-direction: column; gap: 8px; }

.kw-chip {
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--panel);
  overflow: hidden;
  transition: box-shadow .15s;
}
.kw-chip:hover { box-shadow: var(--sh-md); }

.kw-chip-title-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px 10px 14px;
  background: var(--bg);
  border-bottom: 1px solid var(--border-light);
}
.kw-title {
  flex: 1;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kw-chip-top {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 10px 14px;
}

.kw-chip-prefs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 14px 12px;
  border-top: 1px solid var(--border-light);
  background: var(--bg);
}
.kw-chip-prefs .pref-chip {
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 999px;
}
.kw-chip-prefs .pref-chip svg {
  width: 12px;
  height: 12px;
}

.kw-select {
  height: 34px;
  font-size: 12px;
  font-weight: 500;
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--panel);
  color: var(--text);
  width: 100%;
}
.kw-select:focus { outline: 2px solid var(--primary); outline-offset: 1px; }

.kw-x {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border: 1px solid var(--border-light);
  border-radius: var(--r-sm);
  background: transparent;
  cursor: pointer;
  font-size: 16px;
  color: var(--muted);
  transition: background .15s, color .15s, border-color .15s;
  line-height: 1;
}
.kw-x:hover {
  background: #fef2f2;
  color: #dc2626;
  border-color: #fca5a5;
}

/* ── Responsive ── */
@media (max-width: 860px) {
  /* Header de page services */
  .svc-page-header { flex-direction: column; align-items: flex-start; gap: 10px; }
  .svc-plan-badge { width: 100%; justify-content: space-between; }

  /* Actions save */
  .svc-actions { flex-direction: column; }
  .svc-actions .btn { width: 100%; }

  /* Activity chips */
  .kw-chip-title-bar { flex-wrap: wrap; }
}

@media (max-width: 640px) {
  /* Activité en colonne */
  .kw-chip-top { grid-template-columns: 1fr; gap: 6px; }
  .svc-avail-grid { grid-template-columns: 1fr; }

  /* Prefs chips plus petits */
  .kw-chip-prefs .pref-chip { font-size: 10px; padding: 3px 8px; }

  /* Page title */
  .svc-page-title { font-size: 18px; }

  /* Tabs : scroll horizontal */
  .svc-tabs { overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .svc-tabs::-webkit-scrollbar { display: none; }
  .svc-tabs .tab { white-space: nowrap; }
}
