/* Modern Tameside Badminton Styles
 *
 * Loaded after style.css (compiled Bootstrap), so rules here win on equal
 * specificity. Inter/Poppins are pulled in by a <link> in views/header.ejs rather
 * than an @import here, so the font request isn't queued behind this file.
 */

/* Global Resets & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* font-family now comes from $font-family-sans-serif in bootstrap/style.scss. */
body {
    color: #333;
    line-height: 1.6;
    background: #f8f9fa;
}

/* Navigation Overrides */
nav, .navbar {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%) !important;
    padding: 1rem 0 !important;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar-brand {
    font-family: 'Poppins', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: white !important;
}

.navbar-nav .nav-link {
    color: white !important;
    font-weight: 500;
    transition: all 0.3s ease;
    padding: 0.5rem 1rem !important;
    border-radius: 8px;
    margin: 0 0.25rem;
}

.navbar-nav .nav-link:hover {
    background: rgba(255,255,255,0.1);
    transform: translateY(-2px);
}

.navbar-toggler {
    border-color: rgba(255,255,255,0.3) !important;
}

/* Expanded navbar width budget.
 *
 * views/nav.ejs is navbar-expand-xxl, so the horizontal nav first appears at
 * 1400px. At full size it needs ~1478px (brand 366 + items 1088 + 24 padding),
 * which left just 8px of slack at 1400px — and none at all once another admin
 * item was added, at which point the right-most menu goes off-screen.
 *
 * So trim the brand and the per-link chrome wherever the full-size nav would be
 * tight, and let both return to full size only where there's genuinely room. The
 * brand text is scaled rather than shortened so the wording stays intact.
 *
 * The upper bound is 1750px, not 1600px: the free space `ms-auto` leaves between
 * the brand and the items is what absorbs a new nav item, and at full size that
 * is only ~68px at 1600px — less than one item, so the first item added would
 * have overflowed there. At 1750px full size has ~220px, which is real headroom.
 * test/e2e/nav-viewport.spec.js asserts that free space never drops below
 * MIN_FREE_SPACE, so adding a nav item fails the suite rather than a user's
 * browser. If you add items and it fails, widen this band before shipping. */
@media (min-width: 1400px) and (max-width: 1749.98px) {
    .navbar-brand {
        font-size: 1.05rem;
    }

    .navbar-nav .nav-link {
        padding: 0.5rem 0.55rem !important;
        margin: 0 0.1rem;
    }
}

/* Tall-menu overflow — the vertical counterpart to the width budget above.
 *
 * The navbar is position:sticky, so anything inside it that extends past the
 * bottom of the viewport is genuinely unreachable: page scrolling moves the
 * content behind the nav, not the nav itself. Measured before this rule, with the
 * hamburger and the superadmin Admin menu both open, the nav was ~1040px tall on
 * a 1366x768 laptop and scrolling to the very end of the page still left the last
 * admin items ~254px below the fold. The superadmin menu has 16 items, so this
 * hit admins hardest — exactly the people who need those links.
 *
 * Two rules, because Bootstrap positions dropdowns differently either side of the
 * expand breakpoint, and one rule cannot cover both:
 *   - collapsed (<1400px): .dropdown-menu is position:static, so it's part of the
 *     collapse panel's flow. Scroll the whole panel; capping the dropdown as well
 *     would nest two scroll areas.
 *   - expanded (>=1400px): .dropdown-menu is position:absolute and escapes the
 *     panel, so it needs its own cap. This bit below ~680px of viewport height —
 *     a short window, or any window with devtools docked at the bottom.
 *
 * dvh is declared after vh so browsers that support it use it and the rest fall
 * back — on mobile, vh ignores the browser chrome and would still overflow.
 *
 * The 10rem subtrahend is not arbitrary, and it is the fiddly part. The menu does
 * NOT start at the top of the viewport: views/header.ejs puts `pt-5 mt-4` on
 * <body> (72px) to clear what used to be a fixed-top navbar, and the navbar's own
 * brand/toggler row is another ~64px. So the collapse panel's top edge sits ~136px
 * down when the page is unscrolled. 10rem (160px) covers that worst case with a
 * little slack; once the user scrolls, the sticky nav pins to top:0 and the extra
 * room is simply unused. If that body offset ever changes, the reachability tests
 * in test/e2e/nav-viewport.spec.js are what will tell you this needs retuning. */
@media (max-width: 1399.98px) {
    .navbar-collapse {
        max-height: calc(100vh - 10rem);
        max-height: calc(100dvh - 10rem);
        overflow-y: auto;
        /* Stop the page scrolling once the panel reaches its end. */
        overscroll-behavior: contain;
    }
}

