/* League Table Page Styles */

#datatable td, #datatable th {
    border: none !important;
    overflow-x: auto;
}

.league-header {
    background: url('/images/soccer-ball.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 25px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    color: white;
    overflow: hidden;
}

/* Add gradient overlay on top of the image */
.league-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(0,113,5,0.7) 0%, rgba(12,174,19,0.7) 70%, rgba(78,202,81,0.7) 100%);
    z-index: 1;
}

/* Make sure content is above the gradient overlay */
.league-header * {
    position: relative;
    z-index: 2;
}

.league-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 5px;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.2);
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.league-logo {
    height: 50px;
    width: auto;
    object-fit: contain;
}

.league-subtitle {
    font-size: 1rem;
    opacity: 0.9;
    margin-bottom: 15px;
}

.season-selector {
    display: flex;
    align-items: center;
    margin-top: 10px;
}

.season-selector label {
    margin-right: 10px;
    font-weight: 600;
    margin-bottom: 0;
}

.season-selector select {
    background-color: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.3);
    color: white;
    padding: 8px 15px;
    border-radius: 5px;
    font-weight: 500;
    min-width: 150px;
}

.season-selector select:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(255,255,255,0.5);
}

.season-selector select option {
    background-color: #007105;
    color: white;
}

.card.h-100 {
    height: 50vh !important;
    display: flex;
    flex-direction: column;
    margin-bottom: 20px;
}

.league-table-col .card.h-100 {
    height: auto !important;
}

.card-header {
    flex-shrink: 0;
    background: linear-gradient(135deg, #007105 0%, #0cae13 70%, #4eca51 100%);
    color: white !important;
    border: none;
    padding: 15px 20px;
    border-radius: 8px 8px 0 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.league-table-header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.league-table-header-container .card-header {
    padding: 15px 20px;
}

.league-table-header-container .filter-btn {
    padding: 5px 14px;
    font-size: 0.8rem;
}

.card-header .card-title {
    font-weight: 600;
    margin-bottom: 0;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
    letter-spacing: 0.5px;
    color: white;
}

.card-body {
    flex: 1;
    overflow: hidden;
    padding: 0 !important;
}

.match-list-container {
    height: 100%;
    max-height: calc(50vh - 56px);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #0cae13 #f8f9fa;
    padding: 10px;
}

#leagueHistoryContainer {
    height: auto;
    max-height: none;
    overflow-y: visible;
}

#leagueTableContainer {
    scrollbar-width: thin;
    scrollbar-color: #0cae13 #f8f9fa;
}

.match-list-container::-webkit-scrollbar, #leagueTableContainer::-webkit-scrollbar {
    width: 6px;
}

.match-list-container::-webkit-scrollbar-track, #leagueTableContainer::-webkit-scrollbar {
    background: #f8f9fa;
    border-radius: 10px;
}

.match-list-container::-webkit-scrollbar-thumb, #leagueTableContainer::-webkit-scrollbar {
    background-color: #0cae13;
    border-radius: 10px;
    border: 2px solid #f8f9fa;
}

.wg_no_data {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px 20px;
    background-color: #ffffff;
    text-align: center;
    min-height: 150px;
    color: #007105;
    font-size: 1.6rem;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
}

.wg_no_data::before {
    content: '';
    display: block;
    width: 60px;
    height: 60px;
    margin-bottom: 15px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23D4A373' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 4c-6 0-9 3-9 9s3 9 9 9 9-3 9-9-3-9-9-9z'/%3E%3Cpath d='M8 12h8'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    opacity: 0.8;
}

/* Form indicator styles */
.form-container {
    display: inline-flex;
    gap: 3px;
    justify-content: center;
}

.form-indicator {
    display: inline-block;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    text-align: center;
    line-height: 20px;
    font-size: 11px;
    font-weight: bold;
    color: white;
    text-decoration: none !important;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    pointer-events: auto !important;
}

