/* =========================================
   GLOBAL LAYOUT & TYPOGRAPHY
   ========================================= */

body {
    margin: 0;
    padding: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: #f5f5f7;
    color: #222;
}

.wcgc-page {
    max-width: 1600px;        /* widened for pods + results */
    margin: 0 auto;
    padding: 24px 24px 60px;
}

/* -----------------------------------------
   HEADER
   ----------------------------------------- */
.season-nav {
    margin: 0 0 20px 0;
    text-align: center;
}

.season-link {
    display: inline-block;
    margin: 0 8px;
    padding: 10px 16px;
    border-radius: 8px;
    background: #f2f2f2;
    color: #222;
    text-decoration: none;
    font-weight: 600;
    border: 1px solid #ddd;
}

.season-link:hover {
    background: #e8e8e8;
}

.season-link.current {
    background: #222;
    color: #fff;
    border-color: #222;
}

.wcgc-header {
    border-bottom: 1px solid #dedede;
    margin-bottom: 24px;
}

.wcgc-header-inner {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

@media (min-width: 900px) {
    .wcgc-header-inner {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
}

.wcgc-logo-title {
    display: flex;
    gap: 14px;
    align-items: center;
}

.wcgc-logo {
    height: 70px;
    width: auto;
}

.wcgc-site-title {
    margin: 0 0 2px;
    font-size: 1.5rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.wcgc-tagline {
    margin: 0;
    font-size: 0.9rem;
    color: #666;
}

/* NAV */

.wcgc-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    font-size: 0.9rem;
}

.wcgc-nav a {
    text-decoration: none;
    color: #333;
    padding: 4px 10px;
    border-radius: 30px;
}

.wcgc-nav a:hover {
    background: #eee;
}

.wcgc-nav-pill {
    background: #222;
    color: #fff;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* -----------------------------------------
   MAIN CONTENT
   ----------------------------------------- */

.wcgc-main h2,
.wcgc-main h3,
.wcgc-main h4 {
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.wcgc-intro {
    margin-bottom: 16px;
}

/* Cards */

.wcgc-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 20px 20px 22px;
	margin-bottom: 20px;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.06);
}

.wcgc-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
    gap: 8px;
}

.wcgc-card-header h3 {
    margin: 0;
}

/* Pills / Labels */

.wcgc-pill {
    background: #f3efe0;
    color: #7a5b10;
    padding: 5px 11px;
    border-radius: 999px;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* -----------------------------------------
   FORMS
   ----------------------------------------- */

.wcgc-form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    align-items: flex-end;
}

.wcgc-form-field label {
    display: block;
    font-size: 0.85rem;
    margin-bottom: 4px;
}

.wcgc-input {
    padding: 8px 10px;
    border-radius: 6px;
    border: 1px solid #ccc;
    min-width: 260px;
    font-size: 0.95rem;
    background: #fff;
}

.wcgc-form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.wcgc-form-actions-bottom {
    margin-top: 12px;
}

/* Buttons */

.wcgc-btn {
    display: inline-block;
    border-radius: 999px;
    border: none;
    padding: 8px 18px;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    cursor: pointer;
    line-height: 1;
}

.wcgc-btn-primary {
    background: #c29b2f;
    color: #111;
}

.wcgc-btn-primary:hover {
    background: #d3ab3b;
}

.wcgc-btn-outline {
    background: #fff;
    color: #444;
    border: 1px solid #ccc;
}

.wcgc-btn-outline:hover {
    background: #f3f3f3;
}

.wcgc-btn-danger {
    background: #b00020;
    color: #fff;
}

.wcgc-btn-danger:hover {
    background: #c21c32;
}

.wcgc-btn:disabled {
    opacity: 0.4;
    cursor: default;
}

/* -----------------------------------------
   PLAYER LIST (REGISTERED PLAYERS)
   ----------------------------------------- */

.wcgc-players-list {
    margin-top: 16px;
}

.wcgc-players-list h4 {
    margin: 0 0 6px;
    font-size: 0.95rem;
}

.wcgc-players-list ul {
    list-style: none;
    padding-left: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.wcgc-players-list li {
    background: #f1f1f1;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.85rem;
}

.wcgc-player-number {
    font-weight: 600;
    margin-right: 4px;
}

/* -----------------------------------------
   MESSAGES
   ----------------------------------------- */

.wcgc-message {
    display: block;
    margin-top: 10px;
    font-size: 0.85rem;
}

.wcgc-message-info {
    color: #6a5b1c;
}

.wcgc-message-error {
    color: #b00020;
}

/* =========================================
   PODS & RESULTS GRID
   ========================================= */

.wcgc-pods-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
}

/* for results section where we might have 6 pods – allow tighter spacing on large screens */
@media (min-width: 1400px) {
    .wcgc-pods-grid {
        grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    }
}

.wcgc-pod-card {
    background: #fafafa;
    border-radius: 12px;
    padding: 12px 12px 14px;
    border-top: 3px solid #c29b2f;
}

.wcgc-pod-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 8px;
}

