
/* ===== FORM STYLING ===== */

.flex-row {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
}
.flex-row .col1_2 { width: 50%; }
.flex-row .col2_5 { width: 40%; }
.flex-row .col3_5 { width: 60%; }

.instructions-column {
    text-align: left;
    padding: 0 10px;
}
.instructions-list {
    font-size: 16px;
    line-height: 1.3em;
}
.instructions-list li {
    margin-bottom: 8px;
}

/* ===== FORM INTRO ===== */

.fantasy-intro-points {
    margin: 0;
    padding: 14px 16px;
    border: 1px solid #e2e2e2;
    border-top: 4px solid #195c4f;
    border-bottom: 4px solid #195c4f;
    border-radius: 6px;
    background: #fafbfb;
}
.fantasy-intro-points h3 { margin-top: 0; }


/* ===== FORM STYLING ===== */

.form-fantasy {}
.form-fantasy h4 {
    text-align: left;
}

.form-fantasy .form-group {
    margin-bottom: 10px;
}
.form-fantasy label {
    display: inline-block;
    line-height: 1.3em;
    font-weight: 700;
    width: 120px;
    min-width: 25%;
}
.form-fantasy .group-consent label {
    width: auto;
    padding-right: 10px;
}
.form-fantasy .group-radios label {
    width: auto;
    cursor: pointer;
    display: inline-block;
    padding: 8px 12px;
    background-color: #f5f5f5;
    border-radius: 6px;
}
.form-fantasy .group-radios {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 10px;
    margin: 10px 0;
}
.form-fantasy .group-radios .form-group {
    width: 20%;
    min-width: 200px;
}

.form-fantasy input[type="text"],
.form-fantasy input[type="number"],
.form-fantasy input[type="email"],
.form-fantasy input[type="tel"],
.form-fantasy input[type="password"],
.form-fantasy select {
    width: 75%;
}

