/* ── Hidden utility ── */
.hidden { display: none; }

/* ── Page title ── */
.page-title { margin: 0; }

/* ── Loading ── */
.loading-text { color: #666; padding: 20px 0; }

/* ── Archived toggle button ── */
.btn-archived-toggle { font-size: 0.85em; white-space: nowrap; }

/* ── Page header ── */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

/* ── Competition card buttons — fully self-contained, no dependency on layout.css .btn ── */
.btn-comp {
    display: inline-block;
    padding: 10px 18px;
    font-size: 0.9em;
    font-weight: 700;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s;
    text-align: center;
    white-space: nowrap;
}
.btn-comp.btn-primary   { background: var(--cricket-blue);  color: white; }
.btn-comp.btn-success   { background: var(--cricket-green); color: white; }
.btn-comp.btn-warning   { background: #F57C00; color: white; }
.btn-comp.btn-danger    { background: var(--png-red); color: white; }
.btn-comp.btn-secondary { background: #616161; color: white; }
.btn-comp.btn-primary:hover   { background: #1565C0; }
.btn-comp.btn-success:hover   { background: #1B5E20; }
.btn-comp.btn-warning:hover   { background: #E65100; }
.btn-comp.btn-danger:hover    { background: #A00E1E; }
.btn-comp.btn-secondary:hover { background: #424242; }
.btn-comp.btn-points {
    background: white;
    color: var(--cricket-blue);
    border: 2px solid var(--cricket-blue);
    padding: 8px 18px;
}
.btn-comp.btn-points:hover { background: var(--cricket-blue); color: white; }

/* ── Competition card ── */
.competition-card {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
    border-left: 6px solid var(--png-red);
    transition: all 0.3s;
    position: relative;
}
.competition-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}
.competition-card.status-in-progress { border-left-color: var(--cricket-green); }
.competition-card.status-completed   { border-left-color: #616161; }
.competition-card.status-cancelled   { border-left-color: #9e9e9e; opacity: 0.75; }
.competition-card.status-archived    { border-left-color: #bdbdbd; opacity: 0.80; }

/* ── Card internals ── */
.comp-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 12px;
}
.comp-card-title-wrap { flex: 1; }
.comp-card-title      { margin: 0 0 6px 0; color: var(--png-red); font-size: 1.3em; }
.comp-card-link       { text-decoration: none; color: inherit; }
.comp-card-link:hover { text-decoration: underline; }
.comp-card-season     { color: #888; font-size: 0.9em; }
.comp-card-desc       { color: #666; font-size: 0.9em; margin-bottom: 12px; line-height: 1.5; }
.comp-card-dates      { color: #888; font-size: 0.85em; margin-bottom: 14px; }
.comp-card-actions    { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 5px; }

/* ── Competitions grid ── */
.comp-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; margin-top: 10px; }

/* ── No results ── */
.no-results-msg { color: #888; padding: 20px 0; }

/* ── Status badge ── */
.comp-status-badge {
    display: inline-block;
    padding: 5px 14px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 0.8em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.comp-status-badge.upcoming    { background: #FFF3E0; color: #E65100; }
.comp-status-badge.in-progress { background: #E8F5E9; color: var(--cricket-green); }
.comp-status-badge.completed   { background: #ECEFF1; color: #546E7A; }
.comp-status-badge.cancelled   { background: #FAFAFA; color: #9E9E9E; }
.comp-status-badge.archived    { background: #F5F5F5; color: #757575; }

/* ── Comp stats strip ── */
.comp-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin: 15px 0;
    background: #f9f9f9;
    border-radius: 8px;
    padding: 12px;
}
.comp-stat { text-align: center; }
.comp-stat .stat-value {
    font-size: 1.6em;
    font-weight: 700;
    color: var(--png-red);
    line-height: 1;
}
.comp-stat .stat-label {
    font-size: 0.75em;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 3px;
}

/* ── Search bar ── */
.comp-search-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}
.comp-search-bar input[type="text"] {
    flex: 1;
    padding: 9px 14px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 0.95em;
    transition: border-color 0.2s;
}
.comp-search-bar input[type="text"]:focus {
    outline: none;
    border-color: var(--png-red);
}
.comp-search-count { font-size: 0.88em; color: #888; white-space: nowrap; }

/* ── Filter tabs ── */
.filter-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.filter-tab {
    padding: 8px 18px;
    border-radius: 20px;
    border: 2px solid #ddd;
    background: white;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9em;
    transition: all 0.2s;
    color: #555;
}
.filter-tab:hover,
.filter-tab.active {
    background: var(--png-red);
    border-color: var(--png-red);
    color: white;
}

/* ── Empty state ── */
.empty-state          { text-align: center; padding: 50px 10px; }
.empty-state .empty-icon { font-size: 3.5em; margin-bottom: 15px; }
.empty-state h3        { color: var(--cricket-blue); margin-bottom: 10px; }
.empty-state p         { color: #666; max-width: 480px; margin: 0 auto 20px; line-height: 1.6; }

/* ── Mobile ── */
@media (max-width: 768px) { .comp-search-bar { flex-wrap: wrap; } }
@media (max-width: 640px) { .comp-grid { grid-template-columns: 1fr; } }

/* ── Search/filter loading overlay — dims grid without hiding it ── */
.comp-loading-overlay {
    opacity: 0.4;
    pointer-events: none;
    transition: opacity 0.15s;
}

/* ── Pagination bar ── */
.pagination-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    padding: 14px 4px 6px;
    font-size: 0.88em;
}

.pg-info {
    color: #888;
    white-space: nowrap;
    min-width: 90px;
}

.pg-controls {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

.pg-prev,
.pg-next {
    padding: 6px 12px;
    border: 1.5px solid #ddd;
    border-radius: 6px;
    background: white;
    color: #444;
    font-weight: 600;
    font-size: 0.9em;
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
}
.pg-prev:hover:not(:disabled),
.pg-next:hover:not(:disabled) {
    background: var(--cricket-blue);
    border-color: var(--cricket-blue);
    color: white;
}
.pg-prev:disabled,
.pg-next:disabled {
    opacity: 0.35;
    cursor: default;
}

.pg-nums {
    display: flex;
    align-items: center;
    gap: 3px;
}

.pg-num {
    min-width: 34px;
    height: 34px;
    padding: 0 6px;
    border: 1.5px solid #ddd;
    border-radius: 6px;
    background: white;
    color: #444;
    font-weight: 600;
    font-size: 0.88em;
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
}
.pg-num:hover {
    background: #f0f4ff;
    border-color: var(--cricket-blue);
    color: var(--cricket-blue);
}
.pg-num.active {
    background: var(--cricket-blue);
    border-color: var(--cricket-blue);
    color: white;
    cursor: default;
}

.pg-ellipsis {
    padding: 0 4px;
    color: #aaa;
    user-select: none;
}

.pg-size-select {
    padding: 6px 10px;
    border: 1.5px solid #ddd;
    border-radius: 6px;
    font-size: 0.88em;
    font-family: inherit;
    color: #444;
    background: white;
    cursor: pointer;
    transition: border-color 0.2s;
}
.pg-size-select:focus {
    outline: none;
    border-color: var(--cricket-blue);
}

@media (max-width: 600px) {
    .pagination-bar { justify-content: center; }
    .pg-info { width: 100%; text-align: center; }
}
