/**
 * Copyright © ProPlayerFC. All rights reserved.
 * Página de resultados da busca - reutiliza padrão de cards
 */

/* Base: box-sizing para evitar overflow */
.proplayerfc-search-result-page,
.proplayerfc-search-result-page * {
    box-sizing: border-box;
}

.proplayerfc-search-result-page {
    /* Alinhado ao tournament-list (filtros) */
    --view-green: #000000;
    --view-green-light: #1a1a1a;
    --view-green-soft: rgba(0, 0, 0, 0.08);
    --view-gray-50: #f9fafb;
    --view-gray-100: #f3f4f6;
    --view-gray-200: #e5e7eb;
    --view-gray-300: #d1d5db;
    --view-gray-400: #9ca3af;
    --view-gray-500: #6b7280;
    --view-gray-700: #1f2937;
    --sr-gray-100: #f3f4f6;
    --sr-gray-200: #e5e7eb;
    --sr-gray-300: #d1d5db;
    --sr-gray-400: #9ca3af;
    --sr-gray-500: #6b7280;
    --sr-gray-700: #1f2937;
    --sr-green: #059669;
    --sr-green-dark: #047857;
    padding: 24px 0;
    max-width: 1200px;
    margin: 0 auto;
    font-family: 'Inter', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    color: var(--view-gray-700);
}

/* Filtros (mesmo padrão visual da tournamentlist) — grid evita sobreposição e "flutuante" */
.proplayerfc-search-result-page .tournament-filters--search {
    margin-bottom: 20px;
    padding: 20px;
    background: linear-gradient(135deg, #ffffff 0%, var(--view-gray-50) 100%);
    border-radius: 12px;
    border: 1px solid var(--view-gray-200);
    box-shadow: 0 2px 8px rgba(11, 61, 46, 0.04);
    position: relative !important;
    float: none !important;
    clear: both;
    width: 100%;
    max-width: 100%;
    overflow: visible;
    z-index: 0;
}

/* Mobile: barra recolher/expandir (desktop esconde via media query abaixo) */
.proplayerfc-search-result-page .search-filters-mobile-toolbar {
    display: none;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    margin-bottom: 0;
}

.proplayerfc-search-result-page .search-filters-mobile-toolbar__title {
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--view-gray-700);
    margin: 0;
}

.proplayerfc-search-result-page .search-filters-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 14px;
    font-size: 13px;
    font-weight: 600;
    border-radius: 10px;
    cursor: pointer;
    flex-shrink: 0;
    margin: 0;
    line-height: 1.2;
    text-decoration: none;
    box-sizing: border-box;
}

.proplayerfc-search-result-page .search-filters-toggle:hover {
    text-decoration: none;
}

.proplayerfc-search-result-page .search-filters-toggle__chevron {
    display: inline-flex;
    align-items: center;
    transition: transform 0.2s ease;
    font-size: 12px;
}

.proplayerfc-search-result-page .tournament-filters--search.search-filters--collapsed .search-filters-toggle__chevron {
    transform: rotate(180deg);
}

.proplayerfc-search-result-page .search-filters-panel {
    width: 100%;
}

.proplayerfc-search-result-page .filters-form {
    margin: 0;
    width: 100%;
    max-width: 100%;
    float: none !important;
}

.proplayerfc-search-result-page .filters-row--search {
    display: grid !important;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 16px;
    align-items: end;
    width: 100%;
    max-width: 100%;
    float: none !important;
    position: relative;
}

.proplayerfc-search-result-page .filter-group {
    display: flex !important;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
    width: 100%;
    max-width: 100%;
    float: none !important;
    position: relative;
    z-index: auto;
    align-self: stretch;
}

.proplayerfc-search-result-page .filter-group--wide {
    grid-column: 1 / -1;
}

.proplayerfc-search-result-page .filters-row--search > .filter-group:not(.filter-group--wide) {
    grid-column: span 4;
}

.proplayerfc-search-result-page .filters-row--search .filter-actions {
    grid-column: 1 / -1;
    width: 100%;
    max-width: 100%;
    align-self: stretch;
}

.proplayerfc-search-result-page .filter-group label {
    font-size: 13px;
    font-weight: 700;
    color: var(--view-gray-700);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0;
}

