/* Reset y base */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}
body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: #d0e8f2; /* Celeste suave */
  color: #1c2833; /* texto oscuro */
  line-height: 1.6;
  min-height: 100vh;
}
.hidden {
    display: none !important;
}
main {
  margin: 20px 30px;
  padding: 20px;
  background-color: white;
  border-radius: 8px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.1);
}
.sin-resultados {
    grid-column: 1 / -1;
    text-align: center;
    padding: 50px;
    color: #7f8c8d;
    font-size: 18px;
}
.card {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s;
}
.card:hover {
    transform: translateY(-5px);
}

/* Botones */
button {
    background-color: #3498db;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s;
}
button:hover {
    background-color: #2980b9;
}
button:disabled {
    background-color: #95a5a6;
    cursor: not-allowed;
}
#btn-conectar {
    background-color: cadetblue;
    border: 2px solid black;
    color: white;
    font-weight: bold;
    padding: 10px 16px;
    border-radius: 4px;
    transition: background-color 0.3s ease;
}
#btn-conectar.conectado {
    background-color: #27ae60;
    opacity: 0.95;
}
#btn-conectar.conectado::after {
    content: "✓";
    margin-left: 5px;
}
button:disabled {
    cursor: not-allowed !important;
    opacity: 0.6;
}

/* Wallet */
.wallet-container {
    display: flex;
    align-items: center;
    gap: 6px;
    position: absolute;
    right: 5%;
    top: 12%;
    transform: translateY(-50%);
}
.wallet-icon {
    border: 2px solid black;
    border-radius: 50%;
}

/* Filtros */
.filtros {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
    border-radius: 8px;
    padding: 15px 15px 20px 15px;
    background-color: lightcyan;
    justify-content: center;
    position: relative;
}
.filtros-header {
    position: absolute;
    top: 0;
    right: 0;
}
#limpiar-filtros {
    width: 35px;
    height: 35px;
    border: 2px solid black;
    opacity: 0.8;
    transition: opacity 0.2s ease;
}
#limpiar-filtros:hover {
    opacity: 1;
}
.filtro-group {
  justify-items: center;
}
#filtro-propios{
    transform: scale(1.4);
    margin: 14px;
    cursor: pointer;
}
.filtro {
  background-color: cadetblue;
  margin-top: 4px;
  border: 2px solid black;
  color: white;
  font-weight: bold;
  padding: 10px 16px;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}
.filtro:hover, .filtro:focus {
  background-color: #2874a6;
  outline: none;
}
.checkbox-group {
    text-align: center;
}
label {
    display: block;
    font-weight: bold;
    color: #2c3e50;
}

/* Grid y Cards */
.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin: 20px 0 30px 0
}
.nft-card {
    composes: card;
    display: flex;
    flex-direction: column;
}
.nft-imagen-container {
    padding: 10px;
    position: relative;
    width: 100%;
    height: 250px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}
.nft-imagen-container.propio {
  background: linear-gradient(135deg, #d4af37, #fff8dc);
  border: 2px solid #c5a017;
  box-shadow: 0 0 10px rgba(212, 175, 55, 0.6);
}
.nft-imagen-container.no-propio {
  background: repeating-linear-gradient(
    45deg,
    #f0f0f0,
    #f0f0f0 10px,
    #e0e0e0 10px,
    #e0e0e0 20px
  );
  border: 2px dashed #999;
  opacity: 0.7;
}
.nft-imagen {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: filter 0.3s;
}
.nft-cantidad {
    position: absolute;
    right: 10px;
    bottom: 10px;
    height: 28px;
    padding: 0px 8px;
    -webkit-box-pack: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.85);
    background: rgba(25, 28, 31, 0.4);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}
.nft-info {
    padding: 15px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}
