/**
 * Fotbal.live - Component Styles
 * Built on Bootstrap 5, mobile-first approach
 * Theme variables and overrides live in theme.css
 */

/* ── Breadcrumb ───────────────────────────────── */
.breadcrumb {
    background: linear-gradient(135deg, #f8f9fa 0%, #f0f2f5 100%);
    border-radius: 0.5rem;
    padding: 0.5rem 1rem;
    font-size: 1rem;
    border: 1px solid #e9ecef;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    margin-bottom: 0;
}

nav[aria-label="breadcrumb"] {
    margin-top: -1.5rem;
    margin-bottom: 1.25rem;
}

.breadcrumb-item+.breadcrumb-item::before {
    content: "\f285" !important;
    font-family: "bootstrap-icons" !important;
    font-size: 0.8rem;
    vertical-align: middle;
    color: #adb5bd;
    padding: 0 0.35rem;
}

.breadcrumb-item a {
    color: var(--fl-primary, #1B4332);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.15s;
}

.breadcrumb-item a:hover {
    color: var(--fl-secondary, #40B55B);
    text-decoration: underline;
}

.breadcrumb-item.active {
    color: #6c757d;
    font-weight: 600;
}

@media (max-width: 575.98px) {
    .breadcrumb {
        font-size: 0.8rem;
        padding: 0.4rem 0.75rem;
    }
}

/* ── Global ───────────────────────────────────── */
.border-dashed {
    border: 2px dashed #dee2e6 !important;
}

/* ── Match Mode - Large Touch Buttons ─────────── */
#event-actions > [class*="col-"] {
    display: flex;
}

#event-actions .event-btn {
    min-height: 112px;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 1rem 0.75rem !important;
    font-weight: 600;
    line-height: 1.15;
    white-space: normal;
    overflow-wrap: anywhere;
    border-radius: 12px;
    transition: transform 0.1s;
}

#event-actions .event-btn .fl-goal-ball-icon {
    color: #fff;
}

#event-actions .event-btn:active {
    transform: scale(0.95);
}

/* Player selection in modal - large tap targets */
.player-select-btn {
    padding: 12px 16px;
    font-size: 1.1rem;
    border: none;
    background: #f8f9fa;
    width: 100%;
    text-align: left;
    border-bottom: 1px solid #e9ecef;
    cursor: pointer;
    transition: background 0.15s;
}

.player-select-btn .badge {
    min-width: 32px;
}

/* ── Pitch / Lineup Builder ───────────────────── */
#pitch-container {
    background: linear-gradient(to bottom,
            #2d8c4e 0%, #35a05a 5%,
            #2d8c4e 5%, #35a05a 10%,
            #2d8c4e 10%, #35a05a 15%,
            #2d8c4e 15%, #35a05a 20%,
            #2d8c4e 20%, #35a05a 25%,
            #2d8c4e 25%, #35a05a 30%,
            #2d8c4e 30%, #35a05a 35%,
            #2d8c4e 35%, #35a05a 40%,
            #2d8c4e 40%, #35a05a 45%,
            #2d8c4e 45%, #35a05a 50%,
            #2d8c4e 50%, #35a05a 55%,
            #2d8c4e 55%, #35a05a 60%,
            #2d8c4e 60%, #35a05a 65%,
            #2d8c4e 65%, #35a05a 70%,
            #2d8c4e 70%, #35a05a 75%,
            #2d8c4e 75%, #35a05a 80%,
            #2d8c4e 80%, #35a05a 85%,
            #2d8c4e 85%, #35a05a 90%,
            #2d8c4e 90%, #35a05a 95%,
            #2d8c4e 95%, #35a05a 100%) !important;
}

.pitch-position {
    position: absolute;
    width: 62px;
    height: 62px;
    margin-left: -31px;
    margin-top: -31px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid var(--fl-primary);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    z-index: 2;
    transition: transform 0.2s, box-shadow 0.2s;
    text-align: center;
    line-height: 1.1;
    overflow: visible;
}