.proplayerfc-search-result-page .filter-field-hint {
    font-size: 12px;
    font-weight: 500;
    color: var(--view-gray-500);
    line-height: 1.4;
    margin: 0;
    text-transform: none;
    letter-spacing: normal;
}

.proplayerfc-search-result-page .filter-text-input,
.proplayerfc-search-result-page #search-q {
    padding: 16px 20px;
    border: 2px solid var(--view-gray-300);
    border-radius: 10px;
    font-size: 15px;
    font-weight: 500;
    color: var(--view-gray-700);
    background: #ffffff;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    min-height: 56px;
    transition: border-color 0.2s, box-shadow 0.2s;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: relative !important;
    clip: auto !important;
    clip-path: none !important;
    height: auto !important;
    overflow: visible !important;
}

.proplayerfc-search-result-page .filter-text-input:hover,
.proplayerfc-search-result-page #search-q:hover {
    border-color: var(--view-gray-400);
    box-shadow: 0 2px 6px rgba(11, 61, 46, 0.08);
}

.proplayerfc-search-result-page .filter-text-input:focus {
    outline: none;
    border-color: var(--view-green);
    box-shadow: 0 0 0 4px rgba(11, 61, 46, 0.12), 0 2px 8px rgba(11, 61, 46, 0.1);
}

.proplayerfc-search-result-page .filter-select {
    padding: 16px 20px;
    border: 2px solid var(--view-gray-300);
    border-radius: 10px;
    font-size: 15px;
    font-weight: 500;
    color: var(--view-gray-700);
    background: #ffffff;
    cursor: pointer;
    transition: all 0.2s ease;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 14 14'%3E%3Cpath fill='%230b3d2e' d='M7 10L2 5h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 50px;
    box-shadow: 0 1px 3px rgba(11, 61, 46, 0.05);
    min-height: 56px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.proplayerfc-search-result-page .filter-select:hover {
    border-color: var(--view-gray-400);
    box-shadow: 0 2px 6px rgba(11, 61, 46, 0.08);
}

.proplayerfc-search-result-page .filter-select:focus {
    outline: none;
    border-color: var(--view-green);
    box-shadow: 0 0 0 4px rgba(11, 61, 46, 0.12), 0 2px 8px rgba(11, 61, 46, 0.1);
}

.proplayerfc-search-result-page .filter-actions {
    display: flex !important;
    visibility: visible !important;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    align-content: flex-start;
    flex-shrink: 0;
    float: none !important;
    position: relative;
    z-index: auto;
    padding-top: 4px;
    box-sizing: border-box;
}

.proplayerfc-search-result-page .filter-apply,
.proplayerfc-search-result-page .filter-reset,
.proplayerfc-search-result-page .filter-actions .action.primary.filter-apply,
.proplayerfc-search-result-page .filter-actions button[type="submit"] {
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 700;
    border-radius: 10px;
    text-decoration: none;
    transition: all 0.2s ease;
    white-space: nowrap;
    border: 2px solid transparent;
    box-shadow: 0 2px 6px rgba(11, 61, 46, 0.1);
    display: inline-flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: relative !important;
    clip: auto !important;
}

.proplayerfc-search-result-page .filter-apply {
    background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
    color: #ffffff;
    border-color: rgba(107, 114, 128, 0.3);
    cursor: pointer;
}

.proplayerfc-search-result-page .filter-apply:hover {
    background: linear-gradient(135deg, #4b5563 0%, #6b7280 100%);
    color: #ffffff;
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(107, 114, 128, 0.2);
}

.proplayerfc-search-result-page .filter-reset {
    background: #ffffff;
    color: #9ca3af;
    border-color: rgba(156, 163, 175, 0.3);
}

.proplayerfc-search-result-page .filter-reset:hover {
    background: rgba(156, 163, 175, 0.05);
    border-color: rgba(156, 163, 175, 0.4);
    color: #6b7280;
    text-decoration: none;
}

/* Paginação nativa Magento (html/pager) */
.proplayerfc-search-result-page .search-toolbar-bottom {
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid var(--sr-gray-200);
}

.proplayerfc-search-result-page .search-toolbar-bottom .pager {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    background: var(--view-gray-50);
    border-radius: 12px;
    border: 1px solid var(--view-gray-200);
}

.proplayerfc-search-result-page .search-toolbar-bottom .toolbar-amount {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--view-gray-600, #4b5563);
    text-align: center;
}

.proplayerfc-search-result-page .search-toolbar-bottom .pages {
    width: 100%;
}

.proplayerfc-search-result-page .search-toolbar-bottom .pages .pages-items {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    list-style: none;
    margin: 0;
    padding: 0;
    align-items: center;
}

.proplayerfc-search-result-page .search-toolbar-bottom .pages .pages-items .item {
    margin: 0;
}

.proplayerfc-search-result-page .search-toolbar-bottom .pages .page,
.proplayerfc-search-result-page .search-toolbar-bottom .pages .action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    min-height: 42px;
    padding: 8px 14px;
    border: 2px solid var(--view-gray-300);
    border-radius: 10px;
    font-weight: 600;
    color: var(--view-gray-700);
    text-decoration: none;
    transition: all 0.2s ease;
    background: #ffffff;
}

.proplayerfc-search-result-page .search-toolbar-bottom .pages .page:hover,
.proplayerfc-search-result-page .search-toolbar-bottom .pages .action:hover {
    border-color: var(--sr-green);
    color: var(--sr-green);
    text-decoration: none;
}

.proplayerfc-search-result-page .search-toolbar-bottom .pages .item.current .page,
.proplayerfc-search-result-page .search-toolbar-bottom .pages .item.current strong.page {
    background: linear-gradient(135deg, var(--sr-green) 0%, var(--sr-green-dark) 100%);
    border: 2px solid var(--sr-green);
    color: #ffffff;
    border-radius: 10px;
    min-width: 42px;
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    box-sizing: border-box;
}

.proplayerfc-search-result-page .search-toolbar-bottom .pages .label,
.proplayerfc-search-result-page .search-toolbar-bottom .pages-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
}