/* Below sm the 366px brand can't share a row with the toggler, so the navbar
 * header wraps to two rows and the collapse panel starts ~40px lower (measured
 * collTop 176 rather than 136) — which overflowed the panel by exactly that much.
 * Shrink the brand so it fits beside the toggler at any width down to ~360px
 * (it's also simply too big on a phone), and still reserve more in case it wraps
 * on something narrower, so 320px-class screens stay correct too. */
@media (max-width: 575.98px) {
    .navbar-brand {
        font-size: 1.15rem;
    }

    .navbar-collapse {
        max-height: calc(100vh - 12rem);
        max-height: calc(100dvh - 12rem);
    }
}

@media (min-width: 1400px) {
    .navbar .dropdown-menu {
        max-height: calc(100vh - 10rem);
        max-height: calc(100dvh - 10rem);
        overflow-y: auto;
    }
}

.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(255, 255, 255, 0.8)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e") !important;
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, rgba(30,60,114,0.95) 0%, rgba(42,82,152,0.95) 100%),
                url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1200 600"><rect fill="%231e3c72" width="1200" height="600"/><circle cx="200" cy="150" r="100" fill="%232a5298" opacity="0.3"/><circle cx="900" cy="400" r="150" fill="%232a5298" opacity="0.2"/></svg>');
    background-size: cover;
    background-position: center;
    color: white;
    padding: 6rem 2rem 4rem;
    text-align: center;
    animation: fadeIn 1s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

.hero h1 {
    font-family: 'Poppins', sans-serif;
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.hero p {
    font-size: 1.3rem;
    margin-bottom: 2rem;
    opacity: 0.95;
}

.cta-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* Button Styles */
.btn-modern-primary {
    padding: 1rem 2rem;
    border-radius: 12px;
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(255,107,107,0.3);
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-modern-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(255,107,107,0.4);
    color: white;
    text-decoration: none;
}

.btn-modern-secondary {
    padding: 1rem 2rem;
    border-radius: 12px;
    background: white;
    color: #1e3c72;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-modern-secondary:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
    color: #1e3c72;
    text-decoration: none;
}

/* Section Styles */
.section {
    padding: 4rem 0;
}

section.all-tables, section.all-tables .container {
    display: flex;
    gap:1em;
}

.section-title {
    font-family: 'Poppins', sans-serif;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 2rem;
    color: #1e3c72;
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Card Styles. The Bootstrap 3 .panel* selectors that used to be grouped in here
   were dropped — this project is on Bootstrap 5 and no view emits them. */
.card, .news-card {
    background: white;
    padding: 2rem;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    margin-bottom: 2rem;
    transition: all 0.3s ease;
    border: none;
    animation: slideUp 0.6s ease-out;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

.card:hover, .news-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 30px rgba(0,0,0,0.12);
}

.card-header {
    background: transparent !important;
    border: none !important;
    padding: 0 0 1rem 0 !important;
}

.card-title {
    font-family: 'Poppins', sans-serif;
    color: #1e3c72;
    font-size: 1.5rem;
    font-weight: 600;
}

.card-body {
    padding: 0 !important;
}

/* Results Grid */
.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.result-card {
    background: white;
    padding: 1.5rem;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    animation: slideUp 0.6s ease-out;
    animation-fill-mode: both;
}

.result-card:nth-child(1) { animation-delay: 0.1s; }
.result-card:nth-child(2) { animation-delay: 0.2s; }
.result-card:nth-child(3) { animation-delay: 0.3s; }
.result-card:nth-child(4) { animation-delay: 0.4s; }
.result-card:nth-child(5) { animation-delay: 0.5s; }
.result-card:nth-child(6) { animation-delay: 0.6s; }

.result-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 30px rgba(0,0,0,0.12);
}

.result-date {
    color: #999;
    font-size: 0.9rem;
    margin-bottom: 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.result-teams {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.8rem;
}

/* Fixtures */
.fixture-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2rem;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(102,126,234,0.3);
    transition: all 0.3s ease;
    animation: slideUp 0.6s ease-out;
}

.fixture-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 30px rgba(102,126,234,0.4);
}

.fixture-date {
    font-size: 1rem;
    opacity: 0.9;
    margin-bottom: 1rem;
}

