@font-face {
    font-family: 'Acme';
    src: url('../fonts/Acme/Acme-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Fredoka';
    src: url('../fonts/Fredoka/Fredoka-VariableFont_wdth,wght.ttf') format('truetype');
    font-weight: 300 700;
    font-style: normal;
    font-display: swap;
}

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

html, body {
    margin: 0 !important;
    padding: 0 !important;
    width: 100%;
    height: 100%;
}

h1:focus {
    outline: none;
}

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

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

.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+PHBhdGggZ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AyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

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


/* ===== Global Page Navigation Button - Small Absolute ===== */

button.page-nav-button,
button.teacher-exit-button {
    all: unset;

    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 1000;

    box-sizing: border-box;

    min-width: 6.8rem;
    min-height: 1.95rem;

    padding: 0.35rem 0.75rem;

    border-radius: 1.4375rem;
    background: #F9FDFF;
    box-shadow: 3px 4px 3.5px 0 rgba(0, 0, 0, 0.17);

    display: inline-flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 0.38rem;

    color: #000;
    font-family: 'Fredoka', sans-serif;
    font-size: 0.78rem;
    font-weight: 600;
    line-height: 1;

    cursor: pointer;
    white-space: nowrap;

    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

button.page-nav-button img,
button.teacher-exit-button img {
    width: auto;
    height: 0.95em;

    display: block;
    object-fit: contain;
    flex: 0 0 auto;
}

button.page-nav-button svg,
button.teacher-exit-button svg {
    width: 0.9em;
    height: 0.9em;
    display: block;
    flex: 0 0 auto;
    stroke: currentColor;
}

button.page-nav-button span,
button.teacher-exit-button span {
    display: block;
    line-height: 1;
}

button.page-nav-button:hover,
button.teacher-exit-button:hover {
    transform: translateY(-1px);
    box-shadow: 3px 5px 4px 0 rgba(0, 0, 0, 0.2);
}

button.page-nav-button:active {
    transform: translateY(0);
}

@media (max-width: 1200px) {
    button.page-nav-button {
        position: absolute;

        top: 1rem;
        right: 1rem;

        min-width: 6.8rem;
        min-height: 1.95rem;

        padding: 0.35rem 0.75rem;

        border-radius: 1.4375rem;
        font-size: 0.78rem;
        gap: 0.38rem;
    }

    button.page-nav-button img {
        height: 0.95em;
    }
}

@media (max-width: 760px) {
    button.page-nav-button {
        position: absolute;

        top: 0.85rem;
        right: 0.85rem;

        min-width: 6.3rem;
        min-height: 1.8rem;

        padding: 0.32rem 0.65rem;

        border-radius: 1.2rem;
        font-size: 0.72rem;
        gap: 0.32rem;
    }

    button.page-nav-button img {
        height: 0.9em;
    }
}

/* ===== Accessibility & Keyboard Navigation (Added) ===== */

/* חיווי ויזואלי לפוקוס מקלדת (רק ב-Tab) לכל האתר */
*:focus-visible {
    outline: 3px solid #1A73E8 !important;
    outline-offset: 2px;
}

/* כפתור דילוג לתוכן מרכזי - מוסתר כברירת מחדל */
.skip-to-main {
    position: absolute;
    top: -100px;
    left: 50%;
    transform: translateX(-50%);
    background: #1A73E8;
    color: white;
    padding: 10px 20px;
    border-radius: 0 0 10px 10px;
    font-weight: bold;
    text-decoration: none;
    z-index: 9999;
    transition: top 0.2s ease;
}

/* חשיפת כפתור הדילוג רק כאשר הוא מקבל פוקוס מקלדת */
.skip-to-main:focus {
    top: 0;
}

/* ===== Branded Loading Screen ===== */

.branded-loading-container {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100svh;
    z-index: 9999;

    display: flex;
    align-items: center;
    justify-content: center;

    background-image: url("../images/AppBackground.jpg");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;

    box-sizing: border-box;
    padding: 1.5rem;
}

.branded-loading-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: max-content;
}

.branded-loading-mascot {
    position: absolute;
    right: calc(100% - 2.2rem);
    top: 50%;
    transform: translateY(-50%);

    height: 100%;
    width: auto;
    max-height: 100%;
    object-fit: contain;

    z-index: 1;
    pointer-events: none;
}

.branded-loading-card {
    position: relative;
    z-index: 2;

    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);

    border-radius: 2rem;
    padding: clamp(2rem, 5vw, 3.5rem) clamp(2.5rem, 7vw, 5.5rem);

    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08), 0 2px 6px rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.7);

    display: flex;
    align-items: center;
    justify-content: center;
}

.branded-loading-text {
    font-family: 'Fredoka', 'Assistant', sans-serif;
    font-size: clamp(1.4rem, 3.5vw, 2.2rem);
    font-weight: 700;
    color: #2F2F2F;
    text-align: center;
    white-space: nowrap;
}

.loading-dots {
    display: inline-flex;
    margin-inline-start: 0.2rem;
}

.loading-dots span {
    display: inline-block;
    animation: loadingDotFade 1.4s infinite ease-in-out both;
    font-weight: 700;
}

.loading-dots span:nth-child(1) {
    animation-delay: 0s;
}

.loading-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.loading-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes loadingDotFade {
    0%, 80%, 100% {
        opacity: 0.25;
        transform: translateY(0);
    }
    40% {
        opacity: 1;
        transform: translateY(-0.2em);
    }
}