.wcgc-pod-header h4 {
    margin: 0;
    font-size: 0.95rem;
}

.wcgc-pod-meta {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #777;
}

/* Pod players list (in Pods & Fixtures section) */

.wcgc-pod-players {
    list-style: none;
    padding-left: 0;
    margin: 0 0 8px;
}

.wcgc-pod-players li {
    font-size: 0.9rem;
}

/* -----------------------------------------
   MATCHES TABLE (fixtures & results)
   ----------------------------------------- */

.matches-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 6px;
    font-size: 0.85rem;
}

.matches-table th,
.matches-table td {
    border-bottom: 1px solid #e0e0e0;
    padding: 4px 3px;
    vertical-align: top;
}

.matches-table th {
    font-weight: 600;
    text-align: left;
}

/* League table variations */

.wcgc-league-table {
    margin-top: 8px;
}

.wcgc-league-table th:first-child,
.wcgc-league-table td:first-child {
    width: 30px;
}

/* League table row styling */
.wcgc-league-main-table .wcgc-league-row {
    cursor: pointer;
    transition: background 0.15s ease;
}

.wcgc-league-main-table .wcgc-league-row:hover {
    background: #f5f5f5;
}

/* Top 3 – subtle gold tint */
.wcgc-league-top {
    background: #fff8de;
}

/* Mid-table – default background (optional tweak) */
.wcgc-league-mid {
    background: #ffffff;
}

/* Bottom 3 – light red tint */
.wcgc-league-bottom {
    background: #ffecec;
}

/* Make player link inherit row colour */
.wcgc-league-player-link {
    color: inherit;
    text-decoration: none;
}

.wcgc-league-player-link:hover {
    text-decoration: underline;
}

/* History section */

/* ===== Mobile history cards ===== */

@media (max-width: 768px)
{

.history-table thead {
    display:none;
}

.history-table,
.history-table tbody,
.history-table tr,
.history-table td {
    display:block;
    width:100%;
}

.history-table tr
{
    background:#fff;
    border:1px solid #e2e2e2;
    border-radius:12px;
    padding:12px;
    margin-bottom:14px;
}

.history-table td
{
    display:flex;
    justify-content:space-between;
    padding:8px 0;
    border-bottom:1px solid #eee;
    font-size:14px;
}

.history-table td:last-child
{
    border-bottom:none;
}

.history-table td::before
{
    content:attr(data-label);
    font-weight:600;
    color:#666;
}

}

@media (max-width:768px)
{

.history-summary
{
    display:grid;
    grid-template-columns:repeat(2,1fr);
    gap:10px;
}

.history-stat
{
    padding:12px;
    border-radius:10px;
}

}

.history-badge
{
    display:inline-block;
    padding:4px 10px;
    border-radius:20px;
    font-weight:600;
    font-size:12px;
}

.history-badge.win
{
    background:#e3f4e8;
    color:#1c7a3b;
}

.history-badge.loss
{
    background:#f6e4e4;
    color:#a33a3a;
}

.history-badge.draw
{
    background:#ececec;
    color:#666;
}

/* ===== History panel - desktop default ===== */
.history-panel {
    margin-top: 24px;
    padding: 18px;
    border: 1px solid #dcdcdc;
    border-radius: 18px;
    background: #f8f8f6;
}