.form-indicator:hover {
    transform: scale(1.15);
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    text-decoration: none !important;
    color: white !important;
}

.form-win {
    background-color: #28a745;
}

.form-win:hover {
    background-color: #218838;
}

.form-draw {
    background-color: #ffc107;
    color: #333 !important;
}

.form-draw:hover {
    background-color: #e0a800;
    color: #333 !important;
}

.form-loss {
    background-color: #dc3545;
}

.form-loss:hover {
    background-color: #c82333;
}

/* Ensure form cell doesn't interfere with clicks */
.form-cell {
    position: relative;
    z-index: 1;
}

/* Filter buttons */
.table-filter-buttons {
    display: flex;
    gap: 8px;
}

.filter-btn {
    padding: 8px 16px;
    border: 1px solid rgba(255,255,255,0.3);
    background-color: rgba(255,255,255,0.2);
    color: white;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 500;
}

.filter-btn:hover {
    background-color: rgba(255,255,255,0.3);
}

.filter-btn.active {
    background-color: white;
    color: #007105;
    border-color: white;
}

/* Favorite Star Button */
.favorite-star-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.5);
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.favorite-star-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.8);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.favorite-star-btn i {
    font-size: 18px;
    transition: all 0.3s ease;
}

.favorite-star-btn.is-favorite {
    background: rgba(255, 215, 0, 0.3);
    border-color: #FFD700;
}

.favorite-star-btn.is-favorite i {
    color: #FFD700;
}

.favorite-star-btn.is-favorite:hover {
    background: rgba(255, 215, 0, 0.4);
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .league-header {
        padding: 15px;
    }

    .table-filter-buttons {
        gap: 6px;
    }

    .filter-btn {
        padding: 6px 12px;
        font-size: 0.75rem;
    }

    .league-table-header-container .filter-btn {
        padding: 4px 10px;
        font-size: 0.7rem;
    }

    .favorite-star-btn .favorite-text {
        display: none;
    }

    .favorite-star-btn {
        padding: 4px 8px;
        font-size: 10px;
    }

    .favorite-star-btn i {
        font-size: 16px;
    }

    .league-title {
        font-size: 1.1rem;
        padding-right: 45px;
        gap: 8px;
    }

    .league-logo {
        height: 40px;
    }

    /* Ensure points column is visible in portrait mode on mobile */
    #datatable th:nth-child(11),
    #datatable td:nth-child(11) {
        display: table-cell !important;
    }

    /* Hide less important columns on mobile to make space */
    #datatable th:nth-child(5),
    #datatable td:nth-child(5),
    #datatable th:nth-child(6),
    #datatable td:nth-child(6),
    #datatable th:nth-child(7),
    #datatable td:nth-child(7),
    #datatable th:nth-child(9),
    #datatable td:nth-child(9) {
        display: none;
    }

    /* Make table more compact on mobile */
    #datatable th,
    #datatable td {
        font-size: 11px !important;
        padding: 4px 2px !important;
    }
}

@media (max-width: 576px) {
    .league-header {
        padding: 12px;
    }

    .league-title {
        font-size: 1rem;
        padding-right: 42px;
        gap: 6px;
    }

    .league-logo {
        height: 35px;
    }

    .favorite-star-btn {
        padding: 3px 6px;
        font-size: 9px;
    }

    .favorite-star-btn i {
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .league-header {
        padding: 10px;
    }

    .table-filter-buttons {
        gap: 4px;
    }

    .filter-btn {
        padding: 5px 10px;
        font-size: 0.7rem;
    }

    .league-table-header-container .filter-btn {
        padding: 3px 8px;
        font-size: 0.65rem;
    }

    .league-title {
        font-size: 0.95rem;
        padding-right: 40px;
        gap: 5px;
    }

    .league-logo {
        height: 32px;
    }

    .favorite-star-btn {
        padding: 3px 5px;
        font-size: 8px;
    }

    .favorite-star-btn i {
        font-size: 12px;
    }
}
