/* ===== INTERFACE D'ADMINISTRATION - MODE DARK OBLIGATOIRE ===== */

.admin-page {
  background: #0d0d0d;
  min-height: 100vh;
  font-family: "Georgia", "Times New Roman", serif;
  color: #e8e8e8;
}

/* ===== ÉCRAN DE CONNEXION ===== */
.login-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 20px;
  background: linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 100%);
}

.login-box {
  background: #1a1a1a;
  border: 1px solid #2c2c2c;
  border-radius: 3px;
  padding: 50px 40px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.7);
  max-width: 420px;
  width: 100%;
  animation: slideUp 0.5s ease;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.login-box h1 {
  text-align: center;
  color: #e8e8e8;
  margin-bottom: 40px;
  font-size: 32px;
  font-weight: 300;
  letter-spacing: -0.5px;
}

.form-group {
  margin-bottom: 24px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  color: #b0b0b0;
  font-weight: 400;
  font-size: 14px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid #2c2c2c;
  border-radius: 3px;
  font-size: 15px;
  background: #0d0d0d;
  color: #e8e8e8;
  transition: all 0.2s;
  box-sizing: border-box;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: #4a9eff;
  background: #1a1a1a;
  box-shadow: 0 0 0 3px rgba(74, 158, 255, 0.2);
}

.form-group textarea {
  min-height: 120px;
  resize: vertical;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: #666;
}

/* ===== BOUTONS ===== */
.btn {
  padding: 14px 24px;
  border-radius: 3px;
  cursor: pointer;
  font-size: 15px;
  transition: all 0.2s;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  display: inline-block;
}

.btn-primary {
  background: #4a9eff;
  color: #0d0d0d;
  width: 100%;
  border: none;
  letter-spacing: 0.3px;
  font-weight: 600;
}

.btn-primary:hover {
  background: #6bb0ff;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(74, 158, 255, 0.4);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: #1a1a1a;
  color: #e8e8e8;
  border: 1px solid #2c2c2c;
}

.btn-secondary:hover {
  background: #2c2c2c;
  border-color: #404040;
}

.btn-add {
  background: #3fd28b;
  color: #0d0d0d;
  border: none;
  font-weight: 600;
}

.btn-add:hover {
  background: #5fdd9d;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(63, 210, 139, 0.4);
}

.btn-edit {
  background: #4a9eff;
  color: #0d0d0d;
  padding: 8px 16px;
  font-size: 13px;
  border: none;
  font-weight: 600;
}

.btn-edit:hover {
  background: #6bb0ff;
}

.btn-delete {
  background: #ff6b6b;
  color: white;
  padding: 8px 16px;
  font-size: 13px;
  border: none;
  font-weight: 600;
}

.btn-delete:hover {
  background: #ff8787;
}

.btn-back-site {
  background: #1a1a1a;
  color: #4a9eff;
  border: 1px solid #2c2c2c;
  padding: 10px 20px;
  font-size: 14px;
  text-decoration: none;
  display: inline-block;
  border-radius: 3px;
  transition: all 0.2s;
}

.btn-back-site:hover {
  background: #2c2c2c;
  border-color: #4a9eff;
}

.error-message {
  background: rgba(255, 107, 107, 0.15);
  color: #ff8787;
  padding: 14px 16px;
  border-radius: 3px;
  margin-top: 20px;
  border: 1px solid rgba(255, 107, 107, 0.3);
  font-size: 14px;
}

/* ===== INTERFACE PRINCIPALE ===== */
.admin-interface {
  display: none;
}

.admin-interface.active {
  display: block;
}

.admin-header {
  background: #1a1a1a;
  border-bottom: 1px solid #2c2c2c;
  padding: 30px 50px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}

.admin-header h1 {
  margin: 0;
  color: #e8e8e8;
  font-size: 28px;
  font-weight: 300;
  letter-spacing: -0.5px;
  flex: 1;
}

/* ===== NAVIGATION ===== */
.admin-nav {
  background: #0d0d0d;
  border-bottom: 1px solid #2c2c2c;
  padding: 0 50px;
  display: flex;
  gap: 30px;
  overflow-x: auto;
}

.nav-btn {
  padding: 18px 0;
  border: none;
  border-bottom: 3px solid transparent;
  background: transparent;
  cursor: pointer;
  font-weight: 400;
  color: #808080;
  transition: all 0.2s;
  white-space: nowrap;
  font-size: 15px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.nav-btn:hover {
  color: #4a9eff;
  border-bottom-color: #4a9eff;
}

.nav-btn.active {
  color: #e8e8e8;
  border-bottom-color: #4a9eff;
  font-weight: 500;
}

/* ===== SECTIONS DE CONTENU ===== */
.content-sections {
  padding: 50px;
}

.admin-section {
  display: none;
}

.admin-section.active {
  display: block;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 40px;
  padding-bottom: 20px;
  border-bottom: 1px solid #2c2c2c;
}

.section-header h2 {
  color: #e8e8e8;
  font-size: 32px;
  margin: 0;
  font-weight: 300;
  letter-spacing: -0.5px;
}

/* ===== GRILLE DES ÉLÉMENTS ===== */
.items-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
  gap: 25px;
}

.item-card {
  background: #1a1a1a;
  border: 1px solid #2c2c2c;
  border-radius: 4px;
  padding: 25px;
  transition: all 0.2s;
}

.item-card:hover {
  border-color: #4a9eff;
  box-shadow: 0 4px 20px rgba(74, 158, 255, 0.15);
  transform: translateY(-2px);
}

.item-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
  gap: 15px;
}

.item-header h3 {
  margin: 0;
  color: #e8e8e8;
  font-size: 20px;
  font-weight: 400;
  flex: 1;
  line-height: 1.3;
}

