:root {
  --bg-color: #222;
  --card-list-color: #494949;
  --text-color: white;
  --background-filter: #303030;
  --pokemon-red: #FF0000;
  --pokemon-yellow: #FFCC00;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
  }
  
  body {
      font-family: 'Roboto', sans-serif;
      margin: 0;
      padding: 0;
      background-color: var(--bg-color);
      color: #333;
    }

    .exchange-active {
      background-color: #808080 !important;
      cursor: not-allowed !important;
  }

.container {
  max-width: 1400px;
  margin: 75px auto;
  padding: 20px;
}

.exchange-container {
  display: flex;
  flex-direction: column;
  gap: 30px;
  margin-top: 30px;
}

.my-cards, .available-trades {
  background: var(--card-list-color);
  border-radius: 20px;
  padding: 25px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.08);
}

h2 {
  color: var(--text-color);
  margin-bottom: 20px;
  font-size: 1.5rem;
}

.search-filters {
  background: var(--background-filter);
  padding: 20px;
  border-radius: 15px;
  margin-bottom: 30px;
}

.search-filters input {
  width: 100%;
  padding: 12px 15px;
  border: 2px solid #e9ecef;
  border-radius: 12px;
  margin-bottom: 15px;
  font-size: 14px;
  transition: all 0.3s ease;
}

.search-filters input:focus {
  border-color: var(--pokemon-red);
  outline: none;
  box-shadow: 0 0 0 3px rgba(238,21,21,0.1);
}

.filter-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.filter-btn {
  padding: 8px 16px;
  border: 2px solid #e9ecef;
  border-radius: 20px;
  background: white;
  color: #333;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 14px;
}

.filter-btn:hover {
  border-color: var(--pokemon-red);
  background: #fff5f5;
}

.filter-btn.active {
  background: var(--pokemon-yellow);
  color: black;
  border-color: var(--pokemon-yellow);
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 20px;
  padding: 20px;
}

.trades-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 15px;
  padding: 20px;
}

.trade-item {
  background: var(--background-filter);
  border-radius: 12px;
  margin-bottom: 1rem;
  padding: 1.5rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  border: 1px solid rgba(255, 255, 255, 0.1);
  animation: fadeInUp 0.3s ease forwards;
  opacity: 0;
  transform: translateY(20px);
}

.trade-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.trade-card {
  display: flex;
  gap: 2rem;
  align-items: center;
}

.trade-card-image {
  width: 140px;
  height: auto;
  border-radius: 10px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s ease;
}

.trade-card-image:hover {
  transform: scale(1.05);
}

.trade-info {
  color: white;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.trade-info h4 {
  font-size: 1.25rem;
  margin: 0 0 0.75rem 0;
  color: whitesmoke;
}

.trade-info p {
  margin: 0;
  padding: 0.35rem 0;
  display: flex;
  align-items: center;
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.9);
}

.trade-info p:not(:last-child) {
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.card-offer{
  color: var(--header-color) !important;
}

.card-request{
  color: var(--pokemon-yellow) !important;
}

.card-image:hover{
  transform: scale(1.05);
  transition: transform 0.2s ease;
}

/* Délai d'animation pour chaque item */
.trade-item:nth-child(1) { animation-delay: 0.1s; }
.trade-item:nth-child(2) { animation-delay: 0.2s; }
.trade-item:nth-child(3) { animation-delay: 0.3s; }
.trade-item:nth-child(4) { animation-delay: 0.4s; }
.trade-item:nth-child(5) { animation-delay: 0.5s; }

.card-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  z-index: 1000;
  justify-content: center;
  align-items: center;
}

.modal-content-request {
  background: var(--background-filter);
  padding: 20px;
  border-radius: 15px;
  max-width: 660px;
  width: 90%;
  position: relative;
}

.close-modal {
  position: absolute;
  top: 10px;
  right: 10px;
  background: none;
  border: none;
  color: var(--header-color) !important;
  font-size: 24px;
  cursor: pointer;
}

