@import url('open-iconic/font/css/open-iconic-bootstrap.min.css');

html,
body {
    font-family: "Plus Jakarta Sans", "Helvetica", "Arial", "sans-serif";
}

h1:focus {
    outline: none;
}

a,
.btn-link {
    color: #0071c1;
}

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus,
.form-control:focus,
.form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

.content {
    padding-top: 1.1rem;
}

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

.invalid {
    outline: 1px solid red;
}

.validation-message {
    color: red;
}

#blazor-error-ui {
    background: lightyellow;
    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;
}

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

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIu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ExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

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

.mud-table-container {
    overflow-y: visible !important;
}

html,
body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow-x: hidden;
    background-color: #f5f5f5 !important;
}

.mud-dialog {
    overflow: hidden !important;
}

.center-mud-grid {
    text-align: center;
    padding: 15px;
}

.mud-button-root.mud-icon-button.mud-ripple.mud-ripple-icon.mud-button-close {
    color: white;
}

html,
body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow-x: hidden;
    background-color: #f5f5f5 !important;
}

/* =============================================
   ACCESSIBILITY IMPROVEMENTS FOR FORM CONTROLS
   ============================================= */

/* Enhanced focus states for better accessibility */
::deep .mud-input-outlined .mud-input-control:focus-within {
    box-shadow: 0 0 0 3px rgba(32, 68, 126, 0.2) !important;
}

/* Selected provider location dropdown styling - white text on blue background */
::deep .selected-provider-select .mud-input-outlined .mud-input-slot {
    color: white !important;
}

::deep .selected-provider-select .mud-input-outlined .mud-input-label {
    color: white !important;
    background-color: transparent !important;
    background: transparent !important;
}

::deep .selected-provider-select .mud-input-outlined.mud-input-labeled .mud-input-label {
    color: white !important;
    background-color: transparent !important;
    background: transparent !important;
}

::deep .selected-provider-select .mud-input-outlined .mud-select .mud-svg-icon {
    fill: white !important;
}

::deep .selected-provider-select .mud-input-outlined .mud-input-control {
    border-color: rgba(255, 255, 255, 0.5) !important;
}

::deep .selected-provider-select .mud-input-outlined .mud-input-control .mud-input-slot input {
    color: white !important;
}

/* More aggressive targeting for selected value display */
::deep .selected-provider-select * {
    color: white !important;
}

::deep .selected-provider-select .mud-input-label,
::deep .selected-provider-select label {
    background-color: transparent !important;
    background: transparent !important;
}

/* Ensure dropdown items remain readable when opened */
::deep .selected-provider-select .mud-list-item {
    color: #333333 !important;
}

.logo {
    padding: 1rem;
    width: 7.5rem;
    height: auto;
}

@media (max-width: 600px) {
    .mud-appbar {
        height: 80px !important;
        --mud-appbar-height: 80px;
    }

    .logo {
        width: 7rem;
        padding: 0.5rem;
        padding-top: 1.5rem;
    }
}

.mud-container.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 0 1rem;
}

.mud-nav-link {
    display: flex;
    align-items: center;
    flex-grow: 1;
    white-space: nowrap;
}

/* ===== Embedded Mobile: Remove all container side gutters ===== */
/* Ensure all MudContainers under embedded layout have zero side padding/margins */
.embedded-main-wrapper .mud-container,
.embedded-main-content .mud-container,
.embedded-main-wrapper .mud-container-maxwidth-false,
.embedded-main-content .mud-container-maxwidth-false,
.embedded-main-wrapper .mud-container-maxwidth-xl,
.embedded-main-content .mud-container-maxwidth-xl {
    padding-left: 0 !important;
    padding-right: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    width: 100% !important;
}

@media (max-width: 600px) {
    .embedded-main-wrapper .mud-container,
    .embedded-main-content .mud-container,
    .embedded-main-wrapper .mud-container-maxwidth-false,
    .embedded-main-content .mud-container-maxwidth-false,
    .embedded-main-wrapper .mud-container-maxwidth-xl,
    .embedded-main-content .mud-container-maxwidth-xl {
        max-width: none !important;
    }
}


.ToolBar {
    width: 100%;
    overflow: hidden;
    /* Ensure toolbar contents don't overflow */
}

/* App-specific styles that are safe to move */
.mud-appbar.custom-appbar {
    position: sticky;
    top: 30px;
    left: 0;
    right: 0;
    z-index: 1000;
    width: 100%;
    background-color: #20447e;
}

.mud-appbar.custom-appbar .mud-toolbar-appbar {
    height: 100%;
}

/* Navigation-specific styles that are safe */
.mud-toolbar-gutters {
    padding-left: 0;
    padding-right: 0;
}

/* Icon color for this specific app */
.mud-appbar .mud-svg-icon {
    fill: white !important;
}

.mud-layout .mud-main-content {
    /* Match the computed height */
    margin-top: 0;
    min-height: calc(100vh - 85px);
    z-index: 1;
}

