@font-face {
    font-family: 'Monaspace Argon';
    src: url('../fonts/MonaspaceArgon-Regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

html, body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background: #000000;
    color: #e0e0e0;
    margin: 0;
    padding: 0;
    min-height: 100vh;
}

h1:focus {
    outline: none;
}

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

a:hover, .btn-link:hover {
    color: #EF7627;
}

.btn-primary {
    color: #fff;
    background-color: #D52D00;
    border-color: #A30262;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem #000000, 0 0 0 0.25rem #D162A4;
}

.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 {
    color-scheme: light only;
    background: lightyellow;
    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;
    }

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

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

/* Loading Screen */
.loading-screen {
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #000;
    gap: 1rem;
}

.loading-logo {
    font-size: 5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #D52D00, #EF7627, #FF9A56, #D162A4, #B55690);
    background-size: 300% 300%;
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradient-shift 3s ease infinite, float 2s ease-in-out infinite;
    filter: drop-shadow(0 0 20px rgba(209, 98, 164, 0.5));
}

.loading-subtitle {
    font-size: 1.25rem;
    color: #888;
    letter-spacing: 0.5em;
    text-transform: uppercase;
    animation: fade-pulse 2s ease-in-out infinite;
}

.loading-bar-container {
    width: 200px;
    height: 4px;
    background: #1a1a1a;
    border-radius: 2px;
    overflow: hidden;
    margin-top: 1rem;
}

.loading-bar {
    height: 100%;
    width: var(--blazor-load-percentage, 0%);
    background: linear-gradient(90deg, #D52D00, #D162A4);
    border-radius: 2px;
    transition: width 0.1s ease-out;
    box-shadow: 0 0 10px rgba(209, 98, 164, 0.5);
}

.loading-message {
    color: #666;
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

.loading-message::after {
    content: "Summoning the compiler";
    animation: loading-messages 4s steps(1) infinite;
}

@keyframes loading-messages {
    0% { content: "Summoning the compiler"; }
    25% { content: "Brewing syntax magic"; }
    50% { content: "Parsing incantations"; }
    75% { content: "Invoking the runtime"; }
}

.loading-particles {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}

.loading-particles span {
    position: absolute;
    width: 6px;
    height: 6px;
    background: #D162A4;
    border-radius: 50%;
    animation: particle-float 3s ease-in-out infinite;
    opacity: 0;
}

.loading-particles span:nth-child(1) { left: 20%; animation-delay: 0s; }
.loading-particles span:nth-child(2) { left: 35%; animation-delay: 0.5s; }
.loading-particles span:nth-child(3) { left: 50%; animation-delay: 1s; }
.loading-particles span:nth-child(4) { left: 65%; animation-delay: 1.5s; }
.loading-particles span:nth-child(5) { left: 80%; animation-delay: 2s; }
.loading-particles span:nth-child(6) { left: 90%; animation-delay: 2.5s; }

@keyframes particle-float {
    0% { bottom: -10px; opacity: 0; transform: scale(0); }
    10% { opacity: 1; transform: scale(1); }
    90% { opacity: 1; }
    100% { bottom: 100%; opacity: 0; transform: scale(0.5); }
}

@keyframes gradient-shift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@keyframes fade-pulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

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

/* Animations */
@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes success-pulse {
    0% { box-shadow: 0 0 0 0 rgba(38, 176, 80, 0.4); }
    70% { box-shadow: 0 0 0 8px rgba(38, 176, 80, 0); }
    100% { box-shadow: 0 0 0 0 rgba(38, 176, 80, 0); }
}

@keyframes error-shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-4px); }
    40%, 80% { transform: translateX(4px); }
}

/* Magical text animations */
@keyframes glow-pulse {
    0%, 100% { filter: brightness(1) drop-shadow(0 0 2px currentColor); }
    50% { filter: brightness(1.2) drop-shadow(0 0 6px currentColor); }
}

@keyframes shimmer {
    0% { background-position: -200% center; }
    100% { background-position: 200% center; }
}

@keyframes magical-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-1px); }
}

@keyframes color-breathe {
    0%, 100% { filter: hue-rotate(0deg) brightness(1); }
    50% { filter: hue-rotate(10deg) brightness(1.1); }
}

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

/* Y# Playground */
.playground {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    height: calc(100vh - 4rem);
    padding: 1rem;
}

.editor-panel, .output-panel {
    display: flex;
    flex-direction: column;
    background: #000000;
    border-radius: 8px;
    padding: 1rem;
}

.editor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.editor-panel h3, .output-panel h3 {
    color: #ddd;
    margin: 0;
    font-size: 1rem;
}

