/* ============================================
   TOURNAMENTS PAGE STYLES
   Matches news page design system
   ============================================ */


/* Hero Section */

.tournament-hero {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    padding: 4rem 0 3rem 0;
    position: relative;
    overflow: hidden;
    margin-bottom: 0;
}

.tournament-hero::before {
    content: "";
    position: absolute;
    top: -50%;
    right: -10%;
    width: 120%;
    height: 120%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    animation: heroGlow 20s linear infinite;
}

@keyframes heroGlow {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}


/* Filter Section */

.filter-section {
    background: var(--bg-white);
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 16px rgba(13, 71, 161, 0.12);
    border: 2px solid var(--border);
    animation: fadeInUp 0.6s ease-out;
}

.type-filter-container {
    padding-bottom: 1.25rem;
    border-bottom: 2px solid var(--border);
    margin-bottom: 1.25rem;
}

.filter-label {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-dark);
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
}

.filter-label i {
    color: var(--primary);
}

.filter-pills {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.filter-pill {
    padding: 0.65rem 1.25rem;
    border-radius: 30px;
    border: 2px solid var(--border);
    background: var(--bg-light);
    color: var(--text-dark);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.filter-pill::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: var(--primary);
    transform: translate(-50%, -50%);
    transition: width 0.4s ease, height 0.4s ease;
    z-index: 0;
}

.filter-pill:hover::before {
    width: 150%;
    height: 150%;
}

.filter-pill:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(13, 71, 161, 0.2);
}

.filter-pill.active {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(13, 71, 161, 0.3);
}

.filter-pill.active::before {
    display: none;
}

.filter-pill i,
.filter-pill span {
    position: relative;
    z-index: 1;
}


/* Search Container */

.search-filter-container {
    position: relative;
}

.search-wrapper {
    position: relative;
    width: 100%;
}

.search-input {
    width: 100%;
    padding: 0.85rem 3rem 0.85rem 3rem;
    border: 2px solid var(--border);
    border-radius: 12px;
    background: var(--bg-light);
    color: var(--text-dark);
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--bg-white);
    box-shadow: 0 0 0 4px rgba(13, 71, 161, 0.1);
}

.search-input::placeholder {
    color: var(--text-light);
}

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
    font-size: 1rem;
    pointer-events: none;
    transition: color 0.3s ease;
}

.search-input:focus~.search-icon {
    color: var(--primary);
}

.search-clear {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--text-light);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.search-clear:hover {
    background: var(--danger);
    transform: translateY(-50%) scale(1.1);
}


/* Tournament Grid */

.tournament-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}


/* Tournament Item Card */

.tournament-item {
    background: var(--bg-white);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(13, 71, 161, 0.12);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 2px solid transparent;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.tournament-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 32px rgba(13, 71, 161, 0.16);
    border-color: var(--primary);
}

.tournament-item-image {
    width: 100%;
    height: 220px;
    position: relative;
    overflow: hidden;
}

.tournament-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.tournament-item:hover .tournament-item-image img {
    transform: scale(1.15);
}

.tournament-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.3) 0%, rgba(0, 0, 0, 0.6) 100%);
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    padding: 1rem;
}

.tournament-type-badge {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
    padding: 0.4rem 0.9rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(13, 71, 161, 0.4);
    display: inline-flex;
    align-items: center;
}

.tournament-item-content {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.tournament-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-dark);
    line-height: 1.4;
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.3s ease;
    font-family: 'Oswald', sans-serif;
}

.tournament-item:hover .tournament-title {
    color: var(--primary);
}

.tournament-meta {
    margin-top: auto;
}

.tournament-date {
    display: inline-flex;
    align-items: center;
    color: var(--accent);
    font-size: 0.85rem;
    font-weight: 600;
}

.tournament-date i {
    color: var(--accent);
}


/* No Results Message */

.no-results-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    text-align: center;
    background: var(--bg-white);
    border-radius: 16px;
    box-shadow: 0 4px 16px rgba(13, 71, 161, 0.12);
    min-height: 400px;
}

.no-results-message i {
    opacity: 0.5;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%,
    100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-20px);
    }
}


/* Pagination */

.pagination-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 3rem;
    padding: 2rem 0;
}

.pagination-btn {
    min-width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-white);
    color: var(--text-dark);
    border: 2px solid var(--border);
    border-radius: 10px;
    font-weight: 600;
    transition: all 0.3s ease;
    cursor: pointer;
    text-decoration: none;
}

.pagination-btn:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(13, 71, 161, 0.3);
}

.pagination-btn.active {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(13, 71, 161, 0.3);
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination-btn:disabled:hover {
    transform: none;
    background: var(--bg-white);
    color: var(--text-dark);
    border-color: var(--border);
    box-shadow: none;
}


/* Animations */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in {
    animation: fadeInUp 0.6s ease-out both;
}

.stagger-1 {
    animation-delay: 0.1s;
}

.stagger-2 {
    animation-delay: 0.2s;
}

.stagger-3 {
    animation-delay: 0.3s;
}

.stagger-4 {
    animation-delay: 0.4s;
}


/* Filter Animation */

@keyframes filterSlideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.filter-pill {
    animation: filterSlideIn 0.4s ease-out backwards;
}

.filter-pill:nth-child(1) {
    animation-delay: 0.1s;
}

.filter-pill:nth-child(2) {
    animation-delay: 0.2s;
}

.filter-pill:nth-child(3) {
    animation-delay: 0.3s;
}


/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 1024px) {
    .tournament-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 1.5rem;
    }
}

