:root {
    --color-primario: rgb(255, 255, 255);
    --color-secundario: rgb(0, 0, 0);
    /* Transicion suave de color */
    transition: background-color 0.5s ease, color 0.5s ease;
}

body, main, #Banner {
    transition: background-color 0.5s ease, 
                background-image 0.8s ease-in-out,
                filter 0.5s ease;
}

body {
    font-family: Arial, sans-serif;
    background-color: var(--color-secundario);
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

h1, h2 {
    font-weight: bold;
}

/* ======= BANNER ======= */
#Banner {
    background-image: url("./img/pokmon.jpg");
    background-size: cover;
    background-repeat: no-repeat;
    padding: 180px 50px;
}

#P_Banner {
    font-family: "Comic Sans MS", "Comic Sans", cursive;
    color: var(--color-primario);
    font-size: 3rem;    
}

/* ======= NAVBAR ======= */
#navbar {
    background: var(--color-secundario);
    opacity: 85%;
    padding: 5px;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 2px solid gray;
}

#navbar .logo {
    color: var(--color-primario);
    font-size: 1.6rem;
    font-family: "Comic Sans MS", "Comic Sans", cursive;
    text-decoration: none;
    font-weight: bold;
}

#Claro {
    margin-left: auto;
    text-align: end;
}

/* SWITCH DE MODO OSCURO/CLARO */
.switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 26px;
  margin-left: 1rem;
}

.switch input { display: none; }

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;  
  background-color: #ccc;
  transition: .4s;
  border-radius: 26px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  border-radius: 50%;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .4s;
}

input:checked + .slider {
  background-color: #4b79ff;
}

input:checked + .slider:before {
  transform: translateX(24px);
}

/* ====== BARRAS DE BÚSQUEDA ====== */
.search-container {
    display: flex;
    gap: 5px;
}

.search-container input {
    padding: 8px;
    border: 2px solid gray;
    border-radius: 4px;
    background-color: var(--color-secundario);
    color: var(--color-primario);
    font-size: 0.9rem;
}

.search-container button {
    padding: 8px 15px;
    background-color: rgb(0, 136, 255);
    border: none;
    color: var(--color-primario);
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
}

.search-container button:hover {
    background-color: rgb(0, 110, 209);
}

/* ======= FONDOS PRINCIPALES ======= */
main {
    background-image: url("./img/fondo3.jpg");
    background-size: cover;
    background-repeat: no-repeat;
    padding-bottom: 40px;
}

/* ======= TITULOS ======= */
#N_Productod {
    color: var(--color-primario);
    font-family: "Comic Sans MS", "Comic Sans", cursive;
    text-align: center;
    font-size: 3rem;
    padding-top: 20px;
}

/* ======= TARJETAS ======= */
.cards {
    display: flex;
    justify-content: center;
    gap: 25px;
    flex-wrap: wrap;
    padding: 20px;
}

.card {
    background-color: var(--color-secundario);
    width: 280px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 0 10px rgba(255,255,255,0.2);
    border: 2px solid gray;
}
#cardBusqueda {
    display: flex;              
    flex-direction: row;
    width: 40rem;
    gap: 15px;                  
    align-items: center;        
    padding: 10px;              
}
.card img {
    width: 100%;
    display: block;
}

.card h3 {
    font-family: "Comic Sans MS", "Comic Sans", cursive;
    text-align: center;
    font-size: 1.8rem;
    color: var(--color-primario);
    margin: 10px 0;
}

.card p {
    font-family: "Comic Sans MS", "Comic Sans", cursive;
    font-size: 0.9rem;
    text-align: center;
    color: var(--color-primario);
    padding: 0 10px 10px;
}

.card button {
    width: 80%;
    margin: 10px auto 20px;
    display: block;
    padding: 10px 15px;
    background-color: rgb(19, 150, 19);
    border: none;
    color: var(--color-primario);
    font-weight: bold;
    border-radius: 8px;
    cursor: pointer;
}

.card button:hover {
    background-color: rgb(11, 110, 11);
}

/* Aqui va todo lo de la tarjeta completa con busqueda */

/* colores y barras de estadisticas */
.stats-container {
    padding: 10px;
    width: 20rem;
    color: var(--color-primario);
    font-family: "Comic Sans MS", "Comic Sans", cursive;
    font-size: 0.9rem;
}

.stat-row {
    margin-bottom: 8px;
}

.stat-label {
    margin-bottom: 3px;
}

.stat-bar {
    height: 10px;
    background: gray;
    border-radius: 4px;
    overflow: hidden;
}