.history-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.history-header h3 {
    margin: 0;
    font-size: 1.8rem;
    line-height: 1.2;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.history-close-btn {
    border: 0;
    border-radius: 10px;
    padding: 10px 18px;
    background: #2c2c2c;
    color: #fff;
    cursor: pointer;
    font-weight: 600;
}

.history-summary {
    display: grid;
    grid-template-columns: repeat(7, minmax(120px, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}

.history-stat {
    background: #fff;
    border: 1px solid #e2e2e2;
    border-radius: 14px;
    padding: 14px 10px;
    text-align: center;
}

.history-stat-label {
    display: block;
    color: #777;
    font-size: 0.9rem;
    margin-bottom: 6px;
}

.history-stat-value {
    display: block;
    font-size: 1.9rem;
    font-weight: 700;
    color: #222;
}

.history-table {
    width: 100%;
    border-collapse: collapse;
}

.history-table th,
.history-table td {
    padding: 14px 10px;
    text-align: left;
    border-bottom: 1px solid #e5e5e5;
    vertical-align: middle;
}

.history-table th {
    font-weight: 700;
    color: #1f1f1f;
}

.history-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 700;
}

.history-badge.win {
    background: #e4f3e8;
    color: #1f7a38;
}

.history-badge.loss {
    background: #f8e4e4;
    color: #a33a3a;
}

.history-badge.draw {
    background: #ececec;
    color: #666;
}

/* Backdrop hidden by default */
.history-backdrop {
    display: none;
}

/* ===== Tablet ===== */
@media (max-width: 1024px) {
    .history-summary {
        grid-template-columns: repeat(3, minmax(120px, 1fr));
    }
}

/* ===== Mobile slide-up drawer ===== */
@media (max-width: 767px) {

    .history-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.38);
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transition: opacity 0.25s ease, visibility 0.25s ease;
        z-index: 999;
    }

    .history-backdrop.is-open {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }

    .history-panel {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        top: auto;
        margin: 0;
        padding: 14px 14px 18px;
        border-radius: 18px 18px 0 0;
        border: 1px solid #dcdcdc;
        background: #f8f8f6;
        box-shadow: 0 -10px 30px rgba(0,0,0,0.18);
        z-index: 1000;
        max-height: 88vh;
        overflow-y: auto;
        transform: translateY(104%);
        transition: transform 0.28s ease;
    }

    .history-panel.is-open {
        transform: translateY(0);
    }

    .history-panel::before {
        content: "";
        display: block;
        width: 44px;
        height: 5px;
        border-radius: 999px;
        background: #cfcfcf;
        margin: 0 auto 14px;
    }

    .history-header {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        margin-bottom: 14px;
    }

    .history-header h3 {
        font-size: 1.2rem;
    }

    .history-close-btn {
        width: 100%;
    }

    .history-summary {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        margin-bottom: 14px;
    }

    .history-stat {
        padding: 12px 10px;
        border-radius: 12px;
    }

    .history-stat-label {
        font-size: 0.8rem;
    }

    .history-stat-value {
        font-size: 1.45rem;
    }

    .history-table thead {
        display: none;
    }

    .history-table,
    .history-table tbody,
    .history-table tr,
    .history-table td {
        display: block;
        width: 100%;
    }

    .history-table tr {
        background: #fff;
        border: 1px solid #e2e2e2;
        border-radius: 14px;
        padding: 10px 12px;
        margin-bottom: 12px;
    }

    .history-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 12px;
        padding: 8px 0;
        border-bottom: 1px solid #ededed;
        text-align: right;
        font-size: 0.95rem;
    }

    .history-table td:last-child {
        border-bottom: 0;
    }

    .history-table td::before {
        content: attr(data-label);
        text-align: left;
        font-weight: 700;
        color: #666;
        flex: 0 0 42%;
    }

    body.history-open {
        overflow: hidden;
    }
}

.wcgc-history-table {
    margin-top: 10px;
}

.wcgc-history-table {
    margin-top: 12px;
}

.wcgc-no-print .wcgc-btn-outline {
    background: #fff;
    border: 1px solid #aaa;
}


.history-panel {
    margin-top: 24px;
    padding: 20px;
    background: #f8f8f8;
    border: 1px solid #ddd;
    border-radius: 14px;
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}

.history-close-btn {
    padding: 8px 14px;
    border: 0;
    border-radius: 8px;
    background: #333;
    color: #fff;
    cursor: pointer;
}

.history-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}

.history-stat {
    background: #fff;
    border: 1px solid #e3e3e3;
    border-radius: 12px;
    padding: 12px;
    text-align: center;
}

.history-stat-label {
    display: block;
    font-size: 0.85rem;
    color: #777;
    margin-bottom: 4px;
}

.history-stat-value {
    display: block;
    font-size: 1.3rem;
    font-weight: 700;
    color: #222;
}

.history-table {
    width: 100%;
    border-collapse: collapse;
}

.history-table th,
.history-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #e5e5e5;
    text-align: left;
}

.history-badge {
    display: inline-block;
    min-width: 32px;
    text-align: center;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 700;
}

.history-badge.win {
    background: #e6f4ea;
    color: #1f6f3d;
}

.history-badge.draw {
    background: #fff7e0;
    color: #9a6a00;
}

.history-badge.loss {
    background: #fdeaea;
    color: #9f2d2d;
}



/* -----------------------------------------
   RESULTS INPUTS
   ----------------------------------------- */

.wcgc-score-row {
    margin-top: 2px;
    font-size: 0.8rem;
    white-space: nowrap;
}

.wcgc-input-score {
    width: 40px;
    padding: 2px 4px;
    margin: 0 3px;
    font-size: 0.8rem;
}

