/**
 * page-times.css
 *
 * Estilos aprimorados de UI/UX para a página de listagem de times do tema Apito Final.
 *
 * @package Apito_Final
 */

.times-page-container {
    margin: 40px auto;
    max-width: var(--content-w-lg);
    width: 100%;
}

/* Barra de Pesquisa em Cartão Premium */
.team-search-container {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
    margin: 0 auto 40px auto;
    /* Centralizado horizontalmente */
    max-width: 600px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.team-search-container:focus-within {
    border-color: rgba(255, 212, 0, 0.5);
    box-shadow: 0 10px 30px rgba(255, 212, 0, 0.05), 0 4px 20px rgba(0, 0, 0, 0.03);
}

.team-search-label {
    font-size: 0.85rem;
    font-weight: 750;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-muted);
    margin-bottom: 12px;
    display: block;
}

.team-search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.team-search-wrapper .search-icon {
    position: absolute;
    left: 18px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    pointer-events: none;
    transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), color 0.3s ease;
}

.team-search-input {
    width: 100%;
    padding: 14px 45px 14px 54px !important;
    /* Espaço de 54px para a lupa na esquerda */
    font-size: 1rem;
    font-family: inherit;
    color: var(--text-main);
    background-color: var(--bg-body);
    border: 1px solid var(--border-color);
    border-radius: 30px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.02);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    outline: none;
}

.team-search-input:focus {
    border-color: var(--secondary);
    background-color: var(--bg-surface);
    box-shadow: 0 0 0 3px rgba(255, 212, 0, 0.25);
}

.team-search-input:focus+.search-icon {
    color: var(--secondary);
    transform: scale(1.1);
}

/* Botão Limpar Pesquisa */
.clear-search-btn {
    position: absolute;
    right: 14px;
    background: var(--border-color);
    border: none;
    cursor: pointer;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    color: var(--text-muted);
    outline: none;
    padding: 0;
}

.clear-search-btn:hover {
    background-color: var(--secondary);
    color: var(--bg-surface);
    transform: scale(1.08) rotate(90deg);
}

.clear-search-btn svg {
    width: 12px;
    height: 12px;
}

/* Info de Resultados */
.search-results-info {
    margin-top: 14px;
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.search-results-info::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    background-color: var(--primary);
    border-radius: 50%;
}

/* Grid de Times */
.teams-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 16px;
    margin-top: 25px;
}

@media (min-width: 992px) {
    .teams-grid {
        grid-template-columns: repeat(4, 1fr); /* Exatamente 4 times por linha no desktop */
    }
}

/* Card de Time */
.team-card {
    --team-primary-fallback: var(--team-primary, var(--primary));
    --team-secondary-fallback: var(--team-secondary, var(--secondary));

    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color) !important;
    border-bottom: 1px solid var(--border-color) !important;
    /* Força sobrescrever bordas de links do tema */
    border-radius: 12px;
    text-decoration: none !important;
    /* Força remover underlines de links */
    background-image: none !important;
    /* Remove decorações de link baseadas em gradiente */
    color: var(--text-main);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03) !important;
    transition: transform 0.3s cubic-bezier(0.25, 1, 0.5, 1),
        box-shadow 0.3s cubic-bezier(0.25, 1, 0.5, 1),
        border-color 0.3s cubic-bezier(0.25, 1, 0.5, 1);
    position: relative;
    overflow: hidden;
}

.team-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.07) !important;
    border-color: var(--team-primary-fallback) !important;
}

/* Efeito de destaque no hover (barra lateral vertical) */
.team-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background-color: var(--team-primary-fallback);
    transform: scaleY(0);
    transition: transform 0.3s cubic-bezier(0.25, 1, 0.5, 1);
    transform-origin: bottom;
}

.team-card:hover::after {
    transform: scaleY(1);
}

/* Logo do Time */
.team-card-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 52px;
    height: 52px;
    background-color: var(--bg-body);
    border-radius: 50%;
    padding: 8px;
    overflow: hidden;
    transition: transform 0.3s cubic-bezier(0.25, 1, 0.5, 1), background-color 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.02);
}

.team-card:hover .team-card-logo {
    transform: scale(1.08);
    background-color: var(--bg-surface);
}

.team-card-logo img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
}

/* Informações do Time */
.team-card-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* Nome do Time */
.team-card-name {
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.3;
    transition: color 0.25s ease;
    color: var(--text-main);
}

.team-card:hover .team-card-name {
    color: var(--team-secondary-fallback);
}

/* Meta Data / Contador de Notícias */
.team-card-meta {
    display: flex;
    align-items: center;
}

.team-card-count {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-muted);
    background-color: var(--bg-body);
    padding: 3px 10px;
    border-radius: 12px;
    transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);
}

.team-card:hover .team-card-count {
    background-color: rgba(255, 212, 0, 0.12);
    color: var(--secondary);
}

/* Mensagem de nenhum resultado */
.no-teams-found {
    grid-column: 1 / -1;
    display: none;
    text-align: center;
    padding: 50px 20px;
    background-color: var(--bg-surface);
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    color: var(--text-muted);
    font-size: 1rem;
}

/* Ajustes Responsivos */
@media (max-width: 768px) {
    .times-page-container {
        margin: 25px auto;
    }

    .team-search-container {
        margin: 0 auto 25px auto;
    }

    .teams-grid {
        grid-template-columns: repeat(auto-fill, minmax(215px, 1fr));
        gap: 16px;
    }

    .team-card {
        padding: 14px 18px;
        gap: 14px;
    }

    .team-card-logo {
        width: 44px;
        height: 44px;
        padding: 6px;
    }

    .team-card-name {
        font-size: 0.98rem;
    }
}

@media (max-width: 480px) {
    .teams-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .team-search-input {
        padding: 12px 40px 12px 46px;
        font-size: 0.95rem;
    }

    .team-search-wrapper .search-icon {
        left: 16px;
    }

    .clear-search-btn {
        right: 12px;
    }
}

/* Sidebar Centralizado e Estreito no Fim da Página */
.times-page-sidebar-wrapper {
    margin: 60px auto 40px auto;
    max-width: var(--content-w-xsm); /* Limite estreito de 600px */
    width: 100%;
    padding: 0 20px;
    box-sizing: border-box;
    clear: both;
}

.times-page-sidebar-wrapper #secondary.sidebar {
    width: 100% !important;
    float: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Estilo premium para os widgets da sidebar centralizada */
.times-page-sidebar-wrapper .widget {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 25px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.02);
}

.times-page-sidebar-wrapper .widget-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 16px;
    position: relative;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--border-color);
    color: var(--text-main);
}

.times-page-sidebar-wrapper .widget-title::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 40px;
    height: 2px;
    background-color: var(--primary);
}