/* Advanced Animations and Effects for DENDAT.SECURE */

/* Page Loading Animation */
@keyframes pageLoad {
    0% {
        opacity: 0;
        transform: translateY(30px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.page-content {
    animation: pageLoad 0.8s ease-out;
}

/* Tactical Data Grid Animation */
@keyframes dataStream {
    0% {
        background-position: 0% 0%;
    }
    100% {
        background-position: 100% 100%;
    }
}

.data-stream-bg {
    background-image: 
        linear-gradient(45deg, transparent 30%, rgba(0, 245, 160, 0.03) 30%, rgba(0, 245, 160, 0.03) 50%, transparent 50%),
        linear-gradient(-45deg, transparent 30%, rgba(0, 217, 245, 0.02) 30%, rgba(0, 217, 245, 0.02) 50%, transparent 50%);
    background-size: 20px 20px;
    animation: dataStream 20s linear infinite;
}

/* Pulse Effects */
@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.8;
    }
}

.pulse-effect {
    animation: pulse 3s ease-in-out infinite;
}

/* Glow Effect */
@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(0, 245, 160, 0.2);
    }
    50% {
        box-shadow: 0 0 40px rgba(0, 245, 160, 0.4);
    }
}

.glow-effect {
    animation: glow 2s ease-in-out infinite;
}

/* Typing Effect */
@keyframes typing {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

@keyframes blink {
    0%, 50% {
        border-color: var(--primary-color);
    }
    51%, 100% {
        border-color: transparent;
    }
}

.typing-effect {
    overflow: hidden;
    white-space: nowrap;
    border-right: 2px solid;
    animation: typing 3s steps(40) 1s both, blink 1s step-end infinite;
}

/* Matrix Rain Effect */
@keyframes matrixRain {
    0% {
        transform: translateY(-100vh);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh);
        opacity: 0;
    }
}

.matrix-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

.matrix-char {
    position: absolute;
    color: var(--primary-color);
    font-family: 'Courier New', monospace;
    font-size: 14px;
    animation: matrixRain linear infinite;
    opacity: 0.6;
}

/* Tactical Scan Line */
@keyframes scanLine {
    0% {
        transform: translateY(-100%);
    }
    100% {
        transform: translateY(100vh);
    }
}

.scan-line {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--primary-color), transparent);
    z-index: 1000;
    animation: scanLine 8s linear infinite;
    pointer-events: none;
}

/* Card Flip Animation */
@keyframes cardFlip {
    0% {
        transform: rotateY(0);
    }
    50% {
        transform: rotateY(180deg);
    }
    100% {
        transform: rotateY(360deg);
    }
}

.card-flip {
    animation: cardFlip 0.8s ease-in-out;
}

/* Slide In Animations */
@keyframes slideInLeft {
    0% {
        transform: translateX(-100%);
        opacity: 0;
    }
    100% {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideInRight {
    0% {
        transform: translateX(100%);
        opacity: 0;
    }
    100% {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideInUp {
    0% {
        transform: translateY(100%);
        opacity: 0;
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideInDown {
    0% {
        transform: translateY(-100%);
        opacity: 0;
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

.slide-in-left {
    animation: slideInLeft 0.6s ease-out;
}

.slide-in-right {
    animation: slideInRight 0.6s ease-out;
}

.slide-in-up {
    animation: slideInUp 0.6s ease-out;
}

.slide-in-down {
    animation: slideInDown 0.6s ease-out;
}

/* Fade In Stagger */
@keyframes fadeInStagger {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-stagger {
    animation: fadeInStagger 0.6s ease-out backwards;
}

.fade-in-stagger:nth-child(1) { animation-delay: 0.1s; }
.fade-in-stagger:nth-child(2) { animation-delay: 0.2s; }
.fade-in-stagger:nth-child(3) { animation-delay: 0.3s; }
.fade-in-stagger:nth-child(4) { animation-delay: 0.4s; }
.fade-in-stagger:nth-child(5) { animation-delay: 0.5s; }
.fade-in-stagger:nth-child(6) { animation-delay: 0.6s; }

/* Hover Effects */
.hover-lift {
    transition: var(--transition-smooth);
}

.hover-lift:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.hover-glow {
    transition: var(--transition-smooth);
}

.hover-glow:hover {
    box-shadow: 0 0 30px rgba(0, 245, 160, 0.3);
    border-color: rgba(0, 245, 160, 0.5);
}

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

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

/* Tactical HUD Elements */
@keyframes hudSweep {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.hud-sweep {
    position: relative;
    overflow: hidden;
}

.hud-sweep::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 2px;
    height: 50%;
    background: linear-gradient(to bottom, var(--primary-color), transparent);
    transform-origin: bottom center;
    animation: hudSweep 4s linear infinite;
}

/* Text Effects */
@keyframes textGlow {
    0%, 100% {
        text-shadow: 0 0 10px rgba(0, 245, 160, 0.5);
    }
    50% {
        text-shadow: 0 0 20px rgba(0, 245, 160, 0.8);
    }
}

.text-glow {
    animation: textGlow 2s ease-in-out infinite;
}

/* Particle System */
@keyframes float {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
    }
    33% {
        transform: translateY(-10px) rotate(120deg);
    }
    66% {
        transform: translateY(5px) rotate(240deg);
    }
}

.floating-particle {
    animation: float 6s ease-in-out infinite;
}

.floating-particle:nth-child(odd) {
    animation-delay: -2s;
    animation-duration: 8s;
}

.floating-particle:nth-child(even) {
    animation-delay: -4s;
    animation-duration: 10s;
}

/* Progress Bar Animation */
@keyframes progressFill {
    0% {
        width: 0%;
    }
    100% {
        width: var(--progress-width, 100%);
    }
}

.progress-animated {
    animation: progressFill 2s ease-out;
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .matrix-bg,
    .scan-line {
        display: none;
    }
}

/* High Performance Mode */
@media (max-width: 768px) {
    .matrix-bg,
    .data-stream-bg,
    .scan-line {
        display: none;
    }
    
    .hover-lift:hover,
    .hover-glow:hover {
        transform: none;
        box-shadow: none;
    }
}
