/**
 * Tournament List - Styles
 * Styles for tournament-centric filtering pages
 */

/* ==================== Hero Section ==================== */
.hero {
    background: #2d2f43;
    color: white;
    padding: 80px 20px 80px;
    text-align: center;
    position: relative;
    overflow: hidden;
    width: 100%;
    margin-left: calc(-50vw + 50%);
    margin-right: calc(-50vw + 50%);
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 100%;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1200 120"><path d="M0,0 L1200,0 L1200,100 Q600,20 0,100 Z" fill="rgba(255,255,255,0.05)"/></svg>');
    background-size: cover;
    opacity: 0.3;
}

.hero h1 {
    font-size: 2.5rem;
    color: white;
    margin-bottom: 0.5rem;
    position: relative;
    z-index: 1;
    text-shadow: 0 2px 10px rgba(0,0,0,0.2);
    animation: fadeInUp 0.8s ease;
}

.hero .subtitle {
    font-size: 1.2rem;
    color: rgba(255,255,255,0.95);
    position: relative;
    z-index: 1;
    margin-bottom: 20px;
    animation: fadeInUp 0.8s ease 0.2s backwards;
}

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

/* ==================== Stats Bar ==================== */
.stats-bar {
    background: white;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    margin-top: -50px;
    position: relative;
    z-index: 10;
    border-radius: 15px;
    padding: 30px;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 40px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
    text-align: center;
}

.stat-item {
    padding: 10px;
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: #667eea;
    display: block;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 0.95rem;
    color: #666;
    font-weight: 500;
}

/* ==================== Filters Section ==================== */
.filters-section {
    background: #ececec;
    padding: 1.5rem;
    border-radius: var(--border-radius);
    margin: 2rem 0;
    box-shadow: var(--shadow-sm);
    transition: padding 0.3s ease;
}

.filters-section.collapsed {
    padding: 1.5rem 1.5rem 1.5rem 1.5rem;
}

.filters-section.collapsed .filters-content {
    display: none;
}

.filters-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.filters-section.collapsed .filters-header {
    margin-bottom: 0;
}

.filter-toggle {
    padding: 8px;
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-color);
    transition: transform 0.3s ease, background 0.2s ease;
    border-radius: 4px;
}

.filter-toggle:hover {
    background: rgba(0, 0, 0, 0.05);
}

.filter-toggle.active {
    transform: rotate(180deg);
}

.filters-content {
    display: block;
}

.filters-toolbar {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 1rem;
}

.filters-header h2 {
    margin: 0;
    color: var(--secondary-color);
}

.filters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.filter-group {
    display: flex;
    flex-direction: column;
}

.filter-group label {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--secondary-color);
    font-size: 0.9rem;
}

.filter-group input[type="text"],
.filter-group input[type="number"],
.filter-group input[type="date"],
.filter-group select {
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 0.95rem;
    font-family: inherit;
    transition: var(--transition);
    background: white;
    color: var(--text-color);
}

.filter-group input[type="text"]:focus,
.filter-group input[type="number"]:focus,
.filter-group input[type="date"]:focus,
.filter-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    user-select: none;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* ==================== Results Section ==================== */
.results-section {
    margin: 2rem 0;
}

.results-header {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-top: 1.5rem;
    margin-bottom: 1.5rem;
}

#resultsCount {
    font-size: 1rem;
    font-weight: normal;
    color: #666;
}

/* ==================== Loading/Error/Empty States ==================== */
.loading-state,
.error-state,
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
}

.loading-state .spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.error-state {
    color: #d32f2f;
}

.empty-state {
    color: #666;
}

/* ==================== Tournaments Table (Desktop) ==================== */
.tournaments-table-wrapper {
    overflow-x: auto;
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    margin-bottom: 2rem;
}

.tournaments-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.tournaments-table thead {
    background: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
}

.tournaments-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: var(--secondary-color);
    white-space: nowrap;
}

.tournaments-table tbody tr {
    border-bottom: 1px solid #dee2e6;
    transition: background-color 0.2s ease;
}

.tournaments-table tbody tr:hover {
    background-color: #f8f9fa;
}

.tournaments-table td {
    padding: 1rem;
    vertical-align: top;
}

.tournaments-table .event-number {
    font-weight: 600;
    color: var(--primary-color);
}

.tournaments-table .tournament-title {
    font-weight: 500;
    max-width: 300px;
}

