.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+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

/* Session Overlay Styles */
.session-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    z-index: 600;
    border-radius: inherit;
}

.dark .session-overlay {
    background: rgba(30, 41, 59, 0.75);
}

.session-overlay.visible {
    opacity: 1;
    visibility: visible;
}

.overlay-content {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 28px 32px;
    text-align: center;
    max-width: 420px;
    width: 80%;
    box-shadow: 0 20px 40px -12px rgba(0, 0, 0, 0.15), 
                0 0 0 1px rgba(255, 255, 255, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.6);
    color: #1f2937;
    position: relative;
    overflow: hidden;
    z-index: 101;
}

/* Glassmorphism background pattern */
.overlay-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, 
                              rgba(255, 255, 255, 0.1) 0%, 
                              rgba(255, 255, 255, 0.05) 50%, 
                              rgba(255, 255, 255, 0.15) 100%);
    pointer-events: none;
    z-index: -1;
}

.dark .overlay-content {
    background: rgba(30, 41, 59, 0.90);
    border: 1px solid rgba(148, 163, 184, 0.25);
    box-shadow: 0 20px 40px -12px rgba(0, 0, 0, 0.4), 
                0 0 0 1px rgba(148, 163, 184, 0.15);
    color: #f1f5f9;
}

.dark .overlay-content::before {
    background: linear-gradient(135deg, 
                              rgba(148, 163, 184, 0.1) 0%, 
                              rgba(148, 163, 184, 0.05) 50%, 
                              rgba(148, 163, 184, 0.15) 100%);
}