.item-status {
  background: #2c2c2c;
  color: #b0b0b0;
  border: none;
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 12px;
  white-space: nowrap;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.item-subtitle {
  color: #808080;
  font-size: 14px;
  margin-bottom: 20px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.item-description {
  color: #b0b0b0;
  font-size: 15px;
  line-height: 1.6;
  margin-bottom: 20px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.item-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.tag {
  background: #0d0d0d;
  color: #b0b0b0;
  padding: 5px 12px;
  border-radius: 3px;
  font-size: 13px;
  border: 1px solid #2c2c2c;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.item-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.empty-message {
  color: #808080;
  text-align: center;
  font-size: 18px;
  padding: 60px 40px;
  background: #1a1a1a;
  border: 1px dashed #2c2c2c;
  border-radius: 4px;
  font-style: italic;
}

/* ===== MODALES ===== */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  z-index: 1000;
  padding: 20px;
  overflow-y: auto;
  align-items: center;
  justify-content: center;
}

.modal.active {
  display: flex;
}

.modal-content {
  background: #1a1a1a;
  border: 1px solid #2c2c2c;
  border-radius: 4px;
  width: 100%;
  max-width: 700px;
  max-height: 90vh;
  overflow-y: auto;
  animation: modalSlide 0.3s ease;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.9);
}

@keyframes modalSlide {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 25px 30px;
  border-bottom: 1px solid #2c2c2c;
}

.modal-header h2 {
  margin: 0;
  color: #e8e8e8;
  font-size: 24px;
  font-weight: 300;
}

.modal-close {
  background: none;
  border: none;
  font-size: 32px;
  cursor: pointer;
  color: #808080;
  transition: color 0.2s;
  line-height: 1;
}

.modal-close:hover {
  color: #e8e8e8;
}

.modal-body {
  padding: 30px;
}

.modal-footer {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  padding: 20px 30px;
  border-top: 1px solid #2c2c2c;
  background: #0d0d0d;
}

/* ===== CHAMPS DE FORMULAIRE SPÉCIFIQUES ===== */
.array-field {
  margin-bottom: 20px;
}

.array-field label {
  display: block;
  margin-bottom: 10px;
  color: #b0b0b0;
  font-weight: 400;
  font-size: 14px;
}

.array-items {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.array-item {
  display: flex;
  gap: 10px;
  align-items: center;
}

.array-item input {
  flex: 1;
}

.btn-remove-item {
  background: #ff6b6b;
  color: white;
  border: none;
  padding: 10px 14px;
  cursor: pointer;
  border-radius: 3px;
  font-size: 14px;
  transition: all 0.2s;
}

.btn-remove-item:hover {
  background: #ff8787;
}

.btn-add-item {
  background: #2c2c2c;
  color: #e8e8e8;
  border: 1px solid #404040;
  padding: 10px 16px;
  cursor: pointer;
  border-radius: 3px;
  font-size: 14px;
  margin-top: 8px;
  transition: all 0.2s;
  font-weight: 500;
}

.btn-add-item:hover {
  background: #404040;
}

/* ===== NOTIFICATIONS ===== */
.notification {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 16px 24px;
  border-radius: 4px;
  color: white;
  z-index: 2000;
  animation: slideInRight 0.3s ease;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.7);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(100px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.notification.success {
  background: #3fd28b;
  color: #0d0d0d;
  font-weight: 600;
}

.notification.error {
  background: #ff6b6b;
  color: white;
}

.notification.info {
  background: #4a9eff;
  color: #0d0d0d;
  font-weight: 600;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .admin-header,
  .admin-nav,
  .content-sections {
    padding-left: 20px;
    padding-right: 20px;
  }

  .items-grid {
    grid-template-columns: 1fr;
  }

  .section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
  }

  .modal-content {
    max-width: 100%;
  }

  .notification {
    left: 20px;
    right: 20px;
  }
}

/* ===== ÉTATS CACHÉS ===== */
.hidden {
  display: none !important;
}

/* ===== SCROLLBAR DARK ===== */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: #0d0d0d;
}

::-webkit-scrollbar-thumb {
  background: #2c2c2c;
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: #404040;
}

/* ===== CONFIRMATION DE SUPPRESSION ===== */
.delete-confirm-message {
  color: #b0b0b0;
  font-size: 16px;
  line-height: 1.6;
  margin-bottom: 20px;
}

.delete-item-preview {
  background: #0d0d0d;
  border: 1px solid #2c2c2c;
  padding: 16px;
  border-radius: 3px;
  margin-top: 15px;
}

.delete-item-preview strong {
  color: #4a9eff;
  font-weight: 600;
}

/* ===== LIENS DANS LES CARTES ===== */
.item-links {
  display: flex;
  gap: 10px;
  margin-top: 15px;
}

.item-link {
  color: #4a9eff;
  text-decoration: none;
  font-size: 13px;
  padding: 6px 12px;
  border: 1px solid #4a9eff;
  border-radius: 3px;
  transition: all 0.2s;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.item-link:hover {
  background: rgba(74, 158, 255, 0.1);
}

/* ===== IMAGE PREVIEW ===== */
.image-preview {
  margin-top: 10px;
}

.image-preview img {
  max-width: 100%;
  height: auto;
  border-radius: 3px;
  border: 1px solid #2c2c2c;
}

/* ===== LOADING STATE ===== */
.loading {
  text-align: center;
  padding: 40px;
  color: #808080;
}

.loading::after {
  content: "...";
  animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
  0%,
  20% {
    content: ".";
  }
  40% {
    content: "..";
  }
  60%,
  100% {
    content: "...";
  }
}
