/**
 * Maze Animation Styles
 * Responsive styling for the canvas maze animation
 */

.maze-container {
    position: relative;
    width: 100vw;
    margin-left: calc(-50vw + 50%);
    margin-right: calc(-50vw + 50%);
    padding: 10px 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 0;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

.maze-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 50%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 80%, rgba(255, 255, 255, 0.1) 0%, transparent 50%);
    pointer-events: none;
}

#maze-canvas {
    display: block;
    width: 100vw;
    height: auto;
    min-height: 200px;
    border-radius: 0;
    background: #34495e;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

/* Animation controls */
.maze-controls {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    gap: 5px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.maze-container:hover .maze-controls {
    opacity: 1;
}

.maze-control-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    padding: 5px 8px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
    transition: background 0.2s ease;
    backdrop-filter: blur(10px);
}

.maze-control-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.maze-control-btn:active {
    transform: scale(0.95);
}

/* Status indicator */
.maze-status {
    position: absolute;
    bottom: 10px;
    left: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 4px 8px;
    border-radius: 3px;
    font-size: 11px;
    font-family: monospace;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.maze-container:hover .maze-status {
    opacity: 1;
}

/* Responsive design */
@media (max-width: 768px) {
    .maze-container {
        padding: 8px 0;
    }
    
    #maze-canvas {
        min-height: 150px;
    }
    
    .maze-controls {
        opacity: 1; /* Always show on mobile */
    }
    
    .maze-status {
        opacity: 1; /* Always show on mobile */
    }
}

@media (max-width: 480px) {
    .maze-container {
        padding: 5px 0;
    }
    
    #maze-canvas {
        min-height: 120px;
    }
    
    .maze-control-btn {
        padding: 3px 6px;
        font-size: 10px;
    }
    
    .maze-status {
        font-size: 10px;
        padding: 3px 6px;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .maze-container {
        animation: none;
    }
    
    .maze-control-btn {
        transition: none;
    }
    
    .maze-container::before {
        animation: none;
    }
}

/* Dark theme support */
@media (prefers-color-scheme: dark) {
    .maze-container {
        background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    }
    
    .maze-control-btn {
        background: rgba(255, 255, 255, 0.1);
    }
    
    .maze-control-btn:hover {
        background: rgba(255, 255, 255, 0.2);
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .maze-container {
        border: 2px solid #000;
    }
    
    .maze-control-btn {
        background: #000;
        color: #fff;
        border: 1px solid #fff;
    }
}

/* Print styles */
@media print {
    .maze-container {
        display: none;
    }
}

/* Loading state */
.maze-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    color: white;
    font-family: monospace;
}

.maze-loading::after {
    content: '';
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 10px;
}

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

/* Accessibility improvements */
.maze-container:focus-within {
    outline: 2px solid #4a90e2;
    outline-offset: 2px;
}

.maze-control-btn:focus {
    outline: 2px solid #4a90e2;
    outline-offset: 1px;
}

/* Performance optimizations */
#maze-canvas {
    will-change: transform;
    transform: translateZ(0);
}

/* Smooth transitions for theme changes */
.maze-container,
.maze-control-btn,
.maze-status {
    transition: 
        background-color 0.3s ease,
        color 0.3s ease,
        border-color 0.3s ease;
}