.fixture-teams {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.fixture-card a {
    color: white;
    text-decoration: none;
    opacity: 0.9;
    transition: opacity 0.3s ease;
}

.fixture-card a:hover {
    opacity: 1;
}

/* Table Styles
 *
 * Bootstrap 5 paints every cell with `background-color: var(--bs-table-bg)` via
 * `.table > :not(caption) > * > *`. That opaque per-cell fill sat on top of the
 * `background` and `color` set on .table and thead below, so none of it was visible:
 * the gradient header rendered as flat grey with dark text, and the row-hover rule
 * never showed. Neutralising the two custom properties is the Bootstrap-native way to
 * let those declarations through, rather than fighting the cell rule with !important.
 */
.table {
    --bs-table-bg: transparent;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.table thead {
    --bs-table-color: white;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: white;
}

.table thead th {
    border: none;
    padding: 1rem;
    font-weight: 600;
}

.table tbody tr {
    transition: background 0.3s ease;
}

.table tbody tr:hover {
    background: #f8f9fa;
}

.table tbody td {
    padding: 1rem;
    border-top: 1px solid #e9ecef;
}

/* Link Styles */
a {
    color: #ff6b6b;
    transition: color 0.3s ease;
}

a:hover {
    color: #ee5a6f;
    text-decoration: none;
}

/* Footer */
footer {
    background: #1e3c72;
    color: white;
    padding: 2rem;
    text-align: center;
    margin-top: 4rem;
}

/* Responsive */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 2.5rem;
    }
    
    .results-grid {
        grid-template-columns: 1fr;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .cta-buttons {
        flex-direction: column;
    }
    
    .btn-modern-primary,
    .btn-modern-secondary {
        width: 100%;
        justify-content: center;
    }
}

/* Alert/Modal Overrides */
.alert {
    border-radius: 12px;
    border: none;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.modal-content {
    border-radius: 16px;
    border: none;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

.modal-header {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: white;
    border-radius: 16px 16px 0 0;
}

/* Form Styles */
.form-control {
    border-radius: 8px;
    border: 2px solid #e9ecef;
    padding: 0.75rem;
    transition: all 0.3s ease;
}

.form-control:focus {
    border-color: #2a5298;
    box-shadow: 0 0 0 0.2rem rgba(42,82,152,0.25);
}

/* Clubs Page Styles */
.clubs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.club-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    overflow: hidden;
    transition: all 0.3s ease;
    animation: slideUp 0.6s ease-out;
}

.club-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
}

.club-header {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    padding: 1.5rem;
    color: white;
}

.club-name {
    margin: 0;
    font-family: 'Poppins', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
}

.club-name a {
    color: white;
    text-decoration: none;
    transition: opacity 0.3s ease;
}

.club-name a:hover {
    opacity: 0.9;
}

.club-info {
    padding: 1.5rem;
}

.info-item {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #e9ecef;
}

.info-item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.info-label {
    font-weight: 600;
    color: #1e3c72;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.info-content {
    color: #333;
    line-height: 1.6;
}

.team-info {
    margin-bottom: 1rem;
    padding-left: 1rem;
    border-left: 3px solid #ff6b6b;
}

.team-info:last-child {
    margin-bottom: 0;
}

.venue-link {
    color: #2a5298;
    text-decoration: none;
    transition: color 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.venue-link:hover {
    color: #ff6b6b;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

/* Map styling */
#map {
    width: 100%;
}

.alert-danger {
    background: linear-gradient(135deg, #f56565 0%, #e53e3e 100%);
    color: white;
}

/* Responsive adjustments for clubs */
@media (max-width: 768px) {
    .clubs-grid {
        grid-template-columns: 1fr;
    }
    
    .club-info {
        padding: 1rem;
    }
}

/* Results Page Styles */
.results-header {
    background: linear-gradient(135deg, rgba(30,60,114,0.95) 0%, rgba(42,82,152,0.95) 100%);
    color: white;
    padding: 2rem 0;
    margin-bottom: 2rem;
}

.results-header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.results-header h1 {
    font-family: 'Poppins', sans-serif;
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0;
}

.header-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.action-btn {
    background: rgba(255,255,255,0.15);
    color: white;
    padding: 0.75rem 1.25rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    backdrop-filter: blur(10px);
}

.action-btn:hover, .action-btn.active {
    background: rgba(255,255,255,0.25);
    color: white;
    transform: translateY(-2px);
}

/* Admin Info */
.admin-info {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 1rem 0;
    margin-bottom: 1rem;
}

.info-card {
    background: rgba(255,255,255,0.95);
    padding: 1rem 1.5rem;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.info-card i {
    font-size: 2rem;
    color: #667eea;
}

/* Filter toolbar (views/filters.ejs)
 *
 * One compact row of selects that reload the page, then a chip per applied
 * filter. Replaced a 2rem-padded card of 200px grid cells that pushed the table
 * a long way down the page, and whose selects never showed what was applied.
 * The table's own controls (columns, page size, search) live in the .dt-controls
 * band further down, attached to the table itself.
 */
.filters-section {
    background: #f8f9fa;
    padding: 1.5rem 0;
    margin-bottom: 1.5rem;
    border-radius: 12px;
}

.filter-toolbar {
    background: white;
    padding: 1.25rem 1.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    margin-bottom: 1.5rem;
}

.filter-toolbar-form {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 1rem;
}

.filter-fields {
    display: flex;
    flex: 1 1 auto;
    flex-wrap: wrap;
    gap: 0.75rem 1rem;
}

.filter-field {
    display: flex;
    flex: 1 1 9.5rem;
    flex-direction: column;
    min-width: 9.5rem;
}

.filter-field label {
    margin-bottom: 0.3rem;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: #1e3c72;
}

.filter-field label i {
    margin-right: 0.3rem;
    opacity: 0.75;
}

.filter-field select.form-control {
    height: auto;
    padding: 0.4rem 0.5rem;
    font-size: 0.9rem;
}

.filter-apply {
    flex: 0 0 auto;
    white-space: nowrap;
}

/* Applied filters: each chip links to the same page minus that one filter. */
.filter-chips {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
    padding-top: 0.9rem;
    border-top: 1px solid #e9ecef;
}

.filter-chips-label {
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: #6c757d;
}

.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.25rem 0.65rem;
    border: 1px solid #d4ddf2;
    border-radius: 999px;
    background: #eef2fb;
    color: #1e3c72;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.filter-chip:hover,
.filter-chip:focus {
    background: #dbe4f7;
    border-color: #1e3c72;
    color: #1e3c72;
    text-decoration: none;
}

.filter-chip i {
    font-size: 0.7rem;
    opacity: 0.7;
}

.filter-clear {
    margin-left: auto;
    color: #6c757d;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
}

.filter-clear:hover {
    color: #dc3545;
    text-decoration: underline;
}

/* DataTables control band (views/datatables-controls.ejs)
 *
 * DataTables' own length/search/pagination controls, gathered into one bar above
 * the table and one below it, instead of the four loose blocks its Bootstrap-4
 * default layout scatters around. Buttons (the Columns dropdown, and the
 * "Search columns" toggle where a view opts in) render into .dt-controls-left.
 */
.dt-controls,
.dt-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
}

.dt-controls {
    border-bottom: none;
    border-radius: 12px 12px 0 0;
}

.dt-footer {
    border-top: none;
    border-radius: 0 0 12px 12px;
}

.dt-controls-left,
.dt-controls-right {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
}

.dt-controls .dataTables_length,
.dt-controls .dataTables_filter,
.dt-footer .dataTables_info,
.dt-footer .dataTables_paginate {
    margin: 0;
    padding: 0;
}

.dt-controls .dataTables_length label,
.dt-controls .dataTables_filter label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin: 0;
    color: #495057;
    font-size: 0.85rem;
    font-weight: 600;
    text-align: left;
}

.dt-controls select,
.dt-controls input[type="search"] {
    padding: 0.3rem 0.55rem;
    border: 1px solid #ced4da;
    border-radius: 8px;
    font-size: 0.85rem;
}

.dt-controls input[type="search"] {
    min-width: 12rem;
}

.dt-footer .dataTables_info {
    color: #6c757d;
    font-size: 0.85rem;
}

/* A table with many pages produces a long numbered pager - 27 pages of players
 * came to 405px, which pushed the whole page into horizontal scroll on a phone.
 * Let it wrap onto more than one line and let both footer items shrink. */
.dt-footer .dt-info,
.dt-footer .dt-pager {
    min-width: 0;
}

.dt-footer .pagination {
    flex-wrap: wrap;
    margin: 0;
}

/* Buttons: Columns (ColVis) and the Search columns toggle. Overrides both
 * Bootstrap's .btn-secondary and the DataTables Buttons default styling. */
.dt-controls .dt-buttons .dt-btn,
.dt-controls .dt-buttons .dt-btn.btn {
    padding: 0.3rem 0.7rem;
    border: 1px solid #ced4da;
    border-radius: 8px;
    background: white;
    color: #1e3c72;
    font-size: 0.85rem;
    font-weight: 600;
    box-shadow: none;
}

.dt-controls .dt-buttons .dt-btn:hover,
.dt-controls .dt-buttons .dt-btn.btn:hover {
    border-color: #1e3c72;
    background: #eef2fb;
    color: #1e3c72;
}

.dt-controls .dt-buttons .dt-btn.active,
.dt-controls .dt-buttons .dt-btn.btn.active {
    border-color: #1e3c72;
    background: #1e3c72;
    color: white;
}

.dt-controls .dt-buttons .dt-btn i {
    margin-right: 0.35rem;
    opacity: 0.8;
}

/* ColVis dropdown. The visible menu is the .dropdown-menu inside the
 * positioning wrapper, so it - not the wrapper - carries the styling. */
.dt-button-collection .dropdown-menu {
    padding: 0.35rem;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
}

.dt-button-collection .dt-button {
    display: block;
    width: 100%;
    padding: 0.35rem 0.6rem;
    border: none;
    border-radius: 6px;
    background: white;
    color: #495057;
    font-size: 0.85rem;
    text-align: left;
}

.dt-button-collection .dt-button:hover {
    background: #eef2fb;
    color: #1e3c72;
}

.dt-button-collection .dt-button.active {
    background: #eef2fb;
    color: #1e3c72;
    font-weight: 600;
}

/* Wrapper the DataTables views put around their table. Deliberately has no
 * overflow of its own: the horizontal scroller is the .table-responsive that
 * DataTables builds around just the table (see datatables-controls.ejs), so the
 * control bands and the Columns dropdown aren't inside a clipping box. */
.dt-table-shell {
    width: 100%;
}

/* Per-column search row, revealed by the Search columns toggle. It used to be
 * permanently visible, which made every header two rows tall and made the input
 * row read as the table's first data row. */
.dt-colsearch-row {
    display: none;
}

table.colsearch-on .dt-colsearch-row {
    display: table-row;
}

.dt-colsearch-row th {
    padding: 0.4rem 0.5rem;
    background: #f1f3f6;
}

.dt-colsearch-row input {
    width: 100%;
    padding: 0.25rem 0.45rem;
    border: 1px solid #ced4da;
    border-radius: 6px;
    color: #212529;
    font-size: 0.8rem;
    font-weight: 400;
}

/* Results Section */
.results-section {
    padding: 2rem 0;
}

.table-container {
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    animation: slideUp 0.6s ease-out;
}

/* Modern Table Styles */
.modern-table {
    margin: 0;
    width: 100%;
}

.modern-table thead {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: white;
}

.modern-table thead th {
    padding: 1.25rem 1rem;
    font-weight: 600;
    border: none;
    white-space: nowrap;
}

.modern-table tbody tr {
    transition: all 0.3s ease;
    border-bottom: 1px solid #e9ecef;
}

.modern-table tbody tr:hover {
    background: #f8f9fa;
    transform: scale(1.01);
}

.modern-table tbody td {
    padding: 1rem;
    vertical-align: middle;
}

/* Status Colors */
.status-overdue {
    background: rgba(220, 53, 69, 0.1);
    border-left: 4px solid #dc3545;
}

.status-rearranging,
.status-rearranged {
    background: rgba(255, 193, 7, 0.1);
    border-left: 4px solid #ffc107;
}

.status-tournament {
    background: rgba(102, 126, 234, 0.1);
    border-left: 4px solid #667eea;
}

.status-conceded,
.status-void {
    background: rgba(108, 117, 125, 0.1);
    border-left: 4px solid #6c757d;
}

/* Cell Styles */
.date-cell {
    color: #6c757d;
    font-weight: 500;
}

.venue-icon {
    color: #ff6b6b;
    margin-right: 0.5rem;
    transition: color 0.3s ease;
}

.venue-icon:hover {
    color: #ee5a6f;
}

.result-cell {
    font-weight: 600;
}

/* Merged from two blocks. font-size/color came from the later one and won; the
   gradient-text treatment came from the earlier one and still applies. Note the
   -webkit-text-fill-color makes `color` a fallback for non-webkit engines only. */
.score {
    font-size: 1.2rem;
    font-weight: 700;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    padding: 0 1rem;
    color: #1e3c72;
}

.status-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-left: 0.5rem;
}

.status-badge.status-pending {
    background: #ffc107;
    color: #856404;
}

.status-badge.lewis-prelim {
    background: #ddeeff;
    color: #1a4a7a;
}

.status-badge.lewis-r1 {
    background: #c0d8f8;
    color: #0d3566;
}

.status-badge.lewis-qf {
    background: #2980b9;
    color: #fff;
}

.social-link,
.details-link,
.action-link {
    font-size: 0.9rem;
    color: #2a5298;
    text-decoration: none;
    transition: color 0.3s ease;
}

.social-link:hover,
.details-link:hover,
.action-link:hover {
    color: #ff6b6b;
}

/* Grid View Styles */
.division-header {
    margin: 2rem 0 1rem;
}

.division-header h3 {
    font-family: 'Poppins', sans-serif;
    color: #1e3c72;
    font-size: 1.8rem;
    font-weight: 700;
}

.grid-table-wrapper {
    margin-bottom: 3rem;
}

.grid-table {
    margin: 0;
    border-collapse: separate;
    border-spacing: 0;
}

.grid-table th,
.grid-table td {
    border: 2px solid #e9ecef;
    padding: 0.75rem;
    text-align: center;
    min-width: 80px;
}

/* The three navy-gradient cells below all need white text, and all three are cells of
 * a .table, so Bootstrap's `.table > :not(caption) > * > *` paints them with
 * `color: var(--bs-table-color)`. That selector scores 0,1,1 — it beats a bare
 * `.team-row-header` (0,1,0) and only ties `.grid-header th`. The grid's header row is
 * a plain <tr>, not a <thead>, so it never picked up the `--bs-table-color: white` set
 * on `.table thead` above and fell back to Bootstrap's dark default. Setting the
 * variable on each is the same Bootstrap-native fix used for thead, and unlike `color`
 * it doesn't depend on winning a specificity tie.
 */
.grid-header th {
    --bs-table-color: #fff;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: white;
    font-weight: 600;
    position: sticky;
    top: 0;
    z-index: 10;
}

#results-grid .team-header {
    display:table-cell;
    vertical-align: middle;
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    max-width: 40px;
    font-size: 0.85rem;
}