.proplayerfc-search-result-page .search-result-header {
    margin-bottom: 28px;
}

.proplayerfc-search-result-page .search-result-toolbar {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    margin-bottom: 16px;
}

.proplayerfc-search-result-page .search-result-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 18px;
    border-radius: 12px;
    border: 1px solid var(--sr-gray-300);
    background: #ffffff;
    color: var(--sr-gray-700);
    text-decoration: none;
    font-weight: 700;
    transition: border-color 0.2s, color 0.2s, background-color 0.2s;
}

.proplayerfc-search-result-page .search-result-back:hover {
    border-color: var(--sr-green);
    color: var(--sr-green);
    background: #f8fffc;
}

.proplayerfc-search-result-page .search-result-count {
    font-size: 15px;
    color: var(--sr-gray-500);
    margin: 0;
}

/* Estado vazio */
.proplayerfc-search-result-page .search-empty-state {
    text-align: center;
    padding: 48px 24px;
    background: var(--sr-gray-100);
    border-radius: 16px;
    margin-top: 24px;
}

.proplayerfc-search-result-page .search-empty-state .empty-icon {
    display: block;
    font-size: 48px;
    color: var(--sr-gray-400);
    margin-bottom: 16px;
}

.proplayerfc-search-result-page .search-empty-state .empty-message {
    font-size: 18px;
    font-weight: 600;
    color: var(--sr-gray-700);
    margin: 0 0 8px;
}

.proplayerfc-search-result-page .search-empty-state .empty-hint {
    font-size: 14px;
    color: var(--sr-gray-500);
    margin: 0 0 24px;
}

/* Grid de resultados - usa tournament-card.css (mesma estilização do profile) */
.proplayerfc-search-result-page .tournaments-list {
    margin-top: 8px;
}