.nft-nombre {
    font-size: 1.1rem;
    padding: 12px 10px;
    color: #2c3e50;
    min-height: 80px;
    text-align: center;
    justify-content: center;
    background-color: #f8f9fa;
    border-radius: 0 0 8px 8px;
    font-weight: 600;
    line-height: 1.4;
    border-top: 1px solid #e0e0e0;
    overflow: hidden;
    text-overflow: ellipsis;
    display: grid;
    place-items: center;
}
.nft-atributos {
    padding: 12px 15px;
    background: #f8fafb;
    border-radius: 8px;
    margin: 10px 0;
    border: 1px solid #e1e5e9;
}
.nft-card:hover .nft-atributos {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    border-color: #cfd8dc;
}
.nft-atributos-titulo {
    font-size: 0.9rem;
    font-weight: 700;
    color: #4e44ce;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.nft-atributos-contador {
    background: #4e44ce;
    color: white;
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 10px;
    margin-left: 8px;
}
.nft-atributos-lista {
    display: grid;
    gap: 8px;
}
.nft-atributo {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 10px;
    background: white;
    border-radius: 6px;
}
.atributo-nombre {
    font-weight: 600;
    color: #2c3e50;
    font-size: 0.85rem;
}
.atributo-valor {
    text-align: right;
    font-size: 0.82rem;
    color: #5a6a7a;
    padding-left: 10px;
    white-space: pre-line; /* Respeta los saltos de línea */
}

/* Plataformas NFT */
.nft-plataformas {
    display: flex;
    gap: 10px;
    padding-top: 15px;
    border-top: 1px solid #ddd;
    justify-content: center;
}
.nft-plataformas a:hover {
    transform: translateY(-2px) scale(1.1);
    background-color: rgba(0, 0, 0, 0.08);
}
.nft-plataformas img {
    width: 32px;
    height: 32px;
}
.nft-plataformas a:hover img {
    filter: grayscale(0%) contrast(1.2);
}
.nft-plataformas a::after {
    content: attr(title);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background-color: #2c3e50;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
    z-index: 10;
}
.nft-plataformas a:hover::after {
    opacity: 1;
}

/* Paginación */
#div-filtro-paginador{
    display: flex;
    align-items: center;
    gap: 15px;
    margin-top: 30px;
    justify-content: center;
}
.paginador-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}
.paginador-btn {
    display: flex;
}
.paginador-btn:hover:not(:disabled) {
    background: #3a30b0;
    transform: scale(1.1);
}
.paginador-btn:disabled {
    background: #cccccc;
    color: #666666;
    cursor: not-allowed;
    opacity: 0.6;
}
.paginador-contador {
    font-size: 1rem;
    color: #333;
    min-width: 100px;
    text-align: center;
    font-weight: 500;
}

/* Flechas Paginador */
.paginador-btn {
    background: none;
    border-radius: 4px;
    padding: 8px;
}
.paginador-flecha {
    width: 12px;
    height: 12px;
    border-top: 2px solid #4e44ce;
    border-right: 2px solid #4e44ce;
}
.paginador-flecha.izquierda {
    transform: rotate(-135deg);
    margin-right: 2px;
}
.paginador-flecha.derecha {
    transform: rotate(45deg);
    margin-left: 2px;
}
.paginador-btn:hover:not(:disabled) .paginador-flecha {
    border-color: whitesmoke;
}
.paginador-btn:disabled .paginador-flecha {
    border-color: #999;
}