.team-row-header {
    --bs-table-color: #fff;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: white;
    font-weight: 600;
    text-align: left;
    position: sticky;
    left: 0;
    z-index: 5;
}

.corner-cell {
    --bs-table-color: #fff;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    position: sticky;
    left: 0;
    top: 0;
    z-index: 15;
}

.empty-cell {
    background: #f8f9fa;
    border-color: #dee2e6;
}

.result-cell.cell-overdue {
    background: rgba(220, 53, 69, 0.2);
    color: #721c24;
    font-weight: 600;
}

.result-cell.cell-rearranging {
    background: rgba(255, 193, 7, 0.2);
    color: #856404;
    font-weight: 600;
}

.result-cell.cell-conceded,
.result-cell.cell-void {
    background: rgba(108, 117, 125, 0.2);
    color: #495057;
    font-weight: 600;
}

.date-mini {
    font-size: 0.75rem;
    color: #6c757d;
}

.score-display {
    font-weight: 700;
    font-size: 1rem;
    color: #1e3c72;
}

.void-text {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: #6c757d;
}

/* Responsive Tables */
@media (max-width: 768px) {
    .results-header h1 {
        font-size: 1.8rem;
    }
    
    .header-actions {
        width: 100%;
        justify-content: flex-start;
    }
    
    .action-btn {
        flex: 1;
        justify-content: center;
    }
    
    /* Two filters per row rather than one: six stacked full-width selects made
     * the toolbar 645px tall, most of a phone screen before any data. */
    .filter-fields {
        gap: 0.6rem;
    }

    .filter-field {
        flex: 1 1 calc(50% - 0.3rem);
        min-width: 0;
    }

    .filter-apply {
        width: 100%;
    }

    .dt-controls,
    .dt-footer {
        justify-content: flex-start;
    }

    .dt-controls input[type="search"] {
        min-width: 0;
    }
    
    .modern-table {
        font-size: 0.9rem;
    }
    
    .modern-table thead th,
    .modern-table tbody td {
        padding: 0.75rem 0.5rem;
    }
    
    .grid-table {
        font-size: 0.75rem;
    }
    
    .team-row-header {
        font-size: 0.75rem;
        max-width: 100px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
}

/* Tournament Bracket Styles */
.bracket-section {
    padding: 3rem 0;
    background: #f8f9fa;
    overflow-x: auto;
}

.tournament-bracket {
    display: flex;
    gap: 3rem;
    min-width: max-content;
    padding: 2rem;
    animation: fadeIn 1s ease-in;
}

.bracket-round {
    display: flex;
    flex-direction: column;
    min-width: 280px;
}

.round-title {
    font-family: 'Poppins', sans-serif;
    font-size: 1.2rem;
    font-weight: 700;
    color: #1e3c72;
    text-align: center;
    margin-bottom: 2rem;
    padding: 0.75rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

.round-matches {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    flex: 1;
    gap: 1rem;
    position: relative;
}

.match-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    margin: 0.5rem 0;
    z-index: 1;
}

.match-wrapper.spacer {
    visibility: hidden;
}

.match-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    overflow: hidden;
    transition: all 0.3s ease;
    width: 100%;
    border: 2px solid transparent;
    position: relative;
    z-index: 2;
}