/* Status badge colors */
.proplayerfc-search-result-page .tournament-status { border: 2px solid transparent; }
.proplayerfc-search-result-page .status-pending { background: rgba(245, 158, 11, 0.15); color: #b45309; border-color: rgba(245, 158, 11, 0.4); }
.proplayerfc-search-result-page .status-drawn { background: rgba(59, 130, 246, 0.15); color: #1d4ed8; border-color: rgba(59, 130, 246, 0.4); }
.proplayerfc-search-result-page .status-in-progress { background: rgba(34, 197, 94, 0.15); color: #15803d; border-color: rgba(34, 197, 94, 0.4); }
.proplayerfc-search-result-page .status-paused { background: rgba(249, 115, 22, 0.15); color: #c2410c; border-color: rgba(249, 115, 22, 0.4); }
.proplayerfc-search-result-page .status-finished { background: rgba(107, 114, 128, 0.15); color: #374151; border-color: rgba(107, 114, 128, 0.4); }
.proplayerfc-search-result-page .status-cancelled { background: rgba(239, 68, 68, 0.15); color: #b91c1c; border-color: rgba(239, 68, 68, 0.4); }

/* Tablet: dois selects por linha, ações em linha própria (grid já trata) */
@media (max-width: 991px) {
    .proplayerfc-search-result-page .filters-row--search {
        align-items: stretch;
    }

    .proplayerfc-search-result-page .filters-row--search > .filter-group:not(.filter-group--wide) {
        grid-column: span 6;
    }

    .proplayerfc-search-result-page .filters-row--search .filter-actions {
        grid-column: 1 / -1;
        margin-top: 4px;
    }
}

/* Mobile - sem sobreposição, responsivo, sem float, sem corte */
@media (max-width: 768px) {
    .proplayerfc-search-result-page {
        padding: 16px 16px 24px;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        overflow-x: hidden;
    }

    .proplayerfc-search-result-page .search-result-header {
        margin-bottom: 24px;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    .proplayerfc-search-result-page .search-result-toolbar {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    .proplayerfc-search-result-page .search-result-back {
        width: 100%;
        justify-content: center;
    }

    .proplayerfc-search-result-page .tournament-filters--search {
        padding: 16px;
    }

    .proplayerfc-search-result-page .search-filters-mobile-toolbar {
        display: flex;
        margin-bottom: 14px;
        padding-bottom: 4px;
        border-bottom: 1px solid var(--view-gray-200);
    }

    .proplayerfc-search-result-page .tournament-filters--search.search-filters--collapsed .search-filters-panel {
        display: none !important;
    }

    .proplayerfc-search-result-page .tournament-filters--search.search-filters--collapsed {
        padding-bottom: 14px;
        margin-bottom: 16px;
    }

    .proplayerfc-search-result-page .filters-row--search {
        grid-template-columns: minmax(0, 1fr) !important;
        gap: 14px;
        align-items: stretch !important;
        align-content: start;
    }

    .proplayerfc-search-result-page .filters-row--search > .filter-group:not(.filter-group--wide) {
        grid-column: 1 / -1 !important;
    }

    .proplayerfc-search-result-page .filter-group {
        min-width: 0;
    }

    /* Sempre após os campos; evita sobreposição com tema (float/position) */
    .proplayerfc-search-result-page .filters-row--search .filter-actions {
        grid-column: 1 / -1 !important;
        order: 100;
        width: 100% !important;
        max-width: 100%;
        margin-top: 10px;
        margin-bottom: 0;
        padding-top: 16px;
        border-top: 1px solid var(--view-gray-200);
        justify-content: stretch;
        align-self: stretch !important;
        position: static !important;
        top: auto !important;
        left: auto !important;
        right: auto !important;
        bottom: auto !important;
        transform: none !important;
        z-index: 0;
        float: none !important;
        clear: both;
    }

    .proplayerfc-search-result-page .filter-apply,
    .proplayerfc-search-result-page .filter-reset {
        flex: 1 1 calc(50% - 6px);
        min-width: 0;
        justify-content: center;
        text-align: center;
        white-space: normal;
    }

    .proplayerfc-search-result-page .search-result-count {
        width: 100%;
        margin-top: 12px;
        word-break: break-word;
    }

    .proplayerfc-search-result-page .search-empty-state {
        padding: 32px 16px;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    .proplayerfc-search-result-page .search-empty-state .empty-message {
        word-break: break-word;
    }

    .proplayerfc-search-result-page .search-toolbar-bottom .pager {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .proplayerfc-search-result-page .search-toolbar-bottom .pages .pages-items {
        justify-content: flex-start;
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 4px;
    }
}

/* Telas muito pequenas (320px+) */
@media (max-width: 480px) {
    .proplayerfc-search-result-page {
        padding: 12px 12px 20px;
    }

    .proplayerfc-search-result-page .search-empty-state {
        padding: 24px 12px;
    }
}
