/* =========================================================
   BUSCADOR DE INACTIVOS · IKARIAM DATOS
   Mismo estilo que mapas, Pillory y Top:
   rojo imperial / pergamino / oro.
   (Las medidas del contenedor son las originales.)
   ========================================================= */


/* =================================================
   CONTENEDOR PRINCIPAL (medidas originales)
   ================================================= */

#buscador-inactivos {
    position: relative;
    width: calc(100% - 40px);
    max-width: 1380px;
    margin: 40px auto 70px auto;
    padding: 30px;
    box-sizing: border-box;

    background:
        radial-gradient(ellipse at top, rgba(255,255,255,.55), transparent 60%),
        linear-gradient(180deg, #fbf1da 0%, #efd9a8 100%);
    border: 1px solid #b98a3e;
    border-radius: 18px;
    box-shadow:
        0 0 0 5px rgba(255,244,214,.55),
        0 0 0 6px rgba(158,106,45,.55),
        0 18px 40px rgba(67,38,28,.35);
}

/* esquinas decorativas */
#buscador-inactivos::before,
#buscador-inactivos::after {
    content: "";
    position: absolute;
    top: 12px;
    width: 26px;
    height: 26px;
    border-top: 2px solid #c9963e;
    opacity: .8;
    pointer-events: none;
}
#buscador-inactivos::before { left: 12px;  border-left: 2px solid #c9963e;  border-top-left-radius: 8px; }
#buscador-inactivos::after  { right: 12px; border-right: 2px solid #c9963e; border-top-right-radius: 8px; }


/* =================================================
   CABECERA
   ================================================= */

.inactivos-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 30px;
    margin-bottom: 25px;
    padding-bottom: 24px;
    border-bottom: 1px solid rgba(201,150,62,.45);
}

.inactivos-header-left { flex: 1; }

.inactivos-title {
    margin: 0 0 10px 0;
    font-family: "Cinzel", Georgia, "Times New Roman", serif;
    font-size: 34px;
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: 1px;
    color: #7e0c0b;
    text-shadow: 0 1px 0 rgba(255,255,255,.7), 0 2px 6px rgba(126,12,11,.15);
}

.inactivos-description {
    margin: 0 0 22px 0;
    color: #7a5233;
    font-size: 14px;
    line-height: 1.55;
}

.inactivos-description small {
    display: inline-block;
    margin-top: 4px;
    color: #9a7550;
    font-style: italic;
}


/* =================================================
   SELECTORES
   ================================================= */

.inactivos-selectores-fila {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 24px;
}

.inactivos-selector {
    display: flex;
    align-items: center;
    gap: 12px;
}

