/*
|--------------------------------------------------------------------------
| TIERSTRATEGY — Page Intelligence
|--------------------------------------------------------------------------
| Estilos exclusivos de la página Competitive Intelligence.
| Mobile-first.
|--------------------------------------------------------------------------
*/

.ts-intelligence-page {
    --ts-intel-border: #e5e7eb;
    --ts-intel-surface: #ffffff;
    --ts-intel-surface-soft: #f8fafc;
    --ts-intel-text: #111827;
    --ts-intel-muted: #64748b;
    --ts-intel-primary: #2563eb;
    --ts-intel-primary-soft: #eff6ff;
    --ts-intel-success: #15803d;
    --ts-intel-success-soft: #f0fdf4;
    --ts-intel-danger: #dc2626;
    --ts-intel-danger-soft: #fef2f2;
    --ts-intel-warning: #b45309;
    --ts-intel-warning-soft: #fffbeb;
    --ts-intel-radius: 14px;
}

.ts-intelligence-page .ts-page-container {
    width: min(1180px, calc(100% - 32px));
    margin-inline: auto;
    padding-block: 48px 72px;
}

/* ==========================================================================
   HEADER
   ========================================================================== */

.ts-intelligence-page .ts-page-header {
    margin-bottom: 36px;
}

.ts-intelligence-page .ts-page-eyebrow {
    margin-bottom: 10px;
    color: var(--ts-intel-primary);
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: .16em;
    text-transform: uppercase;
}

.ts-intelligence-page .ts-page-title {
    margin: 0;
    color: var(--ts-intel-text);
    font-size: clamp(2.25rem, 7vw, 4rem);
    line-height: 1.05;
    letter-spacing: -.035em;
}

.ts-intelligence-page .ts-page-description {
    max-width: 760px;
    margin: 16px 0 0;
    color: var(--ts-intel-muted);
    font-size: 1.05rem;
    line-height: 1.7;
}

/* ==========================================================================
   SELECTOR
   ========================================================================== */

.ts-intelligence-page .ts-intelligence-filter {
    margin-bottom: 40px;
    padding: 20px;
    border: 1px solid var(--ts-intel-border);
    border-radius: var(--ts-intel-radius);
    background: var(--ts-intel-surface-soft);
}

.ts-intelligence-page .ts-intelligence-filter-form {
    display: grid;
    gap: 16px;
}

.ts-intelligence-page .ts-form-field {
    display: grid;
    gap: 8px;
}

.ts-intelligence-page .ts-form-field label {
    color: var(--ts-intel-text);
    font-size: .88rem;
    font-weight: 600;
}

.ts-intelligence-page .ts-form-field select {
    width: 100%;
    min-height: 46px;
    padding: 0 42px 0 14px;
    border: 1px solid #cbd5e1;
    border-radius: 9px;
    background: #fff;
    color: var(--ts-intel-text);
    font: inherit;
}

.ts-intelligence-page .ts-form-actions {
    display: flex;
    align-items: center;
}