.mud-appbar {
    height: 100px !important;
    --mud-appbar-height: 100px;
}

.mud-layout>.mud-appbar {
    position: relative;
    z-index: 2000 !important;
}

.schedule-appointments-style .mud-appbar {
    position: relative;
    z-index: 1 !important;
}

.dialog-title-text {
    font-size: 24px;
    font-weight: bold;
    text-align: center;
    background-color: var(--mud-palette-primary);
    color: white;
    padding: 0px;
}

.email-link {
    color: #0071c1;
    text-decoration: none;
}

/* ADA Compliant Button Styles */
.ada-compliant-button {
    position: relative;
    transition: all 0.3s ease;
}

/* Focus state for keyboard navigation */
.ada-compliant-button:focus {
    outline: 2px solid var(--mud-palette-primary) !important;
    outline-offset: 2px !important;
}

/* Enhanced focus for MudButton specifically */
.ada-compliant-button.mud-button:focus {
    outline: 2px solid var(--mud-palette-primary) !important;
    outline-offset: 2px !important;
    transform: scale(1.02) !important;
    transition: all 0.2s ease !important;
}

/* Make sure focus is visible on filled buttons */
.ada-compliant-button.mud-button-filled:focus {
    outline: 3px solid white !important;
    outline-offset: 2px !important;
    box-shadow: 0 0 0 6px var(--mud-palette-primary) !important;
    transform: scale(1.02) !important;
}

/* Hover state for mouse users */
.ada-compliant-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2) !important;
    transition: background-color 0.3s ease, color 0.3s ease, border 0.3s ease, transform 0.3s ease;
}

/* Filled buttons (dark background) - hover makes them light with dark border */
.ada-compliant-button.mud-button-filled:hover {
    background-color: #ffffff !important;
    color: var(--mud-palette-primary) !important;
    border: 2px solid var(--mud-palette-primary) !important;
    font-weight: 600 !important;
    /* Make text bolder for better contrast */
}

/* Outlined buttons (light background) - hover makes them dark with light border */
.ada-compliant-button.mud-button-outlined:hover {
    background-color: var(--mud-palette-primary) !important;
    color: #ffffff !important;
    border: 2px solid #ffffff !important;
    font-weight: 600 !important;
    /* Make text bolder for better contrast */
}

/* Text buttons - hover makes them with background */
.ada-compliant-button.mud-button-text:hover {
    background-color: rgba(32, 68, 126, 0.1) !important;
    color: var(--mud-palette-primary-darken) !important;
    border: 2px solid var(--mud-palette-primary) !important;
}

/* Active state for all buttons */
.ada-compliant-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2) !important;
}

/* Disabled state - ensure enough contrast */
.ada-compliant-button:disabled {
    opacity: 0.7;
    background-color: #cccccc !important;
    color: #666666 !important;
    cursor: not-allowed;
}

/* Additional styles for icon buttons */
.mud-icon-button.ada-compliant-button {
    position: relative;
    transition: all 0.3s ease;
}

/* Focus state for icon buttons */
.mud-icon-button.ada-compliant-button:focus {
    outline: 2px solid var(--mud-palette-primary) !important;
    outline-offset: 2px;
}

/* Hover state for icon buttons - dark to light contrast */
.mud-icon-button.ada-compliant-button:hover {
    transform: translateY(-2px);
    background-color: #ffffff !important;
    border: 2px solid var(--mud-palette-primary) !important;
    color: var(--mud-palette-primary) !important;
}

/* Primary icon buttons - hover inverts colors */
.mud-icon-button.ada-compliant-button.mud-theme-primary:hover {
    background-color: #ffffff !important;
    color: var(--mud-palette-primary) !important;
    border: 2px solid var(--mud-palette-primary) !important;
}

/* Secondary icon buttons - hover inverts colors */
.mud-icon-button.ada-compliant-button.mud-theme-secondary:hover {
    background-color: #ffffff !important;
    color: var(--mud-palette-secondary) !important;
    border: 2px solid var(--mud-palette-secondary) !important;
}

/* Active state for icon buttons */
.mud-icon-button.ada-compliant-button:active {
    transform: translateY(0);
    background-color: rgba(32, 68, 126, 0.2) !important;
}

.custom-dialog-header {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    background-color: var(--mud-palette-primary);
    color: white;
    padding: 10px 20px 10px 20px;
    min-height: 46px;
    border-top-left-radius: 4px;
    border-top-right-radius: 4px;
}

.custom-dialog-title {
    flex: 1;
    text-align: center;
    font-size: 1.25rem;
    font-weight: 600;
    color: white;
}

.custom-dialog-header .mud-dialog-close {
    position: absolute;
    right: 0px;
    top: 10%;
    color: white !important;
}

.mud-dialog-content {
    margin-top: 20px;
}

