/* ============================================================
   Bronte Tournament Manager — Public Styles
   Designed to sit cleanly within a typical WordPress theme.
   ============================================================ */

/* ---- View toggle ---- */
.btm-view-toggle {
    display: flex;
    justify-content: flex-end;
    gap: 4px;
    margin-bottom: 14px;
}
.btm-view-toggle__btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border: 1px solid #ccc;
    border-radius: 5px;
    background: #fff;
    color: #888;
    cursor: pointer;
    transition: background .15s, color .15s, border-color .15s;
}
.btm-view-toggle__btn:hover {
    border-color: #2b5329;
    color: #2b5329;
}
.btm-view-toggle__btn--active {
    background: #2b5329;
    border-color: #2b5329;
    color: #fff !important;
}

/* ---- List-view column header ---- */
.btm-list-header {
    display: none; /* shown only in list mode */
    padding: 6px 16px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: #888;
    border-bottom: 2px solid #e0e0e0;
    margin-bottom: 4px;
}

/* ============================================================
   GRID VIEW (default)
   ============================================================ */
.btm-view--grid .btm-list-header { display: none; }

.btm-view--grid .btm-tournaments-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.btm-view--grid .btm-tournament-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 2px 8px rgba(0,0,0,.07);
    transition: box-shadow .2s, transform .2s;
}
.btm-view--grid .btm-tournament-card:hover {
    box-shadow: 0 6px 20px rgba(0,0,0,.12);
    transform: translateY(-2px);
}

/* Grid: name col is the card body */
.btm-view--grid .btm-card__col-name {
    padding: 18px 18px 10px;
    flex: 1;
}
.btm-view--grid .btm-card__col-date,
.btm-view--grid .btm-card__col-venue {
    padding: 2px 18px;
}
.btm-view--grid .btm-card__col-deadline {
    padding: 4px 18px 10px;
}

