/* --- OFFLINE FONTS --- */
@font-face {
    font-family: 'Fredoka';
    src: url('../fonts/Fredoka-Regular.ttf') format('truetype');
    font-weight: 300 400; /* Handles your light/regular weights */
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Fredoka';
    src: url('../fonts/Fredoka-Bold.ttf') format('truetype');
    font-weight: 500 700; /* Handles your bold weights */
    font-style: normal;
    font-display: swap;
}

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

@font-face {
    font-family: 'Roboto';
    src: url('../fonts/Roboto-Bold.ttf') format('truetype');
    font-weight: 500 700;
    font-style: normal;
    font-display: swap;
}

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

/*html, body {
    font-family: 'Helvetica Neue', 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,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2Z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jgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

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

.loading-progress {
    position: relative;
    display: block;
    width: 8rem;
    height: 8rem;
    margin: 20vh auto 1rem auto;
}

.loading-progress circle {
    fill: none;
    stroke: #e0e0e0;
    stroke-width: 0.6rem;
    transform-origin: 50% 50%;
    transform: rotate(-90deg);
}

.loading-progress circle:last-child {
    stroke: #1b6ec2;
    stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
    transition: stroke-dasharray 0.05s ease-in-out;
}

.loading-progress-text {
    position: absolute;
    text-align: center;
    font-weight: bold;
    inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
}

.loading-progress-text:after {
    content: var(--blazor-load-percentage-text, "Loading");
}

code {
    color: #c02d76;
}

/* Fix for MudChip layout issues */
.mud-chip-container {
    display: flex !important;
}

body {
    overflow-x: hidden;
}

/* Ensure the main container doesn't force a scroll */
.mud-main-content {
    overflow-x: hidden;
}

/* Twinkling star trail */
.stardust-particle {
    position: fixed;
    pointer-events: none;
    background: white;
    border-radius: 50%;
    box-shadow: 0 0 10px 2px #FFD700;
    z-index: 2147483647;
    animation: sparkle-fade 0.8s ease-out forwards;
}

@keyframes sparkle-fade {
    0% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: scale(0) rotate(180deg);
        opacity: 0;
    }
}

/* The JS Mirror Star (Appended to body) */
/*.mirror-star {
    position: fixed;
    pointer-events: none;
    z-index: 2147483646; !* Just below the particles *!
    filter: drop-shadow(0px 4px 8px rgba(0, 0, 0, 0.4));
    transition: transform 0.05s linear;
}*/

/* Hide the ACTUAL MudBlazor drag preview on mobile only */
/* This prevents the "double star" look and stops the layer fighting */
/*@media (max-width: 959px) {
    .mud-drop-item-preview {
        opacity: 0 !important;
    }
}*/

/* ------------------- */

.scroll-x {
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch; /* Smooth scroll on iOS */

    /* Hide scrollbar for Chrome, Safari and Opera */

    &::-webkit-scrollbar {
        display: none;
    }

    /* Hide scrollbar for IE, Edge and Firefox */
    -ms-overflow-style: none; /* IE and Edge */
    scrollbar-width: none; /* Firefox */
}

