.tournament-page-wrapper {
    background-color: var(--primary-bg); /* Use theme variable */
    min-height: 100vh;
    padding: 0 0 50px; /* Remove top padding, keep bottom */
    font-family: 'montserrat-md', sans-serif;
}

.banner img {
    object-fit: contain;
    width: 100%;
}

.tournament-page-container {
    background-color: #fff; /* White background for the content area */
    border-radius: 8px;
    padding: 30px;
    width: calc(100% - 40px); /* Match banner container padding */
    max-width: 1360px; /* 1400px - 40px padding */
    margin: 20px auto 0; /* Add top margin to separate from banner */
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

/* Navigation */
.tournament-nav-container {
    margin-bottom: 30px;
    width: 100%;
}

.tournament-nav {
    display: flex;
    gap: 0;
    border-bottom: 2px solid #0d79e2;
    padding-bottom: 0;
    align-items: flex-end;
    overflow-x: auto; /* Allow horizontal scrolling */
    white-space: nowrap; /* Prevent wrapping */
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
    scrollbar-width: none; /* Hide scrollbar Firefox */
}

.tournament-nav::-webkit-scrollbar {
    display: none; /* Hide scrollbar Chrome/Safari */
}

.tournament-nav-item {
    font-family: 'montserrat-bold', sans-serif;
    font-size: 13px;
    color: #0d79e2;
    text-transform: uppercase;
    cursor: pointer;
    text-decoration: none;
    padding: 10px 20px;
    transition: all 0.3s ease;
    border-radius: 5px 5px 0 0;
}

.tournament-nav-item:hover {
    background-color: #e6f2ff;
}

.tournament-nav-item.active {
    background-color: #0d79e2;
    color: #fff;
    border-radius: 5px 5px 0 0;
}

/* Grid */
.tournament-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    width: 100%;
}

@media (max-width: 1200px) {
    .tournament-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 900px) {
    .tournament-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .tournament-grid {
        grid-template-columns: 1fr;
        gap: 10px; /* Reduce gap on mobile */
    }
    
    .tournament-page-container {
        padding: 15px; /* Reduce padding on mobile */
        width: calc(100% - 20px);
    }

    /* Mobile Text Reductions */
    .tournament-title {
        font-size: 13px;
        min-height: 30px;
    }

    .stat-item {
        font-size: 12px;
    }

    .stat-icon {
        font-size: 12px;
    }

    .time-info {
        font-size: 11px;
    }

    .detail-btn {
        font-size: 11px;
        padding: 6px 0;
        width: 90px;
    }

    .card-body {
        padding: 50px 10px 12px;
    }

    /* Mobile Pagination */
    .page-item .page-link {
        width: 30px;
        height: 30px;
        font-size: 12px;
    }
}

/* Card */
.tournament-card {
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 0 10px rgba(0,0,0,0.05);
    border: 1px solid #eee; /* Subtle border */
    transition: transform 0.3s ease;
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.card-header-image {
    height: 140px;
    width: 100%;
    background-size: cover;
    background-position: center 85%;
    position: relative;
}

/* Status Badges */
.status-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    color: #fff;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-family: 'montserrat-bold', sans-serif;
    text-transform: uppercase;
}

.status-upcoming {
    background-color: #e67e22; /* Orange matching image */
}

.status-ongoing {
    background-color: #2ecc71; /* Green */
}

.status-ended {
    background-color: #95a5a6; /* Gray */
}

/* Logo */
.tournament-logo-container {
    position: absolute;
    top: 105px; /* Adjust to overlap header and body */
    left: 50%;
    transform: translateX(-50%);
    width: 90px;
    height: 90px;
    border-radius: 50%;
    border: 3px solid #fff;
    background: #fff;
    overflow: hidden;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.tournament-logo {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Body */
.card-body {
    padding: 60px 15px 16px;
    text-align: center;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.tournament-title {
    font-size: 15px;
    color: #000;
    font-weight:700;
    text-transform: uppercase;
    min-height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 4px;
}

.tournament-stats {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 10px;
    width: 100%;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 14px;
    color: #000;
    padding:0;
    font-family: 'montserrat-bold', sans-serif;
}

.stat-icon {
    font-size: 14px;
}

.time-info {
    font-size: 13px;
    color: #999;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 5px;
    font-family: 'montserrat-md', sans-serif;
}

.time-icon {
    width: 16px;
    height: 16px;
    object-fit: contain;
}

.detail-btn {
    background-color: #0d79e2;
    color: #fff;
    border: none;
    padding: 8px 0;
    width: 100px;
    border-radius: 5px;
    font-family: 'montserrat-bold', sans-serif;
    font-size: 12px;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.3s;
    margin-top: auto;
    text-align: center;
}

.detail-btn:hover {
    background-color: #0a62b9;
}

/* Pagination */
.pagination-container {
    margin-top: 40px;
    display: flex;
    justify-content: center;
    padding-bottom: 20px; /* Add bottom padding for mobile scroll */
}

.pagination {
    display: flex;
    list-style: none;
    padding: 0;
    gap: 5px;
}

.page-item .page-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 4px;
    background-color: #fff;
    border: 1px solid #e0e0e0;
    color: #333;
    font-size: 14px;
    text-decoration: none;
    transition: all 0.2s;
    font-family: 'montserrat-md', sans-serif;
}

.page-item.active .page-link {
    background-color: #0d79e2;
    border-color: #0d79e2;
    color: #fff;
}

.page-item.disabled .page-link {
    color: #ccc;
    pointer-events: none;
    background-color: #f9f9f9;
}

.page-item:not(.active):not(.disabled) .page-link:hover {
    background-color: #f0f0f0;
    border-color: #d0d0d0;
}
