/* =============================================================
   STYLES CLASSEUR DE MONNAIES
   ============================================================= */

/* Modal du classeur */
.monnaies-binder-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.95);
  backdrop-filter: blur(10px);
  z-index: 10000;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px;
  box-sizing: border-box;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  overflow-y: auto;
}

.monnaies-binder-modal.monnaies-binder-show {
  opacity: 1;
  visibility: visible;
}

/* Bouton de fermeture */
.monnaies-binder-close {
  position: fixed;
  top: 20px;
  right: 30px;
  background: #dc3545;
  color: white;
  border: none;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  z-index: 10001;
  transition: all 0.2s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

.monnaies-binder-close:hover {
  background: #c82333;
  transform: scale(1.1) rotate(90deg);
}

/* Titre et statistiques */
.monnaies-header {
  text-align: center;
  color: white;
  margin-bottom: 15px;
  width: 100%;
  max-width: 1750px;
}

.monnaies-header h1 {
  font-size: 2.5em;
  margin-bottom: 10px;
  text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.8);
}

.monnaies-stats {
  background: rgba(255, 215, 0, 0.2);
  padding: 10px 20px;
  border-radius: 25px;
  display: inline-block;
  font-size: 1.2em;
  backdrop-filter: blur(5px);
  border: 2px solid rgba(255, 215, 0, 0.5);
}

#monnaiesProgress {
  color: #FFD700;
  font-weight: bold;
  font-size: 1.3em;
}

