/**
 * Live Document Regeneration Animation System CSS
 * Styles for typing, blur, and reflow effects
 */

/* Enhanced typing effect keyframes with realistic cursor animation */
.typing-cursor {
    display: inline-block;
    background-color: currentColor;
    width: 2px;
    height: 1.2em;
    margin-left: 2px;
    animation: realistic-blink 1.2s infinite;
    vertical-align: baseline;
    border-radius: 1px;
    box-shadow: 0 0 2px rgba(0, 123, 255, 0.3);
}

/* Realistic cursor blinking with varied timing */
@keyframes realistic-blink {
    0%, 45% { opacity: 1; }
    46%, 55% { opacity: 0; }
    56%, 85% { opacity: 1; }
    86%, 100% { opacity: 0; }
}

/* Typing effect for individual characters */
@keyframes type-in {
    from { 
        opacity: 0; 
        transform: translateY(2px) scale(0.95);
    }
    to { 
        opacity: 1; 
        transform: translateY(0) scale(1);
    }
}

/* Character-by-character typing animation */
.typing-char {
    display: inline;
    opacity: 0;
    animation: type-in 0.1s ease-out forwards;
    animation-delay: var(--char-delay, 0s);
}

/* Word-by-word typing animation for smoother performance */
.typing-word {
    display: inline;
    opacity: 0;
    animation: type-in-word 0.3s ease-out forwards;
    animation-delay: var(--word-delay, 0s);
}

@keyframes type-in-word {
    from { 
        opacity: 0; 
        transform: translateX(-5px);
        filter: blur(1px);
    }
    to { 
        opacity: 1; 
        transform: translateX(0);
        filter: blur(0);
    }
}

/* Typing line animation for paragraphs */
.typing-line {
    display: block;
    opacity: 0;
    animation: type-in-line 0.5s ease-out forwards;
    animation-delay: var(--line-delay, 0s);
}

@keyframes type-in-line {
    from { 
        opacity: 0; 
        transform: translateY(10px);
        filter: blur(2px);
    }
    to { 
        opacity: 1; 
        transform: translateY(0);
        filter: blur(0);
    }
}

/* Streaming section styles */
.alya-document__section--streaming {
    position: relative;
    overflow: hidden;
}

.alya-document__section--streaming::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, #007bff, transparent);
    animation: streaming-progress 2s infinite;
    z-index: 1;
}

@keyframes streaming-progress {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Streaming content container */
.alya-document__streaming-content {
    position: relative;
    line-height: 1.6;
    word-wrap: break-word;
}

/* Streaming cursor */
.alya-document__streaming-cursor {
    display: inline-block;
    width: 2px;
    height: 1.2em;
    background-color: #007bff;
    margin-left: 2px;
    animation: pulse 1.5s infinite;
    vertical-align: baseline;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scaleY(1); }
    50% { opacity: 0.7; transform: scaleY(0.8); }
}

/* Content chunk styles */
.alya-document__content-chunk {
    display: inline;
    position: relative;
}

