/**
 * Sports Club Manager - Style CSS
 *
 * @package FootballClubManager
 */

/* ==========================================================================
   Lista Zawodników (player_list)
   ========================================================================== */

.fcm-player-list {
    margin: 2rem 0;
}

.fcm-players-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 1.5rem;
}

.fcm-player-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.fcm-player-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.fcm-player-photo {
    position: relative;
    width: 100%;
    padding-top: 100%;
    background: #f5f5f5;
    overflow: hidden;
}

.fcm-player-photo img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.fcm-player-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
}

.fcm-player-placeholder .dashicons {
    font-size: 80px;
    width: 80px;
    height: 80px;
    color: #fff;
    opacity: 0.6;
}

.fcm-player-number {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    font-size: 24px;
    font-weight: bold;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fcm-player-info {
    padding: 1.5rem;
}

.fcm-player-name {
    margin: 0 0 0.5rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: #333;
}

.fcm-player-position {
    margin: 0 0 0.5rem;
    font-size: 0.95rem;
    color: #0ea5e9;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.fcm-player-team {
    margin: 0 0 0.5rem;
    font-size: 0.9rem;
    color: #666;
}

/* ==========================================================================
   Tabela Drużyn (club_team_table)
   ========================================================================== */

.fcm-team-table {
    margin: 2rem 0;
    overflow: hidden;
    overflow-x: auto;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
}

.fcm-team-table .fcm-table {
    border: 0;
    border-radius: 0;
    border-collapse: separate;
    border-spacing: 0;
}

.fcm-team-table .fcm-table thead th:first-child {
    border-top-left-radius: 8px;
}

.fcm-team-table .fcm-table thead th:last-child {
    border-top-right-radius: 8px;
}

.fcm-team-table .fcm-table tbody tr:last-child td:first-child {
    border-bottom-left-radius: 8px;
}

.fcm-team-table .fcm-table tbody tr:last-child td:last-child {
    border-bottom-right-radius: 8px;
}

.fcm-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
}

.fcm-table thead {
    background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
    color: #fff;
}

.fcm-table thead th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.95rem;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

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

.fcm-table tbody tr:last-child {
    border-bottom: none;
}

.fcm-table tbody tr:hover {
    background-color: #f5f5f5;
}

.fcm-table tbody td {
    padding: 1rem;
    font-size: 0.95rem;
    color: #333;
}

.fcm-table tbody td strong {
    font-weight: 600;
    color: #0ea5e9;
}

/* Responsywność tabeli */
@media screen and (max-width: 768px) {
    .fcm-team-table,
    .fcm-league-table,
    .fcm-schedule-table-wrap {
        overflow-x: hidden;
    }

    .fcm-table {
        min-width: 0;
        width: 100%;
        table-layout: auto;
        border: 1px solid #e0e0e0;
        font-size: 0.84rem;
    }

    .fcm-table thead {
        display: table-header-group;
    }

    .fcm-table tbody tr {
        display: table-row;
        margin-bottom: 0;
        border: 0;
        border-radius: 0;
    }

    .fcm-table tbody td {
        display: table-cell;
        text-align: left;
        padding: 0.58rem 0.42rem;
        border-bottom: 1px solid #f0f0f0;
        white-space: normal;
        overflow-wrap: normal;
        word-break: normal;
    }

    .fcm-table tbody td::before {
        content: none;
    }

    .fcm-standings {
        table-layout: fixed;
        width: 100%;
    }

    .fcm-standings thead th {
        font-size: 0.72rem;
        padding: 0.4rem 0.16rem;
        white-space: nowrap;
        text-align: center;
    }

    .fcm-standings .fcm-rank {
        width: 10%;
        text-align: center;
    }

    .fcm-standings .fcm-team {
        min-width: 0;
        width: 20%;
        text-align: center;
    }

    .fcm-standings thead th.fcm-team {
        font-size: 0;
    }

    .fcm-standings .fcm-played,
    .fcm-standings .fcm-won,
    .fcm-standings .fcm-draw,
    .fcm-standings .fcm-lost {
        width: 10%;
        text-align: center;
    }

    .fcm-standings .fcm-goals {
        display: none;
    }

    .fcm-standings .fcm-points {
        width: 30%;
        text-align: center;
    }

    .fcm-standings td,
    .fcm-standings th {
        padding-left: 0.16rem !important;
        padding-right: 0.16rem !important;
    }

    .fcm-standings tbody td {
        font-size: 0.8rem;
        line-height: 1.08;
        padding-top: 0.42rem !important;
        padding-bottom: 0.42rem !important;
    }

    .fcm-standings .fcm-team-wrap {
        display: flex !important;
        width: 100%;
        align-items: center;
        justify-content: center;
        gap: 0;
    }

    .fcm-standings .fcm-team-wrap strong {
        display: none !important;
    }

    .fcm-standings .fcm-team-crest {
        display: block !important;
        width: 30px !important;
        height: 30px !important;
        border-radius: 999px !important;
        object-fit: contain !important;
        padding: 2px !important;
        border: 1px solid #d5d9dd !important;
        background: #fff !important;
    }

    .fcm-standings .fcm-team-crest-fallback {
        background: #e5e7eb;
        border: 1px solid #cbd5e1;
        border-radius: 999px;
    }

    .fcm-table-scroll {
        overflow-x: visible !important;
    }

    .fcm-schedule {
        table-layout: fixed;
        width: 100%;
    }

    .fcm-schedule th,
    .fcm-schedule td {
        white-space: normal;
        word-break: normal;
        overflow-wrap: break-word;
    }

    .fcm-schedule th {
        white-space: nowrap;
        overflow-wrap: normal;
        word-break: normal;
        font-size: 0.74rem;
        line-height: 1.15;
        overflow: visible;
        text-overflow: initial;
    }

    .fcm-schedule th:nth-child(1),
    .fcm-schedule td:nth-child(1) {
        width: 18%;
    }

    .fcm-schedule th:nth-child(2),
    .fcm-schedule td:nth-child(2) {
        width: 20%;
        text-align: center;
        padding-right: 0.2rem !important;
        padding-left: 0.2rem !important;
    }

    .fcm-schedule th:nth-child(3),
    .fcm-schedule td:nth-child(3) {
        width: 38%;
        padding-left: 0.55rem !important;
    }

    .fcm-schedule th:nth-child(4),
    .fcm-schedule td:nth-child(4) {
        width: 24%;
    }
}

