/*
 * Estilos do front‑end para o plugin TCGdex MyCollection.
 * Estes estilos procuram se inspirar no visual do site MyCollection, com base escura
 * e detalhes em azul Super TCG. Personalize conforme necessário para
 * adequar ao seu tema.
 */

:root {
    /* Paleta de cores mais neutra adaptada ao tema Super TCG. Ajuste estas variáveis para personalizar facilmente o visual. */
    --primary-color: #0175D0;      /* azul Super TCG para destaques */
    --secondary-color: #2c3e50;    /* azul escuro para elementos de contraste */
    --background-dark: #f9fafb;    /* fundo neutro muito claro */
    --card-bg: #ffffff;            /* fundo branco para cartões */
    --card-bg-alt: #f5f6fa;        /* variação de fundo para gradientes */
    --border-color: rgba(0, 0, 0, 0.08); /* bordas discretas */
    --text-light: #2c3e50;         /* cor escura para textos principais */
    --text-muted: #7f8c8d;         /* cor acinzentada para textos secundários */
}

.tcgdex-collections-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
}

.tcgdex-series-title {
    font-size: 1.5rem;
    margin: 2rem 0 0.5rem;
    color: var(--text-light);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.tcgdex-series-title:before {
    content: '';
    width: 8px;
    height: 8px;
    background: var(--primary-color);
    border-radius: 50%;
}

.tcgdex-series-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}
.tcgdex-set-card {
    background: linear-gradient(to bottom right, var(--card-bg), var(--card-bg-alt));
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.tcgdex-set-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}
.tcgdex-set-image {
    position: relative;
    width: 100%;
    padding-top: 100%;
    background: rgba(0, 0, 0, 0.03);
    display: flex;
    align-items: center;
    justify-content: center;
}
.tcgdex-set-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 1rem;
}
.tcgdex-set-info {
    padding: 0.5rem 0.75rem 0.75rem;
}
.tcgdex-set-series {
    color: var(--primary-color);
    font-size: 0.75rem;
    margin-bottom: 0.25rem;
}
.tcgdex-set-name {
    color: var(--text-light);
    font-size: 1rem;
    margin: 0;
    margin-bottom: 0.25rem;
    font-weight: 600;
}
.tcgdex-set-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.tcgdex-collection-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
}
.tcgdex-collection-header {
    /* Apresenta o cabeçalho da coleção como uma “caixinha” com borda e fundo sutil, aproximando‑se do estilo usado na MyCollection. */
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-bottom: 1rem;
    padding: 1rem;
    background: var(--card-bg-alt);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}
.tcgdex-collection-logo img {
    width: 120px;
    height: auto;
    object-fit: contain;
    background: rgba(0, 0, 0, 0.02);
    border-radius: 6px;
    padding: 0.5rem;
}
.tcgdex-collection-meta {
    flex: 1;
}
.tcgdex-collection-series {
    color: var(--primary-color);
    font-size: 0.85rem;
    margin: 0;
}
.tcgdex-collection-name {
    color: var(--text-light);
    font-size: 1.75rem;
    margin: 0.25rem 0;
    font-weight: 700;
}
.tcgdex-collection-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-light);
}
/* Estiliza cada item de estatística (número de cartas, data e código) como um “pílula” com borda arredondada. */
.tcgdex-collection-stats .tcgdex-stat {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-light);
    font-size: 0.8rem;
    white-space: nowrap;
}
/* Ícones para cada estatística usando caracteres Unicode como placeholders. Ajuste conforme desejar. */
.tcgdex-collection-stats .tcgdex-card-count::before {
    content: "\1F0CF"; /* carta de baralho como ícone */
    margin-right: 0.25rem;
}
.tcgdex-collection-stats .tcgdex-release-date::before {
    content: "\1F4C5"; /* calendário */
    margin-right: 0.25rem;
}
.tcgdex-collection-stats .tcgdex-code {
    background: var(--secondary-color);
    color: #fff;
}
/* Barra de filtros: agrupa busca, raridade, tipo e categoria em um container com borda suave */
/* Barra de filtros unificada: posiciona a busca e todos os seletores em linha, com fundo neutro e bordas arredondadas */
.tcgdex-collection-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}
.tcgdex-collection-filters input,
.tcgdex-collection-filters select {
    flex: 1 1 220px;
    padding: 0.6rem 0.75rem;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background: #fff;
    color: var(--text-light);
    font-size: 0.9rem;
    transition: border-color 0.2s ease;
}
.tcgdex-collection-filters input {
    flex: 2 1 350px;
}
.tcgdex-collection-filters input:focus,
.tcgdex-collection-filters select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(1, 117, 208, 0.18);
}
/* Ajusta espaçamento e alinhamento para labels dentro dos selects, caso existam */
.tcgdex-collection-filters select option {
    padding: 0.3rem 0.5rem;
}
.tcgdex-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
}
.tcgdex-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 0.5rem;
    text-align: center;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.tcgdex-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}