.stat-fill {
    height: 100%;
    background: rgb(0, 200, 0);
    width: 0%;
    transition: width 0.6s ease-in-out;
}

/* colores y Tipos del pokemon */

.types-container {
    margin-top: 10px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
}

.type-badge {
    padding: 5px 10px;
    border-radius: 8px;
    font-weight: bold;
    font-family: "Comic Sans MS", "Comic Sans", cursive;
    font-size: 0.9rem;
    text-transform: capitalize;
    border: 2px solid rgba(255,255,255,0.3);
}

/* COLORES POR TIPO */
.type-normal   { background: #A8A878; color: black; }
.type-fire     { background: #F08030; color: white; }
.type-water    { background: #6890F0; color: white; }
.type-electric { background: #F8D030; color: black; }
.type-grass    { background: #78C850; color: black; }
.type-ice      { background: #98D8D8; color: black; }
.type-fighting { background: #C03028; color: white; }
.type-poison   { background: #A040A0; color: white; }
.type-ground   { background: #E0C068; color: black; }
.type-flying   { background: #A890F0; color: black; }
.type-psychic  { background: #F85888; color: white; }
.type-bug      { background: #A8B820; color: black; }
.type-rock     { background: #B8A038; color: black; }
.type-ghost    { background: #705898; color: white; }
.type-dragon   { background: #7038F8; color: white; }
.type-dark     { background: #705848; color: white; }
.type-steel    { background: #B8B8D0; color: black; }
.type-fairy    { background: #EE99AC; color: black; }
.type-shadow   { background: #5A005A; color: white; }
.type-unknown  { background: #68A090; color: black; }
.type-stellar  { background: linear-gradient(45deg, #d7bbff, #a4e4ff); color: black; }

/* ======= FOOTER ======= */
#foot {
    background-color: var(--color-secundario);
    color: var(--color-primario);
    border-top: 2px solid gray;
    text-align: center;
    padding: 15px;
}


/* RESPONSIVE */

/* ---- Pantallas grandes (1200px+) ---- */
@media (min-width: 1200px) {
    #cardBusqueda {
        width: 50rem;
    }
}

/* ---- Laptops y tablets horizontales (1024px) ---- */
@media (max-width: 1024px) {

    #Banner {
        padding: 140px 30px;
        background-position: center;
    }

    .cards {
        gap: 15px;
        padding: 15px;
    }

    #cardBusqueda {
        width: 90%;
        flex-direction: row;
    }
}

/* ---- Tablets verticales y celulares grandes (768px) ---- */
@media (max-width: 768px) {

    /* NAVBAR */
    #navbar {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        padding: 15px;
    }

    #Claro {
        margin-left: 0;
        margin-top: 10px;
    }

    .search-container {
        width: 100%;
    }

    .search-container input {
        width: 70%;
    }

    .search-container button {
        width: 30%;
    }

    /* BANNER */
    #Banner {
        padding: 120px 20px;
        text-align: center;
    }

    #P_Banner {
        font-size: 2.2rem;
    }

    /* Tarjetas random */
    .card {
        width: 90%;
        margin: 0 auto;
    }

    /* Card de búsqueda */
    #cardBusqueda {
        flex-direction: column;
        width: 100%;
        text-align: center;
    }

    #cardBusqueda img {
        width: 60%;
        margin: 0 auto;
    }

    .stats-container {
        width: 100%;
    }

    main {
        padding-bottom: 30px;
    }
}

/* ---- Celulares pequeños (480px) ---- */
@media (max-width: 480px) {

    #Banner {
        padding: 100px 15px;
    }

    #P_Banner {
        font-size: 1.8rem;
    }

    #navbar {
        padding: 10px;
    }

    .search-container input {
        width: 65%;
        font-size: 0.8rem;
    }

    .search-container button {
        width: 35%;
        padding: 7px;
        font-size: 0.8rem;
    }

    /* Tarjetas */
    .card {
        width: 95%;
    }

    .card h3 {
        font-size: 1.4rem;
    }

    .card p {
        font-size: 0.8rem;
    }

    /* Card búsqueda */
    #cardBusqueda img {
        width: 75%;
    }

    .stats-container {
        font-size: 0.8rem;
    }

    .type-badge {
        font-size: 0.8rem;
        padding: 4px 8px;
    }
}

/* ---- Celulares muy pequeños (360px) ---- */
@media (max-width: 360px) {

    #P_Banner {
        font-size: 1.6rem;
    }

    .search-container input {
        width: 60%;
    }

    .search-container button {
        width: 40%;
    }
}