/* ==========================================================================
   Komunikaty
   ========================================================================== */

.fcm-no-results {
    padding: 2rem;
    text-align: center;
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    color: #666;
    font-size: 1rem;
}

/* ==========================================================================
   Responsywność ogólna
   ========================================================================== */

@media screen and (max-width: 640px) {
    .fcm-players-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 1.5rem;
    }

    .fcm-player-info {
        padding: 1rem;
    }

    .fcm-player-name {
        font-size: 1.1rem;
    }
}

@media screen and (min-width: 1200px) {
    .fcm-players-grid {
        grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    }
}

/* ==========================================================================
   Tabela Ligowa (league_table)
   ========================================================================== */

.fcm-league-table {
    margin: 2rem 0;
    overflow-x: auto;
}

.fcm-standings {
    font-size: 0.95rem;
}

.fcm-standings .fcm-rank {
    width: 40px;
    text-align: center;
    font-weight: 600;
    color: #0ea5e9;
}

.fcm-standings .fcm-team {
    min-width: 200px;
}

.fcm-standings .fcm-played,
.fcm-standings .fcm-won,
.fcm-standings .fcm-draw,
.fcm-standings .fcm-lost {
    width: 50px;
    text-align: center;
}

.fcm-standings .fcm-goals {
    width: 90px;
    text-align: center;
}

.fcm-standings .fcm-points {
    width: 60px;
    text-align: center;
    background: #f0f9ff;
    font-size: 1.1rem;
}

.fcm-standings .fcm-rank-badge {
    color: #0f172a;
}

/* ==========================================================================
   Karty Meczów (last_match, next_match)
   ========================================================================== */

.fcm-match-card {
    background: #fff;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 1.5rem;
    margin: 2rem 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    max-width: 600px;
}

.fcm-last-match {
    border-color: #10b981;
}

.fcm-next-match {
    border-color: #0ea5e9;
}

.fcm-match-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #f0f0f0;
}

.fcm-match-status {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
    color: #fff;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.fcm-last-match .fcm-match-status {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.fcm-match-date {
    font-size: 0.9rem;
    color: #666;
    font-weight: 500;
}

