/* ============================================
   SENIOR BRIDGE – Global Styles
   ============================================ */

/* --- Reset & Base --- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 18px; /* Larger base for seniors */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    height: 100%;
    overflow: hidden;
}

body {
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    font-size: 1rem;
    line-height: 1.6;
    color: var(--kendo-color-on-app-surface);
    background: var(--kendo-color-app-surface);
    height: 100%;
    overflow: hidden;
    /* Prevent iOS pull-to-refresh and bounce scroll */
    overscroll-behavior: none;
    /* Disable text selection globally */
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Allow text selection in input fields and textareas */
input,
textarea,
[contenteditable="true"] {
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
}

/* --- Typography --- */
h1, h2, h3, h4, h5, h6 {
    line-height: 1.3;
    color: var(--kendo-color-on-app-surface);
}

a {
    color: var(--kendo-color-primary);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* --- Focus styles (accessibility) --- */
:focus-visible {
    outline: 3px solid var(--kendo-color-primary);
    outline-offset: 2px;
}

/* --- Scrollbar --- */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--kendo-color-border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--kendo-color-subtle);
}

/* --- Auth pages shared styles --- */
.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    min-height: 100dvh;
    background: var(--kendo-color-app-surface);
    padding: 2rem;
    position: relative;
    overflow: hidden;
}

/* Subtle radial glow behind the card */
.auth-page::before {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--kendo-color-primary-subtle, rgba(59, 130, 246, 0.08)) 0%, transparent 70%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.auth-card {
    width: 100%;
    max-width: 420px;
    background: var(--kendo-color-surface-alt);
    border: 1px solid var(--kendo-color-border);
    border-radius: 20px;
    padding: 2.5rem 2rem 2rem;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.04);
    position: relative;
    z-index: 1;
}

.auth-card--wide {
    max-width: 520px;
}

.auth-card__header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-card__icon {
    font-size: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 72px;
    margin: 0 auto 0.75rem;
    border-radius: 50%;
    background: var(--kendo-color-primary-subtle, rgba(59, 130, 246, 0.1));
}

.auth-card__title {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    color: var(--kendo-color-on-app-surface);
}

.auth-field {
    margin-bottom: 1.1rem;
}

.auth-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--kendo-color-subtle);
    margin-bottom: 0.4rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.auth-input {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    border: 1.5px solid var(--kendo-color-border);
    border-radius: 10px;
    background: var(--kendo-color-app-surface);
    color: var(--kendo-color-on-app-surface);
    transition: border-color 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}

.auth-input::placeholder {
    color: var(--kendo-color-subtle);
    opacity: 0.6;
}

.auth-input:hover {
    border-color: var(--kendo-color-subtle);
}

.auth-input:focus {
    outline: none;
    border-color: var(--kendo-color-primary);
    box-shadow: 0 0 0 3px var(--kendo-color-primary-subtle, rgba(59, 130, 246, 0.15));
    background: var(--kendo-color-surface-alt);
}

.auth-error {
    font-size: 0.8rem;
    color: var(--kendo-color-error);
    margin-top: 0.25rem;
}

.auth-alert {
    padding: 0.75rem 1rem;
    border-radius: 10px;
    font-size: 0.9rem;
    margin-bottom: 1rem;
    animation: auth-alert-enter 0.3s ease-out;
}

