@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;600&display=swap");

:root {
  /* Thème Nextcloud adapté */
  --bg: rgba(255, 255, 255, 0.95);
  --bg2: rgba(255, 255, 255, 0.98);
  --bg3: rgba(240, 245, 250, 0.95);
  --border: rgba(0, 102, 204, 0.15);
  --blue: #0082c9;
  --green: #46ba61;
  --amber: #eca700;
  --red: #e9322d;
  --text: #222222;
  --muted: #767676;
  --shadow: rgba(0, 0, 0, 0.08);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family:
    "Inter",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    sans-serif;
  background: url("https://cloud.villededeshaies.fr/apps/theming/image/background?v=10")
    center/cover fixed;
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Overlay pour améliorer la lisibilité */
body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.65);
  z-index: -1;
}

/* Header */
header {
  background: white;
  color: #1e293b;
  padding: 1.5rem 0;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.1);
  border-bottom: 1px solid #e3e8ef;
}

header .container {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

header .logo {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: white;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.2);
}

header h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: #1e293b;
  margin: 0;
}

header p {
  font-size: 0.875rem;
  color: #64748b;
  margin: 0.25rem 0 0 0;
}

.refresh-btn {
  margin-left: auto;
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: white;
  border: none;
  padding: 0.6rem 1.2rem;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.refresh-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.refresh-btn svg {
  color: white;
}

/* Container */
.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 2rem;
  width: 100%;
}

/* Main */
main {
  flex: 1;
  padding: 3rem 0;
}

/* Loading */
.loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  padding: 4rem 0;
}

.spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--border);
  border-top: 4px solid var(--blue);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.loading p {
  color: var(--muted);
  font-size: 1rem;
}

/* Error */
.error {
  background: rgba(233, 50, 45, 0.1);
  border: 1px solid var(--red);
  border-left: 4px solid var(--red);
  border-radius: 8px;
  padding: 1.5rem;
  text-align: center;
  color: var(--red);
}

.error small {
  display: block;
  margin-top: 0.5rem;
  color: var(--muted);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.75rem;
}

/* Sections */
.groups-section {
  margin-bottom: 3rem;
}

.groups-section h2 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.divider {
  border: none;
  border-top: 2px solid var(--border);
  margin: 3rem 0;
}

/* Onglets */
.tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  border-bottom: 2px solid var(--border);
}

.tab-btn {
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  padding: 0.75rem 1.5rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.2s;
  font-family: "Inter", sans-serif;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.tab-btn:hover {
  color: var(--text);
  background: var(--bg3);
}

.tab-btn.active {
  color: var(--blue);
  border-bottom-color: var(--blue);
}

.tab-count {
  background: var(--bg3);
  color: var(--blue);
  padding: 0.15rem 0.5rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 700;
  font-family: "JetBrains Mono", monospace;
}

.tab-btn.active .tab-count {
  background: var(--blue);
  color: white;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* Grille de membres (colonnes multiples) */
.members-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.member-card {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
  transition: all 0.2s;
}

.member-card:hover {
  border-color: var(--blue);
  box-shadow: 0 2px 8px rgba(0, 130, 201, 0.15);
}

.member-card .member-name {
  margin-bottom: 0.5rem;
}

.member-card .member-name strong {
  color: var(--text);
  font-size: 0.95rem;
}

.member-card .member-email {
  color: var(--muted);
  font-size: 0.85rem;
  font-family: "JetBrains Mono", monospace;
}

/* Cards Grid (Services) */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}

/* Group Card (Services) */
.group-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  transition: all 0.2s;
  box-shadow: 0 2px 8px var(--shadow);
  backdrop-filter: blur(5px);
}

.group-card:hover {
  border-color: var(--blue);
  box-shadow: 0 4px 16px rgba(0, 130, 201, 0.2);
  transform: translateY(-2px);
}

.group-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.group-header h3 {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
}

.badge {
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--blue);
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
  font-family: "JetBrains Mono", monospace;
}

.group-code {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 1rem;
  padding: 0.5rem;
  background: var(--bg3);
  border-radius: 6px;
  border: 1px solid var(--border);
}

.view-members-btn {
  width: 100%;
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.75rem;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: "Inter", sans-serif;
}

.view-members-btn:hover {
  background: var(--blue);
  color: white;
  border-color: var(--blue);
  box-shadow: 0 2px 8px rgba(0, 130, 201, 0.25);
}

