@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

:root {
    --color-fondo:       #e0f2f1;
    --color-primario:    #00695c;
    --color-secundario:  #4db6ac;
    --color-texto:       #37474f;
    --color-blanco:      #ffffff;
    --sombra-suave:      0 10px 30px rgba(0, 0, 0, 0.10);
    --sombra-hover:      0 15px 35px rgba(0, 105, 92, 0.20);
    --borde-radio:       16px;
    --transicion-suave:  all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

html {
    overflow-x: hidden;
}

* {
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent; /* Quita el flash azul en móviles */
    -webkit-text-size-adjust: 100%;           /* Evita que el navegador cambie el tamaño del texto al girar el cel */
    box-sizing: border-box;                   /* Evita problemas con el padding y el tamaño */
    user-select: none;                        /* Evita que el usuario seleccione el texto */
    -webkit-user-select: none;                /* Safari y Chrome móvil */
    -webkit-touch-callout: none;              /* Evita el menú de "Copiar" en iOS */
}

@keyframes entradaSuave {
    from { opacity: 0; transform: translateY(30px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes gradienteVivo {
    0%   { background-position: 0%   50%; }
    50%  { background-position: 100% 50%; }
    100% { background-position: 0%   50%; }
}

body {
    background: linear-gradient(-45deg, #e0f7fa, #80deea, #b2dfdb, #e0f2f1);
    background-size: 400% 400%;
    animation: gradienteVivo 15s ease infinite;
    font-family: 'Poppins', sans-serif;
    color: var(--color-texto);
    min-height: 100vh;
    padding: 40px 20px;
}

.contenedor {
    width: 95%;
    max-width: 1200px;
    margin: auto;
    padding: 30px 40px;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(10px);
    border-radius: var(--borde-radio);
    box-shadow: var(--sombra-suave);
    border: 1px solid rgba(255, 255, 255, 0.6);
    animation: entradaSuave 0.8s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

h1 {
    text-align: center;
    color: var(--color-primario);
    font-size: 2rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 30px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.05);
    position: relative;
    padding-bottom: 14px;
}

h1::after {
    content: '';
    display: block;
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, var(--color-primario), var(--color-secundario));
    border-radius: 2px;
    margin: 10px auto 0;
}

h2 {
    color: var(--color-secundario);
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 18px;
    position: relative;
    padding-bottom: 8px;
}

h2::after {
    content: '';
    display: block;
    width: 0;
    height: 3px;
    background: var(--color-secundario);
    border-radius: 2px;
    margin-top: 6px;
    transition: var(--transicion-suave);
}

.card:hover h2::after,
.tabla:hover h2::after {
    width: 100%;
}

.card {
    background: var(--color-blanco);
    padding: 28px 24px;
    border-radius: var(--borde-radio);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.06);
    border: 1px solid transparent;
    transition: var(--transicion-suave);
    margin-bottom: 30px;
    animation: entradaSuave 0.8s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: var(--sombra-hover);
    border-color: rgba(77, 182, 172, 0.30);
}

.contenedor_filtros {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: flex-end;
}

.campo_filtro {
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex: 1 1 200px;
}

label {
    font-weight: 500;
    color: var(--color-primario);
    font-size: 0.95rem;
}

input[type="date"],
select {
    width: 100%;
    padding: 11px 14px;
    border: 2px solid #e0f2f1;
    border-radius: 12px;
    font-family: 'Poppins', sans-serif;
    font-size: 0.95rem;
    color: var(--color-texto);
    background-color: #f9fbe7;
    transition: var(--transicion-suave);
    outline: none;
}

input[type="date"]:hover,
select:hover {
    border-color: #b2dfdb;
    background-color: #ffffff;
}

input[type="date"]:focus,
select:focus {
    border-color: var(--color-secundario);
    background-color: var(--color-blanco);
    box-shadow: 0 0 0 4px rgba(77, 182, 172, 0.15);
}

.botones_filtro {
    display: flex;
    gap: 10px;
}

.btn-filtrar, .btn-limpiar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 11px 22px;
    border: none;
    border-radius: 30px;
    font-family: 'Poppins', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transicion-suave);
    color: white;
}

.btn-filtrar {
    background: linear-gradient(45deg, var(--color-primario), #26a69a);
    box-shadow: 0 5px 15px rgba(0, 105, 92, 0.25);
}

.btn-filtrar:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.20);
}

.btn-limpiar {
    background: linear-gradient(45deg, #78909c, #90a4ae);
    box-shadow: 0 5px 15px rgba(120, 144, 156, 0.25);
}

.btn-limpiar:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.20);
}

/* =========================
    TABLAS
========================= */