.session-overlay h3 {
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 12px 0;
    color: #1e293b;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.dark .session-overlay h3 {
    background: linear-gradient(135deg, #60a5fa, #3b82f6);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.status-text {
    font-size: 15px;
    color: #64748b;
    margin: 0 0 24px 0;
    font-weight: 500;
}

.dark .status-text {
    color: #94a3b8;
}

/* Collecting State */
.collecting-state {
    color: inherit;
}

.spinner-container {
    margin-bottom: 4px;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 3px solid rgba(59, 130, 246, 0.2);
    border-top-color: #3b82f6;
    border-radius: 50%;
    margin: 0 auto 20px;
    animation: spin 1s linear infinite;
}

.dark .spinner {
    border: 3px solid rgba(96, 165, 250, 0.2);
    border-top-color: #60a5fa;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 28px;
}

.stat-item {
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(8px);
    border-radius: 16px;
    padding: 16px 12px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.dark .stat-item {
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid rgba(148, 163, 184, 0.2);
}

.stat-value {
    font-size: 24px;
    font-weight: 700;
    color: #3b82f6;
    line-height: 1;
    display: block;
}

.dark .stat-value {
    color: #60a5fa;
}

.stat-label {
    font-size: 12px;
    color: #64748b;
    margin-top: 6px;
    font-weight: 500;
    display: block;
}

.dark .stat-label {
    color: #94a3b8;
}

.stop-button {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    border: none;
    padding: 12px 28px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.stop-button:hover {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(239, 68, 68, 0.4);
}

/* Processing State */
.processing-state {
    color: inherit;
}

.processing-animation {
    width: 60px;
    height: 60px;
    margin: 0 auto 20px;
    position: relative;
}

.processing-bar {
    width: 100%;
    height: 4px;
    background: rgba(59, 130, 246, 0.2);
    border-radius: 2px;
    position: relative;
    overflow: hidden;
}

.processing-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, #3b82f6, transparent);
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% { left: -100%; }
    100% { left: 100%; }
}

.progress-info {
    margin-top: 16px;
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: rgba(59, 130, 246, 0.2);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6, #1d4ed8);
    border-radius: 3px;
    transition: width 0.3s ease;
}

.progress-text {
    font-size: 13px;
    font-weight: 600;
    color: #3b82f6;
}

.dark .progress-text {
    color: #60a5fa;
}

/* Error State */
.error-state {
    color: inherit;
}

.error-icon {
    font-size: 48px;
    margin: 0 auto 16px;
    display: block;
}

.retry-button {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: white;
    border: none;
    padding: 12px 28px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.retry-button:hover {
    background: linear-gradient(135deg, #1d4ed8, #1e40af);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.4);
}

/* Mobile responsiveness */
@media (max-width: 640px) {
    .overlay-content {
        padding: 24px 20px;
        width: 90%;
    }
    
    .session-overlay h3 {
        font-size: 20px;
    }
    
    .stats-grid {
        gap: 12px;
    }
    
    .stat-item {
        padding: 12px 8px;
    }
    
    .stat-value {
        font-size: 20px;
    }
    
    .stat-label {
        font-size: 11px;
    }
}

/* Dyno Spinner - Main rotating rings */
.dyno-spinner {
    position: relative;
    width: 8rem;
    height: 8rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.spinner-ring {
    position: absolute;
    border: 3px solid transparent;
    border-radius: 50%;
    width: 100%;
    height: 100%;
}

.spinner-ring:nth-child(1) {
    border-top: 3px solid #3b82f6;
    border-right: 3px solid #3b82f6;
    animation: dyno-spin 2s linear infinite;
}

.spinner-ring-2 {
    border-bottom: 3px solid #6366f1;
    border-left: 3px solid #6366f1;
    width: 70%;
    height: 70%;
    animation: dyno-spin 1.5s linear infinite reverse;
}

.spinner-center {
    position: relative;
    width: 2.5rem;
    height: 2.5rem;
    background: rgba(59, 130, 246, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(59, 130, 246, 0.2);
    animation: pulse-glow 2s ease-in-out infinite;
}

.dyno-icon {
    font-size: 1.25rem;
    color: #3b82f6;
    animation: icon-pulse 1s ease-in-out infinite alternate;
}

/* Loading dots */
.loading-dots {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    align-items: center;
    height: 1rem;
}

.dot {
    width: 0.5rem;
    height: 0.5rem;
    background: #3b82f6;
    border-radius: 50%;
    animation: dot-bounce 1.4s ease-in-out infinite both;
}

.dot:nth-child(1) { animation-delay: -0.32s; }
.dot:nth-child(2) { animation-delay: -0.16s; }
.dot:nth-child(3) { animation-delay: 0s; }

/* Animations */
@keyframes dyno-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 0 10px rgba(59, 130, 246, 0.3);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 0 20px rgba(59, 130, 246, 0.6);
        transform: scale(1.05);
    }
}

@keyframes icon-pulse {
    0% {
        opacity: 0.7;
        transform: scale(0.95);
    }
    100% {
        opacity: 1;
        transform: scale(1.05);
    }
}

@keyframes dot-bounce {
    0%, 80%, 100% {
        transform: scale(0);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .spinner-center {
        background: rgba(99, 102, 241, 0.1);
        border-color: rgba(99, 102, 241, 0.2);
    }
    
    .dyno-icon {
        color: #6366f1;
    }
    
    .dot {
        background: #6366f1;
    }
    
    .spinner-ring:nth-child(1) {
        border-top-color: #6366f1;
        border-right-color: #6366f1;
    }
}

.loading-progress-text {
    text-align: center;
    font-weight: 500;
    font-size: 0.875rem;
}

    .loading-progress-text:after {
        content: var(--blazor-load-percentage-text, "Loading");
    }

code {
    color: #c02d76;
}

/* Chart responsiveness fixes */
.unified-rpm-chart {
    max-width: 100%;
    overflow: hidden;
    contain: layout style size;
}

.unified-rpm-chart canvas,
.unified-rpm-chart svg {
    max-width: 100% !important;
    height: auto;
    object-fit: contain;
}

.chart-svg {
    max-width: 100% !important;
    height: auto !important;
    object-fit: contain;
}
