html, body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

/* Override Radzen default uppercase buttons and badges */
.rz-button,
.rz-button-md,
.rz-badge {
    text-transform: none !important;
}

a, .btn-link {
    color: #006bb7;
}

.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;
}

h1:focus {
    outline: none;
}

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

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

.validation-message {
    color: #e50000;
}

/* ==========================================
   Accessibility & Touch Targets
   ========================================== */

/* Ensure minimum 44px touch targets (WCAG 2.5.5) */
.rz-button.rz-button-sm {
    min-width: 44px;
    min-height: 44px;
}

/* Ensure button text doesn't clip, especially for longer localized strings */
.rz-button {
    padding-inline: 1rem;
    white-space: nowrap;
}

.mobile-card-actions .rz-button {
    min-width: 44px;
    min-height: 44px;
}

/* Focus-visible outlines for keyboard navigation */
.rz-button:focus-visible,
button:focus-visible,
a:focus-visible,
.rz-checkbox:focus-visible,
.rz-switch:focus-visible,
.rz-dropdown:focus-visible,
.rz-textbox:focus-visible {
    outline: 2px solid var(--rz-primary, #1b6ec2);
    outline-offset: 2px;
}

/* Skip-to-content link */
.skip-link {
    position: absolute;
    top: -100%;
    left: 1rem;
    z-index: 9999;
    padding: 0.75rem 1.5rem;
    background: var(--rz-primary, #1b6ec2);
    color: #fff;
    border-radius: 0 0 0.25rem 0.25rem;
    text-decoration: none;
    font-weight: 600;
}

.skip-link:focus {
    top: 0;
    color: #fff;
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

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

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

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

/* Footer */
.app-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem;
    margin-top: 2rem;
    font-size: 0.8rem;
    color: #999;
    border-top: 1px solid #eee;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}

/* ==========================================
   Card List Styles
   ========================================== */

.mobile-card-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.mobile-card {
    border: 1px solid var(--rz-border-color, #dee2e6);
    border-radius: 0.5rem;
    padding: 1rem;
    background: var(--rz-surface, #fff);
    position: relative;
}

.mobile-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.5rem;
}

.mobile-card-title {
    font-weight: 600;
    font-size: 1rem;
    margin: 0;
}

.mobile-card-details {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    font-size: 0.875rem;
    color: var(--rz-text-secondary-color, #6c757d);
    margin-bottom: 0.75rem;
}

.mobile-card-detail {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    line-height: 1.4;
}

.mobile-card-detail .rz-icon {
    font-size: 0.9rem;
    opacity: 0.7;
    flex-shrink: 0;
    width: 1rem;
    text-align: center;
}

.mobile-card-label {
    font-weight: 500;
    color: var(--rz-text-secondary-color, #6c757d);
    white-space: nowrap;
    flex-shrink: 0;
}

.mobile-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--rz-text-secondary-color, #6c757d);
    margin-bottom: 0.75rem;
}

.mobile-card-meta span::after {
    content: "·";
    margin-left: 0.5rem;
}

.mobile-card-meta span:last-child::after {
    content: "";
}

.mobile-card-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    padding-top: 0.5rem;
    border-top: 1px solid var(--rz-border-color, #dee2e6);
}

/* User menu dropdown */
.user-menu-container {
    position: relative;
    z-index: 1;
}

.user-menu-btn {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.3rem 0.6rem;
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    background: transparent;
    color: inherit;
    cursor: pointer;
    font-size: 0.875rem;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.user-menu-btn:hover {
    background: rgba(0, 0, 0, 0.04);
    border-color: #adb5bd;
}

.user-menu-name {
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-menu-arrow {
    opacity: 0.5;
}

.user-menu-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    min-width: 200px;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    z-index: 9999;
    padding: 0.35rem 0;
    animation: userMenuFadeIn 0.12s ease;
}

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

.user-menu-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.85rem;
    font-size: 0.8125rem;
    color: #6c757d;
    border-bottom: 1px solid #f0f0f0;
    margin-bottom: 0.25rem;
}

.user-menu-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 0.85rem;
    color: #212529;
    text-decoration: none;
    font-size: 0.875rem;
    transition: background 0.1s ease;
}

.user-menu-item:hover {
    background: #f8f9fa;
    text-decoration: none;
    color: #212529;
}

.user-menu-item .material-icons {
    font-size: 1.1rem;
    color: #6c757d;
}

.user-menu-logout {
    color: #dc3545;
}

.user-menu-logout:hover {
    background: #fff5f5;
    color: #dc3545;
}

.user-menu-logout .material-icons {
    color: #dc3545;
}

.user-menu-divider {
    height: 1px;
    background: #f0f0f0;
    margin: 0.25rem 0;
}

@media (max-width: 768px) {
    .user-menu-dropdown {
        position: fixed;
        top: 3.5rem;
        right: 8px;
        left: auto;
        min-width: 220px;
    }
}

/* Status filter toggle buttons */
.status-filter-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.status-filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.75rem;
    border: 2px solid;
    border-radius: 2rem;
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    line-height: 1.4;
    white-space: nowrap;
    flex-shrink: 0;
}

.status-filter-btn:hover {
    opacity: 0.85;
}

.status-filter-btn .status-filter-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.status-filter-btn .status-filter-count {
    opacity: 0.8;
    font-size: 0.75rem;
}

@media (max-width: 576px) {
    .status-filter-btn {
        padding: 0.25rem 0.5rem;
        font-size: 0.75rem;
        gap: 0.25rem;
    }
    .status-filter-btn .status-filter-dot {
        width: 6px;
        height: 6px;
    }
}

/* Dashboard stat cards */
.dashboard-stat-card {
    text-align: center;
    padding: 1.25rem;
    border-radius: 0.75rem;
    transition: transform 0.15s ease;
}

.dashboard-stat-card:hover {
    transform: translateY(-2px);
}

.dashboard-stat-card .stat-value {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.2;
}

.dashboard-stat-card .stat-label {
    font-size: 0.85rem;
    opacity: 0.85;
    margin-top: 0.25rem;
}

.dashboard-stat-card .stat-icon {
    font-size: 2.5rem;
    opacity: 0.7;
    margin-bottom: 0.5rem;
}

/* Dashboard session list */
.dashboard-session-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 0.75rem;
}

.dashboard-session-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 0.9rem 1rem;
    border-radius: 0.75rem;
    background: linear-gradient(180deg, var(--rz-base-background-color) 0%, #fafbfc 100%);
    border: 1px solid var(--rz-border-color);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.dashboard-session-time {
    min-width: 4.75rem;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-weight: 700;
    color: var(--rz-primary);
}

.dashboard-session-time .rz-icon {
    font-size: 1rem;
}

.dashboard-session-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.dashboard-session-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.dashboard-session-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    color: var(--rz-text-secondary-color);
    font-size: 0.875rem;
}

.dashboard-session-meta span {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.dashboard-session-meta .rz-icon {
    font-size: 0.95rem;
}

@media (max-width: 768px) {
    .dashboard-session-item {
        flex-direction: column;
        gap: 0.65rem;
    }

    .dashboard-session-time {
        min-width: 0;
    }
}

/* ==========================================
   Mobile Responsive Styles
   ========================================== */

/* DataGrid: horizontal scroll wrapper on small screens */
@media (max-width: 768px) {
    .rz-datatable {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .rz-datatable .rz-datatable-thead > tr > th,
    .rz-datatable .rz-datatable-tbody > tr > td {
        white-space: nowrap;
        font-size: 0.85rem;
    }

    /* Hide less important columns on mobile */
    .hide-on-mobile {
        display: none !important;
    }

    /* Scheduler responsive height */
    .rz-scheduler {
        height: 450px !important;
        min-height: 400px;
    }

    /* Make action buttons wrap instead of overflow */
    .mobile-actions {
        flex-wrap: wrap;
        gap: 0.25rem !important;
    }

    /* Hide button text on mobile, show icon only - scoped to action areas */
    .page-header-actions .rz-button .rz-button-text,
    .mobile-actions .rz-button .rz-button-text,
    .rz-toolbar .rz-button .rz-button-text,
    .rz-grid .rz-button .rz-button-text {
        display: none;
    }

    /* Reduce padding on content areas */
    .content {
        padding-left: 0.5rem !important;
        padding-right: 0.5rem !important;
    }

    /* Stack header rows */
    .page-header-actions {
        text-align: left !important;
        margin-top: 0.5rem;
    }
}

@media (max-width: 480px) {
    .rz-scheduler {
        height: 350px !important;
        min-height: 300px;
    }

    .rz-datatable .rz-datatable-thead > tr > th,
    .rz-datatable .rz-datatable-tbody > tr > td {
        font-size: 0.875rem;
        padding: 0.4rem 0.5rem !important;
    }
}

@media (min-width: 769px) {
    .rz-scheduler {
        height: calc(100vh - 160px) !important;
        min-height: 600px;
    }
}

/* Scheduler month view: taller day cells with scroll for many appointments */
.rz-scheduler .rz-view-month .rz-slots .rz-slot {
    min-height: 200px;
}

@media (max-width: 768px) {
    .rz-scheduler .rz-view-month .rz-slots .rz-slot {
        min-height: 120px;
    }

    .rz-scheduler .rz-view-month .rz-events {
        max-height: 110px;
    }
}

.rz-scheduler .rz-view-month .rz-events {
    max-height: 190px;
    overflow-y: auto;
    overflow-x: hidden;
}

.rz-scheduler .rz-view-month .rz-event {
    font-size: 0.75rem;
    padding: 1px 4px;
    margin-bottom: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