.inactivos-selector label {
    margin: 0;
    color: #7a5233;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

.inactivos-selector select,
.inactivos-selector input[type="number"] {
    height: 46px;
    min-width: 210px;
    padding: 0 44px 0 16px;
    box-sizing: border-box;

    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;

    background-color: #fffaf0;
    background-image:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%237e0c0b' stroke-linecap='round' stroke-linejoin='round' stroke-width='2.2' d='m3.5 6 4.5 4.5L12.5 6'/%3E%3C/svg%3E"),
        linear-gradient(180deg, #fffdf7 0%, #f6e6c2 100%);
    background-repeat: no-repeat, no-repeat;
    background-position: right 14px center, 0 0;
    background-size: 14px 14px, 100% 100%;

    color: #3b2412;
    border: 1px solid #c49a55;
    border-radius: 12px;
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,.9),
        inset 0 -2px 0 rgba(158,106,45,.12),
        0 3px 8px rgba(67,38,28,.12);
    cursor: pointer;
    outline: none;
    transition: border-color .2s ease, box-shadow .2s ease;
}

.inactivos-selector input[type="number"] {
    min-width: 100px;
    width: 110px;
    padding: 0 12px;
    background-image: linear-gradient(180deg, #fffdf7 0%, #f6e6c2 100%);
    background-size: 100% 100%;
    background-position: 0 0;
    text-align: center;
    cursor: text;
    -moz-appearance: textfield;
}

.inactivos-selector select option {
    background: #fffaf0;
    color: #3b2412;
    font-weight: 500;
}

.inactivos-selector select:hover,
.inactivos-selector input[type="number"]:hover {
    border-color: #a3201a;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.9), 0 5px 14px rgba(67,38,28,.18);
}

.inactivos-selector select:focus,
.inactivos-selector input[type="number"]:focus {
    border-color: #7e0c0b;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.9), 0 0 0 4px rgba(126,12,11,.15);
}


/* =================================================
   TARJETA TOTAL
   ================================================= */

.inactivos-total {
    min-width: 210px;
    padding: 18px 25px;
    box-sizing: border-box;
    background: linear-gradient(180deg, #a3201a, #7e0c0b);
    border: 1px solid #d9a849;
    border-radius: 14px;
    text-align: center;
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,.25),
        0 0 0 4px rgba(201,150,62,.25),
        0 8px 18px rgba(126,12,11,.3);
}

.inactivos-total-label {
    display: block;
    margin-bottom: 4px;
    color: #f1d08a;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

.inactivos-total-number {
    display: block;
    color: #fff3d6;
    font-family: "Cinzel", Georgia, serif;
    font-size: 36px;
    font-weight: 700;
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
    text-shadow: 0 1px 2px rgba(0,0,0,.35);
}


/* =================================================
   ESTADO / CARGANDO
   ================================================= */

#estadoInactivos {
    margin: 15px 0;
    color: #7a5233;
    font-size: 14px;
    font-weight: 600;
}

.estado-cargando {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #7a5233;
}

.estado-spinner {
    width: 18px;
    height: 18px;
    border: 3px solid #d9bd88;
    border-top-color: #7e0c0b;
    border-radius: 50%;
    animation: inactivos-spin .8s linear infinite;
}

@keyframes inactivos-spin { to { transform: rotate(360deg); } }


/* =================================================
   RESULTADO (marco marrón/dorado como el mapa y el Top)
   ================================================= */

#resultadoInactivos:not(:empty) {
    padding: 10px;
   
    border: 1px solid #c9963e;
    border-radius: 16px;
    box-shadow: 0 0 0 4px rgba(201,150,62,.25), 0 14px 30px rgba(67,38,28,.3);
}


/* =================================================
   CONTENEDOR TABLA
   ================================================= */

.inactivos-table-container {
    width: 100%;
    overflow-x: auto;
    border-radius: 10px;
}


/* =================================================
   TABLA
   ================================================= */

.inactivos-table {
    width: 100%;
    min-width: 760px;
    border-collapse: separate;
    border-spacing: 0;
    overflow: hidden;
    background: #fbf1da;
    color: #3b2412;
    font-size: 14px;
}

.inactivos-table thead th {
    padding: 14px 16px;
    background: linear-gradient(180deg, #a3201a, #7e0c0b);
    color: #ffe9b8;
    border-bottom: 2px solid #c9963e;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    text-align: left;
    white-space: nowrap;
}

.inactivos-table thead th.sortable {
    cursor: pointer;
    user-select: none;
    transition: filter .15s ease;
}
.inactivos-table thead th.sortable:hover { filter: brightness(1.15); }
.inactivos-table thead th.sort-active { color: #fff3d6; box-shadow: inset 0 -3px 0 #f1d08a; }

.sort-indicator {
    display: inline-block;
    margin-left: 6px;
    color: #f1d08a;
    font-size: 11px;
    opacity: .75;
}
.inactivos-table thead th.sort-active .sort-indicator { opacity: 1; }


/* =================================================
   FILAS
   ================================================= */

.inactivos-table tbody tr {
    background: #fbf1da;
    transition: background .15s ease, box-shadow .15s ease;
}
.inactivos-table tbody tr:nth-child(even) { background: #f3e2bb; }
.inactivos-table tbody tr:hover {
    background: #ecd09a;
    box-shadow: inset 4px 0 0 #7e0c0b;
}


/* =================================================
   CELDAS
   ================================================= */

.inactivos-table tbody td {
    padding: 12px 16px;
    border-bottom: 1px solid rgba(158,106,45,.18);
    vertical-align: middle;
    white-space: nowrap;
}
.inactivos-table tbody tr:last-child td { border-bottom: none; }

.jugador-nombre  { color: #3b2412; font-weight: 700; }
.jugador-puntos  { color: #7e0c0b; font-weight: 800; text-align: right; font-variant-numeric: tabular-nums; }
.jugador-alianza { color: #6b3f22; font-weight: 700; }
.jugador-fecha   { color: #7a5233; font-variant-numeric: tabular-nums; }
.jugador-tiempo  { text-align: center; }


/* =================================================
   TIEMPO INACTIVO (dorado → ámbar → rojo)
   ================================================= */

.inactividad-badge {
    display: inline-block;
    min-width: 58px;
    padding: 5px 10px;
    box-sizing: border-box;
    background: linear-gradient(180deg, #fff3cf, #f1d08a);
    color: #6b3f22;
    border: 1px solid #c9963e;
    border-radius: 999px;
    font-size: 12.5px;
    font-weight: 800;
    line-height: 1.1;
    text-align: center;
    font-variant-numeric: tabular-nums;
}
.inactividad-badge.largo {
    background: linear-gradient(180deg, #f7b968, #e08a2c);
    color: #4a2100;
    border-color: #b56a1c;
}
.inactividad-badge.muy-largo {
    background: linear-gradient(180deg, #a3201a, #7e0c0b);
    color: #ffe9b8;
    border-color: #d9a849;
}


/* =================================================
   PAGINACIÓN (dentro del marco)
   ================================================= */

.paginacion-inactivos {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 7px;
    margin: 0;
    padding: 14px 4px 6px;
    flex-wrap: wrap;
}

.paginacion-inactivos button {
    min-width: 38px;
    height: 38px;
    padding: 0 10px;
    background: linear-gradient(180deg, #fbf1da, #ecd09a);
    color: #3b2412;
    border: 1px solid #c9963e;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all .15s ease;
}
.paginacion-inactivos button:hover:not(:disabled) { background: #fff3d6; transform: translateY(-1px); }
.paginacion-inactivos button.activo {
    background: linear-gradient(180deg, #a3201a, #7e0c0b);
    color: #ffe9b8;
    border-color: #d9a849;
    box-shadow: 0 3px 8px rgba(0,0,0,.3);
}
.paginacion-inactivos button:disabled { opacity: .4; cursor: default; transform: none; }

.paginacion-ellipsis {
    min-width: 25px;
    color: #f1d08a;
    font-weight: 700;
    text-align: center;
}


/* =================================================
   SIN RESULTADOS
   ================================================= */

.sin-inactivos {
    padding: 30px;
    background: linear-gradient(180deg, #fbf1da, #f3e2bb);
    border: 1px solid #c49a55;
    border-radius: 10px;
    color: #7a5233;
    font-weight: 600;
    text-align: center;
}


/* =================================================
   BOTÓN VER JUGADOR
   ================================================= */

.jugador-ver { width: 70px; text-align: center; }

.ver-jugador-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    background: linear-gradient(180deg, #fffdf7, #f6e6c2);
    color: #7e0c0b;
    border: 1px solid #c49a55;
    border-radius: 10px;
    text-decoration: none;
    cursor: pointer;
    transition: all .15s ease;
}
.ver-jugador-btn:hover {
    background: linear-gradient(180deg, #a3201a, #7e0c0b);
    color: #ffe9b8;
    border-color: #d9a849;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(126,12,11,.3);
}
.ver-jugador-btn svg { width: 20px; height: 20px; pointer-events: none; }


/* =================================================
   RESPONSIVE (medidas originales)
   ================================================= */

@media (max-width: 900px) {
    #buscador-inactivos {
        width: calc(100% - 20px);
        margin-top: 25px;
        padding: 20px;
    }
    .inactivos-header { flex-direction: column; align-items: stretch; }
    .inactivos-total { width: 100%; }
    .inactivos-title { font-size: 28px; }
}

@media (max-width: 600px) {
    #buscador-inactivos {
        width: 100%;
        margin: 15px 0 40px 0;
        padding: 14px;
        border-radius: 10px;
    }
    #buscador-inactivos::before,
    #buscador-inactivos::after { display: none; }

    .inactivos-title { font-size: 24px; }

    .inactivos-selector { flex-direction: column; align-items: stretch; gap: 6px; }
    .inactivos-selector select,
    .inactivos-selector input[type="number"] { width: 100%; }
    .inactivos-selectores-fila { flex-direction: column; align-items: stretch; gap: 14px; }

    #resultadoInactivos:not(:empty) { padding: 6px; }
    .inactivos-table { min-width: 760px; }

    .paginacion-inactivos { gap: 5px; }
    .paginacion-inactivos button { min-width: 34px; height: 34px; padding: 0 8px; font-size: 13px; }
}
