/* ==========================================================================
   BetVictor Football Stats — Frontend Styles
   ========================================================================== */

/* --- 1. Team Header (Hero) ---
   Layout is handled by Tailwind utilities in the shortcode.
   Only typography that needs to stay consistent lives here. */

.bv-team-header {
    margin-bottom: 24px;
}

.bv-team-header__name {
    color: #ffffff;
    font-family: 'Lato', sans-serif;
    font-size: 2rem;
    font-weight: 900;
    line-height: 1.2;
    margin: 0;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}

@media (min-width: 768px) {
    .bv-team-header__name {
        font-size: 3rem;
    }
}

/* --- 2. Team About --- */

.bv-team-about {
    background: #ffffff;
    border-radius: 6px;
    padding: 20px;
    margin-bottom: 24px;
}

.bv-team-about__table {
    width: 100%;
    border-collapse: collapse;
}

.bv-team-about__table th,
.bv-team-about__table td {
    padding: 8px 12px;
    font-size: 0.8125rem;
    line-height: 1.5;
    vertical-align: top;
    border-bottom: 1px solid #EDEDED;
}

.bv-team-about__table th {
    color: #61676C;
    font-weight: 700;
    white-space: nowrap;
    width: 120px;
    text-align: left;
}

.bv-team-about__table td {
    color: #1D252D;
}

.bv-team-about__table td a {
    color: #2BABDA;
    text-decoration: none;
}

.bv-team-about__table td a:hover {
    text-decoration: underline;
}

.bv-team-about__table tr:last-child th,
.bv-team-about__table tr:last-child td {
    border-bottom: none;
}

/* --- 3. League Standings ---
   Layout is handled entirely by Tailwind utility classes in the shortcode.
   Only minor tweaks that can't be expressed as utilities live here.         */

/* The sticky team cell has its own bg-white to avoid scroll bleed-through.
   On even rows Tailwind adds bg-gray-50 to the <tr>, so we must mirror
   that on the sticky cell so it doesn't show a white stripe.              */
.bv-standings-row:nth-child(even) > .bv-standings-team {
    background: rgb(249 250 251); /* gray-50 */
}

/* --- 4. Live Score ---
   Layout is handled entirely by Tailwind utility classes.        */

/* --- 5. Player Gallery --- */

.bv-team-squad {
    background: #ffffff;
    border-radius: 6px;
    padding: 20px;
    margin-bottom: 24px;
}

.bv-team-squad__title {
    font-family: 'Lato', sans-serif;
    font-size: 1.125rem;
    font-weight: 700;
    color: #1D252D;
    margin: 0 0 16px;
}

.bv-team-squad__legend {
    display: flex;
    gap: 16px;
    margin: -8px 0 14px;
    font-size: 0.6875rem;
    color: #61676C;
}

.bv-team-squad__legend strong {
    color: #009A44;
    font-weight: 700;
    margin-right: 2px;
}

.bv-team-squad__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
}

.bv-team-squad__card {
    background: #F5F6F6;
    border-radius: 6px;
    padding: 16px 12px;
    text-align: center;
    transition: box-shadow 0.2s;
}

.bv-team-squad__card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.bv-team-squad__avatar {
    width: 64px;
    height: 64px;
    margin: 0 auto 10px;
    background: #EDEDED;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bv-team-squad__icon {
    width: 48px;
    height: 48px;
    object-fit: contain;
}

.bv-team-squad__info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.bv-team-squad__name {
    font-size: 0.8125rem;
    font-weight: 700;
    color: #1D252D;
    line-height: 1.3;
}

.bv-team-squad__position {
    font-size: 0.6875rem;
    color: #61676C;
    text-transform: uppercase;
}

.bv-team-squad__number {
    font-size: 0.75rem;
    color: #2BABDA;
    font-weight: 700;
}

.bv-team-squad__appearances {
    font-size: 0.6875rem;
    color: #009A44;
    font-weight: 600;
    margin-top: 2px;
}

.bv-team-squad__load-more {
    display: block;
    margin: 16px auto 0;
    background: none;
    border: 1px solid #EDEDED;
    border-radius: 6px;
    padding: 8px 24px;
    font-size: 0.8125rem;
    color: #61676C;
    cursor: pointer;
    transition: all 0.2s;
}

.bv-team-squad__load-more:hover {
    border-color: #2BABDA;
    color: #2BABDA;
}

/* --- 6. Latest Matches (Fixtures) --- */

.bv-team-fixtures {
    background: #ffffff;
    border-radius: 6px;
    padding: 20px;
    margin-bottom: 24px;
}

.bv-team-fixtures__title {
    font-family: 'Lato', sans-serif;
    font-size: 1.125rem;
    font-weight: 700;
    color: #1D252D;
    margin: 0 0 16px;
}

.bv-team-fixtures__tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.bv-team-fixtures__tab {
    padding: 8px 16px;
    border: none;
    border-radius: 100px;
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    background: #F5F6F6;
    color: #61676C;
}

.bv-team-fixtures__tab--active {
    background: #2BABDA;
    color: #ffffff;
}

.bv-team-fixtures__tab:hover:not(.bv-team-fixtures__tab--active) {
    background: #EDEDED;
}

.bv-team-fixtures__panel {
    display: none;
}

.bv-team-fixtures__panel--active {
    display: block;
}

.bv-team-fixtures__scroll {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 8px;
    scroll-snap-type: x mandatory;
}

.bv-team-fixtures__scroll::-webkit-scrollbar {
    height: 4px;
}

.bv-team-fixtures__scroll::-webkit-scrollbar-thumb {
    background: #EDEDED;
    border-radius: 2px;
}

/* Match Card */