.tcgdex-card img {
    width: 100%;
    height: auto;
    margin-bottom: 0.25rem;
    object-fit: contain;
}
.tcgdex-card-number {
    color: var(--text-muted);
    font-size: 0.75rem;
    margin-bottom: 0.1rem;
}
.tcgdex-card-name {
    color: var(--text-light);
    font-size: 0.85rem;
    line-height: 1.2;
}

.tcgdex-pagination {
    margin-top: 1rem;
    display: flex;
    gap: 0.5rem;
    justify-content: center;
}
.tcgdex-pagination button {
    padding: 0.5rem 0.75rem;
    border: none;
    border-radius: 4px;
    background: #2e2e4a;
    color: var(--text-light);
    cursor: pointer;
    font-size: 0.875rem;
}
.tcgdex-pagination button:hover {
    background: #3c3c5c;
}
.tcgdex-pagination button.active {
    background: var(--primary-color);
    color: #fff;
}

/* Remove sublinhado dos links nos cartões de coleção e garanta que ocupem todo o card */
.tcgdex-set-card a {
    text-decoration: none;
    color: inherit;
    display: block;
}
.tcgdex-set-card a:hover {
    text-decoration: none;
}

/* Descrição personalizada das coleções */
.tcgdex-collection-description {
    margin-top: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.4;
}
.tcgdex-hydration-status {
    margin: 12px 0;
    padding: 10px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #f9fafb;
    font-size: 14px;
}
.tcgdex-no-results {
    grid-column: 1 / -1;
    margin: 20px 0;
}


/* Busca e filtros da página geral de expansões */
.tcgdex-collections-topbar {
    margin: 2rem 0 1rem;
}
.tcgdex-main-collections-title {
    margin-top: 0;
}
.tcgdex-collections-searchbar {
    display: grid;
    grid-template-columns: minmax(260px, 1fr);
    gap: 10px;
    align-items: center;
    margin: 12px 0 20px;
    padding: 12px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.05);
}
.tcgdex-collections-searchbar input,
.tcgdex-collections-searchbar button {
    min-height: 42px;
    border-radius: 8px;
    font-size: 14px;
}
.tcgdex-collections-searchbar input {
    border: 1px solid #d8dee8;
    padding: 0 12px;
    color: #1f2937;
    background: #fff;
}
.tcgdex-collections-searchbar input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(1, 117, 208, 0.14);
}
.tcgdex-collections-searchbar button,
.tcgdex-general-search-button {
    border: none;
    background: #0175D0 !important;
    color: #ffffff !important;
    cursor: pointer;
    font-weight: 700;
    text-decoration: none !important;
}
.tcgdex-collections-searchbar button {
    padding: 0 16px;
}
.tcgdex-collections-searchbar button:hover,
.tcgdex-general-search-button:hover {
    background: #005ca8 !important;
}
.tcgdex-series-subtitle {
    margin: 24px 0 12px;
    font-size: 1.15rem;
    color: #111827;
    font-weight: 800;
}
.tcgdex-set-series,
.tcgdex-collection-series,
.tcgdex-modal-body .card-info strong {
    color: #0175D0 !important;
}
.tcgdex-set-name a,
.tcgdex-set-name,
.tcgdex-set-card a {
    text-decoration: none !important;
}
.tcgdex-set-card a:hover .tcgdex-set-name {
    color: #0175D0;
}
.tcgdex-collection-actions {
    margin-top: 14px;
}
.tcgdex-general-search-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 999px;
    box-shadow: 0 8px 18px rgba(1, 117, 208, .18);
}
@media (max-width: 720px) {
    .tcgdex-collections-searchbar {
        grid-template-columns: 1fr;
    }
}


/* Página geral de expansões: renderização assíncrona e busca apenas por nome/código */
#tcgdex-collections-grid-root {
    min-height: 120px;
}
#tcgdex-collections-search {
    width: 100%;
}
.tcgdex-collections-searchbar button,
#tcgdex-collections-year,
#tcgdex-collections-clear {
    display: none !important;
}
