.animated-bg-container {
    position: relative;
    width: 100%;
    height: 100vh;
    overflow: hidden;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.animated-bg-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

.animated-bg-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url("data:image/svg+xml,%3csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3e%3cg fill='none' fill-rule='evenodd'%3e%3cg fill='%23ffffff' fill-opacity='0.03'%3e%3cpath d='m36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3e%3c/g%3e%3c/g%3e%3c/svg%3e") repeat;
    opacity: 0.6;
    z-index: 0;
}

.animated-bg-content {
    position: relative;
    z-index: 10;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.animated-bg-container.fallback-bg {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.animated-bg-container.fallback-bg::before {
    opacity: 0.8;
}

.animated-bg-container.reduced-motion-bg {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.animated-bg-container.reduced-motion-bg::before {
    opacity: 0.8;
}

.animated-bg-container:hover .animated-bg-canvas {
    opacity: 0.9;
    transition: opacity 0.3s ease;
}

.animated-bg-container::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        linear-gradient(to bottom, transparent 0%, transparent 85%, rgba(103, 126, 234, 0.1) 100%),
        linear-gradient(to right, rgba(103, 126, 234, 0.05) 0%, transparent 15%, transparent 85%, rgba(118, 75, 162, 0.05) 100%);
    z-index: 2;
    pointer-events: none;
}


@media screen and (max-width: 480px) {
    .animated-bg-container {
        background-attachment: scroll;
    }

    .animated-bg-canvas {
        image-rendering: pixelated;
        image-rendering: -moz-crisp-edges;
        image-rendering: crisp-edges;
    }
}

@media screen and (min-width: 481px) and (max-width: 768px) {
    .animated-bg-container::before {
        opacity: 0.4;
    }
}

@media screen and (min-width: 769px) {
    .animated-bg-container {
        background-attachment: fixed;
    }

    .animated-bg-canvas {
        image-rendering: auto;
    }
}

@media screen and (min-width: 1200px) {
    .animated-bg-container::after {
        background:
            linear-gradient(to bottom, transparent 0%, transparent 90%, rgba(103, 126, 234, 0.05) 100%),
            linear-gradient(to right, rgba(103, 126, 234, 0.03) 0%, transparent 10%, transparent 90%, rgba(118, 75, 162, 0.03) 100%);
    }
}

@media (prefers-color-scheme: dark) {
    .animated-bg-container {
        background: linear-gradient(135deg, #4a5568 0%, #2d3748 100%);
    }

    .animated-bg-container::before {
        opacity: 0.3;
    }
}

@media (prefers-reduced-motion: reduce) {
    .animated-bg-canvas {
        display: none !important;
    }

    .animated-bg-container {
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    }

    .animated-bg-container::before {
        opacity: 0.8 !important;
    }

    .animated-bg-container:hover .animated-bg-canvas {
        transition: none;
    }
}

@media (prefers-contrast: high) {
    .animated-bg-container::before {
        opacity: 0.2;
    }

    .animated-bg-canvas {
        filter: contrast(1.5);
    }
}

@media (prefers-reduced-data: reduce) {
    .animated-bg-canvas {
        display: none;
    }
}

.animated-bg-container.loading {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.animated-bg-container.loading::before {
    opacity: 1;
    animation: pulse 2s ease-in-out infinite alternate;
}

@keyframes pulse {
    from {
        opacity: 0.3;
    }
    to {
        opacity: 0.8;
    }
}

.animated-bg-container.error {
    background: linear-gradient(135deg, #e53e3e 0%, #c53030 100%);
}

.animated-bg-blue {
    background: linear-gradient(135deg, #3182ce 0%, #2c5282 100%);
}

.animated-bg-purple {
    background: linear-gradient(135deg, #805ad5 0%, #553c9a 100%);
}

.animated-bg-green {
    background: linear-gradient(135deg, #38a169 0%, #2f855a 100%);
}

.animated-bg-content-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.animated-bg-content-top {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 2rem;
}

.animated-bg-content-bottom {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 2rem;
}

.animated-bg-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.1);
    z-index: 5;
    pointer-events: none;
}

.animated-bg-overlay.dark {
    background: rgba(0, 0, 0, 0.3);
}

.animated-bg-overlay.light {
    background: rgba(255, 255, 255, 0.1);
}