/* Tab Styles */
.rifnote-tab-nav {
    list-style: none;
    padding: 0;
    margin: 20px 0;
    border-bottom: 1px solid #ccc;
    display: flex;
}
.rifnote-tab-nav li {
    margin-right: 5px;
}
.rifnote-tab-nav a.rifnote-tab-link {
    display: block;
    padding: 10px 15px;
    text-decoration: none;
    color: #ed1c24;
    border: 1px solid transparent;
    border-bottom: 0;
    margin-bottom: -1px;
}
.rifnote-tab-nav a.rifnote-tab-link.active {
    border-color: #ccc;
    border-bottom-color: #f1f1f1;
    background: #f1f1f1;
}
.rifnote-tab-pane {
    display: none;
    padding: 15px;
    border: 1px solid #ccc;
    border-top: 0;
}
.rifnote-tab-pane.active {
    display: block;
}

/* Lineup Styles */
.rifnote-lineups-container {
    /* This is now a block container, flex is applied to inner containers */
}

.rifnote-formation-boards-container,
.rifnote-player-lists-container {
    display: flex;
    justify-content: space-between;
    gap: 20px;
}

.rifnote-player-lists-container {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.rifnote-team-lineup,
.rifnote-team-player-list {
    width: 48%;
}
.rifnote-formation {
    font-size: 0.8em;
    font-weight: normal;
    color: #555;
}
.rifnote-team-lineup h3 {
    display: flex;
    flex-direction: column;
}
.rifnote-coach-name {
    font-size: 0.7em;
    font-weight: normal;
    color: #666;
    margin-top: 4px;
}
.rifnote-player-list {
    list-style: none;
    padding: 0;
}
.rifnote-player-list li {
    padding: 5px 0;
    border-bottom: 1px solid #eee;
}
.rifnote-player-list li {
    display: flex;
    align-items: center;
    gap: 10px;
}
.rifnote-player-photo {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    object-fit: cover;
}
.rifnote-player-number {
    display: inline-block;
    width: 25px;
    font-weight: bold;
}

/* Formation Board Styles */
.rifnote-formation-board {
    margin: 20px 0;
}
.pitch {
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 140%; /* Aspect ratio for a vertical pitch */
    background-image: url('pitch-bg.jpg'); /* Use local pitch background */
    background-size: cover;
    background-position: center;
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: 8px;
}
.pitch::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    /* background-image:
        /* Center circle */
        /*radial-gradient(circle at center, transparent 30px, transparent 31px, rgba(255,255,255,0.5) 32px, rgba(255,255,255,0.5) 33px, transparent 34px),
        /* Center line */
        /*linear-gradient(to right, transparent 49.5%, rgba(255,255,255,0.5) 49.5%, rgba(255,255,255,0.5) 50.5%, transparent 50.5%),
        /* Penalty box lines */
        /*linear-gradient(to right, transparent 20%, rgba(255,255,255,0.5) 20%, rgba(255,255,255,0.5) 21%, transparent 21%, transparent 79%, rgba(255,255,255,0.5) 79%, rgba(255,255,255,0.5) 80%, transparent 80%),
        linear-gradient(to bottom, transparent 15%, rgba(255,255,255,0.5) 15%, rgba(255,255,255,0.5) 16%, transparent 16%),
        linear-gradient(to bottom, transparent 84%, rgba(255,255,255,0.5) 84%, rgba(255,255,255,0.5) 85%, transparent 85%); */
}

.player-dot {
    position: absolute;
    transform: translate(-50%, -50%);
    text-align: center;
    color: #fff;
    width: 60px; /* Give the dot a fixed width */
}
.player-dot .player-image-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin: 0 auto 4px;
}
.player-dot .player-image {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #fff;
}
.player-dot .player-number {
    position: absolute;
    bottom: -2px;
    right: -2px;
    background-color: #ed1c24;
    color: #fff;
    border-radius: 50%;
    font-size: 10px;
    font-weight: bold;
    width: 18px;
    height: 18px;
    line-height: 18px; /* Vertically center the number */
    border: 1px solid #fff;
}
.player-dot .player-name {
    display: block;
    font-size: 11px;
    background: rgba(0, 0, 0, 0.5);
    padding: 2px 4px;
    border-radius: 3px;
    white-space: nowrap;
}

.rifnote-info-notice {
    text-align: center;
    padding: 15px;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    margin: 20px 0;
    color: #495057;
}