.match-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(0,0,0,0.12);
}

.match-card.completed {
    border-color: #28a745;
}

.match-card.pending {
    border-color: #ffc107;
}

.match-header {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    padding: 0.5rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.match-number {
    color: white;
    font-weight: 600;
    font-size: 0.85rem;
}

.match-status {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.match-status.completed {
    background: rgba(40, 167, 69, 0.2);
    color: #28a745;
}

.match-status.pending {
    background: rgba(255, 193, 7, 0.2);
    color: #ffc107;
}

.match-teams {
    padding: 0.5rem;
}

.team {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin: 0.25rem 0;
    transition: all 0.3s ease;
    background: #f8f9fa;
}

.team:hover {
    background: #e9ecef;
}

.team.winner {
    background: linear-gradient(135deg, rgba(40, 167, 69, 0.15) 0%, rgba(40, 167, 69, 0.05) 100%);
    border-left: 4px solid #28a745;
    font-weight: 700;
}

/* Single source of truth for .team-name. Three separate blocks used to set this;
   the last one won every property, so these are the values that were actually
   rendering (note font-weight 500, not the 600 the earlier blocks asked for). */
.team-name {
    flex: 1;
    color: #333;
    font-weight: 500;
}

.team.winner .team-name {
    color: #1e3c72;
    font-weight: 700;
}

.team-score {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1e3c72;
    min-width: 40px;
    text-align: center;
}

.team.winner .team-score {
    color: #28a745;
}

/* Bracket Connectors - Fixed Visibility */
.connector {
    position: absolute;
    right: -3rem;
    width: 3rem;
    pointer-events: none;
    z-index: 0;
}

/* Hide all connectors by default for spacers and last round */
.match-wrapper.spacer .connector,
.bracket-round:last-child .connector {
    display: none !important;
}

/* Round 1: Simple pair connections */
.bracket-round[data-round="1"] .match-wrapper:not(.spacer) .connector {
    top: 50%;
    height: 50%;
    border-right: 2px solid #dee2e6;
}

.bracket-round[data-round="1"] .match-wrapper:not(.spacer):nth-child(even) .connector {
    border-bottom: 2px solid #030f1c;
    top: 0;
}

.bracket-round[data-round="1"] .match-wrapper:not(.spacer):nth-child(odd) .connector {
    border-top: 2px solid #030f1c;
}

/* Round 2: Connect to semifinals */
.bracket-round[data-round="2"] .match-wrapper .connector {
    top: 50%;
    height: 100%;
    border-right: 2px solid #dee2e6;
}

.bracket-round[data-round="2"] .match-wrapper:nth-child(even) .connector {
    border-bottom: 2px solid #dee2e6;
    top: -50%;
}

.bracket-round[data-round="2"] .match-wrapper:nth-child(odd) .connector {
    border-top: 2px solid #dee2e6;
}

/* Round 3: Connect to final */
.bracket-round[data-round="3"] .match-wrapper .connector {
    top: 50%;
    height: 200%;
    border-right: 2px solid #dee2e6;
}

.bracket-round[data-round="3"] .match-wrapper:nth-child(even) .connector {
    border-bottom: 2px solid #dee2e6;
    top: -150%;
}

.bracket-round[data-round="3"] .match-wrapper:nth-child(odd) .connector {
    border-top: 2px solid #dee2e6;
}

/* Champion Section */
.champion-section {
    margin-top: 3rem;
    padding: 2rem 0;
    display: flex;
    justify-content: center;
}

.champion-card {
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
    padding: 3rem;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(255, 215, 0, 0.3);
    text-align: center;
    max-width: 500px;
    position: relative;
    overflow: hidden;
    animation: slideUp 1s ease-out;
}

.champion-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    transform: rotate(45deg);
    animation: shine 3s infinite;
}

@keyframes shine {
    0% { transform: translateX(-100%) translateY(-100%) rotate(45deg); }
    100% { transform: translateX(100%) translateY(100%) rotate(45deg); }
}

.trophy-icon {
    font-size: 4rem;
    color: #1e3c72;
    margin-bottom: 1rem;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.champion-card h2 {
    font-family: 'Poppins', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: #1e3c72;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.champion-card h3 {
    font-family: 'Poppins', sans-serif;
    font-size: 2.5rem;
    font-weight: 700;
    color: #1e3c72;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
}

.champion-card .score-display {
    font-size: 1.1rem;
    color: #495057;
    font-weight: 600;
}

/* Responsive Bracket */
@media (max-width: 1400px) {
    .tournament-bracket {
        gap: 2rem;
    }
    
    .bracket-round {
        min-width: 240px;
    }
    
    .connector {
        right: -2rem;
        width: 2rem;
    }
}

@media (max-width: 1200px) {
    .bracket-section {
        padding: 2rem 0;
    }
    
    .tournament-bracket {
        padding: 1rem;
        gap: 1.5rem;
    }
    
    .bracket-round {
        min-width: 200px;
    }
    
    .round-title {
        font-size: 1rem;
        padding: 0.5rem;
    }
    
    .connector {
        right: -1.5rem;
        width: 1.5rem;
    }
}

@media (max-width: 768px) {
    .bracket-section {
        padding: 1rem 0;
    }
    
    .tournament-bracket {
        gap: 1rem;
        padding: 0.5rem;
    }
    
    .bracket-round {
        min-width: 180px;
    }
    
    .match-card {
        font-size: 0.9rem;
    }
    
    .team-name {
        font-size: 0.85rem;
    }
    
    .team-score {
        font-size: 1.2rem;
    }
    
    .champion-card {
        padding: 2rem 1rem;
    }
    
    .champion-card h3 {
        font-size: 1.8rem;
    }
    
    .trophy-icon {
        font-size: 3rem;
    }
}
/* Club Contact Page Styles */
.gdpr-warning {
    padding: 2rem 0 1rem;
}

.alert-modern {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.5rem;
    border-radius: 12px;
    border: none;
    box-shadow: 0 4px 20px rgba(255, 193, 7, 0.2);
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.15) 0%, rgba(255, 193, 7, 0.05) 100%);
    border-left: 4px solid #ffc107;
}