@media (max-width: 768px) {
    .tournament-hero {
        padding: 3rem 0 2rem 0;
    }
    .tournament-hero h1 {
        font-size: 2.5rem !important;
    }
    .filter-section {
        padding: 1.25rem;
    }
    .type-filter-container {
        padding-bottom: 1rem;
        margin-bottom: 1rem;
    }
    .type-filter-container>div {
        flex-direction: column;
        align-items: flex-start;
    }
    .filter-pills {
        gap: 0.5rem;
        width: 100%;
    }
    .filter-pill {
        padding: 0.55rem 1rem;
        font-size: 0.85rem;
        flex: 1;
        min-width: calc(50% - 0.25rem);
        justify-content: center;
    }
    .search-input {
        padding: 0.75rem 2.75rem 0.75rem 2.75rem;
        font-size: 0.9rem;
    }
    .search-icon {
        left: 0.85rem;
        font-size: 0.9rem;
    }
    .search-clear {
        right: 0.85rem;
        width: 26px;
        height: 26px;
    }
    .filter-label {
        font-size: 0.9rem;
        margin-bottom: 0.5rem;
    }
    .tournament-grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }
    .pagination-container {
        gap: 0.35rem;
        margin-top: 2rem;
    }
    .pagination-btn {
        min-width: 40px;
        height: 40px;
        font-size: 0.9rem;
    }
    .tournament-item-image {
        height: 180px;
    }
    .no-results-message {
        padding: 3rem 1.5rem;
        min-height: 300px;
    }
    .no-results-message i {
        font-size: 3rem;
    }
    .no-results-message h3 {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .tournament-hero h1 {
        font-size: 2rem !important;
    }
    .tournament-hero p {
        font-size: 0.95rem;
    }
    .filter-section {
        padding: 1rem;
        border-radius: 12px;
    }
    .filter-pill {
        padding: 0.5rem 0.85rem;
        font-size: 0.8rem;
        min-width: 100%;
    }
    .filter-pills {
        flex-direction: column;
    }
    .search-input {
        padding: 0.7rem 2.5rem;
        font-size: 0.85rem;
    }
    .tournament-title {
        font-size: 1rem;
    }
    .pagination-btn {
        min-width: 36px;
        height: 36px;
        font-size: 0.85rem;
    }
}


/* ============================================
   DARK MODE
   ============================================ */

[data-theme="dark"] .filter-section {
    background: var(--bg-white);
    border-color: var(--border);
}

[data-theme="dark"] .filter-pill {
    background: rgba(13, 71, 161, 0.1);
    border-color: var(--border);
    color: var(--text-dark);
}

[data-theme="dark"] .filter-pill:hover {
    border-color: var(--primary-light);
}

[data-theme="dark"] .filter-pill.active {
    background: linear-gradient(135deg, var(--primary-light), var(--primary));
}

[data-theme="dark"] .search-input {
    background: rgba(13, 71, 161, 0.05);
    border-color: var(--border);
    color: var(--text-dark);
}

[data-theme="dark"] .search-input:focus {
    background: var(--bg-white);
    border-color: var(--primary-light);
}

[data-theme="dark"] .tournament-item {
    background: var(--bg-white);
}

[data-theme="dark"] .tournament-title {
    color: var(--text-dark);
}

[data-theme="dark"] .tournament-item:hover .tournament-title {
    color: var(--primary-light);
}

[data-theme="dark"] .pagination-btn {
    background: var(--bg-white);
    color: var(--text-dark);
    border-color: var(--border);
}

[data-theme="dark"] .pagination-btn:hover {
    background: var(--primary-light);
    border-color: var(--primary-light);
}

[data-theme="dark"] .pagination-btn.active {
    background: linear-gradient(135deg, var(--primary-light), var(--primary));
}

[data-theme="dark"] .no-results-message {
    background: var(--bg-white);
}

[data-theme="dark"] .tournament-type-badge {
    background: linear-gradient(135deg, var(--primary-light), var(--primary));
}


/* ============================================
   ACCESSIBILITY
   ============================================ */

.filter-pill:focus,
.search-input:focus,
.search-clear:focus,
.pagination-btn:focus {
    outline: 3px solid var(--primary);
    outline-offset: 2px;
}


/* High Contrast Mode */

@media (prefers-contrast: high) {
    .filter-pill,
    .search-input,
    .tournament-item {
        border-width: 3px;
    }
}


/* Reduced Motion */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    .filter-pill:hover,
    .tournament-item:hover,
    .pagination-btn:hover {
        transform: none;
    }
}


/* Print Styles */

@media print {
    .filter-section,
    .pagination-container,
    .scroll-progress,
    .back-to-top {
        display: none !important;
    }
    .tournament-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}