* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #4e0389 0%, #6a11cb 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.auth-container {
  width: 100%;
  max-width: 500px;
}

.auth-card {
  background: white;
  border-radius: 15px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
  padding: 40px;
  width: 100%;
}

.auth-header {
  text-align: center;
  margin-bottom: 30px;
}

.auth-header h1 {
  color: #2c3e50;
  font-size: 2em;
  margin-bottom: 10px;
  font-weight: 300;
}

.auth-header p {
  color: #7f8c8d;
  font-size: 1.1em;
}

.auth-form {
  margin-bottom: 20px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}

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

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: #2c3e50;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 12px 15px;
  border: 2px solid #e9ecef;
  border-radius: 8px;
  font-size: 16px;
  transition: all 0.3s ease;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: #4e0389;
  box-shadow: 0 0 0 3px rgba(78, 3, 137, 0.1);
}

.form-group small {
  display: block;
  margin-top: 5px;
  color: #6c757d;
  font-size: 0.85em;
}

.form-info {
  background: #e3f2fd;
  border: 1px solid #bbdefb;
  border-radius: 8px;
  padding: 15px;
  margin-bottom: 20px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.form-info .info-icon {
  font-size: 1.2em;
  flex-shrink: 0;
}

.form-info p {
  color: #1976d2;
  margin: 0;
  line-height: 1.5;
}

.btn-primary {
  width: 100%;
  padding: 15px;
  background: #4e0389;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.btn-primary:hover:not(:disabled) {
  background: #3a0266;
  transform: translateY(-2px);
}

.btn-primary:disabled {
  background: #bdc3c7;
  cursor: not-allowed;
  transform: none;
}

.btn-secondary {
  width: 100%;
  padding: 12px;
  background: #95a5a6;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-secondary:hover {
  background: #7f8c8d;
}

.auth-links {
  text-align: center;
  margin-top: 20px;
}

.auth-links p {
  color: #6c757d;
  margin-bottom: 10px;
}

.auth-links a {
  color: #4e0389;
  text-decoration: none;
  font-weight: 600;
}

.auth-links a:hover {
  text-decoration: underline;
}

.message {
  padding: 15px;
  border-radius: 8px;
  margin-top: 20px;
  text-align: center;
  font-weight: 600;
}

.message.success {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.message.error {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

/* Styles spécifiques à la page de déblocage */
.user-info {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 30px;
}

.info-item {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid #e9ecef;
}

.info-item:last-child {
  margin-bottom: 0;
  border-bottom: none;
}

.unlock-panel {
  text-align: center;
  margin-bottom: 30px;
}

.lock-icon {
  font-size: 4em;
  margin-bottom: 20px;
}

.unlock-panel h3 {
  color: #2c3e50;
  margin-bottom: 15px;
}

.unlock-panel p {
  color: #6c757d;
  margin-bottom: 25px;
  line-height: 1.6;
}

.unlock-form {
  max-width: 400px;
  margin: 0 auto 30px;
}

.help-text {
  background: #fff3cd;
  border: 1px solid #ffeaa7;
  border-radius: 8px;
  padding: 20px;
  text-align: left;
}

.help-text p {
  margin-bottom: 10px;
  color: #856404;
}

.help-text ul {
  margin-left: 20px;
  color: #856404;
}

.help-text li {
  margin-bottom: 5px;
}

/* Responsive */
@media (max-width: 768px) {
  .auth-card {
      padding: 30px 20px;
  }

  .form-row {
      grid-template-columns: 1fr;
  }

  .user-info {
      padding: 15px;
  }

  .info-item {
      flex-direction: column;
      gap: 5px;
  }
}
/* Styles pour les messages de statut de code */
.code-status {
    padding: 10px;
    border-radius: 5px;
    margin: 10px 0;
    font-size: 0.9em;
}

.code-status.valid {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.code-status.invalid {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.code-details {
    margin-top: 5px;
    font-size: 0.8em;
    opacity: 0.8;
}

/* Styles pour les modaux d'édition */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
}

.modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 30px;
    border-radius: 10px;
    min-width: 400px;
    max-width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-content h3 {
    margin-bottom: 20px;
    color: #2c3e50;
}

.modal-actions {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    margin-top: 20px;
}

/* Styles pour les contrôles de filtrage */
.filter-controls {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.filter-controls .control-group {
    margin-bottom: 0;
}

/* Styles pour les questions en mode édition */
.edit-question-text,
.edit-choice-text,
.edit-question-comment {
    width: 100%;
    padding: 10px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 14px;
}

.edit-question-text:focus,
.edit-choice-text:focus,
.edit-question-comment:focus {
    outline: none;
    border-color: #4e0389;
}

.edit-correct-checkbox {
    width: 18px;
    height: 18px;
}

/* Styles responsifs pour les modaux */
@media (max-width: 768px) {
    .modal-content {
        min-width: 90%;
        margin: 20px;
        padding: 20px;
    }

    .modal-actions {
        flex-direction: column;
    }

    .filter-controls {
        flex-direction: column;
        gap: 10px;
    }

  /* Styles pour les ressources vidéo */
  .videos-grid {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
      gap: 25px;
      margin-top: 20px;
  }

  .video-card {
      background: white;
      border-radius: 12px;
      padding: 20px;
      box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
      border: 2px solid transparent;
      transition: all 0.3s ease;
      position: relative;
  }

  .video-card:hover {
      border-color: #4e0389;
      transform: translateY(-5px);
      box-shadow: 0 8px 15px rgba(0, 0, 0, 0.15);
  }

  .video-header {
      display: flex;
      justify-content: space-between;
      align-items: flex-start;
      margin-bottom: 15px;
      padding-bottom: 10px;
      border-bottom: 2px solid #f8f9fa;
  }

  .video-title {
      font-size: 1.3em;
      font-weight: 600;
      color: #2c3e50;
      margin-bottom: 5px;
      line-height: 1.3;
      flex: 1;
      margin-right: 10px;
  }

  .video-badge {
      background: linear-gradient(135deg, #ff6b6b, #ee5a52);
      color: white;
      padding: 6px 12px;
      border-radius: 20px;
      font-size: 0.75em;
      font-weight: 600;
      white-space: nowrap;
  }

  .video-player {
      margin-bottom: 15px;
      border-radius: 8px;
      overflow: hidden;
      box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  }

  .video-player iframe {
      display: block;
      border-radius: 8px;
  }

  .video-description {
      color: #5a6c7d;
      margin-bottom: 15px;
      line-height: 1.5;
      font-size: 0.95em;
      background: #f8f9fa;
      padding: 12px;
      border-radius: 6px;
      border-left: 4px solid #4e0389;
  }

  .video-meta {
      display: flex;
      flex-direction: column;
      gap: 8px;
      margin-bottom: 15px;
  }

  .video-meta span {
      background: #f8f9fa;
      padding: 6px 10px;
      border-radius: 6px;
      font-size: 0.8em;
      color: #6c757d;
      display: flex;
      align-items: center;
      gap: 5px;
  }

  .meta-group {
      border-left: 3px solid #4e0389;
  }

  .meta-organization {
      border-left: 3px solid #27ae60;
  }

  .meta-duration {
      border-left: 3px solid #f39c12;
  }

  .meta-date {
      border-left: 3px solid #9b59b6;
  }

  .video-actions {
      display: flex;
      gap: 8px;
      flex-wrap: wrap;
  }

  .video-actions button {
      flex: 1;
      padding: 10px 15px;
      border: none;
      border-radius: 6px;
      cursor: pointer;
      font-size: 0.85em;
      font-weight: 600;
      transition: all 0.3s ease;
      min-width: 120px;
  }

  .btn-view {
      background: #4e0389;
      color: white;
  }

  .btn-view:hover {
      background: #3a0266;
      transform: translateY(-2px);
  }

  .btn-copy {
      background: #9b59b6;
      color: white;
  }

  .btn-copy:hover {
      background: #8e44ad;
      transform: translateY(-2px);
  }

  .btn-delete {
      background: #e74c3c;
      color: white;
  }

  .btn-delete:hover {
      background: #c0392b;
      transform: translateY(-2px);
  }

  /* Responsive */
  @media (max-width: 768px) {
      .videos-grid {
          grid-template-columns: 1fr;
          gap: 20px;
      }

      .video-card {
          padding: 15px;
      }

      .video-header {
          flex-direction: column;
          gap: 10px;
      }

      .video-title {
          margin-right: 0;
      }

      .video-actions {
          flex-direction: column;
      }

      .video-actions button {
          min-width: auto;
      }
  }

  /* Animation de chargement */
  @keyframes videoCardAppear {
      from {
          opacity: 0;
          transform: translateY(20px);
      }
      to {
          opacity: 1;
          transform: translateY(0);
      }
  }

  .video-card {
      animation: videoCardAppear 0.5s ease-out;
  }
    /* Messages améliorés */
    .message.error {
        background: linear-gradient(135deg, #ffeaea, #ffd6d6);
        border: 2px solid #ffb8b8;
        border-left: 6px solid #e74c3c;
        color: #c0392b;
        padding: 18px;
        border-radius: 10px;
        margin: 20px 0;
        box-shadow: 0 4px 12px rgba(231, 76, 60, 0.1);
        animation: shake 0.5s ease-in-out;
    }

    .message.success {
        background: linear-gradient(135deg, #e8f7ef, #d4f1e1);
        border: 2px solid #a3e4c1;
        border-left: 6px solid #27ae60;
        color: #1e8449;
        padding: 18px;
        border-radius: 10px;
        margin: 20px 0;
        box-shadow: 0 4px 12px rgba(39, 174, 96, 0.1);
        animation: slideIn 0.5s ease-out;
    }

    .message ul {
        margin: 8px 0;
        padding-left: 20px;
    }

    .message li {
        margin-bottom: 6px;
        line-height: 1.4;
    }

    .message a {
        color: #4e0389;
        font-weight: 600;
        text-decoration: underline;
    }

    .message a:hover {
        color: #6a11cb;
        text-decoration: none;
    }

    /* Animations */
    @keyframes shake {
        0%, 100% { transform: translateX(0); }
        25% { transform: translateX(-5px); }
        75% { transform: translateX(5px); }
    }

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

    /* Champ avec erreur */
    .input-error {
        border-color: #e74c3c !important;
        background-color: #fff8f8 !important;
        animation: pulseError 2s infinite;
    }

    @keyframes pulseError {
        0%, 100% { box-shadow: 0 0 0 0 rgba(231, 76, 60, 0.4); }
        50% { box-shadow: 0 0 0 6px rgba(231, 76, 60, 0); }
    }

    /* Aide contextuelle */
    .help-bubble {
        position: relative;
        display: inline-block;
        margin-left: 8px;
        cursor: help;
    }

    .help-bubble:hover::after {
        content: attr(data-tooltip);
        position: absolute;
        bottom: 100%;
        left: 50%;
        transform: translateX(-50%);
        background: #2c3e50;
        color: white;
        padding: 8px 12px;
        border-radius: 6px;
        font-size: 0.85em;
        white-space: nowrap;
        z-index: 100;
        margin-bottom: 8px;
        box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    }