/* Styles additionnels pour les nouvelles fonctionnalités */

/* Statut actif/inactif */
.status-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 0.85em;
  font-weight: 600;
  margin-left: 8px;
}

.status-active {
  background: #d4edda;
  color: #155724;
}

.status-inactive {
  background: #f8d7da;
  color: #721c24;
}

/* Blocs de compétences cliquables */
.blocks-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.block-item {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.block-item:hover {
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(43, 174, 148, 0.1);
}

.block-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.block-toggle {
  color: var(--primary);
  font-size: 1.2em;
  transition: transform 0.2s ease;
}

.block-competences {
  margin-top: 12px;
  animation: slideDown 0.3s ease;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Aperçu des blocs correspondants */
.matched-blocks-preview {
  margin-top: 12px;
  padding: 12px;
  background: var(--bg-secondary);
  border-radius: 8px;
  font-size: 0.9em;
}

/* Certificateur */
.certificateur-item {
  padding: 12px;
  background: var(--bg-secondary);
  border-radius: 8px;
  margin-bottom: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* Détails de certification */
.certification-detail-card {
  background: white;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  margin-top: 24px;
}

.detail-header {
  border-bottom: 2px solid var(--border);
  padding-bottom: 16px;
  margin-bottom: 24px;
}

.detail-header h2 {
  margin: 0 0 12px 0;
  color: var(--text-primary);
}

.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.detail-section {
  margin-bottom: 32px;
}

.detail-section h3 {
  color: var(--primary);
  margin-bottom: 12px;
  font-size: 1.1em;
}

.detail-section p {
  line-height: 1.6;
  color: var(--text-secondary);
}

/* Bouton secondaire */
.btn-secondary {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: 1px solid var(--border);
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.9em;
  transition: all 0.2s ease;
}

.btn-secondary:hover {
  background: var(--border);
  border-color: var(--primary);
}

/* Export button */
.btn-export {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: linear-gradient(135deg, #146356, #2BAE94);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.3);
}
.btn-export:hover {
  background: linear-gradient(135deg, #146356, #146356);
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.4);
  transform: translateY(-1px);
}
.btn-export svg { flex-shrink: 0; }

/* =============================================
   TOAST NOTIFICATIONS
   ============================================= */
#toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 100000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 300px;
  max-width: 450px;
  padding: 14px 16px;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12), 0 1px 4px rgba(0, 0, 0, 0.08);
  font-size: 0.9rem;
  line-height: 1.4;
  pointer-events: auto;
  transform: translateX(120%);
  opacity: 0;
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.35s ease;
  border-left: 4px solid #64748b;
}

.toast-visible {
  transform: translateX(0);
  opacity: 1;
}

.toast-exit {
  transform: translateX(120%);
  opacity: 0;
}

.toast-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

.toast-message {
  flex: 1;
  color: #1e293b;
  font-weight: 500;
}

.toast-close {
  flex-shrink: 0;
  background: none;
  border: none;
  font-size: 1.3rem;
  color: #94a3b8;
  cursor: pointer;
  padding: 0 2px;
  line-height: 1;
  transition: color 0.2s;
}
.toast-close:hover {
  color: #475569;
}

/* Color-coded types */
.toast-info {
  border-left-color: #3b82f6;
}
.toast-info .toast-icon { color: #3b82f6; }

.toast-success {
  border-left-color: #22c55e;
  background: #f0fdf4;
}
.toast-success .toast-icon { color: #22c55e; }

.toast-error {
  border-left-color: #ef4444;
  background: #fef2f2;
}
.toast-error .toast-icon { color: #ef4444; }

.toast-warning {
  border-left-color: #f59e0b;
  background: #fffbeb;
}
.toast-warning .toast-icon { color: #f59e0b; }

@media (max-width: 480px) {
  #toast-container {
    right: 10px;
    left: 10px;
  }
  .toast {
    min-width: auto;
    max-width: 100%;
  }
}

/* =============================================
   AUTOCOMPLETE DROPDOWN
   ============================================= */
.search-box {
  position: relative;
}

.autocomplete-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 1000;
  background: #fff;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 12px;
  margin-top: 4px;
  max-height: 320px;
  overflow-y: auto;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.08);
}

.autocomplete-dropdown:empty {
  display: none;
}

.autocomplete-item {
  padding: 10px 16px;
  cursor: pointer;
  font-size: 0.9rem;
  line-height: 1.4;
  color: var(--text-primary, #1e293b);
  border-bottom: 1px solid var(--border, #f1f5f9);
  transition: background 0.15s ease;
}

.autocomplete-item:last-child {
  border-bottom: none;
}

.autocomplete-item:hover,
.autocomplete-item.active {
  background: var(--bg-secondary, #f1f5f9);
}

.autocomplete-item .ac-code {
  font-weight: 600;
  color: var(--primary, #2563eb);
  margin-right: 6px;
}

.autocomplete-item .ac-niveau {
  color: var(--text-secondary, #64748b);
  font-size: 0.82rem;
}

.autocomplete-no-results {
  padding: 12px 16px;
  color: var(--text-secondary, #64748b);
  font-size: 0.88rem;
  text-align: center;
}