.trade-options {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.propose-trade, .cancel-trade {
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.propose-trade {
  background: var(--pokemon-red);
  color: white;
}

.cancel-trade {
  background-color: var(--background-filter);
  color: var(--text-color);
  border: 1px solid var(--text-color);
  padding: 12px 24px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.3s ease;
}

.cancel-trade:hover{
  background-color: var(--text-color);
    color: var(--background-filter);
}

.energy-filters {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.filter-btn[data-energy="Feu"] { background-color: #FF4136; color: white; }
.filter-btn[data-energy="Eau"] { background-color: #0074D9; color: white; }
.filter-btn[data-energy="Plante"] { background-color: #2ECC40; color: white; }
.filter-btn[data-energy="Électrique"] { background-color: #FFDC00; color: black; }
.filter-btn[data-energy="Combat"] { background-color: #B10DC9; color: white; }
.filter-btn[data-energy="Psy"] { background-color: #FF851B; color: white; }
.filter-btn[data-energy="Normal"] { background-color: #AAAAAA; color: white; }

.filter-btn[data-energy].active {
  box-shadow: 0 0 0 2px white;
}

.modal-layout {
  display: flex;
  gap: 20px;
}

.modal-left {
  flex: 0 0 auto;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 300px;
}

.modal-right {
  flex: 1;
  color: var(--text-color);
  padding: 0 20px;
}

.modal-right h3 {
  margin-bottom: 15px;
}

.card-info {
  border: 1px solid var(--header-color);
  padding: 15px;
  border-radius: 8px;
  margin-bottom: 20px;
}

.card-info p {
  margin-bottom: 8px;
}

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

.form-group label {
  display: block;
  margin-bottom: 8px;
}

.form-group textarea {
  width: 100%;
  height: 100px;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid var(--background-filter);
  background: var(--background-filter);
  color: var(--text-color);
  resize: vertical;
}

.form-group input {
  width: 100%;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid var(--background-filter);
  background: var(--background-filter);
  color: var(--text-color);
}

.form-group input::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

.form-group input:focus {
  outline: none;
  border-color: var(--pokemon-yellow);
}

#modalImage {
  max-width: 300px;
  height: auto;
}

.propose-trade-btn {
    width: 180px;
    background-color: var(--pokemon-red);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    margin-top: 10px;
    transition: background-color 0.3s ease;
}

.propose-trade-btn:hover {
    background-color: #cc0000;
}

.trade-type-selector {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}

.trade-type-btn {
  flex: 1;
  padding: 10px;
  border: 2px solid var(--pokemon-red);
  background: transparent;
  color: var(--text-color);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.trade-type-btn.active {
  background: var(--pokemon-red);
  color: white;
}

.trade-type-btn:hover:not(.active) {
  background: rgba(255, 0, 0, 0.1);
}

/* Ajout du style pour le bouton de proposition */
.make-offer-btn {
  background-color: var(--pokemon-red);
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  margin-top: 15px;
  transition: background-color 0.3s ease;
}

.make-offer-btn:hover {
  background-color: #cc0000;
}

.extension-filters {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.extension-select {
    width: 100%;
    padding: 8px 12px;
    border-radius: 8px;
    background-color: var(--card-list-color);
    color: var(--text-color);
    border: 1px solid rgba(255, 255, 255, 0.2);
    cursor: pointer;
    font-size: 14px;
}

.extension-select:focus {
    outline: none;
    border-color: var(--pokemon-yellow);
    box-shadow: 0 0 0 2px rgba(255, 204, 0, 0.1);
}

.extension-select option {
    background-color: var(--background-filter);
    color: var(--text-color);
    padding: 8px;
}

.card-item {
  animation: fadeInUp 0.3s ease forwards;
  opacity: 0;
  transform: translateY(20px);
}

/* Délai d'animation pour chaque carte */
.card-item:nth-child(1) { animation-delay: 0.05s; }
.card-item:nth-child(2) { animation-delay: 0.1s; }
.card-item:nth-child(3) { animation-delay: 0.15s; }
.card-item:nth-child(4) { animation-delay: 0.2s; }
.card-item:nth-child(5) { animation-delay: 0.25s; }
.card-item:nth-child(6) { animation-delay: 0.3s; }
.card-item:nth-child(7) { animation-delay: 0.35s; }
.card-item:nth-child(8) { animation-delay: 0.4s; }
.card-item:nth-child(9) { animation-delay: 0.45s; }
.card-item:nth-child(10) { animation-delay: 0.5s; }
.card-item:nth-child(11) { animation-delay: 0.55s; }
.card-item:nth-child(12) { animation-delay: 0.6s; }
.card-item:nth-child(13) { animation-delay: 0.65s; }
.card-item:nth-child(14) { animation-delay: 0.7s; }
.card-item:nth-child(15) { animation-delay: 0.75s; }
.card-item:nth-child(16) { animation-delay: 0.80s; }
.card-item:nth-child(17) { animation-delay: 0.85s; }
.card-item:nth-child(18) { animation-delay: 0.90s; }
.card-item:nth-child(19) { animation-delay: 0.95s; }
.card-item:nth-child(20) { animation-delay: 1.00s; }
.card-item:nth-child(21) { animation-delay: 1.05s; }
.card-item:nth-child(22) { animation-delay: 1.10s; }
.card-item:nth-child(23) { animation-delay: 1.15s; }
.card-item:nth-child(24) { animation-delay: 1.20s; }


.modal-content-exchange {
  background: var(--background-filter);
  padding: 20px;
  border-radius: 15px;
  max-width: 400px;
  width: 90%;
  position: relative;
}

.exchange-layout {
  display: flex;
  flex-direction: column;
  gap: 20px;
  align-items: center;
}

.exchange-card {
  width: 100%;
  text-align: center;
  padding: 15px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
}

.exchange-card.offered {
  border: 2px solid var(--pokemon-red);
}

.exchange-card.requested {
  border: 2px solid var(--pokemon-yellow);
}

.exchange-card img {
  max-width: 200px;
  height: auto;
}

.exchange-card-info {
  color: var(--text-color);
  margin-top: 10px;
}

.exchange-arrow {
  color: var(--text-color);
  font-size: 24px;
}

.card-selection {
    width: 100%;
    max-height: 300px;
    overflow-y: auto;
}

.card-search {
    width: 100%;
    padding: 8px;
    margin-bottom: 10px;
    border-radius: 8px;
    border: 1px solid var(--background-filter);
    background: var(--background-filter);
    color: var(--text-color);
}

.cards-grid-exchange {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
    padding: 10px;
}

.card-item-exchange {
    cursor: pointer;
    transition: transform 0.2s ease;
}

.card-item-exchange:hover {
    transform: scale(1.05);
}

.selectable-card {
    width: 100%;
    height: auto;
    border-radius: 8px;
}

.card-info-exchange {
    font-size: 12px;
    margin-top: 5px;
    color: var(--text-color);
}

.card-info-exchange p {
    margin: 2px 0;
}

.exchange-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 20px;
    width: 100%;
}

.confirm-exchange-btn {
    background-color: var(--pokemon-red);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s ease;
}

.confirm-exchange-btn:hover {
    background-color: #cc0000;
}

.cancel-exchange-btn {
    background-color: var(--background-filter);
    color: var(--text-color);
    border: 1px solid var(--text-color);
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.cancel-exchange-btn:hover {
    background-color: var(--text-color);
    color: var(--background-filter);
} 

.switch-button {
  position: fixed;
  right: 30px; 
  bottom: 30px; 
  z-index: 9;
  margin: 0;
  padding: 10px 20px;
  background-color: var(--pokemon-red);
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
}

.modal-content-img {
  position: relative;
  background-color: #222;
  margin: 10% auto;
  padding: 2rem;
  border-radius: 1rem;
  max-width: 500px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  animation: modalSlideDown 0.3s ease-out;
  overflow: hidden;
}







.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.info-button {
  background-color: transparent;
  color: white;
  border: none;
  padding: 8px 15px;
  border-radius: 5px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  border: 1px solid var(--header-color);
}

.info-button:hover {
  background-color: var(--header-color);
}

.modal-content-info {
  background-color: #333;
  padding: 20px;
  border-radius: 10px;
  max-width: 600px;
  width: 90%;
  position: relative;
}

.info-content {
  color: var(--text-color);
}

.info-content h3 {
  margin-bottom: 20px;
  color: var(--primary-color);
}

.info-content ul, .info-content ol {
  margin-left: 20px;
  margin-bottom: 15px;
}

.info-content li {
  margin-top: 10px;
}

/* Style responsive */
@media (max-width: 768px) {

  .container {
    margin: 55px auto;
    overflow: hidden;
  }
  
  .section-header{
    flex-direction: column;
  }

  .exchange-container {
    grid-template-columns: 1fr ;
    gap: 20px;
  }

  .modal-layout {
    flex-direction: column;
    align-items: center;
  }

  .modal-left {
    width: 100%;
    margin-bottom: 20px;
  }

  .modal-right {
    padding: 0;
    width: 100%;
  }

  #modalImage {
    max-width: 200px;
  }

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

  .filter-group {
    width: 100%;
    justify-content: center;
  }

  .cards-grid {
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 10px;
    padding: 10px;
  }

  .card-image {
    width: 120px !important;
  }

  .trade-card {
    flex-direction: column;
    text-align: center;
    gap: 1rem;
  }

  .trade-card-image {
    width: 120px;
  }

  .trade-info {
    align-items: center;
  }

  .trade-info p {
    justify-content: center;
  }

  .make-offer-btn {
    margin: 15px auto 0;
  }

  .switch-button{
    right: 15px;
    bottom: 15px;
  }

  .trades-list{
    display: flex;
    flex-direction: column;
  }

  .modal-content-exchange{
    transform: scale(0.75);
  }

  .exchange-card img{
    max-width: 165px;
  }

}

.info-content h3{
  color: var(--header-color);
}

.info-content p{
  color: var(--pokemon-yellow);
}

@media (max-width: 480px) {

  .search-filters input {
    font-size: 16px;
    padding: 10px;
  }

  .filter-btn {
    padding: 6px 12px;
    font-size: 13px;
  }

  .trade-card {
    flex-direction: column;
    gap: 1rem;
  }

  .trade-card-image {
    width: 100px;
  }

  .trade-info {
    text-align: center;
  }

  .trade-info h4 {
    font-size: 1.1rem;
  }

  .trade-info p {
    font-size: 0.9rem;
    justify-content: center;
  }

  .modal-content-request {
    width: 95%;
    padding: 15px;
    transform: scale(0.93);
  }

  .card-info {
    padding: 10px;
  }

  .form-group input {
    font-size: 16px;
  }
}

/* Animation au chargement des échanges */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