/* Barre de recherche et filtres */
.monnaies-search-bar {
  width: 100%;
  max-width: 1750px;
  margin-bottom: 15px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.monnaies-search-bar .search-container {
  width: 100%;
}

.monnaies-search-bar .search-container input {
  width: 100%;
  padding: 15px 20px;
  font-size: 1.1em;
  border: 3px solid #FFD700;
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  transition: all 0.3s ease;
}

.monnaies-search-bar .search-container input:focus {
  outline: none;
  border-color: #FFA500;
  box-shadow: 0 6px 20px rgba(255, 165, 0, 0.4);
}

.filters-container {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.filters-container select {
  padding: 12px 15px;
  font-size: 1em;
  border: 2px solid #FFD700;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.95);
  cursor: pointer;
  transition: all 0.2s ease;
  flex: 1;
  min-width: 180px;
}

.filters-container select:hover {
  border-color: #FFA500;
  background: white;
}

.btn-reset-filters {
  padding: 12px 25px;
  font-size: 1em;
  font-weight: bold;
  background: linear-gradient(145deg, #666, #444);
  color: white;
  border: 2px solid #888;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-reset-filters:hover {
  background: linear-gradient(145deg, #777, #555);
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

/* Conteneur de l'album */
.monnaies-album-container {
  width: 100%;
  max-width: 1750px;
  background: linear-gradient(145deg, #2a2a2a, #1e1e1e);
  padding: 15px;
  border-radius: 20px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
  height: auto;
  margin-bottom: 15px;
  overflow: hidden;
  border: 3px solid #444;
}

/* Grille des monnaies - 14x3 = 42 monnaies */
.monnaies-grid {
  display: grid;
  grid-template-columns: repeat(14, 110px);
  grid-template-rows: repeat(3, 145px);
  gap: 10px;
  padding: 10px;
  position: relative;
  z-index: 1;
  justify-content: center;
  width: 100%;
  box-sizing: border-box;
}

/* Carte de monnaie */
.coin-card {
  perspective: 1000px;
  width: 110px;
  height: 145px;
  cursor: pointer;
  transition: transform 0.3s ease;
  position: relative;
  box-sizing: border-box;
  justify-self: center;
  align-self: center;
}

.coin-card:hover {
  transform: translateY(-5px);
  z-index: 5;
}

/* Effet flip */
.coin-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.6s;
  transform-style: preserve-3d;
}

.coin-card.flipped .coin-card-inner {
  transform: rotateY(180deg);
}

/* Faces de la monnaie */
.coin-face {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.3);
  background: white;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  border: 3px solid;
  transition: all 0.3s ease;
  box-sizing: border-box;
}

.coin-face img {
  width: calc(100% - 6px);
  height: 95px;
  object-fit: contain;
  background: #f8f8f8;
  padding: 3px;
  flex-shrink: 0;
  display: block;
  margin: 0 auto;
}

.coin-revers {
  transform: rotateY(180deg);
}

.coin-label {
  text-align: center;
  font-weight: bold;
  font-size: 0.75em;
  color: white;
  background: linear-gradient(135deg, #333, #555);
  padding: 6px;
  margin-top: auto;
  flex-shrink: 0;
}

.coin-metal-badge {
  position: absolute;
  top: -5px;
  right: 5px;
  color: white;
  font-size: 0.6em;
  font-weight: bold;
  padding: 8px 1px;
  border-radius: 12px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.7);
  z-index: 10;
}

/* Monnaie vide (non possédée) */
.coin-card.coin-empty {
  width: 110px;
  height: 145px;
  box-sizing: border-box;
}

.coin-placeholder {
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.05);
  border: 2px dashed #999;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8px;
  text-align: center;
  transition: all 0.3s ease;
  box-sizing: border-box;
}

.coin-card.coin-empty:hover .coin-placeholder {
  background: rgba(0, 0, 0, 0.08);
  border-color: #666;
}

.coin-number {
  font-size: 1.2em;
  font-weight: bold;
  color: #999;
  margin-bottom: 6px;
}

.coin-empty-name {
  font-size: 0.7em;
  color: #666;
  line-height: 1.2;
  max-height: 2.4em;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.coin-metal-badge.empty {
  position: static;
  margin-top: 6px;
  opacity: 0.7;
  font-size: 0.6em;
  padding: 3px 8px;
}

/* Tooltip pour afficher le nom complet au survol */
.coin-card {
  position: relative;
}

.coin-card[data-coin-name]:hover::after {
  content: attr(data-coin-name);
  position: absolute;
  bottom: -35px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.9);
  color: white;
  padding: 8px 12px;
  border-radius: 8px;
  white-space: nowrap;
  font-size: 0.85em;
  font-weight: bold;
  z-index: 100;
  pointer-events: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.coin-card[data-coin-name]:hover::before {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-bottom-color: rgba(0, 0, 0, 0.9);
  z-index: 100;
  pointer-events: none;
}

/* Message aucune monnaie */
.no-coins {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  font-size: 1.5em;
  color: #999;
}

/* Indicateur de chargement */
.monnaies-loader {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 20px;
  gap: 20px;
}

.monnaies-loader-spinner {
  width: 60px;
  height: 60px;
  border: 6px solid rgba(255, 215, 0, 0.2);
  border-top-color: #FFD700;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.monnaies-loader-text {
  font-size: 1.3em;
  color: #666;
  font-weight: bold;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Navigation pagination */
.monnaies-navigation {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 15px;
  width: 100%;
  max-width: 1750px;
  padding: 15px 20px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 15px;
  backdrop-filter: blur(5px);
  position: relative;
  z-index: 0;
}

.nav-btn {
  padding: 12px 25px;
  font-size: 1em;
  font-weight: bold;
  background: linear-gradient(145deg, #FFD700, #FFA500);
  color: #333;
  border: none;
  border-radius: 25px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.nav-btn:hover:not(:disabled) {
  background: linear-gradient(145deg, #FFA500, #FF8C00);
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3);
}

.nav-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

.page-indicator {
  font-size: 1.3em;
  font-weight: bold;
  color: white;
  padding: 10px 20px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 20px;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

/* Modal des détails de la monnaie */
.coin-details-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  z-index: 11000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.coin-details-modal.show {
  opacity: 1;
}

.coin-details-content {
  background: white;
  border-radius: 20px;
  padding: 40px;
  max-width: 900px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.close-details {
  position: absolute;
  top: 15px;
  right: 15px;
  background: #dc3545;
  color: white;
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  font-size: 24px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s ease;
}

.close-details:hover {
  background: #c82333;
  transform: scale(1.1) rotate(90deg);
}

.coin-details-content h2 {
  text-align: center;
  color: #333;
  margin-bottom: 30px;
  font-size: 1.8em;
  padding-bottom: 15px;
  border-bottom: 3px solid #FFD700;
}

.coin-images-large {
  display: flex;
  gap: 20px;
  justify-content: center;
  margin-bottom: 30px;
}

.large-image-container {
  text-align: center;
  flex: 1;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.large-image-container img {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: none;
  object-fit: none;
  border-radius: 15px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
  background: #f5f5f5;
  padding: 20px;
  image-rendering: auto;
  image-rendering: crisp-edges;
  image-rendering: -webkit-optimize-contrast;
}

.large-image-container p {
  margin-top: 10px;
  font-weight: bold;
  color: #666;
  font-size: 1.1em;
}

.coin-details-info {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.detail-row {
  display: flex;
  padding: 12px;
  background: #f8f9fa;
  border-radius: 8px;
  border-left: 4px solid #FFD700;
}

.detail-row:nth-child(even) {
  background: #ffffff;
}

.detail-label {
  font-weight: bold;
  color: #555;
  min-width: 180px;
  text-transform: capitalize;
}

.detail-value {
  color: #333;
  flex: 1;
}

/* Responsive */
@media (max-width: 1700px) {
  .monnaies-grid {
    grid-template-columns: repeat(12, 105px);
    grid-template-rows: repeat(4, 140px);
  }

  .coin-card,
  .coin-card.coin-empty {
    width: 105px;
    height: 140px;
  }

  .coin-face img {
    height: 90px;
  }
}

@media (max-width: 1400px) {
  .monnaies-grid {
    grid-template-columns: repeat(10, 100px);
    grid-template-rows: repeat(5, 135px);
  }

  .coin-card,
  .coin-card.coin-empty {
    width: 100px;
    height: 135px;
  }

  .coin-face img {
    height: 85px;
  }
}

@media (max-width: 1200px) {
  .monnaies-grid {
    grid-template-columns: repeat(8, 95px);
    grid-template-rows: repeat(6, 125px);
    gap: 8px;
  }

  .coin-card,
  .coin-card.coin-empty {
    width: 95px;
    height: 125px;
  }

  .coin-face img {
    height: 75px;
  }
}

@media (max-width: 1024px) {
  .monnaies-grid {
    grid-template-columns: repeat(7, 90px);
    grid-template-rows: repeat(6, 120px);
    gap: 8px;
  }

  .coin-card,
  .coin-card.coin-empty {
    width: 90px;
    height: 120px;
  }

  .coin-face img {
    height: 70px;
  }

  .coin-label {
    font-size: 0.7em;
    padding: 5px;
  }
}

@media (max-width: 768px) {
  .monnaies-header h1 {
    font-size: 1.8em;
  }

  .monnaies-grid {
    grid-template-columns: repeat(5, 85px);
    grid-template-rows: repeat(9, 115px);
    gap: 8px;
  }

  .coin-card,
  .coin-card.coin-empty {
    width: 85px;
    height: 115px;
  }

  .coin-face img {
    height: 65px;
  }

  .filters-container {
    flex-direction: column;
  }

  .filters-container select {
    width: 100%;
  }

  .coin-images-large {
    flex-direction: column;
  }

  .coin-details-content {
    padding: 20px;
  }

  .coin-empty-name {
    font-size: 0.65em;
    -webkit-line-clamp: 1;
    max-height: 1.2em;
  }

  .coin-label {
    font-size: 0.65em;
    padding: 4px;
  }

  .coin-number {
    font-size: 1em;
    margin-bottom: 4px;
  }

  .coin-metal-badge {
    font-size: 0.6em;
    padding: 2px 5px;
  }
}