@keyframes auth-alert-enter {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

.auth-alert--error {
    background: var(--kendo-color-error-subtle, #fef2f2);
    color: var(--kendo-color-error, #991b1b);
    border: 1px solid var(--kendo-color-error-subtle-hover, #fecaca);
}

.auth-alert--success {
    background: var(--kendo-color-success-subtle, #f0fdf4);
    color: var(--kendo-color-success, #166534);
    border: 1px solid var(--kendo-color-success-subtle-hover, #bbf7d0);
}

.auth-btn {
    display: block;
    width: 100%;
    padding: 0.8rem;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.25s ease;
    margin-top: 0.75rem;
    position: relative;
    overflow: hidden;
}

.auth-btn--primary {
    background: var(--kendo-color-primary);
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.auth-btn--primary:hover:not(:disabled) {
    background: var(--kendo-color-primary-hover);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    transform: translateY(-1px);
}

.auth-btn--primary:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

.auth-btn--primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.auth-links {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--kendo-color-border);
}

.auth-link {
    font-size: 0.9rem;
    color: var(--kendo-color-primary);
    font-weight: 500;
    transition: opacity 0.2s;
}

.auth-link:hover {
    opacity: 0.8;
}

.auth-back {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    text-align: center;
    font-size: 0.85rem;
    color: var(--kendo-color-subtle);
    transition: color 0.2s;
}

.auth-back:hover {
    color: var(--kendo-color-primary);
    text-decoration: none;
}

/* Reduced motion for auth */
@media (prefers-reduced-motion: reduce) {
    .auth-alert { animation: none; }
    .auth-btn, .auth-input { transition-duration: 0.01s; }
}

/* --- Error text --- */
.error-text {
    text-align: center;
    color: var(--kendo-color-error);
    padding: 2rem;
    font-size: 1.1rem;
}

/* --- Blazor validation overrides --- */
.validation-message {
    font-size: 0.8rem;
    color: var(--kendo-color-error);
}

.valid.modified:not([type=checkbox]) {
    outline: none;
}

.invalid {
    border-color: var(--kendo-color-error) !important;
}

/* --- Layout-Restriction-Hinweis --- */
.sb-layout-restriction {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 50vh;
    padding: 2rem;
    text-align: center;
    color: var(--kendo-color-subtle);
}

.sb-layout-restriction__icon {
    font-size: 4rem;
    margin-bottom: 1.5rem;
    opacity: 0.7;
}

.sb-layout-restriction__message {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--kendo-color-on-app-surface);
    margin-bottom: 0.75rem;
    max-width: 400px;
}

.sb-layout-restriction__hint {
    font-size: 1rem;
    color: var(--kendo-color-subtle);
    max-width: 360px;
    line-height: 1.5;
}

/* --- DefaultFormDialog (Modal) --- */
.default-form-dialog {
    padding: 1.5rem 1.75rem;
}


/* --- Senior Scheduler (vereinfachte, vergrößerte Ansicht) --- */
.senior-scheduler {
    /* Status-Buttons deutlich größer */
    --wdt-scheduler-status-btn-size: 52px;
    --wdt-scheduler-status-btn-font: 1.4rem;
    --wdt-scheduler-status-btn-border: 3px;
    --wdt-scheduler-status-btn-gap: 10px;

    /* Agenda-Texte vergrößert */
    --wdt-scheduler-agenda-title-font: 1.2rem;
    --wdt-scheduler-agenda-time-font: 1.1rem;
    --wdt-scheduler-agenda-time-min-width: 80px;
    --wdt-scheduler-agenda-day-font: 1.1rem;
    --wdt-scheduler-agenda-detail-font: 1rem;
    --wdt-scheduler-agenda-status-font: 0.95rem;
    --wdt-scheduler-agenda-item-padding: 14px 16px;
    --wdt-scheduler-agenda-item-gap: 16px;

    /* Header/Navigation vergrößert */
    --wdt-scheduler-header-title-font: 1.4rem;
    --wdt-scheduler-view-btn-font: 1.05rem;
    --wdt-scheduler-view-btn-padding: 10px 24px;
    --wdt-scheduler-nav-btn-size: 44px;

    /* Tages-/Wochenansicht vergrößert */
    --wdt-scheduler-dayview-hour-font: 0.9rem;
    --wdt-scheduler-dayview-weekday-font: 0.95rem;
    --wdt-scheduler-dayview-daynumber-font: 1.8rem;
    --wdt-scheduler-dayview-daynumber-size: 48px;

    /* Termin-Karten vergrößert */
    --wdt-scheduler-appointment-font: 1rem;
    --wdt-scheduler-appointment-padding: 4px 8px;
    --wdt-scheduler-appointment-detail-font: 0.9rem;
}

.senior-scheduler-detail {
    font-size: 1.15rem;
    line-height: 1.6;
    color: var(--kendo-color-on-app-surface, #333);
}

.senior-scheduler-detail strong {
    color: var(--kendo-color-primary, #1976d2);
}

/* --- WDTListView container: no outline, no rounded corners --- */
.wdt-listview {
    border: none !important;
    border-radius: 0 !important;
    outline: none !important;
}

/* --- WDTPaper in WDTListView: visible border (Outlined="false" = no border by default) --- */
.wdt-listview-item .wdt-paper {
    border: 1px solid var(--kendo-color-border);
}

/* --- Legal dialog content --- */
.legal-dialog__subtitle {
    font-size: 1rem;
    color: var(--kendo-color-subtle, #6b7280);
    margin: 0 0 1.25rem;
}

.legal-dialog__section {
    margin-bottom: 1.5rem;
}

.legal-dialog__section h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--kendo-color-on-app-surface, #1a1a2e);
    margin: 0 0 0.5rem;
    padding-bottom: 0.3rem;
    border-bottom: 1px solid var(--kendo-color-border, #e0e0e0);
}

.legal-dialog__section h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--kendo-color-on-app-surface, #1a1a2e);
    margin: 0.75rem 0 0.4rem;
}

.legal-dialog__section p {
    line-height: 1.7;
    margin: 0 0 0.6rem;
}

.legal-dialog__section ul {
    margin: 0.4rem 0 0.8rem;
    padding-left: 1.5rem;
}

.legal-dialog__section li {
    line-height: 1.7;
    margin-bottom: 0.25rem;
}

.legal-dialog__section a {
    color: var(--kendo-color-primary, #3b82f6);
    text-decoration: none;
}

.legal-dialog__section a:hover {
    text-decoration: underline;
}

.legal-dialog__section code {
    background: var(--kendo-color-surface-alt, #eef2f7);
    padding: 0.1rem 0.35rem;
    border-radius: 4px;
    font-size: 0.9em;
}

/* --- Blazor error UI --- */
#blazor-error-ui {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1rem;
    background: #991b1b;
    color: #ffffff;
    text-align: center;
    z-index: 10000;
}

/* --- Error Pages (404, 500) --- */
.error-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--kendo-color-app-surface, #f5f5f5);
    padding: 2rem;
}

.error-page__card {
    text-align: center;
    max-width: 480px;
    padding: 3rem 2rem;
    background: var(--kendo-color-surface-alt, #ffffff);
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.1);
}

.error-page__icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.error-page__code {
    font-size: 5rem;
    font-weight: 700;
    color: var(--kendo-color-primary, #6495ED);
    line-height: 1;
    margin-bottom: 0.5rem;
}

.error-page__title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--kendo-color-on-app-surface, #1a1a1a);
    margin-bottom: 1rem;
}

.error-page__text {
    font-size: 1.1rem;
    color: var(--kendo-color-subtle, #666);
    line-height: 1.6;
    margin-bottom: 2rem;
}

.error-page__link {
    display: inline-block;
    padding: 0.75rem 2rem;
    background: var(--kendo-color-primary, #6495ED);
    color: var(--kendo-color-on-primary, #ffffff);
    text-decoration: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 500;
    transition: opacity 0.2s;
}

.error-page__link:hover {
    opacity: 0.9;
}