/* CHEQUERED FLAG OVERLAY PATTERN */
.checkered-flag {
    /* 1. Base tint to wash out the image slightly */
    background-color: rgba(255, 255, 255, 0.4);

    /* 2. The Checkered Pattern (CSS Magic) */
    background-image: linear-gradient(45deg, #000000 25%, transparent 25%),
    linear-gradient(-45deg, #000000 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #000000 75%),
    linear-gradient(-45deg, transparent 75%, #000000 75%);

    /* 3. Size of the squares */
    background-size: 30px 30px;
    background-position: 0 0, 0 15px, 15px -15px, -15px 0px;

    /* 4. Opacity of the black squares (Not the whole div) */
    /* We handle overall opacity in the Razor component to keep it adjustable */
}

/* App Store Buttons */
.store-btn {
    transition: transform 0.2s;
}

.store-btn:hover {
    transform: translateY(-3px);
}

/* --- DEVICE MOCKUPS (UPDATED) --- */
.mockup-container {
    perspective: 1000px;
}

.device-phone {
    width: 280px;
    height: 580px;
    background-color: #1a1a1a;
    border-radius: 35px;
    border: 12px solid #1a1a1a;
    position: relative;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    margin: 0 auto;
    overflow: hidden;
    z-index: 2; /* Sit above waves */
    padding-top: 25px;
}

/* The Notch */
.device-phone::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 120px;
    height: 25px;
    background-color: #1a1a1a;
    border-bottom-left-radius: 15px;
    border-bottom-right-radius: 15px;
    z-index: 10;
}

.device-screen {
    width: 100%;
    height: 100%;
    background-color: #fff;
    overflow: hidden;
    position: relative;
    /* FIX: Push content down so notch doesn't cover the menu */
    /* padding-top: 25px;  */
}

.device-tablet {
    width: 100%;
    max-width: 800px;
    /* FIX: Changed to 16/9 for better landscape screenshot fit */
    aspect-ratio: 16/9;
    background-color: #1a1a1a;
    border-radius: 20px;
    border: 12px solid #1a1a1a;
    position: relative;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    margin: 0 auto;
}

/* --- VISUAL FLOW UTILITIES --- */
.section-wave {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    overflow: hidden;
    line-height: 0;
    transform: rotate(180deg);
}

.section-wave svg {
    position: relative;
    display: block;
    width: calc(100% + 1.3px);
    height: 60px;
}

.section-wave .shape-fill {
    fill: #FFFFFF;
}

/* Alternate background for visual flow */
.bg-gradient-primary {
    background: linear-gradient(135deg, var(--mud-palette-primary) 0%, var(--mud-palette-primary-darken) 100%);
    color: white;
}

.bg-light-gray {
    background-color: #f8f9fa;
}

.text-shadow {
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* --- FLYING STAR ANIMATION --- */
.flying-star {
    position: fixed;
    z-index: 9999;
    pointer-events: none; /* So it doesn't block clicks while flying */
    filter: drop-shadow(0px 4px 8px rgba(0, 0, 0, 0.4));
}

/* Forces the actively dragged preview to the absolute front */
.mud-drop-item-preview {
    z-index: 9999 !important;
    will-change: transform;
}

/* Forces the element to break out of overflow:hidden containers and puts it on the highest GPU compositing layer */
.super-drag-mobile-fix {
    /*position: fixed !important;*/
    /*z-index: 2147483647 !important;
    will-change: transform, left, top;*/
    /* The Z-axis translation forces WebKit/Blink to render this on top of standard fixed elements */
    /*transform: translateZ(9999px) !important;
    -webkit-transform: translateZ(9999px) !important;*/
}

.mud-drop-zone {
    overflow: visible !important;
}

/* --- DYNAMIC WRAP ARROWS (Only applies if NOT in scroll mode) --- */
/* sm (600px - 959px): 2 items per row */
@media (min-width: 600px) and (max-width: 959px) {
    .mud-grid:not(.layout-scroll) > .mud-grid-item:nth-child(2n) .arrow-forward {
        display: none !important;
    }

    .mud-grid:not(.layout-scroll) > .mud-grid-item:nth-child(2n) .arrow-return {
        display: flex !important;
    }
}

/* md (960px - 1279px): 3 items per row */
@media (min-width: 960px) and (max-width: 1279px) {
    .mud-grid:not(.layout-scroll) > .mud-grid-item:nth-child(3n) .arrow-forward {
        display: none !important;
    }

    .mud-grid:not(.layout-scroll) > .mud-grid-item:nth-child(3n) .arrow-return {
        display: flex !important;
    }
}

/* lg (1280px - 1919px): 4 items per row */
@media (min-width: 1280px) and (max-width: 1919px) {
    .mud-grid:not(.layout-scroll) > .mud-grid-item:nth-child(4n) .arrow-forward {
        display: none !important;
    }

    .mud-grid:not(.layout-scroll) > .mud-grid-item:nth-child(4n) .arrow-return {
        display: flex !important;
    }
}

/* xl (1920px+): 6 items per row */
@media (min-width: 1920px) {
    .mud-grid:not(.layout-scroll) > .mud-grid-item:nth-child(6n) .arrow-forward {
        display: none !important;
    }

    .mud-grid:not(.layout-scroll) > .mud-grid-item:nth-child(6n) .arrow-return {
        display: flex !important;
    }
}

/* --- HORIZONTAL SCROLL MODE (Large Screens Only) --- */
@media (min-width: 600px) {
    .mud-grid.layout-scroll {
        flex-wrap: nowrap !important; /* Force a single row */
        overflow-x: auto; /* Enable horizontal scrolling inside the container */
        overflow-y: hidden;
        justify-content: flex-start !important; /* Override the center justification */
        justify-content: safe center !important;
        padding-bottom: 20px; /* Space for the scrollbar */
        scroll-behavior: smooth;
        position: relative; /* Helps JS calculate scroll offset */
    }

    /* Keep tiles a fixed width in scroll mode so they don't squash together */
    .mud-grid.layout-scroll > .mud-grid-item {
        flex: 0 0 auto !important;
        width: 300px !important;
        max-width: none !important;
    }

    /* Force all arrows to point forward when in horizontal scroll mode */
    .mud-grid.layout-scroll .arrow-return {
        display: none !important;
    }

    .mud-grid.layout-scroll .arrow-forward {
        display: flex !important;
    }
}