.alert-modern .alert-icon {
    font-size: 2rem;
    color: #856404;
    flex-shrink: 0;
}

.alert-modern .alert-content {
    flex: 1;
}

.alert-modern strong {
    color: #856404;
    font-size: 1.1rem;
    display: block;
    margin-bottom: 0.5rem;
}

.alert-modern p {
    color: #664d03;
    line-height: 1.6;
}

.info-card-main {
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    overflow: hidden;
    height: 100%;
    animation: slideUp 0.6s ease-out;
}

.card-header-custom {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    padding: 1.5rem 2rem;
    color: white;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.card-header-custom i {
    font-size: 2rem;
}

.card-header-custom h2 {
    margin: 0;
    font-family: 'Poppins', sans-serif;
    font-size: 1.75rem;
    font-weight: 700;
}

.info-section {
    padding: 2rem;
}

.info-block {
    margin-bottom: 2rem;
}

.info-block:last-child {
    margin-bottom: 0;
}

.info-block h3 {
    font-family: 'Poppins', sans-serif;
    font-size: 1.2rem;
    font-weight: 700;
    color: #1e3c72;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.info-block h3 i {
    color: #ff6b6b;
}

.venue-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 0.25rem;
    font-size: 1.05rem;
}

.venue-address {
    color: #6c757d;
    line-height: 1.6;
    margin: 0;
}

