/* Tennis-specific overrides — MudBlazor handles base layout and typography */

/* ── Mobile: prevent horizontal overflow ── */
html, body {
    overflow-x: hidden;
    max-width: 100%;
}

/* Tables and wide content scroll within their container, not the page */
.mud-table-root,
.mud-simple-table-root,
table {
    width: 100%;
}

.mud-table-container,
.table-responsive-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
}

/* Prevent MudCards and forms from overflowing on small screens */
.mud-card,
.mud-paper {
    max-width: 100%;
    overflow-x: hidden;
}

/* Tighten container padding on very small screens */
@media (max-width: 600px) {
    .mud-container {
        padding-left: 8px !important;
        padding-right: 8px !important;
    }

    /* Give table cells room to breathe without causing overflow */
    .mud-table-cell {
        padding-left: 8px !important;
        padding-right: 8px !important;
    }
}

/* ── Bootstrap color overrides (Account pages only — MudBlazor uses mud-* classes) ── */
:root {
    --bs-primary: #388E3C;
    --bs-primary-rgb: 56, 142, 60;
    --bs-link-color: #388E3C;
    --bs-link-color-rgb: 56, 142, 60;
    --bs-link-hover-color: #1B5E20;
    --bs-link-hover-color-rgb: 27, 94, 32;
}

.btn-primary {
    --bs-btn-bg: #388E3C;
    --bs-btn-border-color: #388E3C;
    --bs-btn-hover-bg: #2E7D32;
    --bs-btn-hover-border-color: #2E7D32;
    --bs-btn-active-bg: #1B5E20;
    --bs-btn-active-border-color: #1B5E20;
    --bs-btn-focus-shadow-rgb: 56, 142, 60;
    background-color: #388E3C;
    border-color: #388E3C;
}

.btn-primary:hover {
    background-color: #2E7D32;
    border-color: #2E7D32;
}

.btn-primary:focus,
.btn-primary:active,
.btn-primary.active {
    background-color: #1B5E20;
    border-color: #1B5E20;
    box-shadow: 0 0 0 0.25rem rgba(56, 142, 60, 0.5);
}

.nav-pills .nav-link.active,
.nav-pills .show > .nav-link {
    background-color: #388E3C;
}

.nav-link {
    color: #388E3C;
}

.nav-link:hover,
.nav-link:focus {
    color: #1B5E20;
}

.form-control:focus,
.form-select:focus {
    border-color: #388E3C;
    box-shadow: 0 0 0 0.25rem rgba(56, 142, 60, 0.25);
}

/* Remove focus outline on headings (Blazor focuses h1 on navigation for a11y) */
h1:focus, h2:focus, h3:focus, h4:focus {
    outline: none;
}

#blazor-error-ui {
    background: #b32121;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
    color: white;
}

#blazor-error-ui .reload {
    color: #d4efff;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

.blazor-error-boundary {
    background: #b32121;
    padding: 1rem;
    color: white;
}

.blazor-error-boundary::after {
    content: "An error has occurred.";
}

/* Validation styles */
.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}
