/* Shentox Font - EVE Echoes Typography */
@font-face {
    font-family: 'Shentox';
    src: url('../fonts/Shentox.woff2') format('woff2'),
         url('../fonts/Shentox.woff') format('woff');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Shentox';
    src: url('../fonts/Shentox_SemiBold.woff2') format('woff2'),
         url('../fonts/Shentox_SemiBold.woff') format('woff');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

html, body {
    font-family: 'Shentox', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background-color: #0B1020;
    color: #E5E7EB;
    /* iOS touch improvements */
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    /* iOS safe area support */
    padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

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 {
    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,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh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44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) 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;
}

/* EVE Echoes Visual Effects */
.eve-card {
    background: rgba(17, 24, 39, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.5), 0 2px 4px -1px rgba(0, 0, 0, 0.3);
}

.eve-card:hover {
    border-color: rgba(44, 161, 208, 0.3);
    box-shadow: 0 0 20px rgba(44, 161, 208, 0.2);
}

.eve-border-glow {
    border: 1px solid rgba(44, 161, 208, 0.3);
    box-shadow: 0 0 10px rgba(44, 161, 208, 0.2);
}

.eve-border-gold {
    border: 1px solid rgba(212, 175, 55, 0.3);
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.2);
}

.eve-border-purple {
    border: 1px solid rgba(139, 92, 246, 0.3);
    box-shadow: 0 0 10px rgba(139, 92, 246, 0.2);
}

.eve-text-glow {
    text-shadow: 0 0 10px rgba(44, 161, 208, 0.5);
}

.eve-text-gold {
    color: #D4AF37;
    text-shadow: 0 0 8px rgba(212, 175, 55, 0.4);
}

.eve-heading {
    font-weight: 600;
    letter-spacing: -0.01em;
    text-transform: uppercase;
}

/* EVE-style divider */
.eve-divider {
    height: 1px;
    background: linear-gradient(to right, transparent, rgba(44, 161, 208, 0.5), transparent);
}

/* EVE-style button enhancement */
.eve-button {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.eve-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s ease;
}

.eve-button:hover::before {
    left: 100%;
}

/* EVE-style data grid/table */
.eve-table {
    background: rgba(17, 24, 39, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.eve-table thead {
    background: rgba(15, 23, 42, 0.95);
    border-bottom: 2px solid rgba(44, 161, 208, 0.3);
}

.eve-table tbody tr {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: background-color 0.2s ease;
}

.eve-table tbody tr:hover {
    background: rgba(44, 161, 208, 0.1);
}

/* Sci-fi corner accents */
.eve-corner {
    position: relative;
}

.eve-corner::before,
.eve-corner::after {
    content: '';
    position: absolute;
    width: 12px;
    height: 12px;
    border: 2px solid rgba(44, 161, 208, 0.5);
}

.eve-corner::before {
    top: -1px;
    left: -1px;
    border-right: none;
    border-bottom: none;
}

.eve-corner::after {
    bottom: -1px;
    right: -1px;
    border-left: none;
    border-top: none;
}

/* Loading spinner EVE style */
.eve-spinner {
    border: 3px solid rgba(44, 161, 208, 0.2);
    border-top-color: #2CA1D0;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: eve-spin 1s linear infinite;
}

@keyframes eve-spin {
    to { transform: rotate(360deg); }
}

/* Status indicators */
.eve-status-active {
    color: #10B981;
    text-shadow: 0 0 8px rgba(16, 185, 129, 0.5);
}

.eve-status-warning {
    color: #FFB800;
    text-shadow: 0 0 8px rgba(255, 184, 0, 0.5);
}

.eve-status-error {
    color: #EF4444;
    text-shadow: 0 0 8px rgba(239, 68, 68, 0.5);
}

/* Fix scrolling in MudBlazor layout */
html, body {
    height: 100%;
    /* Note: overflow is managed by JavaScript in index.html - hidden during splash, auto after */
}

#app {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.mud-layout {
    /* Use dvh (dynamic viewport height) for iOS Safari, with vh fallback for older browsers */
    height: 100vh;
    height: 100dvh;
    display: flex;
    flex-direction: column;
}

.mud-main-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
}

.mud-container {
    min-height: auto;
    padding-bottom: 2rem;
}

/* Job Progress Bar - CSS-based animation (no Blazor re-renders needed)
   The browser handles the animation at 60fps using CSS variables */
.job-progress-container {
    width: 100%;
    height: 8px;
    background: rgba(44, 161, 208, 0.2);
    border-radius: 4px;
    overflow: hidden;
    min-width: 100px;
}

.job-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #2CA1D0, #1E90FF);
    border-radius: 4px;
    animation: job-progress-fill linear forwards;
    animation-duration: var(--job-duration, 1s);
    animation-delay: var(--job-elapsed-negative, 0s);
}

