/* ============================================
   APPSM - PAGE RESSOURCES PREMIUM
   Fichier: css/ressources.css
============================================ */

/* ============================================
   1. SECTIONS
============================================ */
.res-section {
  padding: 80px 0;
  position: relative;
  overflow: hidden;
  scroll-margin-top: 120px;
}

.res-section-white {
  background: var(--white);
}

.res-section-gray {
  background: linear-gradient(135deg, #ede7f2 0%, #e4daee 100%);
}

.res-section::before {
  content: "";
  position: absolute;
  top: -100px;
  right: -100px;
  width: 350px;
  height: 350px;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(232, 103, 42, 0.06) 0%,
    transparent 70%
  );
  pointer-events: none;
}

.res-section-gray::after {
  content: "";
  position: absolute;
  bottom: -100px;
  left: -100px;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(91, 45, 142, 0.1) 0%,
    transparent 70%
  );
  pointer-events: none;
}

.res-intro-header,
.res-header {
  text-align: center;
  max-width: 900px;
  margin: 0 auto 60px;
  position: relative;
  z-index: 2;
}

.res-intro-header .section-desc strong {
  color: var(--purple);
  font-weight: 700;
}

/* ============================================
   2. LOADER
============================================ */
.res-loader {
  text-align: center;
  padding: 80px 20px;
  color: var(--purple);
}

.loader-spinner {
  display: inline-block;
  width: 60px;
  height: 60px;
  border: 5px solid rgba(91, 45, 142, 0.1);
  border-left-color: var(--orange);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 20px;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.res-loader p {
  font-size: 15px;
  color: var(--gray-500);
  margin: 0;
  font-weight: 500;
}

/* ============================================
   3. GRILLE 4 CATÉGORIES
============================================ */
.categories-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 30px;
  max-width: 1000px;
  margin: 0 auto;
  position: relative;
  z-index: 2;
}

.category-card {
  background: var(--white);
  padding: 40px 30px 30px;
  border-radius: var(--radius-lg);
  text-align: center;
  box-shadow: 0 10px 30px rgba(74, 30, 92, 0.1);
  border-top: 5px solid var(--orange);
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
  border-bottom: 1px solid rgba(91, 45, 142, 0.05);
}

/* Décoration cercle en arrière-plan */
.category-decoration {
  position: absolute;
  top: -80px;
  right: -80px;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(91, 45, 142, 0.05) 0%,
    transparent 70%
  );
  transition: all 0.5s ease;
  pointer-events: none;
}

.category-card:hover .category-decoration {
  top: -50px;
  right: -50px;
  background: radial-gradient(
    circle,
    rgba(232, 103, 42, 0.12) 0%,
    transparent 70%
  );
  transform: scale(1.3);
}

.category-card:hover {
  transform: translateY(-12px);
  box-shadow: 0 25px 50px rgba(74, 30, 92, 0.22);
  border-top-color: var(--purple);
}

/* Icône principale */
.category-icon {
  width: 85px;
  height: 85px;
  margin: 0 auto 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  font-size: 36px;
  transition: all 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
  position: relative;
  z-index: 2;
}

.category-card:hover .category-icon {
  transform: rotate(360deg) scale(1.1);
}

.category-icon-article {
  background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
  box-shadow: 0 10px 25px rgba(52, 152, 219, 0.4);
}

