/* Styles pour le contrôle d'accès et les restrictions de fonctionnalités */

/* Wrapper pour le formulaire restreint */
.restricted-form-wrapper {
  position: relative;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 20px;
  margin: 20px 0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Message d'avertissement intégré */
.form-restriction-banner {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 20px;
  padding: 16px 20px;
  background: #f9fafb;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
}

.form-restriction-banner .lock-icon {
  font-size: 24px;
  color: #6b7280;
  flex-shrink: 0;
}

.form-restriction-banner .restriction-info {
  flex: 1;
}

.form-restriction-banner .restriction-title {
  color: #374151;
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 4px;
  display: block;
}

.form-restriction-banner .restriction-text {
  color: #6b7280;
  font-size: 0.875rem;
  line-height: 1.4;
  margin: 0;
}

/* Bouton de connexion admin */
.form-admin-login-btn {
  background: linear-gradient(
    135deg,
    rgba(26, 42, 108, 0.95) 0%,
    rgba(26, 42, 108, 0.85) 50%,
    rgba(178, 31, 31, 0.9) 100%
  );
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 8px;
  padding: 8px 20px;
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  overflow: hidden;
  position: relative;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18), 0 4px 8px rgba(0, 0, 0, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.2), inset 0 -1px 0 rgba(0, 0, 0, 0.2);
  transition: none !important;
}

.form-admin-login-btn:hover {
  background: linear-gradient(
    135deg,
    rgba(26, 42, 108, 1) 0%,
    rgba(26, 42, 108, 0.9) 50%,
    rgba(178, 31, 31, 0.95) 100%
  );
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.22), 0 6px 16px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.3), inset 0 -1px 0 rgba(0, 0, 0, 0.3);
  transform: none !important;
}

/* Formulaire désactivé */
.restricted-form-wrapper form.disabled,
form.disabled,
input.disabled,
button.disabled,
select.disabled,
textarea.disabled,
input[disabled],
button[disabled],
select[disabled],
textarea[disabled] {
  opacity: 0.5 !important;
  filter: grayscale(100%);
  pointer-events: none !important;
  background: #f5f5f5 !important;
  color: #aaa !important;
  border-color: #e5e7eb !important;
  cursor: not-allowed !important;
}

/* Badge admin sur les boutons */
.admin-badge {
  display: inline-block;
  background: #6b7280;
  color: white;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  margin-left: 8px;
  font-weight: normal;
  vertical-align: middle;
}

/* Indicateur admin actif */
.admin-indicator {
  display: inline-block;
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.8rem;
  margin-left: 5px;
  font-weight: bold;
}

/* Section restreinte (si nécessaire) */
.upload.restricted {
  position: relative;
}

/* Styles pour d'autres éléments restreints */
.restricted-element {
  position: relative;
  opacity: 0.6;
  pointer-events: none;
}

.restricted-element::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(240, 240, 240, 0.5);
  -webkit-backdrop-filter: blur(1px);
  backdrop-filter: blur(1px);
  z-index: 1;
}

/* Message de restriction générique */
.restriction-notice {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 12px 16px;
  margin: 10px 0;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #6b7280;
  font-size: 0.875rem;
}

.restriction-notice .icon {
  font-size: 20px;
  flex-shrink: 0;
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.form-restriction-banner {
  animation: fadeIn 0.3s ease;
}

/* Styles spécifiques pour le générateur de combinaisons en mode restreint */
.generator.disabled {
  position: relative;
  opacity: 0.7;
  filter: grayscale(30%);
  pointer-events: none;
}

/* Icône de cadenas pour le bouton de génération - DÉSACTIVÉ car géré par JavaScript */
/* #generate-btn:disabled::before {
  content: "🔒";
  margin-right: 5px;
  font-size: 0.9em;
} */

/* Style du wrapper spécifique au générateur */
#generator-wrapper .form-restriction-banner {
  margin-bottom: 15px;
}

/* Ajouter un cadre autour du générateur désactivé */
#generator-wrapper.restricted .generator {
  border: 1px dashed #ccc;
  padding: 10px;
  border-radius: 5px;
  background-color: rgba(245, 245, 245, 0.5);
}

/* Style supplémentaire pour l'input nombre */
#nb-combinations:disabled {
  background-color: #f5f5f5;
  cursor: not-allowed;
  border-color: #ddd;
}

/* Animation légère du cadenas */
@keyframes wiggle {
  0% {
    transform: rotate(0deg);
  }
  25% {
    transform: rotate(-5deg);
  }
  75% {
    transform: rotate(5deg);
  }
  100% {
    transform: rotate(0deg);
  }
}

#generator-wrapper .lock-icon {
  animation: wiggle 2s ease-in-out infinite;
  display: inline-block;
}

/* Responsive */
@media (max-width: 768px) {
  .form-restriction-banner {
    flex-direction: column;
    text-align: center;
  }

  .form-admin-login-btn {
    width: 100%;
  }
}

/* Masquer le wrapper jusqu’à ce qu’il soit initialisé */
draws-actions-wrapper {
  visibility: hidden;
}