.pitch-position:hover {
    transform: scale(1.15);
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
}

.pitch-position.occupied {
    background: var(--fl-secondary);
    color: white;
    border-color: white;
}

.pitch-position .pos-label {
    font-size: 0.55rem;
    opacity: 0.95;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    line-height: 1;
}

.pitch-position .pos-number {
    font-size: 1.15rem;
    font-weight: 700;
}

.pitch-position .pos-player {
    position: absolute;
    top: calc(100% + 2px);
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.68rem;
    font-weight: 600;
    line-height: 1.1;
    white-space: nowrap;
    max-width: 96px;
    overflow: hidden;
    text-overflow: ellipsis;
    background: rgba(0, 0, 0, 0.72);
    color: #fff;
    border-radius: 10px;
    padding: 1px 6px;
    pointer-events: none;
    display: none;
}

.pitch-position.occupied .pos-player {
    display: block;
}

/* Player pool drag items */
.player-pool-item {
    cursor: grab;
    padding: 8px 12px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    align-items: center;
    gap: 8px;
}

.player-pool-item:hover {
    background: #f8f9fa;
}

.player-pool-item.assigned {
    opacity: 0.4;
    text-decoration: line-through;
}

/* ── Timeline Event Items ─────────────────────── */
.timeline-event {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 16px;
    border-left: 4px solid transparent;
    transition: background 0.2s;
}

.timeline-event .event-minute {
    min-width: 40px;
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--fl-primary);
}

.timeline-event .event-icon {
    font-size: 1.2rem;
}

.timeline-event .event-detail {
    flex: 1;
}

/* Event type color coding */
.timeline-event.evt-goal_home {
    background: rgba(64, 181, 91, 0.299);
    border-left-color: var(--fl-secondary);
}

.timeline-event.evt-goal_away {
    background: rgba(220, 53, 70, 0.367);
    border-left-color: #dc3545;
}

.timeline-event.evt-yellow_card {
    background: rgba(255, 193, 7, 0.1);
    border-left-color: #dc3545;
}

.timeline-event.evt-red_card,
.timeline-event.evt-second_yellow {
    background: rgba(220, 53, 69, 0.1);
    border-left-color: #ffc107;
}

.timeline-event.evt-substitution {
    background: rgba(13, 110, 253, 0.06);
    border-left-color: #0d6efd;
}

.timeline-event.evt-match_start,
.timeline-event.evt-half_start,
.timeline-event.evt-resume {
    background: rgba(13, 202, 240, 0.037);
    border-left-color: #0dcaf0;
}

.timeline-event.evt-match_end,
.timeline-event.evt-half_end {
    background: rgba(108, 117, 125, 0.06);
    border-left-color: #6c757d;
}

.timeline-event.evt-pause {
    background: rgba(255, 193, 7, 0.04);
    border-left-color: #ffc107;
}

.timeline-event.evt-note {
    background: rgba(108, 117, 125, 0.036);
    border-left-color: #adb5bd;
}

/* ── Score Display ────────────────────────────── */
.score-display .score-number {
    font-size: 4rem;
    font-weight: 800;
    text-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    letter-spacing: -2px;
    line-height: 1;
    color: #ffffff;
}

.score-display .score-separator {
    font-size: 2.5rem;
    font-weight: 300;
    opacity: 0.7;
    margin: 0 0.3rem;
    color: #ffffff;
}

.score-display .score-team-name {
    display: inline-flex !important;
    align-items: center;
    gap: 0.35rem;
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    opacity: 0.95;
    color: #ffffff;
}

.score-display .score-team-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}

.score-display .live-score-team--left .score-team-name {
    justify-content: flex-end;
}

.score-display .live-score-team--right .score-team-name {
    justify-content: flex-start;
}