.category-icon-note {
  background: linear-gradient(135deg, #f39c12 0%, #d68910 100%);
  box-shadow: 0 10px 25px rgba(243, 156, 18, 0.4);
}

.category-icon-rapport {
  background: linear-gradient(
    135deg,
    var(--purple) 0%,
    var(--purple-light) 100%
  );
  box-shadow: 0 10px 25px rgba(91, 45, 142, 0.4);
}

.category-icon-support {
  background: linear-gradient(135deg, #27ae60 0%, #229954 100%);
  box-shadow: 0 10px 25px rgba(39, 174, 96, 0.4);
}

.category-title {
  font-family: "Poppins", sans-serif;
  font-size: 20px;
  font-weight: 800;
  color: var(--navy);
  margin-bottom: 12px;
  line-height: 1.3;
  transition: color 0.4s ease;
  position: relative;
  z-index: 2;
}

.category-card:hover .category-title {
  color: var(--purple);
}

.category-desc {
  font-size: 14px;
  color: var(--gray-500);
  line-height: 1.6;
  margin-bottom: 20px;
  flex-grow: 1;
  position: relative;
  z-index: 2;
}

/* Badge compteur */
.category-count-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: "Poppins", sans-serif;
  font-size: 11px;
  font-weight: 700;
  color: var(--purple);
  padding: 6px 16px;
  background: rgba(91, 45, 142, 0.08);
  border-radius: 50px;
  margin-bottom: 20px;
  text-transform: uppercase;
  letter-spacing: 1px;
  transition: all 0.3s ease;
  border: 1px solid rgba(91, 45, 142, 0.1);
  position: relative;
  z-index: 2;
}

.category-count-badge.has-docs {
  color: var(--orange);
  background: rgba(232, 103, 42, 0.1);
  border-color: rgba(232, 103, 42, 0.2);
}

.category-count-badge.has-docs::before {
  content: "";
  width: 8px;
  height: 8px;
  background: var(--orange);
  border-radius: 50%;
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.5;
    transform: scale(1.2);
  }
}

.category-action {
  width: 100%;
  position: relative;
  z-index: 2;
}

/* Bouton actif */
.category-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 14px 24px;
  background: linear-gradient(
    135deg,
    var(--orange) 0%,
    var(--orange-dark) 100%
  );
  color: var(--white);
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: "Poppins", sans-serif;
  box-shadow: 0 8px 20px rgba(232, 103, 42, 0.4);
}

.category-btn:hover {
  background: linear-gradient(
    135deg,
    var(--purple) 0%,
    var(--purple-light) 100%
  );
  transform: translateY(-3px);
  box-shadow: 0 12px 25px rgba(91, 45, 142, 0.4);
}

.category-btn i {
  font-size: 14px;
  transition: transform 0.3s ease;
}

.category-btn:hover i {
  transform: translateX(4px);
}

/* Bouton désactivé */
.category-btn-disabled {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 14px 24px;
  background: rgba(91, 45, 142, 0.08);
  color: var(--purple);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  border: 2px dashed rgba(91, 45, 142, 0.3);
  border-radius: 50px;
  cursor: not-allowed;
  font-family: "Poppins", sans-serif;
}

.category-btn-disabled i {
  font-size: 14px;
  animation: pulseIcon 2s ease-in-out infinite;
}

@keyframes pulseIcon {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.4;
  }
}

/* ============================================
   4. MODAL PREMIUM
============================================ */
.documents-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.documents-modal.active {
  display: flex;
}

.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(74, 30, 92, 0.85);
  backdrop-filter: blur(10px);
  cursor: pointer;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.modal-content {
  position: relative;
  background: var(--white);
  border-radius: var(--radius-lg);
  max-width: 650px;
  width: 100%;
  max-height: 85vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.4);
  animation: modalSlideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  border: 3px solid var(--white);
}

