/**
 * Robertstown Fixtures - Styles
 *
 * Robertstown GAA: Blue (#0033A0) and White
 * Newtown Gaels: Blue (#0033A0) and Maroon (#722F37) - amalgamation
 */

:root {
    --rstown-blue: #0033A0;
    --rstown-maroon: #722F37;
    --rstown-blue-muted: #2551a2;
    --rstown-maroon-muted: #7e444b;
}

/* Container - with specificity boost */
.rstown-fixtures.rstown-fixtures {
    display: flex !important;
    flex-direction: column !important;
    gap: 1.5rem !important;
    max-width: 690px !important;
    margin: 0 auto;
    padding: 0 !important;
    list-style: none !important;
}

.rstown-empty {
    padding: 2rem !important;
    text-align: center !important;
    background: #f5f5f5 !important;
    border-radius: 8px !important;
    color: #666 !important;
}

/* Individual fixture card */
.rstown-fixture-card {
    background: #ffffff !important;
    border-radius: 8px !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
    overflow: hidden !important;
    border: none !important;
    border-left: 4px solid var(--rstown-blue) !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Header with competition and date */
.rstown-fixture-card .rstown-fixture-header {
    display: flex !important;
    justify-content: flex-start !important;
    align-items: center !important;
    padding: 0.5rem 1rem 0.5rem 0.5rem !important;
    background: var(--rstown-blue-muted) !important;
    color: #ffffff !important;
    font-size: 0.85rem !important;
    margin: 0 !important;
    border: none !important;
}

.rstown-fixture-header .rstown-date {
    font-weight: 600 !important;
    white-space: nowrap !important;
    color: #ffffff !important;
    margin: 0 !important;
    order: -1 !important;
    padding-right: 1rem !important;
}

.rstown-fixture-header .rstown-competition {
    font-weight: 400 !important;
    flex: 1 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    text-align: left !important;
    color: #ffffff !important;
    margin: 0 !important;
}

/* GAA / LGFA / Camogie badge pills */
.rstown-fixture-header .rstown-badge {
    font-size: 0.8rem !important;
    font-weight: 600 !important;
    padding: 0.25rem 0.6rem !important;
    border-radius: 9999px !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
    line-height: 1.2 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.03em !important;
    margin-right: 0.75rem !important;
    cursor: pointer !important;
}

.rstown-fixture-header .rstown-badge-gaa {
    background: rgba(255, 255, 255, 0.15) !important;
    color: #ffffff !important;
    border: 1px solid rgba(255, 255, 255, 0.4) !important;
}

.rstown-fixture-header .rstown-badge-lgfa {
    background: #2e8b57 !important;
    color: #ffffff !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
}

.rstown-fixture-header .rstown-badge-camogie {
    background: #d4a017 !important;
    color: #ffffff !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
}

/* Teams section */
.rstown-fixture-card .rstown-fixture-teams {
    display: flex !important;
    align-items: center !important;
    padding: 1rem !important;
    gap: 0.5rem !important;
    background: #ffffff !important;
    margin: 0 !important;
}

.rstown-fixture-teams .rstown-team {
    flex: 1 !important;
    display: flex !important;
    align-items: center !important;
    gap: 0.75rem !important;
    margin: 0 !important;
    padding: 0 !important;
}

.rstown-fixture-teams .rstown-team.rstown-home {
    justify-content: flex-end !important;
    text-align: right !important;
}

.rstown-fixture-teams .rstown-team.rstown-away {
    justify-content: flex-start !important;
    text-align: left !important;
}

.rstown-fixture-teams .rstown-team-name {
    font-weight: 500 !important;
    color: #333333 !important;
    font-size: 1rem !important;
    margin: 0 !important;
    padding: 0 !important;
    line-height: 1.4 !important;
}

/* Highlight our club */
.rstown-fixture-teams .rstown-team.rstown-club .rstown-team-name {
    color: var(--rstown-blue) !important;
    font-weight: 700 !important;
}

.rstown-fixture-teams .rstown-vs {
    flex-shrink: 0 !important;
    width: 30px !important;
    text-align: center !important;
    color: #999999 !important;
    font-size: 0.875rem !important;
    margin: 0 !important;
}

/* Scores for results */
.rstown-fixture-teams .rstown-score {
    font-size: 1.25rem !important;
    font-weight: 700 !important;
    color: #333333 !important;
    min-width: 60px !important;
    text-align: center !important;
    background: #e0e0e0 !important;
    padding: 0.25rem 0.5rem !important;
    border-radius: 4px !important;
    margin: 0 !important;
    line-height: 1.3 !important;
    white-space: nowrap !important;
}

.rstown-fixture-teams .rstown-team.rstown-club .rstown-score {
    background: var(--rstown-blue-muted) !important;
    color: #ffffff !important;
}

/* Footer with venue, time and referee */
.rstown-fixture-card .rstown-fixture-footer {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 0.35rem 1rem !important;
    background: #f8f9fa !important;
    font-size: 0.85rem !important;
    color: #666666 !important;
    border-top: 1px solid #eeeeee !important;
    margin: 0 !important;
}

.rstown-fixture-footer .rstown-venue {
    display: flex !important;
    align-items: center !important;
    gap: 0.25rem !important;
    margin: 0 !important;
    flex: 1 !important;
}

.rstown-fixture-footer .rstown-venue::before {
    content: "\1F4CD";
    font-size: 0.9em;
}

.rstown-fixture-footer .rstown-time {
    display: flex !important;
    align-items: center !important;
    gap: 0.3rem !important;
    margin: 0 !important;
    color: var(--rstown-blue) !important;
    font-weight: 600 !important;
    flex-shrink: 0 !important;
}

.rstown-fixture-footer .rstown-time::before {
    content: "";
    display: inline-block;
    width: 14px;
    height: 14px;
    vertical-align: -2px !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230033A0' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpolyline points='12 6 12 12 16 14'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
}

.rstown-fixture-footer .rstown-referee {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 0.4rem !important;
    margin: 0 !important;
    color: #666666 !important;
    flex: 1 !important;
}

.rstown-fixture-footer .rstown-referee::before {
    content: "";
    display: inline-block;
    width: 16px;
    height: 16px;
    vertical-align: -4px !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 797.78 487.47'%3E%3Cg transform='translate(20.552,-286.65)'%3E%3Cg transform='translate(175,382.36)'%3E%3Cpath fill='%23666666' d='m604 308.38c-20.052-0.37226-31.889 21.324-41 42-0.80935 1.7759-1.7114 4.0816-2.625 6.5l-135.38-35.5s-9.1598-4.7348-24.469-4.25c-15.31 0.48-29.53 8.25-29.53 8.25l-51 25-305 152 7 61 7 61 299 127 86.219-63.312 162.41 61.031c8.9611 4.2066 20.485 4.4986 36.031 0.25 58.179-12.122 92.521-91.444 111.97-146.38 19.44-54.93 23.19-114.27 6.37-167.59-5.27-16.71-16.8-35.15-31.75-41.88-1.0559-0.47523-2.1961-0.81807-3.375-1.0625l-18.219-4.7812c2.7522-22.213 2.3117-54.193-13.812-63.312-2.78-1.41-8.85-2.97-8.85-2.97l-51-13zm45 44c16.039 2.912 14.736 17.5 14.844 31.188-0.0264 0.1559-0.0361 0.31287-0.0625 0.46875l-36.75-9.6562c5.0096-9.6402 10.897-18.797 21.969-22zm-299.97 1.5625 246.69 70.469l-72.72 44.97-248.72-75.75 74.75-39.688zm-322.22 163.59 287.41 108.81 3.31 109.72-279.25-118.62-11.468-99.91zm492.81 98.35c2.3321-0.008 4.8161 0.41716 7.375 1.5 11.698 4.9501 12 16 12 16s4.2044 41.05 6.7188 61.531c3.2411 11.971 6.5259 22.306 10.469 30.812l-127.8-48.06 76.62-56.28s6.2961-5.4705 14.625-5.5z' transform='translate(-175,-382.36)'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
}

.rstown-fixture-footer .rstown-time {
    font-weight: 600 !important;
    color: var(--rstown-blue) !important;
    margin: 0 !important;
}

/* Conceded match styling */
.rstown-fixture-teams .rstown-score.rstown-conceded {
    background: #dc3545 !important;
    color: #ffffff !important;
    font-size: 1rem !important;
}

/* Results-specific styling */
.rstown-results .rstown-fixture-teams {
    padding: 1.25rem 1rem !important;
    gap: 0.25rem !important;
}

.rstown-results .rstown-vs {
    width: 8px !important;
}

/* Win/Draw indicators */
.rstown-result-indicator {
    font-size: 1rem !important;
    line-height: 1 !important;
    flex-shrink: 0 !important;
}

.rstown-result-indicator.rstown-draw {
    color: #888888 !important;
    font-size: 1.1rem !important;
}

/* Responsive */
@media (max-width: 480px) {
    .rstown-fixture-card .rstown-fixture-header {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 0.25rem !important;
    }

    .rstown-fixture-header .rstown-competition {
        padding-right: 0 !important;
    }

    .rstown-fixture-card .rstown-fixture-teams {
        flex-direction: column !important;
        gap: 0.75rem !important;
    }

    .rstown-fixture-teams .rstown-team {
        width: 100% !important;
        justify-content: space-between !important;
    }

    .rstown-fixture-teams .rstown-team.rstown-away {
        flex-direction: row-reverse !important;
    }

    .rstown-fixture-teams .rstown-vs {
        width: 100% !important;
        padding: 0.25rem 0 !important;
    }
}

/* ===========================================
   Newtown Gaels - Blue to Maroon Gradient
   (Amalgamation of both clubs)
   =========================================== */

.rstown-fixture-card.rstown-newtown-gaels {
    border-left-color: var(--rstown-maroon) !important;
}

/* Blue to Maroon gradient header - 50/50 split for amalgamation */
.rstown-fixture-card.rstown-newtown-gaels .rstown-fixture-header {
    background: linear-gradient(90deg, var(--rstown-blue-muted) 0%, var(--rstown-blue-muted) 45%, var(--rstown-maroon-muted) 55%, var(--rstown-maroon-muted) 100%) !important;
}

/* Newtown Gaels name stays blue */
.rstown-fixture-card.rstown-newtown-gaels .rstown-fixture-teams .rstown-team.rstown-club .rstown-team-name {
    color: var(--rstown-blue) !important;
}

/* Newtown Gaels score with gradient background */
.rstown-fixture-card.rstown-newtown-gaels .rstown-fixture-teams .rstown-team.rstown-club .rstown-score {
    background: linear-gradient(90deg, var(--rstown-blue-muted) 0%, var(--rstown-maroon-muted) 100%) !important;
    color: #ffffff !important;
}

.rstown-fixture-card.rstown-newtown-gaels .rstown-fixture-footer .rstown-time {
    color: var(--rstown-blue) !important;
}

/* ===========================================
   Filter Bar
   =========================================== */

.rstown-filter-bar {
    display: flex;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 0.75rem 1rem !important;
    background: #f0f4ff !important;
    border: 1px solid var(--rstown-blue) !important;
    border-radius: 8px !important;
    margin-bottom: 0 !important;
    font-size: 0.9rem !important;
    /* Animation properties */
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    border-width: 0 !important;
    transition: max-height 0.3s ease-out, opacity 0.3s ease-out, padding 0.3s ease-out, border-width 0.3s ease-out, margin 0.3s ease-out;
}

.rstown-filter-bar.rstown-filter-active {
    max-height: 60px;
    opacity: 1;
    padding-top: 0.75rem !important;
    padding-bottom: 0.75rem !important;
    border-width: 1px !important;
    margin-bottom: 0 !important;
}

.rstown-filter-bar .rstown-filter-text {
    color: #333 !important;
    margin: 0 !important;
}

.rstown-filter-bar .rstown-filter-club {
    color: var(--rstown-blue) !important;
}

.rstown-filter-bar .rstown-filter-clear {
    background: var(--rstown-blue) !important;
    color: #ffffff !important;
    border: none !important;
    padding: 0.4rem 0.8rem !important;
    border-radius: 4px !important;
    cursor: pointer !important;
    font-size: 0.85rem !important;
    font-weight: 500 !important;
    transition: background 0.2s ease, transform 0.15s ease !important;
}

.rstown-filter-bar .rstown-filter-clear:hover {
    background: #002680 !important;
    transform: scale(1.02);
}

/* Clickable team names */
.rstown-fixture-teams .rstown-team-name.rstown-filterable {
    text-decoration: underline !important;
    text-decoration-style: dotted !important;
    text-underline-offset: 2px !important;
}

.rstown-fixture-teams .rstown-team-name.rstown-filterable:hover {
    text-decoration-style: solid !important;
}

/* ===========================================
   Unified Club Component with Tabs
   =========================================== */

.rstown-club {
    max-width: 690px !important;
    margin: 0 auto;
}

/* Tabs */
.rstown-tabs {
    display: flex !important;
    gap: 0 !important;
    margin-bottom: 1rem !important;
    border-bottom: 2px solid #e0e0e0 !important;
}

.rstown-tab {
    flex: 1 !important;
    padding: 0.75rem 1rem !important;
    background: transparent !important;
    border: none !important;
    border-bottom: 3px solid transparent !important;
    margin-bottom: -2px !important;
    font-size: 1rem !important;
    font-weight: 500 !important;
    color: #666666 !important;
    cursor: pointer !important;
    transition: color 0.2s ease, border-color 0.2s ease !important;
}

.rstown-tab:hover {
    color: var(--rstown-blue) !important;
}

.rstown-tab.rstown-tab-active {
    color: var(--rstown-blue) !important;
    border-bottom-color: var(--rstown-blue) !important;
}

/* Panels */
.rstown-panel {
    display: none !important;
    flex-direction: column !important;
    gap: 1.5rem !important;
}

.rstown-panel.rstown-panel-active {
    display: flex !important;
}

/* Clickable competition names */
.rstown-competition.rstown-filterable {
    text-decoration: underline !important;
    text-decoration-style: dotted !important;
    text-underline-offset: 2px !important;
}

.rstown-competition.rstown-filterable:hover {
    text-decoration-style: solid !important;
}

/* ===========================================
   League Table Standings
   =========================================== */

.rstown-standings {
    display: none;
    margin-bottom: 1.5rem !important;
}

.rstown-standings-loading {
    text-align: center !important;
    padding: 1rem !important;
    color: #666 !important;
    font-style: italic !important;
}

.rstown-league-table {
    background: #ffffff !important;
    border-radius: 8px !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
    overflow: hidden !important;
    margin-bottom: 1rem !important;
}

.rstown-table-title {
    background: var(--rstown-blue-muted) !important;
    color: #ffffff !important;
    margin: 0 !important;
    padding: 0.6rem 1rem !important;
    font-size: 0.9rem !important;
    font-weight: 600 !important;
}

.rstown-table {
    width: 100% !important;
    border-collapse: collapse !important;
    font-size: 0.85rem !important;
}

.rstown-table thead {
    background: #f5f5f5 !important;
}

.rstown-table th {
    padding: 0.5rem 0.4rem !important;
    text-align: center !important;
    font-weight: 600 !important;
    color: #333 !important;
    border-bottom: 2px solid #e0e0e0 !important;
}

.rstown-table th.rstown-th-team {
    text-align: left !important;
    padding-left: 0.75rem !important;
}

.rstown-table th.rstown-th-pos {
    width: 30px !important;
}

.rstown-table th.rstown-th-num {
    width: 40px !important;
}

.rstown-table td {
    padding: 0.5rem 0.4rem !important;
    text-align: center !important;
    border-bottom: 1px solid #eee !important;
}

.rstown-table td.rstown-td-team {
    text-align: left !important;
    padding-left: 0.75rem !important;
    font-weight: 500 !important;
}

.rstown-table td.rstown-td-pos {
    font-weight: 600 !important;
    color: #666 !important;
}

.rstown-table td.rstown-td-pts {
    font-weight: 700 !important;
    color: var(--rstown-blue) !important;
}

.rstown-table tr.rstown-our-team {
    background: #f0f4ff !important;
}

.rstown-table tr.rstown-our-team td.rstown-td-team {
    color: var(--rstown-blue) !important;
    font-weight: 700 !important;
}

.rstown-table tbody tr:last-child td {
    border-bottom: none !important;
}

/* Responsive table */
@media (max-width: 480px) {
    .rstown-table {
        font-size: 0.75rem !important;
    }

    .rstown-table th,
    .rstown-table td {
        padding: 0.4rem 0.25rem !important;
    }

    .rstown-table th.rstown-th-num,
    .rstown-table td.rstown-td-num {
        width: 28px !important;
    }
}

/* ===========================================
   Date Groups
   =========================================== */

.rstown-date-group {
    background: #f0f1f3 !important;
    border-radius: 8px !important;
    overflow: hidden !important;
    padding-bottom: 0.75rem !important;
}

.rstown-date-header {
    background: #5a6270 !important;
    color: #ffffff !important;
    padding: 0.5rem 1rem !important;
    font-weight: 700 !important;
    font-size: 0.9rem !important;
    margin: 0 0 0.75rem 0 !important;
}

/* Sub-cards inside date group - visible cards with spacing */
.rstown-date-group .rstown-fixture-card {
    border: none !important;
    border-left: 4px solid var(--rstown-blue) !important;
    border-radius: 6px !important;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1) !important;
    margin: 0 0.75rem 0.75rem 0.75rem !important;
}