/* Screen reader only text - accessible but not visible */
.sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* Skip links for keyboard navigation */
.sr-only-focusable {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.sr-only-focusable:focus {
    position: static !important;
    width: auto !important;
    height: auto !important;
    padding: 8px 16px !important;
    margin: 0 !important;
    overflow: visible !important;
    clip: auto !important;
    white-space: normal !important;
    background-color: var(--mud-palette-primary) !important;
    color: white !important;
    text-decoration: none !important;
    border-radius: 4px !important;
    z-index: 10000 !important;
}

/* ADA Navigation Link Styles */
.ada-nav-link {
    transition: all 0.3s ease;
    border-radius: 4px;
    padding: 8px 12px;
    margin: 2px;
    display: inline-block;
    text-decoration: none;
    color: inherit;
}

/* Focus state for navigation links */
.ada-nav-link:focus {
    outline: 3px solid white !important;
    outline-offset: 2px !important;
    box-shadow: 0 0 0 6px var(--mud-palette-primary) !important;
    background-color: rgba(255, 255, 255, 0.1) !important;
    transform: scale(1.05) !important;
    transition: all 0.2s ease !important;
    z-index: 1000;
}

/* Ensure focus is visible on navigation buttons */
.ada-nav-link.mud-button:focus,
.ada-nav-link.mud-icon-button:focus {
    outline: 3px solid white !important;
    outline-offset: 2px !important;
    box-shadow: 0 0 0 6px var(--mud-palette-primary) !important;
    background-color: rgba(255, 255, 255, 0.2) !important;
    transform: scale(1.05) !important;
}

/* Navigation hover states */
.ada-nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
    transform: translateY(-1px);
    transition: all 0.2s ease;
}

/* Override MudBlazor navigation link focus styles to work with our custom ones */
::deep .ada-nav-link.mud-nav-link:focus {
    outline: 3px solid white !important;
    outline-offset: 2px !important;
    box-shadow: 0 0 0 6px var(--mud-palette-primary) !important;
    background-color: rgba(255, 255, 255, 0.1) !important;
    transform: scale(1.05) !important;
    border-radius: 4px !important;
}

/* Ensure mobile menu button is properly styled */
.ada-nav-link.mud-icon-button {
    border-radius: 50%;
}

.ada-nav-link.mud-icon-button:focus {
    outline: 3px solid white !important;
    outline-offset: 2px !important;
    box-shadow: 0 0 0 6px var(--mud-palette-primary) !important;
    background-color: rgba(255, 255, 255, 0.2) !important;
    transform: scale(1.1) !important;
}

/* Navigation accessibility improvements */
.nav-link-wrapper {
    position: relative;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .ada-nav-link:focus {
        outline: 4px solid white !important;
        outline-offset: 3px !important;
        box-shadow: 0 0 0 8px black !important;
        background-color: yellow !important;
        color: black !important;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {

    .ada-nav-link,
    .ada-nav-link:focus,
    .ada-nav-link:hover {
        transition: none !important;
        transform: none !important;
    }

    .ada-nav-link:focus {
        outline: 3px solid white !important;
        outline-offset: 2px !important;
        box-shadow: 0 0 0 6px var(--mud-palette-primary) !important;
        background-color: rgba(255, 255, 255, 0.2) !important;
    }
}

/* Base appointment overlay styles */
.appointment-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    overflow-y: auto;
}

.appointment-card {
    max-width: 750px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
}

/* Mobile-specific styles */
@media (max-width: 959px) {
    .appointment-overlay {
        padding: 8px;
        align-items: flex-start;
        padding-top: 8px;
        overflow-y: auto;
    }

    .appointment-card {
        max-width: 100%;
        max-height: calc(100vh - 16px);
        overflow-y: auto;
        margin: 0;
        margin-top: 200px !important;
    }
}

@media (max-width: 768px) {
    .appointment-overlay {
        padding: 8px;
        align-items: flex-start;
        padding-top: 8px;
        overflow-y: auto;
    }

    .appointment-card {
        max-width: 100%;
        max-height: calc(100vh - 16px);
        overflow-y: auto;
        margin: 0;
        margin-top: 200px !important;
    }

    .appointment-card .mud-card-content {
        padding: 16px !important;
    }

    .appointment-card .mud-card-actions {
        padding: 16px !important;
    }

    .appointment-card .mud-paper {
        padding: 16px !important;
    }

    .appointment-details-grid .mud-grid-item {
        margin-bottom: 16px;
    }

    .appointment-buttons {
        flex-direction: column;
        gap: 12px;
    }

    .appointment-buttons .mud-button {
        width: 100%;
        min-height: 48px;
    }
}

@media (max-width: 480px) {
    .appointment-overlay {
        padding: 4px;
        padding-top: 4px;
        overflow-y: auto;
    }

    .appointment-card {
        max-height: calc(100vh - 8px);
        overflow-y: auto;
        margin-top: 200px !important;
    }

    .appointment-card .mud-card-content {
        padding: 12px !important;
    }

    .appointment-card .mud-card-actions {
        padding: 12px !important;
    }

    .appointment-card .mud-paper {
        padding: 12px !important;
    }
}
