@import url("https://fonts.googleapis.com/css2?family=Fraunces:wght@600;700&family=Space+Grotesk:wght@400;500;600&display=swap");

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

.invalid {
    outline: 1px solid red;
}

.validation-message {
    color: red;
}

#blazor-error-ui {
    background: lightyellow;
    color: black; /* Force black text in light mode */
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    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;
        color: black;
    }

@media (prefers-color-scheme: dark) {
    #blazor-error-ui {
        background: #f4b400; /* Darker yellow/orange for contrast */
        color: #000000;      /* Ensure text is clearly visible */
    }
    #blazor-error-ui .dismiss {
        color: #000000;
    }
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNz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cnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) 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;
}

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


/* ============================================================
   Bottom Tab Bar
   ============================================================ */
.bottom-tab-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 64px;
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 1100;
    border-top: 1px solid var(--mud-palette-lines-default);
    background: var(--mud-palette-surface);
    padding-bottom: env(safe-area-inset-bottom, 0px);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
}

.tab-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    border: none;
    background: transparent;
    cursor: pointer;
    padding: 6px 12px;
    min-width: 56px;
    color: var(--mud-palette-text-secondary);
    transition: color 0.2s ease, transform 0.15s ease;
    -webkit-tap-highlight-color: transparent;
    position: relative;
}

    .tab-item:active {
        transform: scale(0.92);
    }

    .tab-item.active {
        color: var(--mud-palette-tertiary);
    }

        .tab-item.active::before {
            content: '';
            position: absolute;
            top: 2px;
            left: 50%;
            transform: translateX(-50%);
            width: 32px;
            height: 3px;
            border-radius: 0 0 3px 3px;
            background: var(--mud-palette-tertiary);
        }

.tab-label {
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.02em;
    line-height: 1.2;
    white-space: nowrap;
}


/* ============================================================
   More Bottom Sheet
   ============================================================ */
.more-sheet {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1250;
    background: var(--mud-palette-surface);
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.15);
    transform: translateY(0);
    animation: sheet-slide-up 0.3s cubic-bezier(0.4, 0, 0.2, 1) both;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    max-height: 85vh;
    overflow-y: auto;
}

@keyframes sheet-slide-up {
    from {
        transform: translateY(100%);
    }

    to {
        transform: translateY(0);
    }
}

.more-sheet-handle {
    display: flex;
    justify-content: center;
    padding: 12px 0 8px;
    cursor: pointer;
}

.handle-bar {
    width: 36px;
    height: 4px;
    border-radius: 2px;
    background: var(--mud-palette-action-default);
    opacity: 0.4;
}

.more-sheet-content {
    padding: 4px 8px 8px;
}

.more-sheet-item {
    display: flex;
    align-items: center;
    gap: 16px;
    width: 100%;
    border: none;
    background: transparent;
    cursor: pointer;
    padding: 14px 16px;
    border-radius: 12px;
    color: var(--mud-palette-text-primary);
    transition: background 0.15s ease;
    text-align: left;
    -webkit-tap-highlight-color: transparent;
}

    .more-sheet-item:hover {
        background: var(--mud-palette-action-default-hover);
    }

    .more-sheet-item:active {
        background: var(--mud-palette-action-default-hover);
    }

.more-sheet-item-icon {
    color: var(--mud-palette-text-secondary);
    flex-shrink: 0;
}

.more-sheet-item-text {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}

.more-sheet-item-label {
    font-size: 15px;
    font-weight: 500;
    line-height: 1.3;
}

.more-sheet-item-desc {
    font-size: 12px;
    color: var(--mud-palette-text-secondary);
    line-height: 1.3;
}

.more-sheet-item-chevron {
    color: var(--mud-palette-text-secondary);
    opacity: 0.5;
    flex-shrink: 0;
}

.more-sheet-footer {
    padding: 4px 8px 12px;
    border-top: 1px solid var(--mud-palette-divider);
    margin: 4px 8px 0;
}

.more-sheet-theme-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    border-radius: 12px;
    cursor: pointer;
    color: var(--mud-palette-text-primary);
    font-size: 14px;
    font-weight: 500;
    transition: background 0.15s ease;
    -webkit-tap-highlight-color: transparent;
}

.more-sheet-theme-row:hover {
        background: var(--mud-palette-action-default-hover);
    }

.mobile-main-content {
    margin-bottom: 0;
}

.mobile-main-content.with-bottom-tab-bar {
    margin-bottom: 100px;
}