.hp-field {
    position: absolute;
    left: -10000px;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* ===== TAB NAVIGATION ===== */
.panel-navigation {
    display: flex;
    flex-wrap: wrap;
    list-style: none;
    margin: 0 0 -1px 0;
    padding: 0;
    border-bottom: 2px solid #ccc;
}
.panel-navigation .panel-heading {
    margin: 0;
    padding: 0;
    border: 1px solid transparent;
    border-bottom: none;
    background: #f5f5f5;
    cursor: pointer;
    transition: background .15s ease;
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
}
.panel-navigation .panel-heading a,
.panel-navigation .panel-heading h4 {
    display: block;
    margin: 0;
    padding: 10px 14px;
    color: #333;
    text-decoration: none;
    font-weight: 600;
    font-size: 15px;
}
.panel-navigation .panel-heading h4 a { padding: 0; }
.panel-navigation .panel-heading:hover { background: #ececec; }
.panel-navigation .panel-heading.active {
    background: #fff;
    border-color: #ccc;
    z-index: 2;
}
.panel-navigation .panel-heading.active a,
.panel-navigation .panel-heading.active h4 { color: #0066cc; }

.panel-navigation .panel-heading.hidden,
.panel-bodies .panel.hidden { display: none !important; }

/* ===== PROGRESS BADGE inside panel-heading ===== */
.heading-progress {
    display: inline-block;
    min-width: 30px;
    padding: 2px 6px;
    margin-right: 10px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 700;
    color: #fff;
    background: #d9534f;        /* red by default */
    text-align: center;
    line-height: 1.4;
    transition: background .2s ease;
}
.heading-progress.complete { background: #5cb85c; }   /* green when full */
.heading-progress.partial  { background: #f0ad4e; }   /* optional amber */

/* ===== PANELS ===== */
.panel-bodies .panel {
    display: none;
    padding: 20px;
    border: 1px solid #ccc;
    border-top: none;
    background: #fff;
}
.panel-bodies .panel.active { display: block; }

/* ===== ROW HEADER LABELS ===== */
.fantasy-label-code,
.fantasy-label-name {
    font-weight: 700;
    display: inline-block;
    padding: 0 6px;
}
.form-fantasy .fantasy-label-code { width: 80px; }

/* ===== CODE INPUTS ===== */
.form-fantasy input.fantasy-input-code,
.form-fantasy .fantasy-input-code {
    width: 80px;
    text-align: center;
    font-family: monospace;
    font-size: 18px;
    padding: 6px 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
}
.fantasy-input-code.valid   { border-color: #5cb85c; background: #f3faf3; }
.fantasy-input-code.invalid { border-color: #d9534f; background: #fdf2f2; }

/* ===== NAME DISPLAY SPAN ===== */
.fantasy-name-display {
    display: inline-block;
    margin-left: 10px;
    min-height: 1.2em;
    min-width: 200px;
    font-style: italic;
    color: #333;
    border-bottom: 3px dotted #ddd;
}
.fantasy-name-display.warning { color: #d9534f; font-weight: 700; font-style: normal; }
.fantasy-name-display.valid   { color: #2a7a2a; font-style: normal; }

/* ===== SUBMIT BUTTON ===== */
.page-fantasy .btn,
button[type="submit"] {
    margin: 20px 0;
    padding: 10px 20px;
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    background: #195c4f;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background .2s ease;
}
.page-fantasy .btn:hover,
button[type="submit"]:hover { background: #14463a; text-decoration: none; }

button[type="submit"]:disabled,
input[type="submit"]:disabled,
.btn-disabled {
    opacity: .5;
    cursor: not-allowed;
    pointer-events: none;
    background: #195c4f;
}

/* ===== MOBILE TABS ===== */
@media (max-width: 640px) {
    .panel-navigation {
        flex-wrap: nowrap;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
    }
    .panel-navigation .panel-heading { flex: 0 0 auto; }
    .panel-navigation .panel-heading a,
    .panel-navigation .panel-heading h4 { padding: 8px 10px; font-size: 14px; }
    .heading-progress { font-size: 11px; min-width: 26px; padding: 1px 5px; margin-right: 6px; }
    .panel-bodies .panel { padding: 14px; }
}

/* ===== ADMIN ENTRIES LIST ===== */

.muted { color: #777; font-size: 14px; }

/* Toolbar (filter toggle + export) above the table */
.fantasy-admin-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin: 16px 0;
}
.fantasy-admin-toolbar .muted { margin-left: auto; } /* push the count to the right */

/* Search / filter form (surname or email) */
.fantasy-admin-search {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: 0 0 16px;
}
.fantasy-admin-search input[type="text"] {
    width: 280px;
    max-width: 100%;
    padding: 6px 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
}
.page-fantasy .fantasy-admin-search .btn { margin: 0; }

/* The admin area uses compact buttons; override the big default .page-fantasy
   .btn / button[type=submit] margins, and give the variants distinct colours
   (the base .btn is the brand green). */
.page-fantasy .fantasy-admin-toolbar .btn,
.page-fantasy .fantasy-admin-markpaid .btn {
    margin: 0;
}
.page-fantasy .btn-sm {
    padding: 5px 10px;
    font-size: 13px;
    margin: 0;
}
.page-fantasy .btn-secondary { background: #6c757d; }
.page-fantasy .btn.active { background: #3e5436; }
.page-fantasy .btn-secondary:hover { background: #5a6268; }
.page-fantasy .btn-primary { background: #195c4f; }
.page-fantasy .btn-primary:hover { background: #14463a; }
.page-fantasy .btn-warning { background: #f0ad4e; color: #3a2c00; }
.page-fantasy .btn-warning:hover { background: #ec971f; }

/* Table */
.fantasy-admin-table {
    width: 100%;
    margin: 20px 0;
    border-collapse: collapse;
}
.fantasy-admin-table thead th {
    text-align: left;
    padding: 8px 10px;
    border-bottom: 2px solid #195c4f;
    font-size: 14px;
    white-space: nowrap;
}
.fantasy-admin-table tbody td {
    padding: 8px 10px;
    vertical-align: top;
    font-size: 14px;
}
/* An order is a main row + its details row read as one block. Only a light
   line above the main row, and the strong divider under the details row, so
   each order group is clearly separated. */
.fantasy-admin-table tbody tr:not(.fantasy-admin-details-row) td {
    border-top: 1px solid #e2e2e2;
}
.fantasy-admin-table .fantasy-admin-details-row td {
    border-bottom: 2px solid #195c4f;
    padding-top: 0;
}
.fantasy-admin-table td.mono {
    font-family: monospace;
    font-size: 13px;
    white-space: nowrap;
}

/* Status badge */
.fantasy-status {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 700;
    text-transform: capitalize;
    color: #fff;
    background: #6c757d;
}
.fantasy-status-paid                { background: #5cb85c; }
.fantasy-status-manual                { background: #0F590A; }
.fantasy-status-pending             { background: #f0ad4e; color: #3a2c00; }
.fantasy-status-submitted_to_realex { background: #5bc0de; color: #06303a; }
.fantasy-status-expired             { background: #d9534f; }
.fantasy-status-failed              { background: #d9534f; }

/* Inline mark-as-paid form in the Action column */
.fantasy-admin-markpaid {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    margin: 0;
}
.fantasy-admin-markpaid input[type="text"],
.fantasy-admin-markpaid .form-control {
    width: 140px;
    padding: 5px 8px;
    font-size: 13px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

/* Expandable per-order dog list (reuses the .fantasy-summary markup) */
.fantasy-admin-details-row summary {
    cursor: pointer;
    padding: 6px 0;
    font-weight: 600;
    color: #195c4f;
}
.fantasy-admin-details-row .fantasy-summary {
    margin: 8px 0 16px;
    padding: 12px 16px;
    background: #f7f9f8;
    border-radius: 6px;
}
.fantasy-admin-details-row .summary-entries {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}
.fantasy-admin-details-row .summary-entry { min-width: 180px; }
.fantasy-admin-details-row .summary-dogs {
    margin: 4px 0 0;
    padding-left: 20px;
}
.fantasy-admin-details-row .summary-code {
    font-family: monospace;
    font-weight: 700;
    margin-right: 6px;
}

/* Let the wide table scroll rather than overflow on small screens */
@media (max-width: 782px) {
    .fantasy-admin-table { display: block; overflow-x: auto; white-space: nowrap; }
}

/* ===== PUBLIC RESULTS / LEADERBOARD ===== */

/* League headline banner */
.fantasy-leader-banner {
    margin: 16px 0;
    padding: 14px 18px;
    background: #195c4f;
    color: #fff;
    border-radius: 6px;
}
.fantasy-leader-banner p { margin: 0; font-size: 17px; }
.fantasy-leader-banner strong { color: #ffd24d; }

.fantasy-results-intro {
    margin: 16px 0;
    line-height: 1.4em;
}

/* Search form */
.fantasy-results-search {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin: 0 0 24px;
}
.fantasy-results-search label { font-weight: 700; }
.fantasy-results-search input[type="text"] {
    flex: 1 1 280px;
    max-width: 360px;
    padding: 8px 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
}
.page-fantasy .fantasy-results-search .btn { margin: 0; }

.fantasy-results-heading { margin: 20px 0 12px; }

/* One entry block */
.fantasy-result-entry {
    margin: 0 0 14px;
    padding: 14px 16px;
    border: 1px solid #e2e2e2;
    border-left: 4px solid #195c4f;
    border-radius: 6px;
    background: #fafbfb;
}
.fantasy-result-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 8px 16px;
}
.fantasy-result-pos {
    font-weight: 700;
    color: #fff;
    background: #195c4f;
    padding: 2px 10px;
    border-radius: 10px;
    font-size: 13px;
}
.fantasy-result-name { font-size: 18px; font-weight: 700; }
.fantasy-result-points { margin-left: auto; font-weight: 700; color: #195c4f; }
.fantasy-result-codes { margin: 8px 0 0; font-family: monospace; font-size: 14px; }

/* Per-dog details */
.fantasy-result-details { margin-top: 10px; }
.fantasy-result-details summary {
    cursor: pointer;
    font-weight: 600;
    color: #195c4f;
    padding: 4px 0;
}
/* Same look as the results "Show dog details" summary, but as a static (not
   clickable) heading — used for the "Entry N" titles on the summary page. */
.fantasy-entry-title {
    font-weight: 600;
    color: #195c4f;
    padding: 4px 0;
}
.fantasy-dogs-table {
    width: 100%;
    max-width: 480px;
    margin: 10px 0 4px;
    border-collapse: collapse;
}
.fantasy-dogs-table th,
.fantasy-dogs-table td {
    text-align: left;
    padding: 6px 10px;
    border-bottom: 1px solid #e2e2e2;
    font-size: 14px;
}
.fantasy-dogs-table th { border-bottom: 2px solid #195c4f; white-space: nowrap; }
.fantasy-dogs-table td.mono { font-family: monospace; }
.fantasy-dogs-table td:last-child,
.fantasy-dogs-table th:last-child { text-align: right; }

@media (max-width: 640px) {
    .fantasy-result-points { margin-left: 0; }
}

/* ===== TOP DOGS (default view) ===== */
.fantasy-topdogs { margin: 8px 0 24px; }
.fantasy-topdogs-table { max-width: 560px; }

/* ===== TWO-COLUMN RESULTS (My Entries | My Selected Dogs) ===== */
.fantasy-results-columns {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 24px;
}
.fantasy-results-columns .fantasy-col { flex: 1 1 150px; min-width: 0; }
.fantasy-results-columns .fantasy-col-entries { flex: 1 1 420px; min-width: 0; }
.fantasy-results-columns .fantasy-col-dogs {
    flex: 1 1 320px;
    min-width: 0;
    position: sticky;
    top: 16px;
}
.fantasy-selected-table { max-width: none; }

/* Code chips inside an entry */
.fantasy-code-chip {
    display: inline-block;
    padding: 1px 7px;
    margin: 1px 0;
    border-radius: 9px;
    background: #eef2f1;
    color: #195c4f;
    font-family: monospace;
    cursor: default;
    transition: background .12s ease, color .12s ease;
}

/* ===== HOVER LINKAGE HIGHLIGHTS ===== */
.fantasy-result-entry,
.fantasy-selected-dog,
.fantasy-selected-dog td {
    transition: background .12s ease, box-shadow .12s ease;
}
.fantasy-selected-dog { cursor: default; }

/* Active = the element under the cursor */
.fantasy-result-entry.entry-active {
    border-left-color: #ffb300;
    box-shadow: 0 0 0 2px rgba(25, 92, 79, .25);
}
.fantasy-selected-dog.dog-active > td { background: #fff3d6; }

/* Highlight = the linked element(s) in the other column */
.fantasy-result-entry.entry-highlight {
    background: #fff8e8;
    border-left-color: #ffb300;
}
.fantasy-selected-dog.dog-highlight > td { background: #eaf3f0; }
.fantasy-code-chip.chip-highlight {
    background: #ffb300;
    color: #1a1a1a;
}

@media (max-width: 880px) {
    .fantasy-col-dogs { position: static; }
}