@keyframes modalSlideUp {
  from {
    opacity: 0;
    transform: translateY(50px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-close {
  position: absolute;
  top: 15px;
  right: 15px;
  width: 40px;
  height: 40px;
  background: rgba(91, 45, 142, 0.1);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  color: var(--purple);
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3;
  font-size: 16px;
}

.modal-close:hover {
  background: var(--orange);
  color: var(--white);
  transform: rotate(90deg);
}

.modal-header {
  padding: 30px 30px 25px;
  background: linear-gradient(
    135deg,
    rgba(91, 45, 142, 0.05) 0%,
    rgba(232, 103, 42, 0.05) 100%
  );
  border-bottom: 2px solid rgba(91, 45, 142, 0.1);
  display: flex;
  align-items: center;
  gap: 18px;
}

#modal-icon {
  width: 55px;
  height: 55px;
  border-radius: 15px;
  background: linear-gradient(
    135deg,
    var(--purple) 0%,
    var(--purple-light) 100%
  );
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  flex-shrink: 0;
  font-size: 24px;
  box-shadow: 0 8px 20px rgba(91, 45, 142, 0.3);
}

.modal-header-text {
  flex: 1;
}

.modal-header-label {
  display: block;
  font-family: "Poppins", sans-serif;
  font-size: 11px;
  font-weight: 700;
  color: var(--orange);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 4px;
}

.modal-header h3 {
  font-family: "Poppins", sans-serif;
  font-size: 22px;
  font-weight: 800;
  color: var(--navy);
  margin: 0;
  line-height: 1.3;
}

.modal-body {
  padding: 20px 30px 30px;
  overflow-y: auto;
  flex: 1;
}

.modal-body::-webkit-scrollbar {
  width: 6px;
}

.modal-body::-webkit-scrollbar-track {
  background: rgba(91, 45, 142, 0.05);
  border-radius: 3px;
}

.modal-body::-webkit-scrollbar-thumb {
  background: linear-gradient(
    180deg,
    var(--orange) 0%,
    var(--orange-dark) 100%
  );
  border-radius: 3px;
}

/* Item document */
.modal-doc-item {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 16px 18px;
  background: linear-gradient(135deg, #f8f5fa 0%, #ede7f2 100%);
  border-radius: var(--radius-md);
  margin-bottom: 12px;
  transition: all 0.3s ease;
  text-decoration: none;
  color: inherit;
  border: 1px solid transparent;
  position: relative;
  overflow: hidden;
}

.modal-doc-item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, var(--orange) 0%, var(--purple) 100%);
  transform: scaleY(0);
  transform-origin: top;
  transition: transform 0.4s ease;
}

.modal-doc-item:hover::before {
  transform: scaleY(1);
}

.modal-doc-item:hover {
  background: var(--white);
  box-shadow: 0 10px 25px rgba(74, 30, 92, 0.15);
  transform: translateX(8px);
  border-color: rgba(232, 103, 42, 0.2);
}

.modal-doc-info {
  flex: 1;
}

.modal-doc-title {
  font-family: "Poppins", sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 4px;
  transition: color 0.3s ease;
}

.modal-doc-item:hover .modal-doc-title {
  color: var(--purple);
}

.modal-doc-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--gray-500);
  font-weight: 500;
}

.modal-doc-meta i {
  color: var(--orange);
  font-size: 11px;
}

.modal-doc-icon {
  flex-shrink: 0;
  width: 45px;
  height: 45px;
  background: linear-gradient(
    135deg,
    var(--orange) 0%,
    var(--orange-dark) 100%
  );
  color: var(--white);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  font-size: 16px;
  box-shadow: 0 5px 15px rgba(232, 103, 42, 0.4);
}

.modal-doc-item:hover .modal-doc-icon {
  transform: translateY(-3px) scale(1.1);
  background: linear-gradient(
    135deg,
    var(--purple) 0%,
    var(--purple-light) 100%
  );
  box-shadow: 0 8px 20px rgba(91, 45, 142, 0.5);
}

/* ============================================
   5. RESPONSIVE
============================================ */
@media (max-width: 900px) {
  .categories-grid {
    grid-template-columns: 1fr;
    gap: 25px;
    max-width: 450px;
  }

  .modal-content {
    max-height: 90vh;
  }

  .modal-header {
    padding: 25px 20px 20px;
    gap: 12px;
  }

  #modal-icon {
    width: 45px;
    height: 45px;
    font-size: 20px;
  }

  .modal-header h3 {
    font-size: 18px;
  }

  .modal-body {
    padding: 15px 20px 25px;
  }
}

@media (max-width: 480px) {
  .category-card {
    padding: 30px 22px 25px;
  }

  .category-title {
    font-size: 17px;
  }

  .category-icon {
    width: 70px;
    height: 70px;
    font-size: 30px;
  }
}