.desktop-main-content {
    margin-bottom: 100px;
}

.mobile-dashboard-shortcuts {
    border: 1px solid var(--mud-palette-divider);
    border-radius: 24px;
    padding: 1rem;
    background:
        linear-gradient(135deg, color-mix(in srgb, var(--mud-palette-primary) 10%, transparent), transparent 60%),
        var(--mud-palette-surface);
}

.home-dashboard {
    padding-bottom: 1rem;
}

.mobile-dashboard-shortcuts__header {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin-bottom: 0.9rem;
}

.mobile-dashboard-shortcuts__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
}

.mobile-dashboard-shortcuts__button {
    min-height: 52px;
    border-radius: 16px;
}

.marketplace-search-shell {
    border: 1px solid var(--mud-palette-divider);
    border-radius: 30px;
    padding: 0.6rem;
    background: color-mix(in srgb, var(--mud-palette-surface) 92%, var(--mud-palette-background));
}

.marketplace-search-shell__inner {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: nowrap;
}

.marketplace-search-shell__field {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    min-width: 0;
    padding: 0 0.35rem 0 0.25rem;
}

.marketplace-search-shell__icon {
    flex-shrink: 0;
    opacity: 0.65;
}

.marketplace-search-shell__input {
    flex: 1;
}

.marketplace-search-shell__button {
    border-radius: 999px;
    min-width: 110px;
}

.dashboard-section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.dashboard-section-heading__copy {
    min-width: 0;
}

.dashboard-section-heading__button {
    border-radius: 999px;
    white-space: nowrap;
}

.dashboard-section-heading__menu {
    margin-left: auto;
}

.campaign-spotlight {
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    gap: 0.7rem;
    padding: 1rem 1.15rem;
    border-radius: 24px;
    cursor: pointer;
    color: var(--mud-palette-text-primary);
    background:
        radial-gradient(circle at top right, color-mix(in srgb, var(--mud-palette-primary) 10%, transparent), transparent 38%),
        linear-gradient(180deg, color-mix(in srgb, var(--mud-palette-surface) 88%, var(--mud-palette-background)), var(--mud-palette-surface));
    border: 1px solid color-mix(in srgb, var(--mud-palette-divider) 80%, transparent);
}

.campaign-spotlight__chip {
    width: fit-content;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 0.3rem 0.65rem;
    border-radius: 999px;
    color: var(--mud-palette-primary);
    background: color-mix(in srgb, var(--mud-palette-primary) 12%, transparent);
}

.campaign-spotlight__title {
    line-height: 1.1;
    max-width: 18ch;
}

.campaign-spotlight__description {
    color: var(--mud-palette-text-secondary);
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    max-width: 34ch;
    margin: 0 auto;
}

.campaign-spotlight__footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.85rem;
    flex-wrap: wrap;
}

.campaign-spotlight__meta {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    align-items: center;
}

.campaign-spotlight__button {
    border-radius: 999px;
    white-space: nowrap;
}

@media (max-width: 600px) {
    .bottom-tab-bar {
        height: 68px;
        padding-left: 0.35rem;
        padding-right: 0.35rem;
    }

    .tab-item {
        flex: 1 1 0;
        min-width: 0;
        padding: 0.45rem 0.25rem 0.35rem;
    }

    .tab-label {
        font-size: 0.65rem;
    }

    .marketplace-search-shell {
        border-radius: 24px;
        padding: 0.65rem;
    }

    .marketplace-search-shell__inner {
        flex-direction: row;
        align-items: center;
        gap: 0.5rem;
    }

    .marketplace-search-shell__field {
        min-height: 48px;
        border-radius: 18px;
        background: color-mix(in srgb, var(--mud-palette-surface) 78%, var(--mud-palette-background));
        padding: 0 0.65rem;
        flex: 1 1 auto;
    }

    .marketplace-search-shell__button {
        width: auto;
        min-width: 96px;
        min-height: 48px;
        flex: 0 0 auto;
    }

    .dashboard-section-heading {
        flex-direction: column;
        align-items: stretch;
    }

    .dashboard-section-heading__button {
        width: 100%;
    }

    .dashboard-section-heading__menu {
        margin-left: 0;
        align-self: flex-end;
    }

    .campaign-spotlight {
        padding: 0.85rem 1rem;
        border-radius: 20px;
    }

    .campaign-spotlight__button {
        width: auto;
    }
}