/* Estadísticas */
.estadisticas {
    margin-top: 20px;
}
.estadisticas-container {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    margin: 20px auto;
    max-width: 3500px;
    margin-top: 0;
    border-top: 1px solid #eee;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}
.estadisticas-container.hidden {
    opacity: 0;
    height: 0;
    padding: 0;
    margin: 0;
    overflow: hidden;
}
.estadisticas-container h3, .estadisticas-container h4 {
    margin: 0 0 10px 0;
    color: #333;
}
.progreso-total, .progreso-categoria {
    height: 24px;
    background: #e9ecef;
    border-radius: 12px;
    position: relative;
    overflow: hidden;
}
.progreso-total {
    margin-bottom: 25px;
}
.progreso-categoria {
    margin-bottom: 8px;
}
.progreso-barra {
    height: 100%;
    background: #4e44ce;
    border-radius: 12px;
    transition: width 0.3s ease;
}
.progreso-total span, .progreso-categoria span {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #B09EFF;
    font-size: 12.5px;
    font-weight: bold;
}
.lista-categorias {
    list-style: none;
    padding: 0;
    margin: 0;
}
.lista-categorias li {
    margin-bottom: 10px;
}
.categoria-nombre {
    display: block;
    font-weight: 500;
    margin-bottom: 4px;
    color: #555;
}

/* BANNER SORTEO */
#banner-sorteo {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: linear-gradient(135deg, #fff38f, #ffa76f);
    color: #000;
    padding: 16px 20px;
    border-radius: 16px;
    box-shadow: 0 0 15px rgba(0,0,0,0.25);
    z-index: 9999;
    animation: entrada 0.4s ease-out;
}
#banner-sorteo button {
    margin-top: 10px;
    padding: 8px 14px;
    background: #000;
    border-radius: 10px;
    font-weight: bold;
    cursor: pointer;
}
#banner-sorteo button:hover {
    background: #222;
}
@keyframes entrada {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* TRANSFERENCIA NFT */
.div-transferir {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 4px;
  cursor: pointer;
}
.div-transferir img {
  width: 32px;
  height: 32px;
}
.popup {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: rgba(0,0,0,0.5);
    z-index: 100;
    display: flex;
    justify-content: center;
    align-items: center;
}
.popup-contenido {
    background: white;
    padding: 40px 20px 20px 20px;
    border-radius: 12px;
    box-shadow: 0 0 15px rgba(0,0,0,0.3);
    position: relative;
}
#popup-cerrar {
    position: absolute;
    top: 0;
    right: 14px;
    font-size: 28px;
    cursor: pointer;
}
.popup-contenido input {
    width: 100%;
    margin: 8px 0;
    padding: 8px;
}
.popup-contenido button {
    width: 100%;
    padding: 10px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

/* TOOGLES */
.toggle-content {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  padding: 0 1em;
  border-width: 0;
  border-style: solid;
  border-color: #154360;
  transition: max-height 0.6s ease, opacity 0.6s ease, padding 0.6s ease, border-width 0.6s ease;
}
.toggle-content.expanded {
  max-height: 3500px; /* suficiente para todo el contenido */
  opacity: 1;
  padding: 1em;
  border-width: 1px;
}
.toggle-header {
  font-size: 1.2rem;
  background-color: #eaf2f8;
  border: 1px solid #154360;
  border-radius: 6px;
  padding: 12px 16px;
  margin: 20px 0 10px 0;
  cursor: pointer;
  user-select: none;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #154360;
  transition: background-color 0.3s ease;
  justify-content: space-between;
}
.toggle-header .arrow {
  transition: transform 0.3s ease;
}
.toggle-header.active .arrow {
  transform: rotate(180deg);
}

/* Spinners */
#loading {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}
.spinner {
    border: 5px solid #f3f3f3;
    border-top: 5px solid #3498db;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
}
.spinner.pequeno {
    width: 20px;
    height: 20px;
    border-width: 3px;
    position: absolute;
}

/* Animaciones */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
@keyframes slideIn {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
}

/* Scroll suave */
html {
    scroll-behavior: smooth;
}
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
}

/* Mensajes de Error */
.error-mensaje {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: #e74c3c;
    color: white;
    padding: 15px;
    border-radius: 5px;
    animation: slideIn 0.3s forwards;
    max-width: 300px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
    white-space: pre-line;
    z-index: 1000;
}

/* Mensajes de Advertencia */
.advertencia {
    position: fixed;
    grid-column: 1 / -1;
    text-align: left;
    padding: 15px;
    bottom: 20px;
    right: 20px;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s ease;
    background-color: #fff3cd;
    border-left: 4px solid #ffc107;
    color: #856404;
    animation: slideIn 0.3s forwards;
    max-width: 500px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
    white-space: pre-line;
    z-index: 1000;
}

/* Mensajes de Éxito */
.mensaje-exito {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: #27ae60;
    color: white;
    padding: 15px;
    border-radius: 5px;
    animation: slideIn 0.3s forwards;
    max-width: 300px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
    white-space: pre-line;
    z-index: 1000;
}

/* Responsive */
@media (max-width: 768px) {
    header {
        flex-direction: column;
        gap: 15px;
    }
    .grid-container {
        grid-template-columns: 1fr;
    }
    .nft-plataformas a {
        width: 28px;
        height: 28px;
    }
}