@keyframes job-progress-fill {
    from { width: 0%; }
    to { width: 100%; }
}

/* ================================================
   MOBILE RESPONSIVENESS
   ================================================ */

/* Mobile-first breakpoints:
   - xs: 0-599px (mobile phones)
   - sm: 600-959px (tablets portrait)
   - md: 960px+ (tablets landscape, desktop)
*/

@media (max-width: 599px) {
    /* Dialog full-width on mobile */
    .mud-dialog {
        width: 95vw !important;
        max-width: 95vw !important;
        margin: 0.5rem !important;
    }

    .mud-dialog-content {
        padding: 12px !important;
    }

    /* Right sidebar full-width on mobile */
    .mud-drawer-right {
        width: 95% !important;
    }

    /* Touch targets - minimum 48px for accessibility */
    .mud-button:not(.mud-button-icon) {
        min-height: 44px;
        padding-left: 16px;
        padding-right: 16px;
    }

    .mud-icon-button {
        width: 44px !important;
        height: 44px !important;
    }

    .mud-checkbox .mud-button-root {
        width: 44px !important;
        height: 44px !important;
    }

    /* DataGrid mobile improvements */
    .mud-table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Remove sticky columns on mobile - allow natural scroll */
    .mud-table-cell[style*="sticky"] {
        position: relative !important;
        left: auto !important;
        right: auto !important;
    }

    /* Reduce padding in table cells for more space */
    .mud-table-cell {
        padding: 8px 6px !important;
    }

    /* Stack toolbar items vertically on mobile */
    .mud-toolbar-content {
        flex-wrap: wrap;
        gap: 8px;
    }

    /* Full-width search fields on mobile */
    .mud-input-control {
        min-width: 0 !important;
    }

    .mud-toolbar .mud-input-control {
        width: 100% !important;
        max-width: none !important;
    }

    /* Footer links stack better on mobile */
    footer .mud-stack {
        flex-direction: column !important;
        align-items: center !important;
        gap: 12px !important;
    }

    /* Smaller chips on mobile */
    .mud-chip {
        font-size: 0.75rem;
        height: 24px;
    }

    /* Reduce typography sizes slightly on mobile */
    .mud-typography-h4 {
        font-size: 1.5rem !important;
    }

    .mud-typography-h6 {
        font-size: 1rem !important;
    }
}

/* Tablet styles (600-959px) */
@media (min-width: 600px) and (max-width: 959px) {
    /* Right sidebar 70% on tablet */
    .mud-drawer-right {
        width: 70% !important;
    }

    /* Touch targets slightly larger on tablets */
    .mud-icon-button {
        width: 40px !important;
        height: 40px !important;
    }
}

/* Hide elements on mobile only */
@media (max-width: 599px) {
    .hide-on-mobile {
        display: none !important;
    }
}

/* Hide elements on tablet and mobile */
@media (max-width: 959px) {
    .hide-on-tablet-down {
        display: none !important;
    }
}

/* Show elements only on mobile */
@media (min-width: 600px) {
    .show-on-mobile-only {
        display: none !important;
    }
}

/* ================================================
   iOS-SPECIFIC FIXES
   ================================================ */

/* Prevent iOS from auto-zooming on input focus (requires 16px min font size) */
@media screen and (-webkit-min-device-pixel-ratio: 0) and (max-width: 959px) {
    input, textarea, select {
        font-size: 16px !important;
    }

    .mud-input-root input,
    .mud-input-root textarea {
        font-size: 16px !important;
    }
}

/* Fix iOS input appearance issues */
input, textarea, select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    border-radius: 0;
}

/* Fix iOS button styling */
button, input[type="button"], input[type="submit"] {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

/* Ensure touch scrolling works smoothly on iOS */
.mud-main-content,
.mud-drawer-content,
.mud-table-container {
    -webkit-overflow-scrolling: touch;
}

/* Fix iOS Safari 100vh issue for dialogs */
.mud-dialog-container {
    max-height: 100vh;
    max-height: 100dvh;
}

/* Prevent iOS text selection during tap */
.mud-button, .mud-icon-button, .mud-list-item {
    -webkit-user-select: none;
    user-select: none;
}

/* ================================================
   AD BANNER STYLES
   ================================================ */
.ad-banner {
    width: 100%;
    text-align: center;
}

.ad-placeholder {
    background: linear-gradient(135deg, rgba(17, 24, 39, 0.95) 0%, rgba(15, 23, 42, 0.98) 100%);
    border: 1px dashed rgba(255, 184, 0, 0.3);
    border-radius: 8px;
    min-height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Responsive ad sizing */
@media (max-width: 599px) {
    .ad-placeholder {
        min-height: 60px;
    }

    .ad-banner .mud-button {
        font-size: 0.75rem;
        padding: 4px 12px;
        min-height: 32px;
    }
}