/* Los colores pueden ser cualquiera, en este caso los eligió una diseñadora gráafica. Carecen de importancia en el ejercicio. */
*{
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
body{
     font-family: "Poppins", sans-serif;
     line-height: 1.5;
}

header{
    /* Al no poner un color liso, le da otro aspecto al diseño */
    background: linear-gradient(135deg, #111827,#1e293b);
    color: white;
    padding: 2rem;
}
header .contenido{
    /* lo limitamos para pantallas muy grandes */
    width: min(1200px, 100%);
    /* lo centramos */
    margin: auto;
}
/* Para que solo afecte al hijo directo y no a todos los span en su interior */
header .contenido > span{
    padding: 6px 12px;
    border: 1px solid rgba(255,255,255,0.2);
    /* Al poner un valor gigante, hace el efecto de cápsula. */
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    color: #67e8f9;
    background: rgba(255,255,255,0.06);
}
header .contenido h1{
    /* Limita el tamaño en pantallas grandes y hace que baje. */
    max-width: 800px;
    margin-top: 20px;
    /* Empieza con un valor base del 5% del tamaño de la pantalla del dispositivo, se agranda hasta un máximo de 4.5rem o se achica hasta un mínimo de 2.2rem */
    /* 1 rem = 16px (si el usuario no lo cambió en su computadora  */
    font-size: clamp(2.2rem, 5vw, 4.5rem);
    line-height: 1.05;
    /* Las letras se juntan en un 0.05% de su tamaño inicial */
    letter-spacing: -0.05em;
}
header .contenido h1 > span{
    color:#22d3ee;
}

main{
    /*  Cuando ocupa menos de 1200px, al 100% le dejamos un margen interior */
    width: min(1200px, calc(100% - 40px));
    /* Arriba y abajo deja 50px, en los laterales lo centra. */
    margin:50px auto;
}
main section#tarjeta1{
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    box-shadow: 0 20px 50px rgba(15,23,42,0.07);
    overflow: hidden;
}
main section#tarjeta1 .encabezado{
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap:20px;
    padding: 28px 30px;
    border-bottom: 1px solid #e2e8f0;

}
main section#tarjeta1 .encabezado h2{
    font-size: 1.4rem;
}
main section#tarjeta1 .encabezado p{
    font-size: 0.9rem;
    color: #64748b;
    margin-top: 5px;
}
main section#tarjeta1 .encabezado > span{
    padding: 8px 14px;
    border-radius: 999px;
    background-color: #ecfeff;
    color: #0891b2;
    font-weight: 700;
}

main section#tarjeta1 .latabla{
    overflow-x: hidden;
}
/* Comienza la tabla */
main section#tarjeta1 table{
    width: 100%;
    border-collapse: collapse;
    min-width: 950px;
}

main section#tarjeta1 thead{
    background: #f8fafc;
}

main section#tarjeta1 thead th{
    /* Es lo que le da tamaño a las celdas */
    padding: 16px 18px;
    text-align: left;
    color: #64748b;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    white-space: nowrap;
}

main section#tarjeta1 tbody td{
    padding: 20px 18px;
    border-top: 1px solid #eef2f7 ;
    vertical-align: middle;
    font-size: 0.92rem;
}
main section#tarjeta1 tbody tr{
    transition:  background 0.2s ease, transform 0.2s ease;
}
main section#tarjeta1 tbody tr:hover{
    background: #f8fafc;
    cursor: default;
}

main section#tarjeta1 tbody .pais{
    display: flex;
    align-items: center;
    gap:12px;
    min-width: 150px;
}
main section#tarjeta1 tbody .pais strong{
    white-space: nowrap;
    font-size: 1.1rem;
}
main section#tarjeta1 tbody .pais img{
    width: 30px;
    height: 20px;
    object-fit: cover;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
    display: block;
}

footer{
    padding: 35px 20px;
    text-align: center;
    color: #94a3b8;
    font-family: 0.85rem;
}