.officials-section {
    padding: 2rem;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
}

.officials-section h3 {
    font-family: 'Poppins', sans-serif;
    font-size: 1.2rem;
    font-weight: 700;
    color: #1e3c72;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.officials-section h3 i {
    color: #ff6b6b;
}

.official-card {
    background: white;
    padding: 1.25rem;
    border-radius: 12px;
    margin-bottom: 1rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
}

.official-card:last-child {
    margin-bottom: 0;
}

.official-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.official-role {
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    color: #6c757d;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

.official-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1e3c72;
    margin-bottom: 0.75rem;
}

.official-contacts {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.contact-link {
    color: #2a5298;
    text-decoration: none;
    font-size: 0.95rem;
    transition: color 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.contact-link:hover {
    color: #ff6b6b;
}

.contact-link i {
    width: 20px;
    text-align: center;
}

/* Teams Grid */
.teams-grid {
    padding: 2rem;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.team-captain-card {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 1.25rem;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.team-captain-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.08);
    border-color: #2a5298;
    background: white;
}

.team-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #dee2e6;
}

.team-badge {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.team-header h4 {
    margin: 0;
    font-family: 'Poppins', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: #1e3c72;
}

.captain-info {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.captain-name {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #333;
}

.captain-name i {
    color: #2a5298;
}

.captain-contacts {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Responsive Club Contact */
@media (max-width: 768px) {
    .card-header-custom {
        padding: 1rem 1.5rem;
    }
    
    .card-header-custom h2 {
        font-size: 1.3rem;
    }
    
    .card-header-custom i {
        font-size: 1.5rem;
    }
    
    .info-section,
    .officials-section,
    .teams-grid {
        padding: 1.5rem;
    }
    
    .teams-grid {
        grid-template-columns: 1fr;
    }
    
    .alert-modern {
        flex-direction: column;
        text-align: center;
    }
    
    .alert-modern .alert-icon {
        align-self: center;
    }
}