/* =======================
   VARIABLES GLOBALES
======================= */
:root {
    --primary-color: #e3350d;
    --secondary-color: #ffcc00;
    --background-color: #f8f9fa;
    --card-bg: #ffffff;
    --shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

/* =======================
   RESET Y GLOBAL
======================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Arial', sans-serif;
}

body {
    background: var(--background-color);
}

/* =======================
   HEADER
======================= */
header {
    position: relative;
    color: white;
    height: 15vh;
    display: flex;
    align-items: end;
    justify-content: center;
    z-index: 10;
    background: radial-gradient(
        circle at 50% 80%,
        #FD5557 0%,
        #F04A4C 35%,
        #D94446 70%
    );
    border-bottom: #111 10px solid;
}

/* =======================
   CÍRCULOS (UI)
======================= */
.circle-container {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translate(-50%, 50%);
    width: 80px; 
    height: 80px;
    background-color: #111;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.inner-circle {
    width: 60px; 
    height: 60px;
    background-color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.inner-inner-circle {
    width: 35px;
    height: 35px;
    box-shadow: var(--shadow);
    border-radius: 50%;
    transition: all 0.3s ease;
}

/* =======================
   MAIN / CONTENEDORES
======================= */
main {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    background: radial-gradient(
        circle at 50% 10%,
        var(--background-color) 0%,
        #E9ECEF 35%,
        #DEE2E6 70%
    );
}

.sets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 30px;
    padding: 2rem 12rem;
    margin-top: 4rem;
    width: 100%;
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, 140px); /* columnas fijas */
    gap: 20px;
    padding: 2.5rem 1rem;
    width: 100%;
    border-radius: 40px;
    justify-content: center; 
    justify-items: center;
    background: #fff;
    box-shadow: var(--shadow);
}

.top-div {
    background: #fff;
    margin-top: 4rem;
    box-shadow: var(--shadow);
    border-radius: 40px;
    padding: 1rem 4rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.overview-data {
    display: flex;
    gap: 2rem;
    justify-content: space-between;
}

.overview-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.overview-item span {
    font-size: 2rem;
    font-family:'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #999;
}

.overview-item small {
    color: #999
}

/* =======================
   SETS PAGE
======================= */
.set-card {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    text-align: center;
    height: 100px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: all 0.2s ease-out;
    cursor: pointer;

    /* quitamos background-inline y lo pasamos a la variable */
    /* opcional: fondo de respaldo */
    background: white;
    box-shadow: var(--shadow);

}

/* Pseudo-elemento para el background en B/N */
.set-card::before {
    content: "";
    position: absolute;
    inset: 0; /* top:0; left:0; right:0; bottom:0 */
    background-image: var(--bg); /* la imagen viene de style="--bg:url(...)" */
    background-size: 200%;
    background-repeat: no-repeat;
    filter: grayscale(70%); /* blanco y negro */
    opacity: 0.1;
    transition: all 0.3s ease-out;
}

/* Logo encima del pseudo-elemento */
.set-card .logo {
    max-height: 80px;
    max-width: 120px;
    width: auto;
    height: auto;
    z-index: 2; /* encima del background */
    position: relative;
    object-fit: contain;
    transition: all 0.2s ease-out;
}

/* =======================
   CARDS PAGE
======================= */

#set-cards {
    gap: 2rem;
}

#set-title {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 1.5rem;
    color: #444;
}

#set-title .set-logo {
    width: 150px;   /* tamaño del logo */
    height: 150px;
    object-fit: contain;
}

#set-content {
    display: flex;
    gap: 2rem;
}

#cards-container {
    flex: 3;
}

#set-controls {
    background: #fff;
    border-radius: 40px;;
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 1rem; 
    gap: 20px;
    box-shadow: var(--shadow);
}

#set-controls button {
    margin: 0
}

#set-controls h2 {
    text-align: center;
    font-size: 1rem;
    color: #444;
    padding: 1rem 0 0 0;
}

.card {
    width: 150px;
    height: 202px;
    background-color: #FFF;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
}

.card img {
    max-width: 95%;
    max-height: 95%;
    object-fit: contain;
    cursor: pointer;
}

.card:hover {
    transform: translateY(-5%);
}

#type-buttons-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr); /* 3 columnas iguales */
    gap: 10px; /* espacio entre botones */
    justify-items: center;
    align-items: center;
    width: 100%
}
/* Estilo de los botones */
#type-buttons-container button {
    background: none;
    width: 3rem;
    aspect-ratio: 1/1;
    border-radius: 0;
    padding: 0.2rem;
    box-shadow: none;
}

/* Imagen dentro del botón */
#type-buttons-container button img {
    width: 100%; /* ajusta el tamaño de la imagen según tu diseño */
    height: auto;
}

/* =======================
   BOTONES
======================= */
button, .language-select {
    background: linear-gradient(
        110deg,
        #111111 0%,
        #555 100%
    );
    border: none;
    padding: 1rem 1.5rem;
    color: var(--background-color);
    border-radius: 100px;
    font-size: 1rem;
    font-family:'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-weight: 500;
    transition: all 0.2s ease-out;
    width: 16rem;
    align-self: center;
    margin-top: 4rem;
    cursor: pointer;
}