@media (max-width: 576px) {
    .score-display .score-number {
        font-size: 2.8rem;
    }

    .score-display .score-separator {
        font-size: 1.8rem;
    }

    .score-display .score-team-name {
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
        gap: 0.2rem;
        font-size: 0.85rem;
        letter-spacing: 0;
        word-break: break-word;
        hyphens: auto;
        line-height: 1.15;
        text-align: center;
    }

    .score-display .live-score-team--right .score-team-logo {
        order: 1;
    }

    .score-display .live-score-team--right .score-team-label {
        order: 2;
    }
}

/* ── Rating Sliders ───────────────────────────── */
.rating-slider {
    height: 8px;
}

.rating-value {
    font-size: 0.9rem;
    min-width: 28px;
}

/* ── Responsive Adjustments ───────────────────── */
@media (max-width: 576px) {
    .display-3 {
        font-size: 2.5rem;
    }

    #event-actions .event-btn {
        min-height: 96px;
        font-size: 1rem !important;
    }

    #event-actions .event-btn .fs-1 {
        font-size: 1.8rem !important;
    }

    .pitch-position {
        width: 50px;
        height: 50px;
        margin-left: -25px;
        margin-top: -25px;
        font-size: 0.65rem;
    }

    .pitch-position .pos-number {
        font-size: 0.95rem;
    }

    .pitch-position .pos-label {
        font-size: 0.5rem;
    }

    .pitch-position .pos-player {
        font-size: 0.6rem;
        max-width: 82px;
        padding: 1px 4px;
    }
}

/* ── Public Live Page Enhancements ─────────────── */
#public-match .card {
    transition: box-shadow 0.3s ease, transform 0.2s ease;
}

#public-match .card:hover {
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.1) !important;
}

#public-match .card-header:not(.public-card-header):not(.public-section-header) {
    background: white;
    border-bottom: 2px solid #f0f0f0;
}

#public-match .card-header h5 i {
    font-size: 1.1rem;
}

/* Timeline scrollbar styling */
#public-match .card-body::-webkit-scrollbar {
    width: 6px;
}

#public-match .card-body::-webkit-scrollbar-track {
    background: #f8f9fa;
}

#public-match .card-body::-webkit-scrollbar-thumb {
    background: #ced4da;
    border-radius: 3px;
}

#public-match .card-body::-webkit-scrollbar-thumb:hover {
    background: #adb5bd;
}

/* Photo grid enhancements */
#pub-photos-grid .col-4 a img {
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

#pub-photos-grid .col-4 a img:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    z-index: 2;
    position: relative;
}

/* Photo modal backdrop */
#publicPhotoModal .modal-content {
    border-radius: 16px;
    overflow: hidden;
}

/* Lineup table polish */
#public-match .table-hover tbody tr {
    transition: background 0.15s ease;
}

/* Auto-refresh indicator */
#public-match .bi-arrow-repeat {
    animation: spin 3s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* ── Offline Indicator ────────────────────────── */
.offline-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #dc3545;
    color: white;
    text-align: center;
    padding: 8px;
    z-index: 9999;
    display: none;
    font-weight: 600;
}

.offline-bar.visible {
    display: block;
}

/* ── Unified Dialog (msAlert / msConfirm) ─────── */
#ms-dialog-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 100000;
    display: none;
    justify-content: center;
    align-items: flex-start;
    padding-top: 12vh;
}

#ms-dialog-overlay.active {
    display: flex;
}

#ms-dialog-box {
    background: #fff;
    border-radius: 1rem;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
    max-width: 400px;
    width: 92%;
    overflow: hidden;
    animation: ms-dlg-slide 0.22s ease;
}

@keyframes ms-dlg-slide {
    from {
        transform: translateY(-30px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

#ms-dialog-bar {
    height: 6px;
}

#ms-dialog-body {
    padding: 1.75rem 1.5rem 0.75rem;
    text-align: center;
}

#ms-dialog-icon {
    font-size: 2.75rem;
    margin-bottom: 0.75rem;
}

#ms-dialog-message {
    font-size: 1.05rem;
    color: #333;
    line-height: 1.5;
    word-break: break-word;
}