.tour-nav {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.tour-btn {
    background: #1a1a1a;
    color: #e0e0e0;
    border: 1px solid #3c3c3c;
    border-radius: 4px;
    padding: 0.35rem 0.6rem;
    font-size: 0.875rem;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.tour-btn:hover:not(:disabled) {
    background: #2a2a2a;
    border-color: #D162A4;
}

.tour-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.tour-select {
    background: #0a0a0a;
    color: #e0e0e0;
    border: 1px solid #3c3c3c;
    border-radius: 4px;
    padding: 0.35rem 0.75rem;
    font-size: 0.875rem;
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    min-width: 140px;
}

.tour-select:hover {
    border-color: #D162A4;
}

.tour-select:focus {
    outline: none;
    border-color: #D162A4;
    box-shadow: 0 0 0 2px rgba(209, 98, 164, 0.3);
}

.editor-panel textarea {
    flex: 1;
    background: #0a0a0a;
    color: #d4d4d4;
    border: 1px solid #3c3c3c;
    border-radius: 4px;
    padding: 0.75rem;
    font-family: 'Monaspace Argon', 'Consolas', 'Monaco', monospace;
    font-size: 14px;
    line-height: 1.5;
    resize: none;
    tab-size: 4;
}

.editor-panel textarea:focus {
    outline: none;
    border-color: #D162A4;
}

.button-row {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.run-btn, .transpile-btn {
    padding: 0.5rem 1rem;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    position: relative;
    transition: background-color 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
}

.run-btn:focus, .transpile-btn:focus {
    outline: none;
    box-shadow: 0 0 0 2px #000000, 0 0 0 4px #D162A4;
}

.run-btn:focus:not(:focus-visible), .transpile-btn:focus:not(:focus-visible) {
    box-shadow: none;
}

.run-btn {
    background: #D52D00;
    flex: 1;
}

.run-btn:hover:not(:disabled) {
    background: #EF7627;
    transform: translateY(-1px);
}

.run-btn:active:not(:disabled) {
    transform: translateY(0);
}

.run-btn:disabled, .transpile-btn:disabled {
    background: #4b5563;
    cursor: not-allowed;
    opacity: 0.7;
}

.transpile-btn {
    background: #D162A4;
}

.transpile-btn:hover:not(:disabled) {
    background: #B55690;
    transform: translateY(-1px);
}

.transpile-btn:active:not(:disabled) {
    transform: translateY(0);
}

/* Button loading state */
.btn-loading {
    color: transparent !important;
}

.btn-loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

.tabs {
    display: flex;
    gap: 0.25rem;
    margin-bottom: 0.5rem;
}

.tabs button {
    padding: 0.5rem 1rem;
    background: #2d2d2d;
    color: #858585;
    border: none;
    border-bottom: 2px solid transparent;
    border-radius: 4px 4px 0 0;
    cursor: pointer;
    transition: color 0.15s ease, border-color 0.2s ease, background-color 0.15s ease, transform 0.1s ease;
}

.tabs button:focus {
    outline: none;
    box-shadow: inset 0 0 0 2px #D162A4;
}

.tabs button:focus:not(:focus-visible) {
    box-shadow: none;
}

.tabs button.active {
    background: #0a0a0a;
    color: #e0e0e0;
    border-bottom-color: #D162A4;
}

.tabs button:hover:not(.active) {
    color: #e0e0e0;
    border-bottom-color: #B55690;
    background: #353535;
}

.tabs button:active {
    transform: translateY(1px);
}

pre.output, pre.error {
    flex: 1;
    background: #0a0a0a;
    color: #d4d4d4;
    border: 1px solid #3c3c3c;
    border-radius: 4px;
    padding: 0.75rem;
    font-family: 'Monaspace Argon', 'Consolas', 'Monaco', monospace;
    font-size: 13px;
    line-height: 1.5;
    overflow: auto;
    margin: 0;
    white-space: pre-wrap;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

pre.output.success {
    border-color: #26b050;
    animation: success-pulse 0.5s ease-out;
}

pre.error {
    color: #f48771;
    border-color: #5a1d1d;
    animation: error-shake 0.4s ease;
}

@media (max-width: 768px) {
    .playground {
        grid-template-columns: 1fr;
        grid-template-rows: 1fr 1fr;
    }
}

/* Code Editor with Syntax Highlighting */
.code-editor {
    display: flex;
    flex: 1;
    background: #000000;
    border: 1px solid #1a1a1a;
    border-radius: 4px;
    overflow: hidden;
    font-family: 'Monaspace Argon', 'Consolas', 'Monaco', monospace;
    font-size: 14px;
    line-height: 1.5;
}

.line-numbers {
    background: #0a0a0a;
    color: #555;
    padding: 0.75rem 0.5rem;
    text-align: right;
    user-select: none;
    border-right: 1px solid #1a1a1a;
    min-width: 3rem;
}

.line-number {
    height: 1.5em;
}

.editor-container {
    position: relative;
    flex: 1;
    overflow: hidden;
    background: #000000;
}

.editor-scroll-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: auto;
}

.editor-content {
    display: grid;
    min-height: 300px;
}

.editor-content > * {
    grid-area: 1 / 1;
    margin: 0;
    padding: 0.75rem;
    border: 0;
    font-family: 'Monaspace Argon', 'Consolas', 'Monaco', monospace;
    font-size: 14px;
    line-height: 1.5;
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-wrap: break-word;
    tab-size: 4;
    box-sizing: border-box;
    letter-spacing: normal;
}

pre.highlighted-code {
    pointer-events: none;
    color: #d4d4d4;
    background: transparent;
    z-index: 1;
}

textarea.code-input {
    background: transparent;
    color: transparent;
    caret-color: #fff;
    border: none;
    outline: none;
    resize: none;
    z-index: 2;
    -webkit-text-fill-color: transparent;
}

.code-input::selection {
    background: rgba(38, 79, 120, 0.8);
}

/* Syntax highlighting - Lesbian Pride colors */
/* Flag: #D52D00, #EF7627, #FF9A56, #FFFFFF, #D162A4, #B55690, #A30262 */

/* Keywords - fiery red */
.tok-keyword {
    color: #D52D00;
    font-weight: 500;
}

/* For loops - cycling energy */
.tok-for {
    color: #D52D00;
    font-weight: 500;
    background: linear-gradient(
        90deg,
        #D52D00,
        #EF7627,
        #FF9A56,
        #EF7627,
        #D52D00
    );
    background-size: 300% auto;
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: loop-cycle 1.5s ease-in-out infinite;
    filter: drop-shadow(0 0 4px rgba(239, 118, 39, 0.6));
}

/* In keyword - swirling connector */
.tok-in {
    color: #D162A4;
    font-weight: 500;
    text-shadow:
        0 0 4px rgba(209, 98, 164, 0.6),
        0 0 8px rgba(209, 98, 164, 0.3);
    animation: loop-pulse 1.5s ease-in-out infinite;
}

@keyframes loop-cycle {
    0% { background-position: 0% center; }
    50% { background-position: 100% center; }
    100% { background-position: 0% center; }
}

@keyframes loop-pulse {
    0%, 100% {
        opacity: 0.7;
        text-shadow: 0 0 4px rgba(209, 98, 164, 0.4);
    }
    50% {
        opacity: 1;
        text-shadow: 0 0 8px rgba(209, 98, 164, 0.8), 0 0 12px rgba(209, 98, 164, 0.4);
    }
}

/* Types - pink */
.tok-type {
    color: #D162A4;
}

/* Void - the abyss, deep purple */
.tok-void {
    color: #4a1a6b;
    text-shadow: 0 0 8px rgba(74, 26, 107, 0.8);
}

/* Strings - warm amber */
.tok-string {
    color: #FF9A56;
}

/* Numbers - orange */
.tok-number {
    color: #EF7627;
}

/* Booleans - dusty pink */
.tok-bool {
    color: #B55690;
}

/* Identifiers - fallback */
.tok-ident {
    color: #e0e0e0;
}

/* Function calls - magical invocation */
.tok-func-call {
    color: #FFD700;
    text-shadow: 0 0 6px rgba(255, 215, 0, 0.5);
}

/* Method calls - chained magic */
.tok-method-call {
    color: #87CEEB;
    text-shadow: 0 0 4px rgba(135, 206, 235, 0.4);
}

/* Variable references - bound spirits */
.tok-var-ref {
    color: #98FB98;
}

/* Parameters - summoned values */
.tok-param {
    color: #DDA0DD;
    font-style: italic;
}

/* Type references - arcane classifications */
.tok-type-ref {
    color: #D162A4;
}

/* Operators - starlight with glow */
.tok-operator {
    color: #FFFFFF;
    text-shadow: 0 0 4px rgba(255, 255, 255, 0.8), 0 0 8px rgba(209, 98, 164, 0.4);
}

/* Arrows - flowing pink energy */
.tok-arrow {
    background: linear-gradient(
        90deg,
        #D162A4,
        #ff8ad4,
        #D162A4
    );
    background-size: 200% auto;
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: shimmer 2s linear infinite;
    filter: drop-shadow(0 0 6px rgba(209, 98, 164, 0.6));
}

/* Punctuation - subtle ember glow */
.tok-punct {
    color: #808080;
    text-shadow: 0 0 3px rgba(128, 128, 128, 0.4);
}

/* Colon - purple binding sigil */
.tok-colon {
    color: #9370DB;
    text-shadow: 0 0 4px rgba(147, 112, 219, 0.5);
}

/* Comments - dark rose */
.tok-comment {
    color: #A30262;
    font-style: italic;
    opacity: 0.85;
}