/* Teams Page Styles */

/* CSS Variables */
:root {
    --primary-green: #007105;
    --light-green: #0cae13;
    --dark-green: #005a04;
    --white: #ffffff;
    --light-gray: #f8f9fa;
    --dark-gray: #343a40;
    --yellow: #ffc107;
    --red: #dc3545;
    --blue: #0d6efd;
    --shadow: 0 4px 6px rgba(0,0,0,0.1);
    --card-shadow: 0 5px 15px rgba(0,0,0,0.08);
    --transition: all 0.3s ease;
}

/* Team Logo Styles */
.team-logo {
    width: 50px;
    height: 50px;
    object-fit: contain;
    transition: var(--transition);
    margin-right: 10px;
    vertical-align: middle;
}

.team-logo:hover {
    transform: scale(1.05);
}

.team-name {
    font-size: 1.0rem;
    font-weight: 500;
    text-align: center;
    color: black;
}

.team-code {
    font-size: 0.8rem;
    color: #666;
    margin-top: 3px;
}

.team-logo-sm {
    width: 24px;
    height: 24px;
    object-fit: contain;
    margin-right: 8px;
    vertical-align: middle;
}

/* League Table Styles */
.league-standings-table {
    width: 100%;
    margin-bottom: 0;
    font-size: 0.9rem;
}

.league-standings-table thead {
    background-color: var(--primary-green);
    color: var(--white);
}

.league-standings-table thead th {
    border: none;
    padding: 10px 8px;
    font-weight: 600;
    font-size: 0.85rem;
}

.league-standings-table tbody tr {
    border-bottom: 1px solid #e9ecef;
    transition: background-color 0.2s ease;
}

.league-standings-table tbody tr:hover {
    background-color: var(--light-gray);
}

.league-standings-table td {
    padding: 8px;
    vertical-align: middle;
}

.position-col {
    width: 40px;
    font-weight: 600;
    color: var(--dark-gray);
}

.team-col {
    min-width: 150px;
}

.points-col {
    font-weight: 700;
    color: var(--primary-green);
}

.promotion-zone {
    background-color: rgba(0, 113, 5, 0.05);
    border-left: 3px solid var(--primary-green);
}

.relegation-zone {
    background-color: rgba(220, 53, 69, 0.05);
    border-left: 3px solid #dc3545;
}

/* Match Status Styles */
.match-status {
    background-color: var(--primary-green);
    color: var(--white);
    padding: 4px 16px;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
    min-width: 100px;
    display: inline-block;
    text-align: center;
}

.match-status.ft { background-color: #adadad; }
.match-status.post { background-color: #dc3545; }
.match-status.live {
    background-color: #28a745;
    animation: live-pulse 2s ease-in-out infinite;
    box-shadow: 0 0 10px rgba(40, 167, 69, 0.6);
}
.match-status.awaitingresult { background-color: #2d3aad; }
.match-status.upcoming { background-color: #ffc107; color: #212529; }

@keyframes live-pulse {
    0%, 100% { box-shadow: 0 0 10px rgba(40, 167, 69, 0.6); }
    50% { box-shadow: 0 0 20px rgba(40, 167, 69, 0.9), 0 0 30px rgba(40, 167, 69, 0.6); }
}

#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;
}

.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;
}

.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);
}

.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;
}

#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;
}

/* 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: 6px 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);
}

@media (max-width: 768px) {
    .favorite-star-btn .favorite-text {
        display: none;
    }

    .favorite-star-btn {
        padding: 6px 8px;
        font-size: 11px;
    }

    .favorite-star-btn i {
        font-size: 14px;
    }

    .league-title {
        font-size: 1.2rem;
        padding-right: 50px; /* Ensure space for star button */
    }

    .team-logo {
        max-width: 35px !important;
        max-height: 35px !important;
    }
}