#ms-dialog-footer {
    padding: 0.75rem 1.5rem 1.25rem;
    display: flex;
    gap: 0.75rem;
    justify-content: center;
}

.ms-dlg-btn {
    padding: 0.5rem 1.75rem;
    border-radius: 0.5rem;
    border: none;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: opacity 0.15s, transform 0.1s;
}

.ms-dlg-btn:hover {
    opacity: 0.85;
}

.ms-dlg-btn:active {
    transform: scale(0.96);
}

.ms-dlg-cancel {
    background: #e9ecef;
    color: #495057;
}

.ms-dlg-ok {
    color: #fff;
}

/* ══════════════════════════════════════════════════
   TEAM – Player stats compact table (mobile)
   ══════════════════════════════════════════════════ */
@media (max-width: 575.98px) {
    .team-players-compact {
        font-size: 0.78rem;
    }

    .team-players-compact th,
    .team-players-compact td {
        padding: 0.3rem 0.35rem;
    }

    .team-players-compact thead th {
        font-size: 0.72rem;
    }

    .team-players-compact .badge {
        font-size: 0.68rem;
        padding: 0.15em 0.4em;
    }
}

/* ══════════════════════════════════════════════════
   ADMIN - Mobile Responsive Tables → Cards
   ══════════════════════════════════════════════════ */
@media (max-width: 767.98px) {

    /* Convert tables to stacked card layout */
    .admin-table-cards table,
    .admin-table-cards table tbody {
        display: block;
        width: 100%;
    }

    .admin-table-cards table thead {
        display: none;
    }

    .admin-table-cards table tr {
        display: block;
        margin-bottom: 0.75rem;
        background: #fff;
        border-radius: 0.5rem;
        box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
        border-left: 3px solid var(--fl-primary, #1B4332);
        padding: 0.25rem 0;
        overflow: hidden;
    }

    .admin-table-cards table tr:hover {
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    }

    .admin-table-cards table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.35rem 0.75rem;
        border: none;
        border-bottom: 1px solid #f5f5f5;
        text-align: right;
        min-height: 2rem;
    }

    .admin-table-cards table td:last-child {
        border-bottom: none;
    }

    .admin-table-cards table td::before {
        content: attr(data-label);
        font-weight: 600;
        font-size: 0.8rem;
        text-align: left;
        color: #6c757d;
        margin-right: 0.75rem;
        flex-shrink: 0;
        white-space: nowrap;
    }

    /* Action cells: no label, centered content */
    .admin-table-cards table td.td-actions {
        justify-content: center;
        padding-top: 0.5rem;
        padding-bottom: 0.5rem;
        background: #f8f9fa;
    }

    .admin-table-cards table td.td-actions::before {
        content: none;
    }

    /* Primary info cell: bigger text */
    .admin-table-cards table td.td-primary {
        font-size: 1rem;
        font-weight: 600;
        padding-top: 0.5rem;
        border-bottom: 2px solid #e9ecef;
    }

    /* Hide cells marked as mobile-hidden */
    .admin-table-cards table td.td-mobile-hide {
        display: none;
    }

    /* Compact variant – all fields visible, tighter spacing */
    .admin-users-compact table tr {
        padding: 0.15rem 0;
    }

    .admin-users-compact table td {
        padding: 0.2rem 0.6rem;
        font-size: 0.78rem;
        min-height: 1.6rem;
    }

    .admin-users-compact table td::before {
        font-size: 0.72rem;
    }

    .admin-users-compact table td.td-primary {
        font-size: 0.88rem;
        padding-top: 0.35rem;
        padding-bottom: 0.25rem;
    }

    .admin-users-compact table td.td-actions {
        padding-top: 0.35rem;
        padding-bottom: 0.35rem;
    }

    /* Admin heading */
    .admin-table-cards h2 {
        font-size: 1.25rem;
    }

    /* Nav pills compact on mobile */
    .nav-pills.nav-fill .nav-link {
        padding: 0.35rem 0.5rem;
        font-size: 0.8rem;
    }
}