/* H2H Styles */
.rifnote-h2h-container {
    text-align: center;
}
.rifnote-h2h-summary {
    display: flex;
    justify-content: space-around;
    align-items: center;
    margin: 20px 0;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 5px;
}
.rifnote-h2h-team-wins, .rifnote-h2h-draws {
    display: flex;
    flex-direction: column;
}
.rifnote-h2h-team-wins .team-name, .rifnote-h2h-draws .team-name {
    font-size: 14px;
    color: #555;
}
.rifnote-h2h-team-wins .count, .rifnote-h2h-draws .count {
    font-size: 28px;
    font-weight: bold;
}
.rifnote-h2h-subtitle {
    margin-top: 30px;
    text-align: left;
    font-size: 1.2em;
    border-bottom: 1px solid #ddd;
    padding-bottom: 5px;
    margin-bottom: 10px;
}
.rifnote-h2h-match-list {
    list-style: none;
    padding: 0;
    text-align: left;
}
.rifnote-h2h-match-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 5px;
    border-bottom: 1px solid #eee;
}
.rifnote-h2h-match-item:last-child {
    border-bottom: none;
}
.rifnote-h2h-match-item .date {
    color: #777;
    flex-basis: 100px;
}
.rifnote-h2h-match-item .match-result {
    flex-grow: 1;
    text-align: center;
}

/* Standings Table Styles */
.rifnote-standings-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    font-size: 14px;
}
.rifnote-standings-table th,
.rifnote-standings-table td {
    padding: 8px 5px;
    text-align: center;
    border-bottom: 1px solid #eee;
}
.rifnote-standings-table th {
    font-weight: bold;
    background-color: #f9f9f9;
}
.rifnote-standings-table .team-col {
    text-align: left;
    width: 50%;
}
.rifnote-standings-table .rifnote-team-logo {
    width: 20px;
    height: 20px;
    vertical-align: middle;
    margin-right: 8px;
}
.rifnote-standings-table .rifnote-team-highlight {
    background-color: #f0f8ff;
    font-weight: bold;
}

/* Search Bar Styles */
.rifnote-filters-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 20px;
    align-items: flex-end;
}

.rifnote-filter-item.rifnote-search-container {
    flex-grow: 1;
    min-width: 200px;
}

.rifnote-team-search-input,
.rifnote-date-filter-input {
    width: 100%;
    padding: 8px 10px;
    font-size: 16px;
    box-sizing: border-box; /* Important for 100% width */
}

/* Match Stats Styles */
.rifnote-stats-header {
    display: flex;
    justify-content: space-between;
    font-weight: bold;
    padding: 0 10px;
    margin-bottom: 10px;
}
.rifnote-stats-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.rifnote-stat-item {
    margin-bottom: 15px;
}
.rifnote-stat-item .stat-values {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
    font-size: 14px;
}
.rifnote-stat-item .stat-type {
    color: #555;
    font-weight: bold;
}
.rifnote-stat-item .home-value,
.rifnote-stat-item .away-value {
    font-weight: bold;
    font-size: 16px;
}
.rifnote-stat-item .stat-bar {
    display: flex;
    height: 8px;
    background-color: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
}
.rifnote-stat-item .home-bar {
    background-color: #ed1c24; /* Or home team color */
    transition: width 0.5s ease-in-out;
}
.rifnote-stat-item .away-bar {
    background-color: #0073aa ; /* Or away team color */
    transition: width 0.5s ease-in-out;
}

.rifnote-date-filter-label {
    display: block;
    margin-bottom: 4px;
    font-size: 14px;
}

.rifnote-no-fixtures {
    padding: 20px;
    text-align: center;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    margin: 20px 0;
}

.rifnote-date-nav-wrapper {
    display: flex;
    width: 100%;
}

.rifnote-date-filter-input {
    flex-grow: 1; /* Let the input take up the available space */
    min-width: 120px; /* Prevent it from becoming too small */
    border-radius: 0;
    border-left: none;
    border-right: none;
}

.rifnote-date-nav-btn {
    flex-shrink: 0;
    padding: 8px 12px;
    font-size: 16px;
    line-height: 1.2; /* Match input height better */
    border: 1px solid #a2a2a2;
    background: #f0f0f0;
    cursor: pointer;
}

.rifnote-date-nav-btn:hover {
    background: #e0e0e0;
}

#rifnote-date-prev {
    border-radius: 4px 0 0 4px;
}

#rifnote-date-next {
    border-radius: 0 4px 4px 0;
}

.rifnote-live-filter-btn {
    padding: 8px 15px;
    font-size: 16px;
    border: 1px solid #a2a2a2;
    background: #f0f0f0;
    cursor: pointer;
    border-radius: 4px;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
    width: 100%;
    height: 100%;
}

.rifnote-live-filter-btn.active {
    background-color: #e74c3c;
    color: #fff;
    border-color: #c0392b;
    font-weight: bold;
}