.ts-intelligence-page .ts-button {
    min-height: 46px;
    padding: 0 20px;
    border: 0;
    border-radius: 9px;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.ts-intelligence-page .ts-button-primary {
    background: var(--ts-intel-primary);
    color: #fff;
}

/* ==========================================================================
   SELECCIÓN
   ========================================================================== */

.ts-intelligence-page .ts-intelligence-selection {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    margin-bottom: 32px;
    padding: 14px 16px;
    border-left: 3px solid var(--ts-intel-primary);
    background: var(--ts-intel-primary-soft);
}

.ts-intelligence-page .ts-selection-label {
    color: var(--ts-intel-muted);
    font-size: .85rem;
}

.ts-intelligence-page .ts-selection-value {
    color: var(--ts-intel-text);
    font-weight: 700;
}



/* ==========================================================================
   POKÉMON SELECCIONADO
   ========================================================================== */

.ts-intelligence-page .ts-intelligence-pokemon-header {
    margin-bottom: 40px;
    padding: 20px;
    border: 1px solid var(--ts-intel-border);
    border-radius: var(--ts-intel-radius);
    background: var(--ts-intel-surface);
    box-shadow: 0 2px 8px rgba(15, 23, 42, .04);
    overflow: hidden;
}

.ts-intelligence-page .ts-intelligence-pokemon-main {
    display: flex;
    align-items: center;
    gap: 20px;
    min-width: 0;
}

.ts-intelligence-page .ts-intelligence-pokemon-sprite {
    flex: 0 0 120px;
    width: 120px;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ts-intelligence-page .ts-intelligence-pokemon-sprite img {
    display: block;
    width: 120px;
    height: 120px;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.ts-intelligence-page .ts-intelligence-pokemon-info {
    min-width: 0;
    flex: 1;
}

.ts-intelligence-page .ts-intelligence-pokemon-title-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 10px;
    margin-bottom: 8px;
}

.ts-intelligence-page .ts-intelligence-pokemon-title {
    color: var(--ts-intel-text);
    font-size: 1.45rem;
    font-weight: 700;
    line-height: 1.2;
    text-decoration: none;
}

.ts-intelligence-page .ts-intelligence-pokemon-title:hover {
    color: var(--ts-intel-primary);
}

.ts-intelligence-page .ts-intelligence-pokemon-tiers {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.ts-intelligence-page .ts-intelligence-pokemon-tier {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 4px 9px;
    border-radius: 999px;
    background: var(--ts-intel-primary-soft);
    color: var(--ts-intel-primary);
    font-size: .76rem;
    font-weight: 700;
    text-decoration: none;
}

.ts-intelligence-page .ts-intelligence-pokemon-tier:hover {
    background: #dbeafe;
}

.ts-intelligence-page .ts-intelligence-types {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.ts-intelligence-page .ts-intelligence-type {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 4px 10px;
    border-radius: 999px;
    background: var(--ts-intel-surface-soft);
    color: var(--ts-intel-muted);
    font-size: .76rem;
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
}

.ts-intelligence-page .ts-intelligence-type:hover {
    color: var(--ts-intel-primary);
}


/* ==========================================================================
   RELACIONES — POKÉMON + TIPOS
   ========================================================================== */

.ts-intelligence-page .ts-intelligence-pokemon {
    min-width: 0;
}

.ts-intelligence-page .ts-intelligence-pokemon-name {
    text-decoration: none;
}

.ts-intelligence-page .ts-intelligence-pokemon .ts-intelligence-types {
    margin-top: 6px;
}


/* ==========================================================================
   PROTECCIÓN DE ANCHO
   ========================================================================== */

.ts-intelligence-page,
.ts-intelligence-page .ts-page-container,
.ts-intelligence-page .ts-intelligence-card,
.ts-intelligence-page .ts-intelligence-card-header {
    min-width: 0;
    max-width: 100%;
}

.ts-intelligence-page img {
    max-width: 100%;
}


/* ==========================================================================
   MOBILE
   ========================================================================== */

@media (max-width: 640px) {

    .ts-intelligence-page .ts-page-container {
        width: min(100% - 28px, 1180px);
        padding-block: 40px 60px;
    }

    .ts-intelligence-page .ts-intelligence-pokemon-header {
        margin-bottom: 34px;
        padding: 18px;
    }

    .ts-intelligence-page .ts-intelligence-pokemon-main {
        flex-direction: column;
        align-items: flex-start;
        gap: 14px;
    }

    .ts-intelligence-page .ts-intelligence-pokemon-sprite {
        align-self: center;
        flex: 0 0 110px;
        width: 110px;
        height: 110px;
    }

    .ts-intelligence-page .ts-intelligence-pokemon-sprite img {
        width: 110px;
        height: 110px;
    }

    .ts-intelligence-page .ts-intelligence-pokemon-info {
        width: 100%;
    }

    .ts-intelligence-page .ts-intelligence-pokemon-title-row {
        gap: 7px 8px;
        margin-bottom: 7px;
    }

    .ts-intelligence-page .ts-intelligence-pokemon-title {
        font-size: 1.35rem;
    }

    .ts-intelligence-page .ts-intelligence-pokemon-tier,
    .ts-intelligence-page .ts-intelligence-type {
        min-height: 27px;
        padding: 4px 9px;
        font-size: .74rem;
    }

    .ts-intelligence-page .ts-intelligence-card-header {
        gap: 10px;
    }
    
        .ts-intelligence-page .ts-intelligence-card {
        padding: 18px;
    }

    .ts-intelligence-page .ts-intelligence-card-header {
        gap: 12px;
    }

    .ts-intelligence-page .ts-intelligence-pokemon-name {
        font-size: .92rem;
    }

    .ts-intelligence-page .ts-intelligence-type {
        min-height: 27px;
        padding: 4px 9px;
        font-size: .74rem;
    }

    .ts-intelligence-page .ts-intelligence-impact {
        min-height: 28px;
        padding: 5px 9px;
        font-size: .70rem;
    }
    

}


/* ==========================================================================
   DESKTOP
   ========================================================================== */

@media (min-width: 768px) {

    .ts-intelligence-page .ts-intelligence-pokemon-header {
        padding: 24px;
    }

    .ts-intelligence-page .ts-intelligence-pokemon-sprite {
        flex-basis: 140px;
        width: 140px;
        height: 140px;
    }

    .ts-intelligence-page .ts-intelligence-pokemon-sprite img {
        width: 140px;
        height: 140px;
    }

    .ts-intelligence-page .ts-intelligence-pokemon-title {
        font-size: 1.65rem;
    }

}




/* ==========================================================================
   RESUMEN
   ========================================================================== */

.ts-intelligence-page .ts-intelligence-summary {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 36px;
}

.ts-intelligence-page .ts-section-heading h2 {
    margin: 0;
    color: var(--ts-intel-text);
    font-size: clamp(1.65rem, 4vw, 2.25rem);
    line-height: 1.15;
}

.ts-intelligence-page .ts-section-heading p {
    margin: 8px 0 0;
    color: var(--ts-intel-muted);
    line-height: 1.6;
}

.ts-intelligence-page .ts-intelligence-count {
    color: var(--ts-intel-muted);
    font-size: .95rem;
    font-weight: 600;
}

/* ==========================================================================
   GRUPOS
   ========================================================================== */

.ts-intelligence-page .ts-intelligence-relations {
    display: grid;
    gap: 34px;
}

.ts-intelligence-page .ts-intelligence-group {
    min-width: 0;
}

.ts-intelligence-page .ts-intelligence-group-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--ts-intel-border);
}

.ts-intelligence-page .ts-intelligence-group-header h2 {
    margin: 0;
    color: var(--ts-intel-text);
    font-size: 1.35rem;
}

.ts-intelligence-page .ts-intelligence-group-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 30px;
    height: 30px;
    padding-inline: 8px;
    border-radius: 999px;
    background: var(--ts-intel-surface-soft);
    color: var(--ts-intel-muted);
    font-size: .8rem;
    font-weight: 700;
}

/* ==========================================================================
   CARDS — RELACIONES
   ========================================================================== */

.ts-intelligence-page .ts-intelligence-cards {
    display: grid;
    gap: 16px;
}

.ts-intelligence-page .ts-intelligence-card {
    min-width: 0;
    padding: 20px;
    border: 1px solid var(--ts-intel-border);
    border-radius: 14px;
    background: var(--ts-intel-surface);
    box-shadow: 0 2px 8px rgba(15, 23, 42, .04);
    transition:
        border-color .18s ease,
        box-shadow .18s ease;
}

.ts-intelligence-page .ts-intelligence-card:hover {
    border-color: #dbe2ea;
    box-shadow: 0 4px 14px rgba(15, 23, 42, .06);
}


/* ==========================================================================
   CABECERA DE LA RELACIÓN
   ========================================================================== */

.ts-intelligence-page .ts-intelligence-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    min-width: 0;
}