/* Grid: actions col becomes the card footer */
.btm-view--grid .btm-card__col-actions {
    padding: 12px 18px;
    border-top: 1px solid #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

/* ============================================================
   LIST VIEW
   ============================================================ */
.btm-view--list .btm-list-header {
    display: grid;
    grid-template-columns: 28% 16% 22% 16% 18%;
    align-items: center;
}
.btm-view--list .btm-tournaments-grid {
    display: flex;
    flex-direction: column;
    gap: 0;
    list-style: none;
    margin: 0;
    padding: 0;
}
.btm-view--list .btm-tournament-card {
    display: grid;
    grid-template-columns: 28% 16% 22% 16% 18%;
    align-items: center;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-bottom: none;
    padding: 14px 16px;
    transition: background .15s;
}
.btm-view--list .btm-tournament-card:first-child {
    border-radius: 8px 8px 0 0;
}
.btm-view--list .btm-tournament-card:last-child {
    border-bottom: 1px solid #e0e0e0;
    border-radius: 0 0 8px 8px;
}
.btm-view--list .btm-tournament-card:only-child {
    border-radius: 8px;
}
.btm-view--list .btm-tournament-card:hover {
    background: #f9fdf9;
}

/* List: name col */
.btm-view--list .btm-card__col-name {
    padding-right: 16px;
}
.btm-view--list .btm-card__col-name .btm-card__description {
    display: none; /* too verbose in list view */
}

/* List: date, venue, deadline cols */
.btm-view--list .btm-card__col-date,
.btm-view--list .btm-card__col-venue,
.btm-view--list .btm-card__col-deadline {
    padding-right: 12px;
    font-size: 13px;
}

/* List: actions col */
.btm-view--list .btm-card__col-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
}
.btm-view--list .btm-card__col-actions .btm-card__ctas {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

/* ============================================================
   Shared card element styles (both layouts)
   ============================================================ */
.btm-card__name {
    font-size: 1rem;
    font-weight: 700;
    margin: 0 0 4px;
    color: #1a1a1a;
    line-height: 1.3;
}

.btm-card__rounds-banner {
    display: inline-block;
    background: #e8f5e9;
    color: #2b5329;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .6px;
    padding: 3px 10px;
    border-radius: 12px;
    margin-bottom: 6px;
}

.btm-card__meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #555;
    margin-bottom: 3px;
}
.btm-card__meta svg { flex-shrink: 0; color: #2b5329; }

.btm-card__deadline-past {
    font-size: 12px;
    font-weight: 600;
    color: #c62828;
}
.btm-card__meta-empty { color: #bbb; font-size: 13px; }

.btm-card__description {
    font-size: 13px;
    color: #777;
    margin: 4px 0 0;
    line-height: 1.4;
}

/* ---- CTA buttons (shared) ---- */
.btm-card__ctas {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.btm-card__map-link {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    color: #2b5329;
    text-decoration: underline;
    text-underline-offset: 2px;
}
.btm-card__map-link:hover { color: #1e3d1c; }

@media (max-width: 640px) {
    .btm-view--grid .btm-tournaments-grid,
    .btm-view--list .btm-tournaments-grid  { grid-template-columns: 1fr; }
    .btm-view--list .btm-tournament-card   {
        grid-template-columns: 1fr 1fr;
        grid-template-rows: auto auto auto;
        gap: 8px 12px;
    }
    .btm-view--list .btm-card__col-name    { grid-column: 1 / -1; }
    .btm-view--list .btm-card__col-actions { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; }
    .btm-view--list .btm-list-header       { display: none; }
}

.btm-status-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .4px;
}
.btm-status-badge--open      { background: #e8f5e9; color: #2e7d32; }
.btm-status-badge--closed    { background: #fff8e1; color: #f57f17; }
.btm-status-badge--cancelled { background: #ffebee; color: #c62828; }

.btm-btn-register {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 8px 18px;
    background: #2b5329;
    color: #fff !important;
    border-radius: 5px;
    text-decoration: none !important;
    font-size: 14px;
    font-weight: 600;
    transition: background .2s;
}
.btm-btn-register:hover { background: #1e3d1c; }
.btm-btn-register--disabled {
    background: #bbb;
    cursor: not-allowed;
    pointer-events: none;
}

.btm-btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 7px 14px;
    border: 2px solid #2b5329;
    color: #2b5329 !important;
    border-radius: 5px;
    text-decoration: none !important;
    font-size: 13px;
    font-weight: 600;
    transition: background .2s, color .2s;
}
.btm-btn-secondary:hover {
    background: #2b5329;
    color: #fff !important;
}

.btm-no-tournaments {
    text-align: center;
    color: #888;
    padding: 40px 20px;
    border: 2px dashed #ddd;
    border-radius: 8px;
}

/* ---- Registration form ---- */
.btm-register-wrap {
    max-width: 580px;
}

.btm-tournament-info-box {
    background: #f5f9f4;
    border: 1px solid #c8e6c9;
    border-radius: 6px;
    padding: 16px 20px;
    margin-bottom: 28px;
}
.btm-tournament-info-box h3 {
    margin: 0 0 10px;
    color: #2b5329;
}
.btm-info-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #444;
    margin-bottom: 5px;
}
.btm-info-row svg { color: #2b5329; flex-shrink: 0; }

.btm-form label {
    display: block;
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 5px;
    color: #333;
}
.btm-form .btm-field {
    margin-bottom: 18px;
}
.btm-form input[type="text"],
.btm-form input[type="email"],
.btm-form select {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 14px;
    box-sizing: border-box;
    transition: border-color .2s;
}
.btm-form input:focus,
.btm-form select:focus {
    outline: none;
    border-color: #2b5329;
    box-shadow: 0 0 0 2px rgba(43,83,41,.15);
}
.btm-form .btm-field-hint {
    font-size: 12px;
    color: #888;
    margin-top: 4px;
}
.btm-form-required { color: #c62828; }

.btm-form .btm-submit-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 24px;
    background: #2b5329;
    color: #fff;
    border: none;
    border-radius: 5px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background .2s;
}
.btm-form .btm-submit-btn:hover  { background: #1e3d1c; }
.btm-form .btm-submit-btn:disabled { background: #888; cursor: not-allowed; }

.btm-form-message {
    padding: 12px 16px;
    border-radius: 5px;
    margin-top: 16px;
    font-size: 14px;
    display: none;
}
.btm-form-message--success {
    background: #e8f5e9;
    border: 1px solid #a5d6a7;
    color: #2e7d32;
}
.btm-form-message--error {
    background: #ffebee;
    border: 1px solid #ef9a9a;
    color: #c62828;
}

.btm-sumup-panel {
    margin-top: 20px;
    padding: 18px 20px;
    background: #fff8e1;
    border: 1px solid #ffe082;
    border-radius: 6px;
    display: none;
}
.btm-sumup-panel h4 {
    margin: 0 0 10px;
    color: #e65100;
}
.btm-sumup-panel p { margin: 0 0 12px; font-size: 14px; }
.btm-sumup-link {
    display: inline-block;
    padding: 10px 22px;
    background: #e65100;
    color: #fff !important;
    text-decoration: none !important;
    border-radius: 5px;
    font-weight: 700;
}
.btm-sumup-link:hover { background: #bf360c; }

.btm-tournament-closed-msg {
    padding: 20px;
    background: #fff8e1;
    border: 1px solid #ffe082;
    border-radius: 6px;
    color: #795548;
}
.btm-tournament-not-found {
    color: #888;
    font-style: italic;
}

/* ---- Results page ---- */
.btm-results-wrap { margin: 0 0 2rem; }

.btm-results-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.btm-result-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 18px 22px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
}

.btm-result-card__icon {
    flex-shrink: 0;
    color: #2b5329;
}

.btm-result-card__info { flex: 1; }
.btm-result-card__title {
    font-size: 1rem;
    font-weight: 700;
    margin: 0 0 4px;
}
.btm-result-card__meta {
    font-size: 13px;
    color: #777;
}

.btm-result-card__link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: 2px solid #2b5329;
    color: #2b5329 !important;
    border-radius: 5px;
    text-decoration: none !important;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    transition: background .2s, color .2s;
}
.btm-result-card__link:hover {
    background: #2b5329;
    color: #fff !important;
}

.btm-no-results {
    text-align: center;
    color: #888;
    padding: 40px 20px;
    border: 2px dashed #ddd;
    border-radius: 8px;
}

/* ---- Cancel form ---- */
.btm-cancel-wrap { max-width: 540px; }

/* ---- Utility ---- */
@media (max-width: 600px) {
    .btm-tournaments-grid { grid-template-columns: 1fr; }
    .btm-result-card { flex-direction: column; align-items: flex-start; }
}