.tournaments-table .buy-in,
.tournaments-table .guaranteed {
    font-weight: 600;
    color: #2e7d32;
}

.tournaments-table .festival-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.tournaments-table .festival-link:hover {
    text-decoration: underline;
}

.tournaments-table .festival-dates {
    font-size: 0.85rem;
    color: #666;
    margin-top: 0.25rem;
}

.tournaments-table .location {
    white-space: nowrap;
}

/* Hide table on mobile/tablet */
@media (max-width: 1024px) {
    .tournaments-table-wrapper {
        display: none;
    }
}

/* ==================== Tournament Cards (Mobile/Tablet) ==================== */
.tournaments-cards {
    display: none;
    grid-template-columns: 1fr;
    gap: 1rem;
}

@media (max-width: 1024px) {
    .tournaments-cards {
        display: grid;
    }
}

.tournament-card {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.tournament-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.tournament-card-header {
    padding: 1rem;
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
}

.tournament-card-header .event-number {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.tournament-card-header h4 {
    margin: 0 0 0.5rem 0;
    font-size: 1.1rem;
    color: var(--secondary-color);
}

.tournament-card-header .game-type {
    font-size: 0.9rem;
    color: #666;
}

.tournament-card-body {
    padding: 1rem;
}

.tournament-detail {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid #f0f0f0;
}

.tournament-detail:last-child {
    border-bottom: none;
}

.tournament-detail .label {
    font-weight: 600;
    color: #666;
    font-size: 0.9rem;
}

.tournament-detail .value {
    font-weight: 500;
    color: var(--text-color);
    text-align: right;
}

.tournament-detail .festival-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.tournament-detail .festival-link:hover {
    text-decoration: underline;
}

.tournament-detail .festival-dates {
    font-size: 0.85rem;
    color: #666;
    margin-top: 0.25rem;
}

/* ==================== Pagination ==================== */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin: 2rem 0;
}

.pagination-btn {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    background: white;
    color: var(--text-color);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.95rem;
}

.pagination-btn:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.pagination-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    font-weight: 600;
}

.pagination-ellipsis {
    padding: 0.5rem;
    color: #666;
}

/* ==================== Tournament Table (New Structure) ==================== */
.table-container {
    overflow-x: auto;
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    margin-bottom: 2rem;
}

.tournament-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.tournament-table thead {
    background: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
}

.tournament-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: var(--secondary-color);
    white-space: nowrap;
}

.tournament-table tbody tr {
    border-bottom: 1px solid #dee2e6;
    transition: background-color 0.2s ease;
}

.tournament-table tbody tr:hover {
    background-color: #f8f9fa;
}

.tournament-table td {
    padding: 1rem;
    vertical-align: top;
}

.tournament-table .tournament-info {
    min-width: 250px;
}

.tournament-table .tournament-title {
    font-weight: 500;
    color: var(--secondary-color);
    margin-bottom: 0.25rem;
}

.tournament-table .tournament-meta {
    font-size: 0.85rem;
    color: #666;
}

.tournament-table .festival-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.tournament-table .festival-link:hover {
    text-decoration: underline;
}

.tournament-table .festival-dates {
    font-size: 0.85rem;
    color: #666;
    margin-top: 0.25rem;
}

.tournament-table .date-info .time {
    font-size: 0.85rem;
    color: #666;
    margin-top: 0.25rem;
}

.tournament-table .buy-in,
.tournament-table .guaranteed {
    font-weight: 600;
    color: #2e7d32;
    white-space: nowrap;
}

.tournament-table .location {
    min-width: 200px;
}

.tournament-table .venue-name {
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.tournament-table .venue-location {
    font-size: 0.85rem;
    color: #666;
}

/* Desktop/Mobile Toggle */
.desktop-only {
    display: block;
}

.mobile-only {
    display: none;
}

@media (max-width: 1024px) {
    .desktop-only {
        display: none;
    }

    .mobile-only {
        display: block;
    }
}

/* ==================== Responsive Design ==================== */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 2rem;
    }

    .hero .subtitle {
        font-size: 1rem;
    }

    .stats-bar {
        margin-top: -30px;
        padding: 20px;
    }

    .stat-value {
        font-size: 2rem;
    }

    .filters-grid {
        grid-template-columns: 1fr;
    }

    .results-header {
        justify-content: flex-end;
    }
}