.fcm-match-teams {
    display: flex;
    align-items: center;
    justify-content: space-around;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.fcm-team-home,
.fcm-team-away {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.fcm-match-team-badge {
    width: 56px;
    height: 56px;
    border-radius: 999px;
    object-fit: contain;
    border: 1px solid #d5d9dd;
    background: #fff;
    padding: 4px;
    display: block;
    margin: 0 auto 0.55rem;
}

.fcm-team-home h3,
.fcm-team-away h3 {
    margin: 0 0 0.5rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: #1a1a1a;
    min-height: 2.6em;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fcm-team-score {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background: #f0f9ff;
    border: 2px solid #0ea5e9;
    border-radius: 8px;
    font-size: 2rem;
    font-weight: 800;
    color: #0369a1;
    min-width: 80px;
}

.fcm-match-divider {
    font-size: 1.5rem;
    font-weight: 300;
    color: #ccc;
    padding: 0 1rem;
}

.fcm-match-time,
.fcm-match-venue,
.fcm-match-league {
    padding: 0.5rem 1rem;
    background: #f9f9f9;
    border-radius: 6px;
    margin-top: 0.75rem;
    font-size: 0.9rem;
    color: #555;
}

.fcm-match-time {
    background: #fef3c7;
    border-left: 3px solid #f59e0b;
}

.fcm-match-venue {
    background: #e0f2fe;
    border-left: 3px solid #0ea5e9;
}

.fcm-match-league {
    background: #f0fdf4;
    border-left: 3px solid #10b981;
    font-weight: 600;
}

/* Responsywność meczów */
@media screen and (max-width: 640px) {
    .fcm-match-card {
        padding: 1rem;
        overflow-x: hidden;
    }

    .fcm-team-home h3,
    .fcm-team-away h3 {
        font-size: 1rem;
        overflow-wrap: anywhere;
    }

    .fcm-match-team-badge {
        width: 44px;
        height: 44px;
        margin-bottom: 0.4rem;
    }

    .fcm-team-score {
        font-size: 1.35rem;
        padding: 0.45rem 0.8rem;
        min-width: 52px;
    }

    .fcm-match-divider {
        display: block;
    }

    .fcm-match-teams {
        gap: 0.5rem;
    }
}

/* ==========================================================================
   Komunikaty błędów
   ========================================================================== */

.fcm-error {
    padding: 1rem;
    background: #fee;
    border: 1px solid #fcc;
    border-radius: 6px;
    color: #c33;
    margin: 1rem 0;
}

/* ==========================================================================
   Pasek Następnego Meczu (next_match_bar)
   ========================================================================== */

.fcm-next-match-bar {
    margin: 1.2rem 0;
    background: transparent;
    color: var(--fcm-bar-text, #e5e7eb);
    font-size: var(--fcm-bar-font-size, 16px);
    font-family: var(--fcm-bar-font-family, inherit);
}

.fcm-next-bar-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    border: 1px solid var(--fcm-bar-border, rgba(255,255,255,.22));
    border-radius: var(--fcm-bar-radius, 14px);
    padding: 5px !important;
    background: var(--fcm-bar-bg, transparent);
}

.fcm-next-bar-teams {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    min-width: 0;
    flex-wrap: wrap;
}

.fcm-next-bar-badge {
    width: 38px;
    height: 38px;
    border-radius: 999px;
    object-fit: cover;
    border: 1px solid rgba(255, 255, 255, 0.25);
}

.fcm-next-bar-home,
.fcm-next-bar-away {
    font-size: 1.9em;
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: 0.1px;
}

.fcm-next-bar-vs {
    font-size: 1.45em;
    font-weight: 700;
    opacity: 0.88;
}

.fcm-next-bar-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.95rem;
    justify-content: flex-end;
}

.fcm-next-bar-item {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 600;
    white-space: nowrap;
    color: var(--fcm-bar-text, #e5e7eb);
}

.fcm-next-bar-icon {
    font-size: 1.05em;
    color: var(--fcm-bar-accent, #60a5fa);
    display: inline-block;
    vertical-align: -0.12em;
}

@media screen and (max-width: 900px) {
    .fcm-next-match-bar {
        margin: 0.65rem 0;
        overflow-x: hidden;
    }

    .fcm-next-bar-main {
        align-items: center;
        flex-direction: column;
        width: 100%;
        min-width: 0;
        gap: 0.25rem;
        flex-wrap: nowrap;
        padding: 5px;
        border-radius: 10px;
    }

    .fcm-next-bar-teams {
        flex: 0 0 auto;
        width: 100%;
        min-width: 0;
        flex-wrap: nowrap;
        gap: 0.25rem;
        justify-content: center;
        line-height: 1.05;
    }

    .fcm-next-bar-home,
    .fcm-next-bar-away {
        display: none;
    }

    .fcm-next-bar-vs {
        font-size: 0.92em;
        white-space: nowrap;
    }

    .fcm-next-bar-meta {
        display: none;
    }

    .fcm-next-bar-item {
        display: none;
    }

    .fcm-next-bar-badge {
        width: 34px;
        height: 34px;
    }
}

.fcm-team-crest-cell {
    width: 72px;
    text-align: center;
}

.fcm-team-crest {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid #d5d9dd;
}

.fcm-team-crest-placeholder {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #f3f4f6;
    color: #6b7280;
    font-weight: 700;
}

/* ==========================================================================
   Showcase (fcm_players_showcase, fcm_teams_showcase)
   ========================================================================== */

.fcm-showcase {
    margin: 2rem 0;
}

.fcm-showcase-track {
    display: grid;
    gap: 1rem;
}

.fcm-showcase-grid .fcm-showcase-track {
    grid-template-columns: repeat(var(--fcm-showcase-columns, 3), minmax(0, 1fr));
}

.fcm-showcase-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.fcm-showcase-media {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    background: #f3f4f6;
}

.fcm-showcase-team-media {
    aspect-ratio: 4 / 3;
}

.fcm-showcase-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.fcm-showcase-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
}

.fcm-showcase-placeholder .dashicons {
    width: 64px;
    height: 64px;
    font-size: 64px;
    color: #fff;
    opacity: 0.75;
}

.fcm-showcase-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    border-radius: 999px;
    background: rgba(17, 24, 39, 0.85);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
}

.fcm-showcase-content {
    padding: 0.9rem 1rem 1rem;
}

.fcm-showcase-title {
    margin: 0 0 0.25rem;
    font-size: 1.05rem;
    line-height: 1.25;
}

.fcm-showcase-meta {
    margin: 0;
    color: #0369a1;
    font-weight: 600;
}

.fcm-showcase-submeta {
    margin: 0.2rem 0 0;
    color: #6b7280;
    font-size: 0.9rem;
}

.fcm-showcase-carousel .fcm-showcase-track {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(220px, 280px);
    overflow-x: auto;
    padding-bottom: 0.5rem;
    scroll-snap-type: x mandatory;
}

.fcm-showcase-carousel .fcm-showcase-card {
    scroll-snap-align: start;
}

.fcm-carousel-shell {
    position: relative;
    padding: 0 56px;
    direction: ltr;
}

.fcm-carousel-viewport {
    overflow: hidden;
    width: 100%;
}

.fcm-carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 3;
    width: 44px;
    height: 44px;
    border: 1px solid #d1d5db;
    background: #fff;
    color: #111827;
    border-radius: 999px;
    font-size: 1.7rem;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

/* Harden against theme-level button overrides (padding/radius/appearance). */
.fcm-carousel-shell .fcm-carousel-btn {
    border-radius: 50% !important;
    padding: 0 !important;
    min-width: 44px !important;
    min-height: 44px !important;
    aspect-ratio: 1 / 1;
    -webkit-appearance: none;
    appearance: none;
}

.fcm-carousel-prev {
    left: 6px;
}

.fcm-carousel-next {
    right: 6px;
}

.fcm-carousel-btn:hover {
    background: #f9fafb;
}

.fcm-showcase-carousel .fcm-showcase-track::-webkit-scrollbar {
    display: none;
}

.fcm-showcase-carousel .fcm-showcase-track {
    -ms-overflow-style: none;
    scrollbar-width: none;
    direction: ltr;
}

@media screen and (max-width: 900px) {
    .fcm-showcase-grid .fcm-showcase-track {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media screen and (max-width: 640px) {
    .fcm-showcase-carousel .fcm-showcase-track > .fcm-showcase-card {
        flex: 0 0 calc(100% - 6px) !important;
        max-width: calc(100% - 6px) !important;
    }

    .fcm-showcase-carousel .fcm-showcase-track {
        padding-right: 3px;
    }

    .fcm-showcase-grid .fcm-showcase-track {
        grid-template-columns: 1fr;
    }

    .fcm-carousel-shell {
        padding: 0 42px;
    }

    .fcm-carousel-btn {
        width: 36px;
        height: 36px;
        font-size: 1.4rem;
    }

    .fcm-carousel-shell .fcm-carousel-btn {
        min-width: 36px !important;
        min-height: 36px !important;
    }

    .fcm-carousel-prev {
        left: 0;
    }

    .fcm-carousel-next {
        right: 0;
    }
}

