.spinner-container {
  position: relative;
}

.attps-spinner {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: none;
  justify-content: center;
  align-items: center;
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  z-index: 1000;
}

.spinner-circle {
  position: absolute;
  top: 50%;
  left: 50%;
  translate: -50% -50%;
  width: 24px;
  height: 24px;
  border: 3px solid #e2e8f0;
  border-top: 3px solid #0052cc;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

/* Popup générique réutilisable */
.attps-popup {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 9999;
  justify-content: center;
  align-items: center;
}

.attps-popup .popup-content {
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  width: 90%;
  position: relative;
  padding: 20px;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  width: 90%;
  position: relative;
  padding: 20px;
  top: 50%;
  left: 50%;
  translate: -50% -50%;
}

.attps-popup .popup-content > .popup-close {
  position: absolute;
  top: 0;
  right: 0;
  background: none;
  border: none;
  font-size: 20px;
  color: #6b7280;
  cursor: pointer;
  transition: color 0.2s ease;
}

.attps-popup .popup-close:hover {
  color: #1a1a1a;
}

.attps-popup .popup-body {
  max-height: 80vh;
  overflow-y: auto;
  padding: 5px;
}

.metabase-iframe {
  width: 1px;
  min-width: 100%;
  transition: height 0.25s ease-in-out; /* Animation douce lors du changement d'onglet */
}

/* ==========================================================================
   Composants Partagés (Frontend + Admin)
   ========================================================================== */

/* Alertes */
.attps-alert {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-radius: 6px;
  margin-bottom: 1.5rem;
}

.attps-alert > .dashicons {
  font-size: 20px;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  margin-top: 2px;
}

.attps-alert > div {
  flex: 1;
}

.attps-alert strong {
  display: block;
  margin-bottom: 0.25rem;
}

.attps-alert p {
  margin: 0;
  font-size: 0.9rem;
}

.attps-alert-info {
  background: #e3f2fd;
  border: 1px solid #90caf9;
  color: #1565c0;
}

.attps-alert-info > .dashicons {
  color: #1976d2;
}

.attps-alert-success {
  background: #e8f5e9;
  border: 1px solid #a5d6a7;
  color: #2e7d32;
}

.attps-alert-success > .dashicons {
  color: #388e3c;
}

.attps-alert-warning {
  background: #fff3e0;
  border: 1px solid #ffcc80;
  color: #e65100;
}

.attps-alert-warning > .dashicons {
  color: #f57c00;
}

.attps-alert-error {
  background: #ffebee;
  border: 1px solid #ef9a9a;
  color: #c62828;
}

.attps-alert-error > .dashicons {
  color: #d32f2f;
}

/* Badges */
.attps-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.attps-badge-success {
  background: #e8f5e9;
  color: #2e7d32;
}

.attps-badge-warning {
  background: #fff3e0;
  color: #e65100;
}

.attps-badge-error {
  background: #ffebee;
  color: #c62828;
}

.attps-badge-info {
  background: #e3f2fd;
  color: #1565c0;
}

/* Tables */
.attps-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  font-size: 0.9rem;
}

.attps-table th,
.attps-table td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid #e0e0e0;
}

.attps-table th {
  background: #f5f5f5;
  font-weight: 600;
  color: #333;
}

.attps-table tbody tr:hover {
  background: #fafafa;
}

.attps-table-compact th,
.attps-table-compact td {
  padding: 0.5rem 0.75rem;
}

/* Listes */
.attps-list {
  margin: 0.75rem 0;
  padding-left: 1.5rem;
}

.attps-list li {
  margin-bottom: 0.5rem;
  line-height: 1.5;
}

.attps-list-check {
  list-style: none;
  padding-left: 0;
}

.attps-list-check li {
  position: relative;
  padding-left: 1.75rem;
}

.attps-list-check li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: #43a047;
  font-weight: bold;
}

.attps-list-numbered {
  counter-reset: list-counter;
  list-style: none;
  padding-left: 0;
}

.attps-list-numbered > li {
  counter-increment: list-counter;
  position: relative;
  padding-left: 2.5rem;
  margin-bottom: 1.5rem;
}

.attps-list-numbered > li::before {
  content: counter(list-counter);
  position: absolute;
  left: 0;
  top: 0;
  width: 1.75rem;
  height: 1.75rem;
  background: #6c63ff;
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 600;
}

.attps-list-numbered > li ul {
  margin-top: 0.5rem;
}

/* Cards */
.attps-card {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  overflow: hidden;
  transition: box-shadow 0.2s ease;
}

.attps-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.attps-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: #f8f9fa;
  border-bottom: 1px solid #e0e0e0;
}

.attps-card-header code {
  background: #fff;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.85rem;
  border: 1px solid #e0e0e0;
}

.attps-card-body {
  padding: 1.25rem;
}

.attps-card-body p:first-child {
  margin-top: 0;
}

.attps-card-body h5 {
  margin: 1rem 0 0.5rem;
  font-size: 0.9rem;
  color: #666;
}

/* Code blocks */
.attps-directus-code {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: #f5f5f5;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  padding: 0.5rem 0.75rem;
  margin: 0.75rem 0;
}

.attps-directus-code code {
  flex: 1;
  font-family: "Monaco", "Consolas", monospace;
  font-size: 0.85rem;
  word-break: break-all;
}

.attps-directus-code-block {
  display: block;
}

.attps-directus-code-block pre {
  margin: 0;
  padding: 1rem;
  overflow-x: auto;
  font-family: "Monaco", "Consolas", monospace;
  font-size: 0.85rem;
  line-height: 1.5;
}

.attps-directus-copy-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: #666;
  padding: 0.25rem;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.attps-directus-copy-btn:hover {
  background: #e0e0e0;
  color: #333;
}

.attps-directus-copy-btn.copied {
  color: #43a047;
}

.attps-directus-copy-btn.copied::after {
  content: " ✓";
}

/* FAQ Accordion */
.attps-faq {
  margin: 1rem 0;
}

.attps-faq-item {
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  margin-bottom: 0.5rem;
  overflow: hidden;
}

.attps-faq-item summary {
  padding: 1rem 1.25rem;
  cursor: pointer;
  font-weight: 600;
  background: #f8f9fa;
  transition: background 0.2s ease;
  list-style: none;
}

.attps-faq-item summary::-webkit-details-marker {
  display: none;
}

.attps-faq-item summary::before {
  content: "▶";
  display: inline-block;
  margin-right: 0.75rem;
  font-size: 0.75rem;
  transition: transform 0.2s ease;
}

.attps-faq-item[open] summary::before {
  transform: rotate(90deg);
}

.attps-faq-item summary:hover {
  background: #f0f0f0;
}

.attps-faq-content {
  padding: 1rem 1.25rem;
  background: #fff;
  border-top: 1px solid #e0e0e0;
}

.attps-faq-content p:first-child,
.attps-faq-content ul:first-child {
  margin-top: 0;
}

.attps-faq-content p:last-child,
.attps-faq-content ul:last-child {
  margin-bottom: 0;
}