#add-remove-btn, #download, #upload {
    padding: 1rem 1.25rem;
    width: auto;
}

#add-remove-btn.delete-mode, .set-card.delete {
    background: linear-gradient(
        110deg,
        #D94446 0%,
        #FD5557 70%
    );
}

#add-remove-btn.add-mode, .set-card.add {
    background: linear-gradient(
        110deg,
        #41e06c 0%,
        #6efa93 100%
    );
}

.dropdown-wrapper {
    align-self: center;
}

.language-select {
    appearance: none;
    text-align: center;
    margin: 0;
}

.language-select option {
    background-color: #111;
    padding: 1rem;
}

.language-select:focus {
    outline: none;
}

/* =======================
   HOVER GENERAL
======================= */
button:hover, 
.inner-inner-circle:hover, .language-select:hover {
    transform: scale(1.05);
    color: white;
    background: linear-gradient(
        110deg,
        #00d6f7 0%,
        #48faf1 100%
    );
    box-shadow: var(--shadow);
}

.set-card:hover {
    background-color: #48faf1;
}

.set-card:hover::before {
    background-size: 120%;
    background-position: center;
}

.set-card:hover, .button:hover {
    transform: scale(1.1);
}

.set-card:hover .logo, #type-buttons-container button:hover {
    transform: scale(1.2);
}

/* =======================
   MEDIA QUERIES
======================= */
@media (max-width: 1000px) {
    .sets-grid {
        width: 100%;
        padding: 0;
        gap: 20px;
    }
}

/* POP UP */

.popup {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.popup.hidden {
  display: none;
}

.popup img {
  max-width: 85vw;
  max-height: 85vh;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}

.popup-inner {
  position: relative;
  display: flex;
  align-items: center;
  gap: 2rem;
}

.card-nav {
    display: flex;
    gap: 1rem;
}

.nav-btn {
  font-size: 24px;
    aspect-ratio: 1/1;
    width: 50%;
    padding: 1rem;
    background: #fff;
    color: #333;
}

.popup-info {
  background: #fff;
  color: #333;
  padding: 2rem;
  border-radius: 50px;
}

.popup-info h2 {
  margin-bottom: 1rem;
  text-align: center;
}

.owned-controls {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.owned-controls input {
    padding: 1rem;
    font-size: 1rem;
    text-align: center;
    border-radius: 50px;
    margin-bottom: 8px;
    border: none;
        background: linear-gradient(
        110deg,
        #00d6f7 0%,
        #48faf1 100%
    );
    color: #fff;
    font-weight: bold;
}

.owned-controls button {
  margin-top: 8px;
}

/* Base de la carta */
.card img {
  display: block;
  position: relative;
}

/* Solo cartas NO normales */
.card:not([data-variant="normal"]) {
  position: relative;
  overflow: hidden;
}

/* Capa de brillo */
.card:not([data-variant="normal"])::after {
  content: "";
  position: absolute;
  inset: -40%;
  background: linear-gradient(
    120deg,
    transparent 30%,
    rgba(255, 255, 255, 0.35) 45%,
    rgba(255, 255, 255, 0.6) 50%,
    rgba(255, 255, 255, 0.35) 55%,
    transparent 70%
  );
  opacity: 0.6;
  transform: translateX(-100%) rotate(10deg);
  animation: foil-sweep 2.5s linear infinite;
  pointer-events: none;
}

.card:not([data-variant="normal"]):hover {
    filter: brightness(1.15);
}

.card-pricing {
    color: #999;
    font-size: 90%;
    justify-content: space-between;
    padding: 0 1rem;
}

.card-pricing span {
    color: #555;
    font-weight: bold;
    margin-left: 5px;
}

/* Animación del brillo */
@keyframes foil-sweep {
  0% {
    transform: translateX(-100%) rotate(10deg);
  }
  100% {
    transform: translateX(100%) rotate(10deg);
  }
}


@media (max-width: 1000px) {
    main {
        padding: 0;
    }
    #set-content {
        display: flex;
        flex-direction: column-reverse;
        align-items: center;
    }
    #set-title, .buttons {
        justify-content: center;
        margin: 1rem 0
    }
    #set-title h2, .popup-info p{
        display: none;  
    }
    #set-controls, #cards-container, #sets-container, .buttons, .cards-grid, .top-div {
        width: 90%;
        align-self: center;
        background: none;
        box-shadow: none;
    }
    .cards-grid {
        background: none;
    }
    .popup-inner {
        display: flex;
        flex-direction: column;
        height: 100vh;
        justify-content: space-between;
    }

    .card-nav {
        width: 70%;
        justify-content: center;
    }
    .popup img {
        width: 60%;
        margin-top: 10vh;
    }
    button, input, .dropdown-wrapper, .language-select, .popup-info, .cards-grid {
        width: 100%;
        text-align: center;
    }
    .popup-info {
        border-radius: 25px 25px 0 0;
        justify-self: end;
    }
    .popup-info h2{
        font-size: 1rem;
    }
    .card-pricing {
        font-size: 80%;
        display: flex;
    }
    .card-pricing span {
        margin: 0;
    }
    .top-div {
        display: block;
    }
}