.rstown-date-group .rstown-fixture-card:last-child {
    margin-bottom: 0 !important;
}

/* Preserve Newtown Gaels border inside date groups */
.rstown-date-group .rstown-fixture-card.rstown-newtown-gaels {
    border-left-color: var(--rstown-maroon) !important;
}

/* Time in sub-card header */
.rstown-fixture-header .rstown-time-header {
    font-weight: 600 !important;
    white-space: nowrap !important;
    color: #ffffff !important;
    margin: 0 !important;
    flex-shrink: 0 !important;
}

/* ===========================================
   Team Logos
   =========================================== */

img.rstown-team-logo {
    width: 36px !important;
    height: 36px !important;
    max-width: 36px !important;
    max-height: 36px !important;
    min-width: 36px !important;
    min-height: 36px !important;
    border-radius: 50% !important;
    object-fit: cover !important;
    flex-shrink: 0 !important;
    display: inline-block !important;
}

span.rstown-team-logo.rstown-logo-placeholder {
    width: 36px !important;
    height: 36px !important;
    min-width: 36px !important;
    min-height: 36px !important;
    display: inline-block !important;
    background: #e0e0e0 !important;
    border-radius: 50% !important;
    flex-shrink: 0 !important;
}

.rstown-logo-left {
    margin-right: 0.25rem !important;
}

.rstown-logo-right {
    margin-left: 0.25rem !important;
}

/* ===========================================
   Awaiting Result (TBC scores)
   =========================================== */

.rstown-score.rstown-score-tbc {
    background: #f0f0f0 !important;
    color: #999 !important;
    font-style: italic !important;
    font-weight: 500 !important;
    font-size: 1rem !important;
}

.rstown-awaiting-banner {
    text-align: center !important;
    padding: 0.35rem 1rem !important;
    background: #dcdee2 !important;
    color: #000000 !important;
    font-size: 1rem !important;
    font-style: italic !important;
    font-weight: 700 !important;
    margin: 0 !important;
}