.tabla {
    background: var(--color-blanco);
    padding: 28px 24px;
    border-radius: var(--borde-radio);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.06);
    margin-bottom: 28px;
    border: 1px solid transparent;
    transition: var(--transicion-suave);
    opacity: 0;
    animation: entradaSuave 0.8s cubic-bezier(0.22, 1, 0.36, 1) forwards;
    animation-delay: 0.3s;
}

.tabla:hover {
    transform: translateY(-3px);
    box-shadow: var(--sombra-hover);
    border-color: rgba(77, 182, 172, 0.25);
}

/* Scroll agregado a petición */
.tabla-scroll {
    width: 100%;
    overflow-x: auto;
    max-height: 480px;
    overflow-y: auto;
    border-radius: 10px;
    -webkit-overflow-scrolling: touch;
    border: 1px solid #e0f2f1;
}

/* Para navegadores que soportan thead th pegado */
.tabla-scroll thead th {
    position: sticky;
    top: 0;
    z-index: 2;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
}

table th {
    background: linear-gradient(135deg, #e0f2f1, #b2dfdb);
    color: var(--color-primario);
    padding: 12px 14px;
    text-align: center;
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

table td {
    padding: 12px 14px;
    border-bottom: 1px solid #e0f2f1;
    font-size: 0.9rem;
    vertical-align: middle;
    text-align: center;
    white-space: nowrap;
}

table tr:last-child td {
    border-bottom: none;
}

table tr:hover td {
    background: #f0fdfc;
}

.td-observaciones {
    white-space: normal;
    min-width: 250px;
    max-width: 350px;
    text-align: justify;
}


.badges-container {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
}

.badge {
    padding: 5px 10px;
    border-radius: 30px;
    font-size: 0.82rem;
    font-weight: 600;
    color: white;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.badge-pet { background-color: #2196f3; }
.badge-carton { background-color: #795548; }
.badge-tapas { background-color: #e91e63; }
.badge-vidrio { background-color: #4caf50; }
.badge-papel { background-color: #ff9800; }
.badge-electrodomesticos { background-color: #9c27b0; }
.badge-pilas { background-color: #607d8b; }

/* Boton Inicio Pie */
.boton-inicio-wrap {
    display: flex;
    justify-content: center;
    margin: 36px 0 10px 0;
}

.boton-inicio-link {
    text-decoration: none;
    display: inline-block;
}

.boton-inicio-svg {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    padding: 10px 26px 10px 16px;
    border-radius: 999px;
    background: linear-gradient(45deg, var(--color-primario), #26a69a);
    color: #ffffff;
    font-family: 'Poppins', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1;
    box-shadow: 0 8px 18px rgba(0, 105, 92, 0.30);
    transition: var(--transicion-suave);
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.boton-inicio-svg::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.20), transparent);
    transition: 0.5s;
    z-index: -1;
}

.boton-inicio-svg:hover::before {
    left: 100%;
}

.boton-inicio-svg:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 12px 28px rgba(0, 105, 92, 0.35);
}

.boton-inicio-icono {
    width: 54px;
    height: 54px;
    min-width: 54px;
    min-height: 54px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.18);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
    transition: transform 0.4s ease, background 0.4s ease;
}

.boton-inicio-svg:hover .boton-inicio-icono {
    transform: rotate(-15deg);
    background: rgba(255, 255, 255, 0.30);
}

.boton-inicio-icono svg {
    display: block;
    width: auto;
    height: 24px;
}

@media (max-width: 900px) {
    body { padding: 24px 12px; }
    .contenedor { padding: 22px 18px; border-radius: 12px; }
    h1 { font-size: 1.5rem; }
    h2 { font-size: 1.1rem; }
    .card, .tabla { padding: 20px 16px; }
}

/* =========================
    PAGINACIÓN
========================= */
.paginacion {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 30px;
    flex-wrap: wrap;
}

.page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    height: 44px;
    padding: 0 16px;
    background: #ffffff;
    color: var(--color-texto);
    text-decoration: none;
    border: 1px solid #d1d5db;
    margin-left: -1px; /* Para fusionar los bordes como en la imagen */
    font-size: 1rem;
    transition: all 0.3s ease;
}

.page-link:first-child {
    border-top-left-radius: 6px;
    border-bottom-left-radius: 6px;
}

.page-link:last-child {
    border-top-right-radius: 6px;
    border-bottom-right-radius: 6px;
}

.page-link:hover {
    background: #f9fafb;
    color: var(--color-primario);
}

.page-link.active {
    background: var(--color-primario);
    color: #ffffff;
    border-color: var(--color-primario);
    z-index: 1; /* Para que el borde primario se sobreponga */
    box-shadow: 0 2px 8px rgba(0, 105, 92, 0.3);
}

.page-dots {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    height: 44px;
    background: #ffffff;
    color: #9ca3af;
    border: 1px solid #d1d5db;
    margin-left: -1px;
}