main section#nota{
    margin-top: 25px;
    padding: 22px;
    border-left: 4px solid #0891b2;
    border-radius: 10px;
    background: white;
    border-top: 1px solid #e2e8f0;
    border-right: 1px solid #e2e8f0;
    border-bottom: 1px solid #e2e8f0;
}
main section#nota strong{
    display: block;
    margin-bottom: 5px;
}
main section#nota p{
    color: #64748b;
    font-size: 0.9rem;
}
/* Parte adicional no filmada */

 #divisor{
    width: 100%;
    height: 2rem;
    background: linear-gradient(135deg,#111827,#1e293b);
    margin: 6rem 0 2rem;
 }
section#tarjeta2{
    width: min(1200px, calc(100% - 40px));
    padding: 5rem ;
    margin: 2rem auto;
  
}
 section#tarjeta2 h1{
    margin-bottom:3rem;
    width: 100%;
    text-align: left;
}
 section#tarjeta2 table{
    border-collapse:collapse;
    overflow: hidden;
    border-radius: 0.3rem;
    width: 100%;
}
 section#tarjeta2 table caption{
    font-size: 1.3rem;
    margin-bottom: 20px;
    font-weight: 700;
}
 section#tarjeta2 th, section#tarjeta2 td{
    padding: 10px 15px;

}
 section#tarjeta2 thead{
    background-color: black;
    color: white;
}
 section#tarjeta2 tr:nth-child(even){
    background-color: #e2e8f0;
 }
 section#tarjeta2 tbody tr:hover{
    background-color: #64748b;
    color: #f3f3f3;
    cursor: default;
 }
 section#tarjeta2 tbody td:nth-child(4), section#tarjeta2 tbody td:nth-child(1){
    text-align: center;
 }


/* Celulares */
@media (max-width:1000px) {
    header{
        padding: 1rem;
    }
    main{
        width: min(100% - 24px, 600px);
        margin: 30px auto;
    }
    main section#tarjeta1{
        border-radius: 16px;
    }
    main section#tarjeta1 .encabezado{
        padding: 22px;
        align-items: flex-start;
        flex-direction: column;
    }
    main section#tarjeta1 .latabla{
    overflow: visible;
    }
    /* Comienzan los cambios en la tabla */
     main section#tarjeta1 table{
        min-width: 0;
     }
    main section#tarjeta1 thead{
    display: none;
    }
      /*  transformamos la tabla en tarjetas */
     main section#tarjeta1 tbody,  main section#tarjeta1 tr,  main section#tarjeta1 td{
        display: block;
        width: 100%;
     }
    main section#tarjeta1 tr{
        margin: 0;
        padding: 20px;
    }
      main section#tarjeta1 tr:not(:last-child){
        border-bottom: 1px solid #e2e8f0;
      }
    main section#tarjeta1 tbody  td{
        display: flex;
        justify-content: space-between;
        align-items: center;
        border: none;
        text-align: right;
        font-size: 0.9rem;
    }
    /*  Antes de renderizar el dato, renderizar esto */
     main section#tarjeta1 tbody  td::before{
        content: attr(data-label);
        color: #64748b;
        font-size: 0.75rem;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.04em;
        text-align: left;
     }
    main section#tarjeta1 tbody  td:first-child{
    display: none;
    }

    main section#tarjeta1 tbody  td:nth-child(2):before{
    display: none;
    }
     main section#tarjeta1 tbody  td:nth-child(2){
        display: block;
        padding-bottom: 15px;
        margin-bottom: 5px;
        border-bottom: 1px solid #f1f5f9;
        text-align: left;
    }
     main section#tarjeta1 tbody  td:nth-child(3){
        padding-top: 14px;
     }
    main section#tarjeta1 tbody tr:hover{
        background-color: white;
    }
     section#tarjeta2 table {
        padding: 2rem;
        display: block;
       border: none;
        overflow-x: auto;
        white-space: nowrap;
    }
    section#tarjeta2{
        padding: 1rem ;
        margin: 1rem auto;
    }
    section#tarjeta2 h1{
        font-size: 1.4rem;
        margin-bottom:1rem;
    }

}
/* celulares pequeños */
@media (max-width:420px) {
    header h1{
        font-size: 2.4rem;
    }
    main{
        width: calc(100% - 16px);
    }
    main section#tarjeta1 .encabezado{
        padding: 18px;
    }
    main section#tarjeta1 tbody tr{
        padding: 17px;
    }
    main section#tarjeta1 tbody td{
        font-size: 0.85rem;
    }
}