/* Form Styles */
.rifnote-form-container {
    padding: 10px;
}
.rifnote-form-title {
    text-align: center;
    margin-bottom: 20px;
}
.rifnote-form-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px;
}
.rifnote-form-row .team-name {
    font-weight: bold;
    flex-basis: 40%;
}
.rifnote-form-row .form-results {
    display: flex;
    gap: 5px;
    flex-grow: 1;
    justify-content: flex-end;
}
.form-result {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    color: #fff;
    font-weight: bold;
    font-size: 14px;
}
.form-result.form-w {
    background-color: #28a745; /* Green for Win */
}
.form-result.form-d {
    background-color: #ffc107; /* Yellow for Draw */
    color: #333;
}
.form-result.form-l {
    background-color: #dc3545; /* Red for Loss */
}

/* League Grouping Styles */
.rifnote-league-group {
    margin-bottom: 30px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 15px;
    background: #fff;
}
.rifnote-league-title {
    display: flex;
    align-items: center;
    font-size: 1.5em;
    margin-top: 0;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}
.rifnote-league-logo {
    width: 32px;
    height: 32px;
    margin-right: 10px;
}

/* News Tab Styles */
.rifnote-news-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.rifnote-news-item {
    margin-bottom: 15px;
    border-bottom: 1px solid #eee;
    padding-bottom: 15px;
}
.rifnote-news-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}
.rifnote-news-item a {
    display: flex;
    gap: 15px;
    text-decoration: none;
    color: inherit;
}
.rifnote-news-item .news-thumbnail img {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 4px;
}
.rifnote-news-item .news-content .news-title {
    margin: 0 0 5px 0;
    font-size: 1.1em;
    color: #ed1c24;
}
.rifnote-news-item .news-content .news-excerpt {
    font-size: 0.9em;
    color: #555;
    margin: 0;
}
.rifnote-news-item .news-content .news-excerpt p {
    margin: 0;
}

.rifnote-match-timeline {
    position: relative;
    padding: 20px 0;
}

/* The center line */
.rifnote-match-timeline::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    width: 2px;
    height: 100%;
    background-color: #e0e0e0;
    transform: translateX(-50%);
}

.rifnote-timeline-entry {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    position: relative;
    width: 50%;
}

.rifnote-timeline-entry.home {
    justify-content: flex-end;
    padding-right: 50px; /* Increased padding for arrow */
    text-align: right;
}

.rifnote-timeline-entry.away {
    margin-left: 50%;
    padding-left: 50px; /* Increased padding for arrow */
}

.rifnote-timeline-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    border: 2px solid #fff;
    z-index: 1;
    box-shadow: 0 0 0 2px #e0e0e0;
}

.rifnote-timeline-entry.home .rifnote-timeline-icon {
    right: -21px; /* (40px icon width + 2px border) / 2 */
}

.rifnote-timeline-entry.away .rifnote-timeline-icon {
    left: -21px;
}

.rifnote-timeline-icon svg {
    width: 20px;
    height: 20px;
    fill: #fff;
}