/* ==========================================================================
   POKÉMON RELACIONADO
   ========================================================================== */

.ts-intelligence-page .ts-intelligence-pokemon-list {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    min-width: 0;
    flex: 1 1 auto;
}

.ts-intelligence-page .ts-intelligence-pokemon {
    min-width: 0;
    width: 100%;
}

.ts-intelligence-page .ts-intelligence-pokemon-name {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    max-width: 100%;
    padding: 5px 10px;
    border-radius: 8px;
    background: var(--ts-intel-surface-soft);
    color: var(--ts-intel-text);
    font-size: .94rem;
    font-weight: 700;
    line-height: 1.2;
    text-decoration: none;
    transition:
        background-color .18s ease,
        color .18s ease;
}

.ts-intelligence-page .ts-intelligence-pokemon-name:hover,
.ts-intelligence-page .ts-intelligence-pokemon-name:focus-visible {
    background: var(--ts-intel-primary-soft);
    color: var(--ts-intel-primary);
    text-decoration: none;
}


/* ==========================================================================
   TIPOS DEL POKÉMON RELACIONADO
   ========================================================================== */

.ts-intelligence-page .ts-intelligence-types {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.ts-intelligence-page .ts-intelligence-pokemon .ts-intelligence-types {
    margin-top: 0;
}

.ts-intelligence-page .ts-intelligence-type {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 4px 9px;
    border-radius: 999px;
    background: var(--ts-intel-surface-soft);
    color: var(--ts-intel-muted);
    font-size: .76rem;
    font-weight: 700;
    line-height: 1.2;
    text-decoration: none;
    white-space: nowrap;
    transition:
        background-color .18s ease,
        color .18s ease,
        transform .18s ease;
}

.ts-intelligence-page .ts-intelligence-type:hover,
.ts-intelligence-page .ts-intelligence-type:focus-visible {
    background: var(--ts-intel-primary-soft);
    color: var(--ts-intel-primary);
    text-decoration: none;
}

.ts-intelligence-page .ts-intelligence-type:active {
    transform: translateY(1px);
}


/* ==========================================================================
   IMPACTO
   ========================================================================== */

.ts-intelligence-page .ts-intelligence-impact {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .04em;
    line-height: 1;
    text-transform: uppercase;
    white-space: nowrap;
}

.ts-intelligence-page .ts-intelligence-impact-high {
    background: var(--ts-intel-danger-soft);
    color: var(--ts-intel-danger);
}

.ts-intelligence-page .ts-intelligence-impact-medium {
    background: var(--ts-intel-warning-soft);
    color: var(--ts-intel-warning);
}

.ts-intelligence-page .ts-intelligence-impact-low {
    background: var(--ts-intel-success-soft);
    color: var(--ts-intel-success);
}


/* ==========================================================================
   EXPLICACIÓN
   ========================================================================== */

.ts-intelligence-page .ts-intelligence-explanation {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--ts-intel-border);
    color: var(--ts-intel-muted);
    font-size: .94rem;
    line-height: 1.65;
}