.bv-match-card {
    min-width: 200px;
    background: #F5F6F6;
    border-radius: 6px;
    padding: 14px;
    flex-shrink: 0;
    scroll-snap-align: start;
    border: 1px solid #EDEDED;
}

.bv-match-card__league {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid #EDEDED;
}

.bv-match-card__league-name {
    font-size: 0.75rem;
    font-weight: 700;
    color: #1D252D;
}

.bv-match-card__date {
    font-size: 0.6875rem;
    color: #61676C;
}

.bv-match-card__teams {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.bv-match-card__team {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8125rem;
    color: #1D252D;
}

.bv-match-card__score {
    font-weight: 700;
    font-size: 0.875rem;
    min-width: 20px;
    text-align: center;
}

/* --- 7. Latest News (matches category archive layout) --- */

.bv-team-news {
    margin-bottom: 24px;
}

.bv-team-news__title {
    font-family: 'Lato', sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    color: #1D252D;
    margin: 0 0 20px;
}

.bv-team-news__grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

@media (min-width: 768px) {
    .bv-team-news__grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.bv-team-news__card {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.bv-team-news__card-link {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.bv-team-news__image {
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: 8px;
    margin: 0 0 var(--wp--preset--spacing--small, 12px);
}

.bv-team-news__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.bv-team-news__content {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.bv-team-news__date {
    font-size: 12px;
    font-weight: 700;
    color: #61676C;
    margin-bottom: 8px;
}

.bv-team-news__headline {
    font-size: 16px;
    font-weight: 700;
    color: #1D252D;
    line-height: 1.4;
    margin: 0 0 8px;
    transition: color 0.2s;
}

.bv-team-news__card-link:hover .bv-team-news__headline {
    color: #2BABDA;
}

.bv-team-news__excerpt {
    font-size: 14px;
    color: #61676C;
    line-height: 1.5;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.bv-team-news__load-more-wrap {
    display: flex;
    justify-content: center;
    margin-top: 24px;
}

.bv-team-news__load-more {
    background-color: #2BABDA;
    color: #ffffff;
    border: none;
    border-radius: 100px;
    padding: 12px 32px;
    font-family: 'Lato', sans-serif;
    font-size: 0.875rem;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.2s;
}

.bv-team-news__load-more:hover {
    background-color: #2196C8;
}

.bv-team-news__load-more:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* --- 8. Poll --- */

.bv-team-poll {
    background: #1D252D;
    border-radius: 6px;
    padding: 24px;
    margin-bottom: 24px;
}

.bv-team-poll__title {
    font-family: 'Lato', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    color: #ffffff;
    margin: 0 0 16px;
}

.bv-team-poll__options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

@media (min-width: 768px) {
    .bv-team-poll__options {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1024px) {
    .bv-team-poll__options {
        grid-template-columns: repeat(4, 1fr);
    }
}

.bv-team-poll__option {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    padding: 8px 10px;
    cursor: pointer;
    transition: all 0.2s;
    overflow: hidden;
    color: #ffffff;
    font-size: 0.75rem;
    text-align: left;
    width: 100%;
}

.bv-team-poll__option:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: #2BABDA;
}

.bv-team-poll__player {
    position: relative;
    z-index: 1;
    font-weight: 600;
    display: flex;
    flex-direction: column;
    line-height: 1.3;
}

.bv-team-poll__apps {
    font-size: 0.625rem;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.5);
}

.bv-team-poll__pct {
    position: relative;
    z-index: 1;
    font-weight: 700;
    color: #2BABDA;
}

.bv-team-poll__bar {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: rgba(43, 171, 218, 0.2);
    transition: width 0.5s ease;
    border-radius: 6px;
}

.bv-team-poll__total {
    margin-top: 12px;
    font-size: 0.75rem;
    color: #61676C;
}

.bv-team-poll__count {
    font-weight: 700;
    color: #ffffff;
}

.bv-team-poll--voted .bv-team-poll__option {
    cursor: default;
    pointer-events: none;
}

/* --- 9. Season Statistics --- */

.bv-team-stats {
    background: #ffffff;
    border-radius: 6px;
    padding: 20px;
    margin-bottom: 24px;
}

.bv-team-stats__title {
    font-family: 'Lato', sans-serif;
    font-size: 1.125rem;
    font-weight: 700;
    color: #1D252D;
    margin: 0 0 16px;
}

.bv-team-stats__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 12px;
}

.bv-team-stats__item {
    text-align: center;
    padding: 12px 8px;
    background: #F5F6F6;
    border-radius: 6px;
}

.bv-team-stats__value {
    display: block;
    font-size: 1.5rem;
    font-weight: 900;
    color: #1D252D;
    line-height: 1;
}

.bv-team-stats__label {
    display: block;
    font-size: 0.6875rem;
    color: #61676C;
    margin-top: 4px;
    text-transform: uppercase;
}

.bv-team-stats__form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    margin-top: 16px;
}

.bv-team-stats__form-label {
    font-size: 0.8125rem;
    font-weight: 700;
    color: #61676C;
    margin-right: 4px;
}

.bv-team-stats__form-item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 4px;
    font-size: 0.6875rem;
    font-weight: 700;
    color: #ffffff;
}

.bv-team-stats__form-w {
    background: #009A44;
}

.bv-team-stats__form-d {
    background: #B7B7B7;
}

.bv-team-stats__form-l {
    background: #dc3545;
}

/* --- Responsive --- */

@media (max-width: 768px) {
    .bv-team-header {
        padding: 32px 16px;
    }

    .bv-team-header__name {
        font-size: 1.5rem;
    }

    .bv-team-squad__grid {
        grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    }

    .bv-team-news__grid {
        grid-template-columns: 1fr;
    }

    .bv-team-stats__grid {
        grid-template-columns: repeat(3, 1fr);
    }

}