/* Members List (Services) */
.members-list {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.loading-small {
  text-align: center;
  color: var(--muted);
  padding: 1rem;
  font-size: 0.875rem;
}

.no-members {
  text-align: center;
  color: var(--muted);
  padding: 1rem;
  font-size: 0.875rem;
  font-style: italic;
}

.error-small {
  text-align: center;
  color: var(--red);
  padding: 1rem;
  font-size: 0.875rem;
}

.member-item {
  padding: 0.875rem;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 0.75rem;
}

.member-item:last-child {
  margin-bottom: 0;
}

.member-item .member-name {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-bottom: 0.5rem;
}

.member-item .member-name strong {
  color: var(--text);
  font-size: 0.9375rem;
}

/* Footer */
footer {
  background: var(--bg2);
  border-top: 2px solid var(--blue);
  padding: 1.5rem 0;
  text-align: center;
  color: var(--muted);
  font-size: 0.875rem;
  font-family: "JetBrains Mono", monospace;
  box-shadow: 0 -2px 8px var(--shadow);
  backdrop-filter: blur(10px);
}

/* Sous-onglets services */
.sub-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: var(--bg3);
  border-radius: 8px;
  border: 1px solid var(--border);
}

.sub-tab-btn {
  background: white;
  border: 1px solid var(--border);
  padding: 0.5rem 1rem;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  transition: all 0.2s;
  font-family: "JetBrains Mono", monospace;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.sub-tab-btn:hover {
  border-color: var(--blue);
  background: rgba(0, 130, 201, 0.05);
}

.sub-tab-btn.active {
  background: var(--blue);
  color: white;
  border-color: var(--blue);
}

.sub-tab-code {
  display: block;
  font-size: 0.65rem;
  font-weight: 400;
  opacity: 0.65;
  letter-spacing: 0.05em;
  margin-top: 0.1rem;
}

.sub-tab-count {
  background: rgba(0, 0, 0, 0.1);
  padding: 0.1rem 0.4rem;
  border-radius: 10px;
  font-size: 0.7rem;
  font-weight: 700;
}

.sub-tab-btn.active .sub-tab-count {
  background: rgba(255, 255, 255, 0.3);
}

.sub-tab-content {
  display: none;
}

.sub-tab-content.active {
  display: block;
}

.service-header {
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--border);
}

.service-header h3 {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text);
}

/* Responsive */
@media (max-width: 768px) {
  .container {
    padding: 0 1rem;
  }

  .cards-grid,
  .members-grid {
    grid-template-columns: 1fr;
  }

  header h1 {
    font-size: 1.125rem;
  }

  header p {
    font-size: 0.75rem;
  }

  .tabs {
    overflow-x: auto;
    scrollbar-width: thin;
  }

  .tab-btn {
    white-space: nowrap;
  }
}
/* === CARTES MEMBRES === */
.member-card {
  background: white;
  border: 1px solid #e3e8ef;
  border-radius: 8px;
  padding: 20px;
  transition: all 0.2s;
}

.member-card:hover {
  box-shadow: 0 4px 12px rgba(14, 31, 77, 0.08);
  border-color: #3b82f6;
  transform: translateY(-2px);
}

.card-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid #e3e8ef;
  margin-bottom: 12px;
}

.card-avatar {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  flex-shrink: 0;
}

.card-identity {
  flex: 1;
  min-width: 0;
}

.card-name {
  font-family: "Georgia", serif;
  font-size: 16px;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 2px;
}

.card-title {
  font-size: 10px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: #64748b;
  font-weight: 600;
}

.card-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.service-badge {
  background: #dbeafe;
  color: #1e40af;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 600;
}

.card-contact {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  color: #64748b;
}

.card-contact svg {
  flex-shrink: 0;
  color: #94a3b8;
}

.card-contact a {
  color: #1e293b;
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-contact a:hover {
  color: #3b82f6;
  text-decoration: underline;
}
/* === BARRE DE RECHERCHE === */
.search-bar {
  position: relative;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  background: white;
  border: 2px solid #e3e8ef;
  border-radius: 10px;
  padding: 0.75rem 1rem;
  transition: all 0.2s;
}

.search-bar:focus-within {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.search-bar svg:first-child {
  color: #94a3b8;
  flex-shrink: 0;
  margin-right: 0.75rem;
}

.search-bar input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 0.95rem;
  color: #1e293b;
  background: transparent;
}

.search-bar input::placeholder {
  color: #94a3b8;
}

.search-bar button {
  background: #f1f5f9;
  border: none;
  border-radius: 6px;
  padding: 0.4rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  margin-left: 0.5rem;
}

.search-bar button:hover {
  background: #e2e8f0;
}

.search-bar button svg {
  color: #64748b;
}

/* Compteur de résultats */
.results-count {
  font-size: 0.875rem;
  color: #64748b;
  margin-bottom: 1rem;
  padding: 0.5rem 1rem;
  background: #f8fafc;
  border-radius: 6px;
  border-left: 3px solid #3b82f6;
}

.no-results {
  text-align: center;
  padding: 3rem 1rem;
  color: #64748b;
}

.no-results svg {
  margin-bottom: 1rem;
  color: #94a3b8;
}