/* ── Admin Nav Scrollable (mobile) ────────────── */
.admin-nav-wrap {
    -webkit-overflow-scrolling: touch;
}

.admin-nav-wrap ul {
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.admin-nav-wrap ul::-webkit-scrollbar {
    display: none;
}

@media (max-width: 575.98px) {
    .admin-nav-wrap .nav-link {
        padding: 0.4rem 0.6rem;
        font-size: 1.1rem;
    }
}

/* ── Public Pitch Formation Visualization ─────── */
.pub-pitch-container {
    background: #2d8c4e;
    margin: 0;
}

.pub-pitch-player {
    position: absolute;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 2;
    pointer-events: none;
}

.pub-pitch-player-circle {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.7);
    border: 2px solid #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.pub-pitch-player-number {
    color: #fff;
    font-size: 0.85rem;
    font-weight: 700;
    line-height: 1;
}

.pub-pitch-player-label {
    color: #ffc107;
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    margin-top: 1px;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
    white-space: nowrap;
}

.pub-pitch-player-name {
    color: #fff;
    font-size: 0.75rem;
    font-weight: 500;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
    white-space: nowrap;
    max-width: 90px;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (max-width: 575.98px) {
    .pub-pitch-player-circle {
        width: 30px;
        height: 30px;
    }

    .pub-pitch-player-number {
        font-size: 0.7rem;
    }

    .pub-pitch-player-label {
        font-size: 0.5rem;
    }

    .pub-pitch-player-name {
        font-size: 0.55rem;
        max-width: 60px;
    }
}

/* ── Goal Applause ────────────────────────────────────────────── */

.applause-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    border: none;
    background: transparent;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
    font-size: 1.15rem;
    padding: 0.2rem 0.55rem;
    border-radius: 1rem;
    color: #555;
    transition: background 0.2s, color 0.2s;
    white-space: nowrap;
    margin-top: 0.15rem;
}

.applause-btn:hover:not(:disabled) {
    background: rgba(0, 0, 0, 0.06);
    color: #333;
}

.applause-btn:disabled,
.applause-btn.applause-sent {
    cursor: default;
    opacity: 0.7;
}

.applause-btn.applause-sent {
    color: #1a7f37;
}

/* Total applause in score header */
.total-applause {
    font-size: 0.75rem;
    opacity: 0.8;
    margin-top: 0.25rem;
}

.applause-count {
    font-weight: 600;
    font-size: 0.8rem;
}

/* ── Fan Fire (Hvězda publika) ────────────────────────────────── */

.fan-fire-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    border: none;
    background: transparent;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
    font-size: 1.1rem;
    padding: 0.15rem 0.45rem;
    border-radius: 1rem;
    color: #888;
    transition: background 0.2s, color 0.2s;
    white-space: nowrap;
}

.fan-fire-btn:hover:not(:disabled) {
    background: rgba(255, 100, 0, 0.08);
    color: #e65100;
}

.fan-fire-btn:disabled,
.fan-fire-btn.fan-fire-voted {
    cursor: default;
    opacity: 0.7;
}

.fan-fire-btn.fan-fire-voted {
    color: #e65100;
}

.fan-fire-btn.fan-fire-maxed:not(.fan-fire-voted) {
    opacity: 0.35;
}

.fan-fire-count {
    font-weight: 600;
    font-size: 0.8rem;
}

/* HP card top player highlight */
.fan-fire-hp-winner {
    background: linear-gradient(135deg, rgba(255, 152, 0, 0.08), rgba(255, 87, 34, 0.08));
    border-radius: 0.5rem;
    padding: 0.75rem;
}

/* Total fire in score header */
.total-fire {
    font-size: 0.75rem;
    opacity: 0.8;
    margin-top: 0.15rem;
}

/* Hide PWA install hint when running as installed PWA */
@media (display-mode: standalone) {
    .pwa-install-hint {
        display: none !important;
    }
}