.rifnote-timeline-content {
    background-color: #f9f9f9;
    padding: 10px 15px;
    border-radius: 6px;
    width: 100%;
    box-sizing: border-box;
    position: relative;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.rifnote-timeline-content:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* Arrow for the content box */
.rifnote-timeline-content::after {
    content: " ";
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    border: 8px solid transparent;
}

.rifnote-timeline-entry.home .rifnote-timeline-content::after {
    right: -16px;
    border-left-color: #f9f9f9;
}

.rifnote-timeline-entry.away .rifnote-timeline-content::after {
    left: -16px;
    border-right-color: #f9f9f9;
}

.rifnote-timeline-header {
    display: flex;
    justify-content: space-between;
    font-weight: bold;
    margin-bottom: 5px;
}

.rifnote-event-description {
    margin: 0;
    font-size: 0.9em;
    color: #555;
}

/* Event-specific colors */
.event-goal { background-color: #28a745; } /* Green */
.event-card-yellow { background-color: #ffc107; } /* Yellow */
.event-card-red { background-color: #dc3545; } /* Red */
.event-subst { background-color: #17a2b8; } /* Teal */
.event-default { background-color: #6c757d; } /* Gray */
.event-penalty-miss { background-color: #dc3545; } /* Red */
.event-var { background-color: #6f42c1; } /* Purple */
.event-own-goal { background-color: #fd7e14; } /* Orange */
.event-goal-disallowed { background-color: #dc3545; } /* Red */

.rifnote-timeline-separator-wrapper {
    text-align: center;
    margin: 20px 0;
    position: relative;
    z-index: 1;
}

.rifnote-timeline-separator {
    display: inline-block;
    font-weight: bold;
    color: #555;
    background: #e9ecef;
    padding: 5px 15px;
    border-radius: 20px;
}

/* Admin Styles */
.button.button-danger {
    background: #dc3545;
    border-color: #dc3545 #c82333 #c82333;
    color: #fff;
    box-shadow: 0 1px 0 #c82333;
}

/* New Match Detail Header Styles */
.rifnote-match-header-v2 {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #f7f7f7;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 25px;
    border: 1px solid #e9e9e9;
}

.rifnote-match-header-v2 .team-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 10px;
}

.rifnote-match-header-v2 .team-info.home-team {
    align-items: flex-start;
    text-align: left;
}

.rifnote-match-header-v2 .team-info.away-team {
    align-items: flex-end;
    text-align: right;
}

.rifnote-match-header-v2 .team-logo {
    max-width: 80px;
    height: auto;
}

.rifnote-match-header-v2 .team-name {
    font-size: 1.5em;
    font-weight: 600;
    margin: 0;
    color: #333;
}

.rifnote-match-header-v2 .score-board {
    flex: 0 0 auto;
    padding: 0 30px;
    text-align: center;
}

.rifnote-match-header-v2 .score-line {
    font-size: 3.5em;
    font-weight: 700;
    color: #111;
    letter-spacing: -2px;
}

.rifnote-match-header-v2 .score-separator {
    margin: 0 15px;
}

.rifnote-match-header-v2 .match-status-line {
    font-size: 1em;
    color: #e74c3c; /* A nice red for live status */
    font-weight: 500;
    margin-top: 5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.rifnote-match-header-v2 .goal-scorers {
    font-size: 0.85em;
    color: #666;
    min-height: 40px; /* Reserve space to prevent layout shifts */
}

.rifnote-match-header-v2 .goal-scorers .scorer {
    display: block;
    margin-top: 4px;
}

.rifnote-match-header-v2 .team-info.winner .team-name {
    font-weight: 800;
    color: #000;
}

.rifnote-match-header-v2 .team-info.winner::after {
    content: 'WINNER';
    font-size: 0.7em;
    font-weight: bold;
    color: #28a745;
    background: #e9f7ec;
    padding: 2px 6px;
    border-radius: 4px;
    margin-top: 5px;
    letter-spacing: 0.5px;
}

.rifnote-match-header-v2 .penalty-score-line {
    font-size: 1.2em;
    font-weight: 500;
    color: #555;
    margin-top: 5px;
}

.rifnote-fixture-score .penalty-score {
    display: block;
    font-size: 0.8em;
    font-weight: normal;
    color: #666;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .rifnote-match-header-v2 {
        padding: 15px;
        gap: 10px;
    }

    .rifnote-match-header-v2 .team-logo {
        max-width: 50px;
    }

    .rifnote-match-header-v2 .score-board {
        padding: 0 10px;
    }

    .rifnote-match-header-v2 .team-name {
        font-size: 1.1em;
    }

    .rifnote-match-header-v2 .score-line {
        font-size: 2.5em;
    }

    .rifnote-match-header-v2 .goal-scorers {
        font-size: 0.8em;
    }
}

/* --- New Fixture List Styles --- */
.rifnote-fixtures-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.rifnote-fixture-row-link {
    text-decoration: none;
    color: inherit;
    display: block;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.rifnote-fixture-row-link:hover {
    background-color: #f8f9fa;
}

.rifnote-fixture-row {
    display: flex;
    align-items: center;
    padding: 12px 10px;
    background-color: #fff;
    border-radius: 4px;
    animation: rifnote-fade-in-up 0.4s ease-out;
    min-height: 40px;
}

.rifnote-fixture-status {
    flex: 0 0 50px;
    text-align: center;
    font-weight: bold;
    font-size: 0.9em;
    color: #555;
}

.rifnote-fixture-row.status-live .rifnote-fixture-status {
    color: #e74c3c; /* Red for live */
}

.rifnote-fixture-row.status-finished .rifnote-fixture-status {
    color: #3498db; /* Blue for finished */
}

.rifnote-fixture-matchup {
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 10px;
    min-width: 0; /* Fix for flexbox overflow */
}

.rifnote-fixture-matchup .team-home,
.rifnote-fixture-matchup .team-away {
    display: flex;
    align-items: center;
    flex: 1;
    min-width: 0;
}

.rifnote-fixture-matchup .team-home {
    justify-content: flex-end;
}

.rifnote-fixture-matchup .team-away {
    justify-content: flex-start;
}

.rifnote-fixture-matchup .team-logo {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.rifnote-fixture-matchup .team-home .team-logo {
    margin-left: 8px;
}

.rifnote-fixture-matchup .team-away .team-logo {
    margin-right: 8px;
}

.rifnote-fixture-matchup .team-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rifnote-fixture-matchup .team-home .team-name {
    text-align: right;
}

.rifnote-fixture-score {
    flex: 0 0 auto;
    margin: 0 15px;
    font-weight: bold;
    font-size: 1.1em;
    color: #333;
}

@media (max-width: 480px) {
    .rifnote-fixture-status {
        flex-basis: 40px;
    }
    .rifnote-fixture-matchup {
        padding: 0 5px;
    }
    .rifnote-fixture-score {
        margin: 0 8px;
    }
}

/* --- Goal Scorers Modal --- */
.rifnote-view-all-scorers {
    display: inline-block;
    margin-top: 8px;
    font-size: 0.9em;
    color: #ed1c24;
    text-decoration: none;
    font-weight: 500;
}

.rifnote-view-all-scorers:hover {
    text-decoration: underline;
}

.rifnote-scorers-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.rifnote-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
}

.rifnote-modal-content {
    position: relative;
    background: #fff;
    padding: 20px 30px;
    border-radius: 8px;
    width: 90%;
    max-width: 400px;
    z-index: 1001;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.rifnote-modal-close {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 28px;
    font-weight: bold;
    color: #aaa;
    cursor: pointer;
    line-height: 1;
}

.rifnote-modal-close:hover {
    color: #000;
}

.rifnote-modal-title {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 1.4em;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

.rifnote-modal-list {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 60vh;
    overflow-y: auto;
}

.rifnote-modal-list li {
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 1.1em;
}

.rifnote-modal-list li:last-child {
    border-bottom: none;
}

.assist-info-modal {
    font-size: 0.9em;
    color: #666;
}

/* --- Chat Tab Styles --- */
.rifnote-chat-container {
    display: flex;
    flex-direction: column;
    height: 500px; /* Or a height that fits your design */
    max-height: 70vh;
}

.rifnote-chat-messages {
    flex-grow: 1;
    overflow-y: auto;
    padding: 10px;
    background-color: #f0f2f5;
    border-radius: 6px;
    margin-bottom: 10px;
}

.rifnote-chat-message {
    margin-bottom: 12px;
    padding: 10px 15px;
    border-radius: 8px;
    background-color: #fff;
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
}

.rifnote-chat-message-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 4px;
}

.rifnote-chat-user {
    font-weight: bold;
    color: #ed1c24;
}

.rifnote-chat-time {
    font-size: 0.8em;
    color: #999;
}

.rifnote-chat-text {
    margin: 0;

}

.rifnote-chat-textarea-wrapper {
    display: flex;
    align-items: center;
}

.rifnote-typing-indicator {
    font-style: italic;
    color: #666;
    font-size: 0.9em;
    padding: 0 10px 5px;
    height: 20px; /* Reserve space to prevent layout jump */
    box-sizing: border-box;
    display: none; /* Hidden by default, controlled by JS */
}

.rifnote-chat-error {
    color: #dc3545;
    font-weight: bold;
    padding: 10px;
    text-align: center;
}

.rifnote-chat-textarea-wrapper textarea {
    flex-grow: 1;
    resize: none;
    height: 40px;
    padding: 8px;
    border-radius: 4px 0 0 4px;
    border-right: none;
}

.rifnote-chat-textarea-wrapper button {
    flex-shrink: 0;
    height: 40px;
    border: 1px solid #ccc;
    background: #f7f7f7;
    cursor: pointer;
    padding: 0 12px;
}

.rifnote-chat-textarea-wrapper button:hover {
    background: #e9e9e9;
}

.rifnote-chat-textarea-wrapper button[type="submit"] {
    border-radius: 0 4px 4px 0;
}

.rifnote-chat-textarea-wrapper button[type="submit"] svg {
    width: 20px;
    height: 20px;
    fill: #555;
}

.rifnote-chat-event {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    margin: 8px 0;
    background-color: #f8f9fa;
    border-left: 4px solid #6c757d;
    border-radius: 4px;
    position: relative;
}

.rifnote-chat-event.event-goal { border-left-color: #28a745; }
.rifnote-chat-event.event-card-yellow { border-left-color: #ffc107; }
.rifnote-chat-event.event-card-red { border-left-color: #dc3545; }
.rifnote-chat-event.event-subst { border-left-color: #17a2b8; }
.rifnote-chat-event.event-var { border-left-color: #6f42c1; }
.rifnote-chat-event.event-penalty-miss,
.rifnote-chat-event.event-goal-disallowed { border-left-color: #dc3545; }
.rifnote-chat-event.event-own-goal { border-left-color: #fd7e14; }

.rifnote-chat-event-icon {
    position: relative;
    flex-shrink: 0;
    width: 32px; /* Reduced size */
    height: 32px; /* Reduced size */
    display: flex;
    align-items: center;
    justify-content: center;
}

.rifnote-chat-event-icon i,
.rifnote-chat-event-icon strong {
    font-size: 16px;
    color: #555;
}

.rifnote-chat-event-icon strong {
    font-weight: 900;
}

.rifnote-chat-event.event-card-yellow .rifnote-chat-event-icon i {
    color: #ffc107; /* Yellow */
}

.rifnote-chat-event.event-card-red .rifnote-chat-event-icon i {
    color: #dc3545; /* Red */
}

.rifnote-chat-event-team-logo {
    width: 16px; /* Reduced size */
    height: 16px; /* Reduced size */
    position: absolute;
    bottom: 0; /* Adjusted position */
    right: 0; /* Adjusted position */
    border-radius: 50%;
    background-color: #fff;
    border: 1px solid #ddd;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.rifnote-chat-event-content {
    flex-grow: 1;
    min-width: 0;
}

.rifnote-chat-event-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 4px;
}

.rifnote-chat-event-minute {
    font-weight: bold;
    color: #333;
}

.rifnote-chat-event-time {
    font-size: 0.8em;
    color: #999;
}

.rifnote-chat-event-details {
    display: flex;
    align-items: baseline;
    gap: 0.5em;
    min-width: 0;
}

.rifnote-chat-event-details .rifnote-chat-event-player,
.rifnote-chat-event-details .rifnote-chat-event-player-wrapper {
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-shrink: 0; /* Prevent player name from shrinking */
}

.rifnote-chat-event-player-wrapper {
    display: flex;
    align-items: center;
    gap: 0.4em;
}

.rifnote-chat-event-player-out {
    color: #e74c3c;
    text-decoration: line-through;
}

.rifnote-chat-event-sub-arrow {
    color: #7f8c8d;
}
.rifnote-chat-event-details .rifnote-chat-event-desc {
    color: #666;
    font-size: 0.95em;
}

.rifnote-chat-event-player-in {
	color: #27ae60;
}

.rifnote-chat-event .rifnote-chat-actions {
    display: none;
    position: absolute;
    top: 5px;
    right: 5px;
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.rifnote-chat-event:hover .rifnote-chat-actions {
    display: block;
}

.rifnote-chat-event .rifnote-reply-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    display: flex;
}

.rifnote-chat-event .rifnote-reply-btn svg {
    width: 16px;
    height: 16px;
    fill: #555;
}

.rifnote-chat-event .rifnote-reply-btn:hover svg {
    fill: #ed1c24;
}
.rifnote-giphy-btn {
    font-weight: bold;
    color: #555;
    border-left: none !important;
    border-right: none !important;
}

/* Giphy Modal Styles */
.rifnote-giphy-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1001; /* Higher than scorer modal */
    display: flex;
    align-items: center;
    justify-content: center;
}

.rifnote-giphy-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
}

.rifnote-giphy-modal-content {
    position: relative;
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    z-index: 1002;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    display: flex;
    flex-direction: column;
    max-height: 80vh;
}

.rifnote-giphy-modal-close {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 28px;
    font-weight: bold;
    color: #aaa;
    cursor: pointer;
    line-height: 1;
}

#rifnote-giphy-search-input {
    width: 100%;
    padding: 10px;
    font-size: 16px;
    margin-bottom: 15px;
    box-sizing: border-box;
}

.rifnote-giphy-results {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 5px;
    overflow-y: auto;
    flex-grow: 1;
}

.rifnote-giphy-result-item {
    width: 100%;
    height: 100px;
    object-fit: cover;
    cursor: pointer;
    border-radius: 4px;
}

.rifnote-chat-gif-wrapper {
    max-width: 250px;
}

.rifnote-chat-gif {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
}

/* --- Prediction Tab Styles --- */
.rifnote-prediction-container {
    padding: 15px;
    line-height: 1.6;
}

.rifnote-prediction-container h4 {
    margin-top: 20px;
    margin-bottom: 10px;
    border-bottom: 1px solid #eee;
    padding-bottom: 5px;
}
.rifnote-prediction-container h4:first-child {
    margin-top: 0;
}

.rifnote-prediction-last-updated {
    font-size: 0.85em;
    font-style: italic;
    color: #777;
    text-align: right;
    margin-top: 15px;
}

/* --- New Chat Actions & Reactions --- */
.rifnote-chat-message-actions {
    display: none; /* Hidden by default */
    align-items: center;
    gap: 5px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #f0f0f0;
}

.rifnote-chat-message:hover .rifnote-chat-message-actions {
    display: flex; /* Show on hover */
}

.rifnote-action-btn {
    background: none;
    border: none;
    color: #555;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    border-radius: 50%;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.rifnote-action-btn svg {
    width: 18px;
    height: 18px;
}

.rifnote-action-btn:hover {
    color: #ed1c24;
    background-color: #eef7ff;
}

.rifnote-reactions-container {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 8px;
}

.rifnote-reaction-bubble {
    display: flex;
    align-items: center;
    background-color: #f0f2f5;
    border: 1px solid #f0f2f5;
    border-radius: 20px;
    padding: 2px 8px;
    font-size: 0.9em;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.rifnote-reaction-bubble:hover {
    background-color: #e4e6eb;
}

.rifnote-reaction-bubble.reacted {
    background-color: #e7f3ff;
    border-color: #ed1c24;
    color: #ed1c24;
    font-weight: 500;
}

.rifnote-reaction-bubble span {
    margin-left: 4px;
    font-size: 0.9em;
}

.rifnote-emoji-picker {
    position: absolute;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    padding: 5px;
    z-index: 1100; /* Above other elements */
}

.rifnote-emoji-picker-content {
    display: flex;
    gap: 5px;
}

.rifnote-emoji-option {
    font-size: 20px;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    transition: background-color 0.2s ease;
}

.rifnote-emoji-option:hover {
    background-color: #f0f2f5;
}

/* --- Chat Meta Event Styles --- */
.rifnote-chat-meta-event {
    text-align: center;
    margin: 15px 0;
    position: relative;
}

.rifnote-chat-meta-event span {
    display: inline-block;
    background-color: #e9ecef;
    color: #495057;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: 500;
    position: relative;
    z-index: 1;
}

.rifnote-chat-meta-event::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 1px;
    background-color: #e0e0e0;
}

/* --- Chat Load More Button --- */
.rifnote-chat-load-more-container {
    text-align: center;
    padding: 10px 0;
    border-bottom: 1px solid #ddd;
    background-color: #f0f2f5;
}

/* --- League Table Styles --- */
.rifnote-league-table-wrapper {
	overflow-x: auto; /* Allows horizontal scrolling on small screens */
	margin-bottom: 20px;
	-webkit-font-smoothing: antialiased;
}

.rifnote-league-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 14px;
	text-align: center;
	background-color: #fff;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
	border-radius: 5px;
	overflow: hidden; /* Ensures border-radius is respected by children */
}

.rifnote-league-table th,
.rifnote-league-table td {
	padding: 14px 12px;
	border-bottom: 1px solid #f0f0f0;
}

.rifnote-league-table thead th {
	background-color: #fafafa;
	font-weight: 600;
	color: #555;
	text-transform: uppercase;
	font-size: 11px;
	letter-spacing: 0.5px;
}

.rifnote-league-table tbody tr:last-child td {
	border-bottom: none;
}

.rifnote-league-table tbody tr:nth-child(even) {
	background-color: #fdfdfd;
}

.rifnote-league-table tbody tr:hover {
	background-color: #f5faff;
}

/* Column-specific styles */
.rifnote-league-table .team-col {
	text-align: left;
	white-space: nowrap;
	font-weight: 500;
}

.rifnote-league-table .team-logo {
	width: 22px;
	height: 22px;
	vertical-align: middle;
	margin-right: 10px;
}

.rifnote-league-table .points-col strong {
	font-weight: 700;
	color: #000;
}

.rifnote-league-table .rank-col {
	font-weight: 600;
	color: #888;
}

/* --- League Table Widget Switcher --- */
.rifnote-league-switcher {
	width: 100%;
	padding: 10px;
	margin-bottom: 15px;
	font-size: 1em;
	border: 1px solid #ddd;
	border-radius: 4px;
	background-color: #fff;
	-webkit-appearance: none; /* Removes default browser styling */
	-moz-appearance: none;
	appearance: none;
	background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%230073aa%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.4-12.8z%22%2F%3E%3C%2Fsvg%3E');
	background-repeat: no-repeat;
	background-position: right 10px top 50%;
	background-size: 10px auto;
}

.rifnote-league-table-content {
	transition: opacity 0.3s ease-in-out;
}

/* --- Live & Upcoming Matches Widget --- */
.rifnote-live-matches-list {
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.rifnote-live-matches-day-group {
	--rifnote-date-header-height: 45px;
}

.rifnote-live-matches-date-header {
	font-size: 0.9em;
	font-weight: 600;
	color: #555;
	background-color: #f8f9fa;
	padding: 12px 8px;
	margin: 0;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	position: sticky;
	top: 0;
	z-index: 2;
	border-bottom: 1px solid #e9ecef;
}

.rifnote-live-match-row-link {
	text-decoration: none;
	color: inherit;
	display: block;
}

.rifnote-live-match-row {
	display: flex;
	flex-direction: column;
	gap: 1px;
	align-items: center;
	padding: 12px 8px;
	border-bottom: 1px solid #f0f0f0;
	animation: rifnote-fade-in-up 0.4s ease-out;
	transition: background-color 0.2s ease;
}

.rifnote-live-match-row-link:hover .rifnote-live-match-row {
	background-color: #f5faff;
}

.rifnote-live-matches-day-group .rifnote-live-match-row-link:last-child .rifnote-live-match-row {
	border-bottom: none;
}

.rifnote-match-main-info {
	display: flex;
	align-items: center;
	width: 100%;
	min-height: 40px; /* Ensures uniform height for all match rows */
}

.rifnote-match-sub-info {
	text-align: center;
}

.rifnote-live-match-status {
	text-align: center;
	font-weight: 600;
	font-size: 0.8em; /* Reduced font size for time/status */
}

.rifnote-live-match-row.status-live .rifnote-live-match-status {
	color: #e74c3c;
	animation: rifnote-pulse 1.5s infinite;
}

.rifnote-live-match-row.status-finished .rifnote-live-match-status {
	color: #3498db; /* Blue for finished */
	font-weight: 600;
}

.rifnote-live-match-team {
	flex: 1;
	display: flex;
	align-items: center;
	gap: 8px;
	min-width: 0;
}

.rifnote-live-match-team.home-team {
	justify-content: flex-end;
}

.rifnote-live-match-team .team-name {
	white-space: normal;
	overflow: visible;
	text-overflow: initial;
	line-height: 1.2; /* Reduces space between lines for wrapped text */
}

.rifnote-live-match-team.home-team .team-name {
	text-align: right;
}

.rifnote-live-match-team.winner .team-name {
	font-weight: 700;
	color: #000;
}

.rifnote-live-match-team .team-logo {
	width: 24px;
	height: 24px;
}

.rifnote-live-match-score {
	flex: 0 0 auto;
	padding: 0 15px;
	font-weight: 700;
	font-size: 1.1em;
}

.rifnote-live-matches-footer {
	text-align: center;
	margin-top: 20px;
}

.rifnote-see-all-btn {
	display: inline-block;
	text-decoration: none;
	background-color: #ed1c24;
	color: #fff;
	padding: 8px 16px;
	border-radius: 4px;
	transition: background-color 0.2s ease;
}

.rifnote-see-all-btn:hover {
	background-color: #005a87;
	color: #fff;
}

@keyframes rifnote-pulse {
	0% { opacity: 1; }
	50% { opacity: 0.5; }
	100% { opacity: 1; }
}

.rifnote-live-matches-league-header,
.rifnote-live-matches-date-header {
	animation: rifnote-fade-in-up 0.4s ease-out;
}

@keyframes rifnote-fade-in-up {
	from {
		opacity: 0;
		transform: translateY(10px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.rifnote-live-matches-league-header {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 10px 8px;
	background-color: #fff;
	border-bottom: 1px solid #e9ecef;
	font-weight: 600;
	color: #333;
	margin-top: 5px;
	position: sticky;
	top: var(--rifnote-date-header-height); /* Use the variable to position it perfectly. */
	z-index: 1;
}

.rifnote-live-matches-league-logo {
	width: 20px;
	height: 20px;
}

/* --- Goal Animation --- */
.goal-scored {
	animation: rifnote-goal-flash 1.5s ease-out;
	border-radius: 4px; /* Add radius to make background flash look nice */
}

@keyframes rifnote-goal-flash {
	0% {
		background-color: transparent;
		transform: scale(1);
	}
	20% {
		background-color: #d4edda; /* A light green flash */
		transform: scale(1.15);
		color: #155724;
	}
	100% {
		background-color: transparent;
		transform: scale(1);
	}
}

/* --- Live Matches Date Picker --- */
.rifnote-date-picker-wrapper {
	margin-bottom: 15px;
}

.rifnote-date-picker-wrapper label {
	display: block;
	font-weight: 600;
	margin-bottom: 5px;
	font-size: 0.9em;
}

.rifnote-date-picker-input {
	/* This class is now mainly for JS targeting. Styles are inherited from .rifnote-date-filter-input */
	padding: 8px 10px;
	font-size: 16px;
	box-sizing: border-box;
}

/* --- Prediction Sharing --- */
.rifnote-prediction-share {
	margin-top: 25px;
	padding-top: 15px;
	border-top: 1px solid #eee;
}

.rifnote-prediction-share h4 {
	margin-top: 0;
	margin-bottom: 10px;
	font-size: 1.1em;
}

.rifnote-share-buttons {
	display: flex;
	gap: 10px;
}

.rifnote-share-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	color: #fff !important; /* Important to override link colors */
	text-decoration: none;
	font-size: 18px;
	transition: opacity 0.2s ease;
}

.rifnote-share-btn:hover {
	opacity: 0.85;
}

.rifnote-share-btn.twitter { background-color: #1DA1F2; }
.rifnote-share-btn.facebook { background-color: #1877F2; }
.rifnote-share-btn.whatsapp { background-color: #25D366; }

/* --- Admin Actions --- */
.rifnote-admin-actions {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px dashed #ccc;
    text-align: center;
}

/* For the match detail page header */
.aggregate-score-line {
    font-size: 1em;
    color: #555;
    font-weight: 600;
    margin-top: 5px;
}

/* For the main fixtures list */
.aggregate-score {
    font-size: 0.85em;
    color: #666;
    font-weight: normal;
}

/* Highlight for team winning on aggregate */
.aggregate-winner .team-name {
    font-weight: 700;
    color: #272727;
}

/* On the match detail page, we can also make the aggregate score line more prominent */
.rifnote-match-header-v2.has-aggregate .aggregate-score-line {
    font-weight: 600;
    color: #333;
}