.ts-intelligence-page .ts-intelligence-explanation p {
    margin: 0;
}

.ts-intelligence-page .ts-intelligence-explanation p + p {
    margin-top: 8px;
}
/* ==========================================================================
   EMPTY
   ========================================================================== */

.ts-intelligence-page .ts-intelligence-empty {
    padding: 32px 20px;
    border: 1px dashed #cbd5e1;
    border-radius: var(--ts-intel-radius);
    background: var(--ts-intel-surface-soft);
    text-align: center;
}

.ts-intelligence-page .ts-intelligence-empty h2 {
    margin: 0;
    color: var(--ts-intel-text);
    font-size: 1.35rem;
}

.ts-intelligence-page .ts-intelligence-empty p {
    margin: 8px 0 0;
    color: var(--ts-intel-muted);
}

/* ==========================================================================
   DESKTOP
   ========================================================================== */

@media (min-width: 768px) {

    .ts-intelligence-page .ts-page-container {
        width: min(1180px, calc(100% - 64px));
        padding-block: 72px 96px;
    }

    .ts-intelligence-page .ts-intelligence-filter-form {
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: end;
    }

    .ts-intelligence-page .ts-form-actions {
        padding-bottom: 0;
    }

    .ts-intelligence-page .ts-intelligence-summary {
        flex-direction: row;
        align-items: end;
        justify-content: space-between;
    }

    .ts-intelligence-page .ts-intelligence-cards {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

}

@media (min-width: 1100px) {

    .ts-intelligence-page .ts-intelligence-cards {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

}


/* ==========================================================================
   TIPOS DE POKÉMON
   ========================================================================== */

.ts-intelligence-page .ts-intelligence-pokemon-types {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}

.ts-intelligence-page .ts-intelligence-type {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 4px 9px;
    border-radius: 999px;
    background: var(--ts-intel-surface-soft);
    color: var(--ts-intel-muted);
    font-size: .78rem;
    font-weight: 700;
    line-height: 1.2;
    text-decoration: none;
    transition:
        background-color .18s ease,
        color .18s ease,
        transform .18s ease;
}

.ts-intelligence-page .ts-intelligence-type:hover,
.ts-intelligence-page .ts-intelligence-type:focus-visible {
    background: var(--ts-intel-primary-soft);
    color: var(--ts-intel-primary);
    text-decoration: none;
}

.ts-intelligence-page .ts-intelligence-type:active {
    transform: translateY(1px);
}


/* ==========================================================================
   SELECTOR DE FORMATO — SINGLES / DOUBLES
   ========================================================================== */

.ts-intelligence-page .ts-single-pokemon__view-nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 32px;
}

.ts-intelligence-page .ts-single-pokemon__view-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 8px 18px;
    border: 1px solid var(--ts-intel-border);
    border-radius: 10px;
    background: var(--ts-intel-surface);
    color: var(--ts-intel-muted);
    font-size: .92rem;
    font-weight: 700;
    line-height: 1;
    text-decoration: none;
    transition:
        background-color .18s ease,
        border-color .18s ease,
        color .18s ease,
        box-shadow .18s ease,
        transform .18s ease;
}