/* Enhanced blur-to-focus transition classes for smooth content appearance */
.alya-document__content-chunk--blurred {
    filter: blur(4px);
    opacity: 0.4;
    transform: scale(0.98);
    transition: filter 0.6s cubic-bezier(0.4, 0, 0.2, 1), 
                opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.alya-document__content-chunk--focusing {
    filter: blur(2px);
    opacity: 0.7;
    transform: scale(0.99);
}

.alya-document__content-chunk--focused {
    filter: blur(0px);
    opacity: 1;
    transform: scale(1);
}

/* Progressive blur reveal for different content types */
.blur-reveal-text {
    filter: blur(3px);
    opacity: 0.5;
    animation: blur-to-focus-text 0.8s ease-out forwards;
}

@keyframes blur-to-focus-text {
    0% { 
        filter: blur(3px); 
        opacity: 0.5; 
        transform: translateY(5px);
    }
    50% { 
        filter: blur(1px); 
        opacity: 0.8; 
        transform: translateY(2px);
    }
    100% { 
        filter: blur(0); 
        opacity: 1; 
        transform: translateY(0);
    }
}

.blur-reveal-heading {
    filter: blur(4px);
    opacity: 0.3;
    animation: blur-to-focus-heading 1s ease-out forwards;
}

@keyframes blur-to-focus-heading {
    0% { 
        filter: blur(4px); 
        opacity: 0.3; 
        transform: scale(0.95) translateY(10px);
    }
    60% { 
        filter: blur(1px); 
        opacity: 0.8; 
        transform: scale(0.98) translateY(3px);
    }
    100% { 
        filter: blur(0); 
        opacity: 1; 
        transform: scale(1) translateY(0);
    }
}

.blur-reveal-list {
    filter: blur(2px);
    opacity: 0.6;
    animation: blur-to-focus-list 0.6s ease-out forwards;
}

@keyframes blur-to-focus-list {
    0% { 
        filter: blur(2px); 
        opacity: 0.6; 
        transform: translateX(-10px);
    }
    100% { 
        filter: blur(0); 
        opacity: 1; 
        transform: translateX(0);
    }
}

/* Staggered blur reveal for multiple elements */
.blur-reveal-stagger {
    animation-delay: var(--stagger-delay, 0s);
}

/* Enhanced reflow animation utilities for height and position changes */
.alya-document__section-content {
    transition: height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

/* Reflow animation utilities */
.reflow-height {
    transition: height 0.5s cubic-bezier(0.4, 0, 0.2, 1),
                max-height 0.5s cubic-bezier(0.4, 0, 0.2, 1),
                min-height 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.reflow-width {
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1),
                max-width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.reflow-position {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                top 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.reflow-margin {
    transition: margin 0.4s cubic-bezier(0.4, 0, 0.2, 1),
                margin-top 0.4s cubic-bezier(0.4, 0, 0.2, 1),
                margin-bottom 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.reflow-padding {
    transition: padding 0.4s cubic-bezier(0.4, 0, 0.2, 1),
                padding-top 0.4s cubic-bezier(0.4, 0, 0.2, 1),
                padding-bottom 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Smooth content expansion */
.content-expand {
    animation: expand-content 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    transform-origin: top;
}

@keyframes expand-content {
    from {
        transform: scaleY(0);
        opacity: 0;
    }
    to {
        transform: scaleY(1);
        opacity: 1;
    }
}

/* Smooth content collapse */
.content-collapse {
    animation: collapse-content 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    transform-origin: top;
}

@keyframes collapse-content {
    from {
        transform: scaleY(1);
        opacity: 1;
    }
    to {
        transform: scaleY(0);
        opacity: 0;
    }
}

/* Layout shift prevention */
.prevent-layout-shift {
    contain: layout style;
    will-change: height, width;
}

/* Smooth scroll position preservation */
.preserve-scroll {
    scroll-behavior: smooth;
    overflow-anchor: auto;
}

/* Reflow with fade effect */
.reflow-fade {
    transition: height 0.5s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.3s ease-out;
}

.reflow-fade--expanding {
    animation: reflow-expand-fade 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes reflow-expand-fade {
    0% {
        height: 0;
        opacity: 0;
        transform: translateY(-10px);
    }
    50% {
        opacity: 0.5;
        transform: translateY(-5px);
    }
    100% {
        height: auto;
        opacity: 1;
        transform: translateY(0);
    }
}

/* Staggered reflow for multiple elements */
.reflow-stagger {
    animation-delay: var(--reflow-delay, 0s);
}

/* Performance-optimized reflow */
.reflow-optimized {
    will-change: height, transform;
    backface-visibility: hidden;
    transform: translateZ(0);
    contain: layout;
}

/* Enhanced performance optimizations with GPU acceleration */
.alya-document__section--streaming .alya-document__content-chunk {
    will-change: opacity, filter, transform;
    backface-visibility: hidden;
    transform: translateZ(0);
    contain: layout style paint;
}

/* GPU-accelerated animation classes */
.gpu-accelerated {
    will-change: transform, opacity, filter;
    transform: translateZ(0);
    backface-visibility: hidden;
    perspective: 1000px;
}

.gpu-transform {
    transform: translate3d(0, 0, 0);
}

.gpu-optimized-animation {
    contain: layout style paint;
    isolation: isolate;
}

/* Performance-optimized reflow */
.reflow-optimized {
    will-change: height, transform;
    backface-visibility: hidden;
    transform: translateZ(0);
    contain: layout;
}

.prevent-layout-shift {
    contain: layout style;
    will-change: height, width;
}

/* Enhanced typing character animations with GPU acceleration */
.typing-char {
    display: inline;
    opacity: 0;
    transform: translateY(2px) scale(0.95) translateZ(0);
    animation: type-in-gpu 0.1s ease-out forwards;
    animation-delay: var(--char-delay, 0s);
    will-change: opacity, transform;
    backface-visibility: hidden;
}

@keyframes type-in-gpu {
    from { 
        opacity: 0; 
        transform: translateY(2px) scale(0.95) translateZ(0);
    }
    to { 
        opacity: 1; 
        transform: translateY(0) scale(1) translateZ(0);
    }
}

/* GPU-accelerated blur transitions */
.blur-reveal-gpu {
    filter: blur(3px);
    opacity: 0.5;
    transform: translateY(5px) translateZ(0);
    animation: blur-to-focus-gpu 0.8s ease-out forwards;
    will-change: filter, opacity, transform;
    backface-visibility: hidden;
}

@keyframes blur-to-focus-gpu {
    0% { 
        filter: blur(3px); 
        opacity: 0.5; 
        transform: translateY(5px) translateZ(0);
    }
    50% { 
        filter: blur(1px); 
        opacity: 0.8; 
        transform: translateY(2px) translateZ(0);
    }
    100% { 
        filter: blur(0); 
        opacity: 1; 
        transform: translateY(0) translateZ(0);
    }
}

/* Memory-efficient animations */
.memory-optimized {
    contain: strict;
    content-visibility: auto;
}

/* Performance monitoring indicators */
.performance-warning {
    border-left: 3px solid #ffc107;
    background-color: rgba(255, 193, 7, 0.1);
}

.performance-critical {
    border-left: 3px solid #dc3545;
    background-color: rgba(220, 53, 69, 0.1);
}

/* Adaptive performance classes */
.animation-level-0 {
    /* Full animations */
    animation-duration: 1s;
    transition-duration: 0.4s;
}

.animation-level-1 {
    /* Reduced animations */
    animation-duration: 0.5s;
    transition-duration: 0.2s;
}

.animation-level-2 {
    /* Minimal animations */
    animation-duration: 0.1s;
    transition-duration: 0.05s;
}

/* Frame rate optimization */
@media (max-resolution: 1dppx) {
    /* Lower resolution displays - reduce animation complexity */
    .typing-char,
    .blur-reveal-gpu {
        animation-duration: 0.2s;
    }
}

@media (min-resolution: 2dppx) {
    /* High DPI displays - can handle more complex animations */
    .typing-char {
        animation-duration: 0.08s;
    }
    
    .blur-reveal-gpu {
        animation-duration: 0.6s;
    }
}

/* Animation timing utilities */
.animation-speed-slow {
    animation-duration: 2s !important;
    transition-duration: 0.8s !important;
}

.animation-speed-normal {
    animation-duration: 1s !important;
    transition-duration: 0.4s !important;
}

.animation-speed-fast {
    animation-duration: 0.5s !important;
    transition-duration: 0.2s !important;
}

.animation-speed-instant {
    animation-duration: 0.1s !important;
    transition-duration: 0.05s !important;
}

/* Animation delay utilities */
.animation-delay-100 { animation-delay: 0.1s; }
.animation-delay-200 { animation-delay: 0.2s; }
.animation-delay-300 { animation-delay: 0.3s; }
.animation-delay-500 { animation-delay: 0.5s; }
.animation-delay-700 { animation-delay: 0.7s; }
.animation-delay-1000 { animation-delay: 1s; }

/* Content type specific animations */
.animate-paragraph {
    animation: type-in-line 0.6s ease-out forwards;
}

.animate-heading {
    animation: blur-to-focus-heading 1s ease-out forwards;
}

.animate-list-item {
    animation: blur-to-focus-list 0.6s ease-out forwards;
}

.animate-table-row {
    animation: slide-in-row 0.4s ease-out forwards;
}

@keyframes slide-in-row {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Interactive animation states */
.animation-paused {
    animation-play-state: paused !important;
}

.animation-running {
    animation-play-state: running !important;
}

/* Smooth state transitions */
.state-transition {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* GPU acceleration for smooth animations */
.alya-document__streaming-content,
.alya-document__streaming-cursor,
.typing-cursor {
    will-change: transform, opacity;
    transform: translateZ(0);
}

/* Enhanced reduced motion media query support for accessibility */
@media (prefers-reduced-motion: reduce) {
    /* Disable all cursor animations */
    .typing-cursor,
    .alya-document__streaming-cursor {
        animation: none;
        opacity: 1;
    }
    
    /* Disable streaming progress indicators */
    .alya-document__section--streaming::before {
        animation: none;
        display: none;
    }
    
    /* Simplify all typing animations */
    .typing-char,
    .typing-word,
    .typing-line {
        animation: none;
        opacity: 1;
        transform: none;
        filter: none;
    }
    
    /* Disable blur transitions */
    .alya-document__content-chunk--blurred,
    .alya-document__content-chunk--focusing,
    .alya-document__content-chunk--focused,
    .blur-reveal-text,
    .blur-reveal-heading,
    .blur-reveal-list {
        filter: none;
        opacity: 1;
        transform: none;
        transition: none;
        animation: none;
    }
    
    /* Simplify reflow animations */
    .alya-document__section-content,
    .reflow-height,
    .reflow-width,
    .reflow-position,
    .reflow-margin,
    .reflow-padding,
    .reflow-fade {
        transition: none;
        animation: none;
    }
    
    /* Disable content expansion/collapse animations */
    .content-expand,
    .content-collapse,
    .reflow-fade--expanding {
        animation: none;
        transform: none;
        opacity: 1;
    }
    
    /* Provide instant feedback instead of animations */
    .alya-document__section--complete::after {
        animation: none;
        opacity: 1;
        transform: none;
    }
    
    /* Maintain functionality with reduced motion */
    .alya-document__content-chunk--focused {
        opacity: 1;
        filter: none;
        transform: none;
    }
    
    /* Keep essential transitions but make them instant */
    .alya-animation-controls__button {
        transition: background-color 0.1s;
    }
    
    /* Preserve scroll behavior but make it instant */
    .alya-document {
        scroll-behavior: auto;
    }
    
    .preserve-scroll {
        scroll-behavior: auto;
    }
}

/* Respect user's motion preferences with fine-grained control */
@media (prefers-reduced-motion: no-preference) {
    /* Enhanced animations for users who prefer motion */
    .typing-cursor {
        animation: realistic-blink 1.2s infinite, cursor-pulse 2s infinite alternate;
    }
    
    @keyframes cursor-pulse {
        from { box-shadow: 0 0 2px rgba(0, 123, 255, 0.3); }
        to { box-shadow: 0 0 8px rgba(0, 123, 255, 0.6); }
    }
    
    /* Add subtle hover effects for interactive elements */
    .alya-animation-controls__button:hover {
        transform: translateY(-1px);
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    }
}

/* Mobile optimizations */
@media (max-width: 768px) {
    .typing-cursor,
    .alya-document__streaming-cursor {
        width: 1px;
        height: 1em;
    }
    
    .alya-document__streaming-content {
        font-size: 0.95em;
        line-height: 1.5;
    }
    
    /* Reduce animation complexity on mobile */
    .alya-document__section--streaming::before {
        animation-duration: 3s;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .typing-cursor,
    .alya-document__streaming-cursor {
        background-color: currentColor;
    }
    
    .alya-document__section--streaming::before {
        background: currentColor;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .alya-document__streaming-cursor {
        background-color: #4dabf7;
    }
    
    .alya-document__section--streaming::before {
        background: linear-gradient(90deg, transparent, #4dabf7, transparent);
    }
}

/* Loading states */
.alya-document__section--loading {
    position: relative;
}

.alya-document__section--loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Enhanced loading states for streaming sections */
.alya-document__loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: rgba(0, 123, 255, 0.05);
    border: 1px dashed rgba(0, 123, 255, 0.2);
    border-radius: 8px;
    margin: 1rem 0;
}

.alya-document__loading-spinner {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    color: #007bff;
}

.alya-document__loading-spinner i {
    font-size: 1.2rem;
}

.alya-document__loading-progress {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    max-width: 200px;
}

.alya-document__progress-bar {
    width: 100%;
    height: 4px;
    background: rgba(0, 123, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
}

.alya-document__progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #007bff, #0056b3);
    border-radius: 2px;
    transition: width 0.3s ease-out;
    animation: progress-shimmer 2s infinite;
}

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

.alya-document__progress-text {
    font-size: 0.8rem;
    color: #6c757d;
    font-weight: 500;
}

/* Streaming indicator styles */
.alya-document__streaming-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.8rem;
    color: #007bff;
    background: rgba(0, 123, 255, 0.1);
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    margin-left: 0.5rem;
}

.alya-document__streaming-indicator i {
    animation: stream-pulse 1.5s infinite;
}

@keyframes stream-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(0.9); }
}

/* Section status indicators */
.alya-document__section-status {
    display: inline-flex;
    align-items: center;
    margin-left: 0.5rem;
    font-size: 0.9rem;
}

.alya-document__section-status i {
    color: #28a745;
}

/* Staging area styles */
.alya-document__staging-area,
.alya-document__content-staging {
    position: relative;
    overflow: hidden;
}

.alya-document__staging-content,
.alya-document__staged-content {
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s ease-out, transform 0.3s ease-out;
}

.alya-document__staging-content--visible,
.alya-document__staged-content--visible {
    opacity: 1;
    transform: translateY(0);
}

/* Streaming placeholder enhancements */
.alya-document__streaming-placeholder {
    position: relative;
    min-height: 2rem;
    background: linear-gradient(90deg, 
        rgba(0, 123, 255, 0.05) 0%, 
        rgba(0, 123, 255, 0.1) 50%, 
        rgba(0, 123, 255, 0.05) 100%);
    border-radius: 4px;
    padding: 1rem;
    margin: 0.5rem 0;
}

.alya-document__streaming-placeholder::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(255, 255, 255, 0.4), 
        transparent);
    animation: streaming-shimmer 2s infinite;
}

@keyframes streaming-shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* Error states */
.alya-document__section--error {
    border-left: 4px solid #dc3545;
    background-color: #f8d7da;
    padding: 1rem;
    margin: 1rem 0;
    border-radius: 4px;
}

.alya-document__section--error::before {
    content: '⚠️ ';
    font-weight: bold;
    color: #721c24;
}

/* Success states */
.alya-document__section--complete {
    position: relative;
}

.alya-document__section--complete::after {
    content: '✓';
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    color: #28a745;
    font-weight: bold;
    font-size: 1.2em;
    opacity: 0;
    animation: fadeInSuccess 0.5s ease-in-out 0.2s forwards;
}

@keyframes fadeInSuccess {
    from { opacity: 0; transform: scale(0.8); }
    to { opacity: 1; transform: scale(1); }
}

/* Smooth scroll behavior */
.alya-document {
    scroll-behavior: smooth;
}

/* Focus management during streaming */
.alya-document__section--streaming:focus-within {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

/* Performance monitoring indicator */
.alya-performance-indicator {
    position: fixed;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-family: monospace;
    z-index: 9999;
    display: none;
}

.alya-performance-indicator--visible {
    display: block;
}

.alya-performance-indicator--warning {
    background: rgba(255, 193, 7, 0.9);
    color: black;
}

.alya-performance-indicator--error {
    background: rgba(220, 53, 69, 0.9);
    color: white;
}

/* Performance notification */
.alya-performance-notification {
    position: fixed;
    top: 50px;
    right: 10px;
    background: rgba(255, 193, 7, 0.95);
    color: #856404;
    padding: 10px 15px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    max-width: 300px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(255, 193, 7, 0.3);
    z-index: 9998;
    display: none;
    animation: slideInNotification 0.3s ease-out;
}

@keyframes slideInNotification {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.alya-performance-notification::before {
    content: '⚠️ ';
    margin-right: 5px;
}

/* Performance optimization level indicators */
.animation-level-0 .alya-document__section--streaming::before {
    animation-duration: 2s;
}

.animation-level-1 .alya-document__section--streaming::before {
    animation-duration: 3s;
}

.animation-level-2 .alya-document__section--streaming::before {
    animation: none;
    display: none;
}

/* Memory usage indicator */
.alya-memory-indicator {
    position: fixed;
    bottom: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 5px 8px;
    border-radius: 3px;
    font-size: 11px;
    font-family: monospace;
    z-index: 9997;
    display: none;
}

.alya-memory-indicator--visible {
    display: block;
}

.alya-memory-indicator--warning {
    background: rgba(255, 193, 7, 0.8);
    color: black;
}

.alya-memory-indicator--critical {
    background: rgba(220, 53, 69, 0.8);
    color: white;
}

/* Animation controls */
.alya-animation-controls {
    position: sticky;
    top: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid #e9ecef;
    padding: 0.5rem 1rem;
    display: flex;
    gap: 0.5rem;
    align-items: center;
    z-index: 100;
}

.alya-animation-controls__button {
    background: #007bff;
    color: white;
    border: none;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.875rem;
    transition: background-color 0.2s;
}

.alya-animation-controls__button:hover {
    background: #0056b3;
}

.alya-animation-controls__button:disabled {
    background: #6c757d;
    cursor: not-allowed;
}

.alya-animation-controls__speed {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.875rem;
}

.alya-animation-controls__speed input[type="range"] {
    width: 80px;
}

/* Accessibility improvements */
.alya-document__streaming-content[aria-live="polite"] {
    /* Screen reader will announce content as it's added */
}

/* Print styles */
@media print {
    .alya-document__section--streaming::before,
    .alya-document__streaming-cursor,
    .typing-cursor,
    .alya-animation-controls,
    .alya-performance-indicator {
        display: none !important;
    }
    
    .alya-document__content-chunk--blurred {
        filter: none;
        opacity: 1;
    }
}