.wcgc-player-result-row {
    margin-bottom: 4px;
}

.wcgc-player-name {
    font-size: 0.8rem;
    margin-bottom: 1px;
}

/* Input + live warning */
.wcgc-input-with-warning {
    display: flex;
    align-items: center;
    gap: 8px;
}

.wcgc-inline-warning {
    color: #b00020;
    font-size: 0.8rem;
}

/* Player pills + duplicate highlight */
.wcgc-player-pill {
    background: #f1f1f1;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.85rem;
    border: 1px solid transparent;
}

/* Player pill with remove button */
.wcgc-player-pill {
    position: relative;
    background: #f1f1f1;
    padding: 4px 28px 4px 10px; /* make space for the x */
    border-radius: 999px;
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
    border: 1px solid transparent;
}

/* Red remove button */
/* Player pill */
.wcgc-player-pill {
    position: relative;
    background: #f1f1f1;
    padding: 4px 34px 4px 10px; /* room for the icon */
    border-radius: 999px;
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
    border: 1px solid transparent;
}

/* Clickable trash icon */
.wcgc-remove-player {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    padding: 2px;
    cursor: pointer;
    text-decoration: none !important;
}

/* SVG icon styling */
.wcgc-trash-icon svg {
    width: 14px;
    height: 14px;
    fill: #b00020;
    transition: fill 0.2s ease;
}

.wcgc-trash-icon svg:hover {
    fill: #ff0033;
}

/* Highlight duplicate (still works) */
.wcgc-player-duplicate {
    background: #ffe4e6;
    border-color: #b00020;
}


.wcgc-remove-player:hover {
    color: #ff0033;
}

/* Duplicate highlighting still works */
.wcgc-player-duplicate {
    background: #ffe4e6;
    border-color: #b00020;
}


.wcgc-player-duplicate {
    background: #ffe4e6;
    border-color: #b00020;
}

/* Suggestions dropdown under player input */
.wcgc-suggestions {
    position: relative;
    margin-top: 2px;
}

.wcgc-suggestions-list {
    position: absolute;
    z-index: 20;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.12);
    margin: 0;
    padding: 4px 0;
    list-style: none;
    max-height: 200px;
    overflow-y: auto;
    min-width: 220px;
}

.wcgc-suggestions-item {
    padding: 4px 10px;
    font-size: 0.85rem;
    cursor: pointer;
}

.wcgc-suggestions-item:hover {
    background: #f5f5f5;
}

/* =========================================
   FOOTER
   ========================================= */

.wcgc-footer {
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid #dedede;
    font-size: 0.8rem;
    color: #666;
}

.wcgc-footer a {
    color: #555;
}

/* =========================================
   RESPONSIVE TWEAKS
   ========================================= */

@media (max-width: 900px) {
    .wcgc-page {
        padding: 16px 10px 40px;
    }

    .wcgc-card {
        padding: 16px 14px 18px;
    }

    .wcgc-input {
        min-width: 200px;
        width: 100%;
    }
}

/* Utility hook used in code-behind */
.wcgc-no-print {
    /* hidden only in print */
}

/* Horizontal scroll for wide results section */
.wcgc-results-scroll {
    overflow-x: auto;
    padding-bottom: 10px;
}

/* Optional: nicer looking scrollbar on supporting browsers */
.wcgc-results-scroll::-webkit-scrollbar {
    height: 8px;
}

.wcgc-results-scroll::-webkit-scrollbar-thumb {
    background: #bbb;
    border-radius: 4px;
}


/* =========================================
   PRINT STYLES
   ========================================= */

@media print {

    body {
        background: #ffffff !important;
        color: #000000 !important;
    }

    /* Hide buttons, nav, admin-only bits */
    .wcgc-no-print,
    .wcgc-btn,
    .wcgc-nav,
    .wcgc-message {
        display: none !important;
    }

    .wcgc-page {
        max-width: 100%;
        padding: 0;
        margin: 0;
    }

    .wcgc-card {
        box-shadow: none !important;
        border: none !important;
        padding: 0;
        margin: 0 0 12px 0;
    }

    .wcgc-pods-grid {
        display: block;
    }

    .wcgc-pod-card {
        page-break-inside: avoid;
        border-top: 1px solid #000;
        margin-bottom: 10px;
        padding: 6px 0;
        background: #fff;
    }

    .wcgc-pod-header h4 {
        font-size: 1rem;
    }

    .wcgc-pod-players li {
        font-size: 0.9rem;
    }

    .matches-table {
        font-size: 0.85rem;
    }

    .wcgc-footer {
        font-size: 0.75rem;
        border-top: 1px solid #000;
        margin-top: 10px;
        padding-top: 4px;
    }
}