.ts-intelligence-page .ts-single-pokemon__view-link:hover,
.ts-intelligence-page .ts-single-pokemon__view-link:focus-visible {
    border-color: #bfdbfe;
    background: var(--ts-intel-primary-soft);
    color: var(--ts-intel-primary);
    text-decoration: none;
}

.ts-intelligence-page .ts-single-pokemon__view-link.is-active {
    border-color: var(--ts-intel-primary);
    background: var(--ts-intel-primary);
    color: #fff;
    box-shadow: 0 2px 8px rgba(37, 99, 235, .18);
}

.ts-intelligence-page .ts-single-pokemon__view-link.is-active:hover,
.ts-intelligence-page .ts-single-pokemon__view-link.is-active:focus-visible {
    border-color: var(--ts-intel-primary);
    background: var(--ts-intel-primary);
    color: #fff;
}

.ts-intelligence-page .ts-single-pokemon__view-link:active {
    transform: translateY(1px);
}

@media (max-width: 640px) {

    .ts-intelligence-page .ts-single-pokemon__view-nav {
        gap: 7px;
        margin-bottom: 28px;
    }

    .ts-intelligence-page .ts-single-pokemon__view-link {
        min-height: 40px;
        padding: 8px 16px;
        font-size: .88rem;
    }
}
