/* ===== TECH LAB ANIMATIONS ===== */
/* Cyber-Industrial Theme with Circuit Animations */

/* ===== KEYFRAME ANIMATIONS ===== */

/* Fade In Up - For cards and sections */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Fade In - General purpose */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Slide In Left - For sidebar and menus */
@keyframes slideInLeft {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Slide In Right - For notifications */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Slide In Up - For search results */
@keyframes slideInUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Pulse - For buttons and notifications */
@keyframes pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 var(--cyber-glow);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 20px var(--cyber-glow);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 var(--cyber-glow);
    }
}

/* Glow - For text and borders */
@keyframes glow {
    0% {
        text-shadow: 0 0 5px var(--secondary-cyan);
        box-shadow: 0 0 5px var(--secondary-cyan);
    }
    50% {
        text-shadow: 0 0 20px var(--secondary-cyan), 0 0 30px var(--primary-blue);
        box-shadow: 0 0 20px var(--secondary-cyan), 0 0 30px var(--primary-blue);
    }
    100% {
        text-shadow: 0 0 5px var(--secondary-cyan);
        box-shadow: 0 0 5px var(--secondary-cyan);
    }
}

/* Rotate - For loading spinners */
@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Float - For particles and decorative elements */
@keyframes float {
    0% {
        transform: translateY(0px) translateX(0px);
    }
    25% {
        transform: translateY(-10px) translateX(5px);
    }
    50% {
        transform: translateY(-20px) translateX(-5px);
    }
    75% {
        transform: translateY(-10px) translateX(5px);
    }
    100% {
        transform: translateY(0px) translateX(0px);
    }
}

/* Circuit Board Background Movement */
@keyframes circuitMove {
    0% {
        background-position: 0 0;
    }
    100% {
        background-position: 100px 100px;
    }
}

/* SVG Drawing Animation */
@keyframes drawLine {
    from {
        stroke-dashoffset: 1000;
    }
    to {
        stroke-dashoffset: 0;
    }
}

/* Glitch Effect */
@keyframes glitch {
    0% {
        transform: translate(0);
        opacity: 1;
    }
    20% {
        transform: translate(-2px, 2px);
        opacity: 0.8;
    }
    40% {
        transform: translate(-2px, -2px);
        opacity: 0.9;
    }
    60% {
        transform: translate(2px, 2px);
        opacity: 0.8;
    }
    80% {
        transform: translate(2px, -2px);
        opacity: 0.9;
    }
    100% {
        transform: translate(0);
        opacity: 1;
    }
}

/* Glitch Top Layer */
@keyframes glitchTop {
    0%, 100% {
        transform: translate(0);
        clip-path: inset(0 0 70% 0);
    }
    20% {
        transform: translate(-2px, -2px);
        clip-path: inset(0 0 70% 0);
    }
    40% {
        transform: translate(-2px, 2px);
        clip-path: inset(0 0 70% 0);
    }
    60% {
        transform: translate(2px, 2px);
        clip-path: inset(0 0 70% 0);
    }
    80% {
        transform: translate(2px, -2px);
        clip-path: inset(0 0 70% 0);
    }
}

/* Glitch Bottom Layer */
@keyframes glitchBottom {
    0%, 100% {
        transform: translate(0);
        clip-path: inset(70% 0 0 0);
    }
    20% {
        transform: translate(2px, 2px);
        clip-path: inset(70% 0 0 0);
    }
    40% {
        transform: translate(2px, -2px);
        clip-path: inset(70% 0 0 0);
    }
    60% {
        transform: translate(-2px, -2px);
        clip-path: inset(70% 0 0 0);
    }
    80% {
        transform: translate(-2px, 2px);
        clip-path: inset(70% 0 0 0);
    }
}

/* Shine Effect - For cards on hover */
@keyframes shine {
    0% {
        left: -100%;
        opacity: 0;
    }
    20% {
        left: 100%;
        opacity: 0.5;
    }
    100% {
        left: 100%;
        opacity: 0;
    }
}

/* Ripple Effect - For clicks */
@keyframes ripple {
    0% {
        width: 0;
        height: 0;
        opacity: 0.5;
    }
    100% {
        width: 500px;
        height: 500px;
        opacity: 0;
    }
}

/* Scale In - For modal dialogs */
@keyframes scaleIn {
    from {
        transform: scale(0.9);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* Scale Out - For modal close */
@keyframes scaleOut {
    from {
        transform: scale(1);
        opacity: 1;
    }
    to {
        transform: scale(0.9);
        opacity: 0;
    }
}

/* Bounce - For notifications */
@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* Shake - For error states */
@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-5px);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(5px);
    }
}

/* Typing Effect - For hero text */
@keyframes typing {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

/* Blink Caret - For typing effect */
@keyframes blinkCaret {
    from, to {
        border-color: transparent;
    }
    50% {
        border-color: var(--secondary-cyan);
    }
}

/* Spin - For loading */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* ===== SVG ANIMATION CLASSES ===== */

/* Circuit Line Drawing */
.circuit-line {
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    animation: drawLine 2s ease forwards;
}

/* SVG Path Animation */
.animate-path {
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    animation: drawLine 1.5s ease forwards;
}

/* Logo Animation */
.animated-logo path {
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    animation: drawLine 2s ease forwards;
}

.animated-logo circle {
    opacity: 0;
    animation: fadeIn 0.5s ease forwards 1.5s;
}

.animated-logo text {
    opacity: 0;
    animation: fadeIn 1s ease forwards 2s;
}

/* ===== LOADING ANIMATIONS ===== */

/* Loading Spinner */
.loader {
    width: 50px;
    height: 50px;
    border: 3px solid var(--card-bg);
    border-top: 3px solid var(--secondary-cyan);
    border-right: 3px solid var(--primary-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Loading Dots */
.loader-dots {
    display: flex;
    gap: 5px;
    justify-content: center;
    align-items: center;
}

.loader-dots div {
    width: 10px;
    height: 10px;
    background: var(--secondary-cyan);
    border-radius: 50%;
    animation: pulse 1s ease-in-out infinite;
}

.loader-dots div:nth-child(2) {
    animation-delay: 0.2s;
}

.loader-dots div:nth-child(3) {
    animation-delay: 0.4s;
}

/* Progress Bar */
.loader-progress {
    width: 100%;
    height: 4px;
    background: var(--card-bg);
    position: relative;
    overflow: hidden;
}

.loader-progress::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 50%;
    height: 100%;
    background: linear-gradient(90deg, var(--primary-blue), var(--secondary-cyan));
    animation: loading 1.5s ease-in-out infinite;
}

@keyframes loading {
    0% {
        left: -50%;
    }
    100% {
        left: 100%;
    }
}

/* ===== PAGE TRANSITIONS ===== */

/* Page Enter Animation */
.page-enter {
    animation: fadeInUp 0.5s ease forwards;
}

/* Page Exit Animation */
.page-exit {
    animation: fadeOut 0.3s ease forwards;
}

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: scale(1);
    }
    to {
        opacity: 0;
        transform: scale(0.95);
    }
}

/* ===== TEXT EFFECTS ===== */

/* Glitch Text */
.glitch-text {
    position: relative;
    animation: glitch 3s infinite;
}

.glitch-text::before,
.glitch-text::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--dark-bg);
}

.glitch-text::before {
    animation: glitchTop 2s infinite;
    color: #ff00ff;
    z-index: -1;
}

.glitch-text::after {
    animation: glitchBottom 2s infinite;
    color: #00ffff;
    z-index: -2;
}

/* Typewriter Effect */
.typewriter {
    overflow: hidden;
    border-right: 2px solid var(--secondary-cyan);
    white-space: nowrap;
    margin: 0 auto;
    animation: 
        typing 3.5s steps(40, end),
        blinkCaret 0.75s step-end infinite;
}

/* Neon Text */
.neon-text {
    animation: glow 2s ease-in-out infinite;
}

/* ===== CARD ANIMATIONS ===== */

/* Product Card Hover Effects */
.product-card {
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.product-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent,
        rgba(0, 255, 255, 0.1),
        transparent
    );
    transform: rotate(45deg);
    animation: shine 3s infinite;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.product-card:hover::before {
    opacity: 1;
}



/* Feature Card Animations */
.feature-card {
    transition: all 0.3s ease;
    animation: fadeInUp 0.6s ease forwards;
    opacity: 0;
}

.feature-card:nth-child(1) { animation-delay: 0.2s; }
.feature-card:nth-child(2) { animation-delay: 0.4s; }
.feature-card:nth-child(3) { animation-delay: 0.6s; }

.feature-card:hover svg {
    animation: bounce 0.5s ease;
}

/* ===== BUTTON ANIMATIONS ===== */

.btn {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.3s ease, height 0.3s ease;
}

.btn:active::after {
    width: 200px;
    height: 200px;
}

.btn-primary:hover {
    animation: pulse 1s infinite;
}

/* ===== MENU ANIMATIONS ===== */

/* Mobile Menu */
.mobile-menu-btn span {
    transition: all 0.3s ease;
}

.mobile-menu-btn.active span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.mobile-menu-btn.active span:nth-child(2) {
    opacity: 0;
    transform: translateX(-20px);
}

.mobile-menu-btn.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* Main Navigation */
.main-nav a {
    position: relative;
    overflow: hidden;
}

.main-nav a::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.main-nav a:hover::before {
    left: 100%;
}

/* Dropdown Menu */
@keyframes dropdown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== SEARCH ANIMATIONS ===== */

.search-results.active {
    animation: slideInUp 0.3s ease;
}

.search-result-item {
    transition: all 0.2s ease;
}

.search-result-item:hover {
    transform: translateX(5px);
}

/* ===== CART ANIMATIONS ===== */

.cart-count {
    transition: all 0.3s ease;
}

.cart-count:not(:empty) {
    animation: pulse 0.3s ease;
}

/* ===== NOTIFICATION ANIMATIONS ===== */

.notification {
    animation: slideInRight 0.3s ease;
}

.notification.hiding {
    animation: slideOut 0.3s ease forwards;
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* ===== BACKGROUND ANIMATIONS ===== */

/* Circuit Board Background */
.circuit-bg {
    position: relative;
    overflow: hidden;
}

.circuit-bg::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 20px,
        rgba(0, 255, 255, 0.03) 20px,
        rgba(0, 255, 255, 0.03) 40px
    );
    animation: circuitMove 20s linear infinite;
    pointer-events: none;
}

/* Floating Particles */
.particle {
    position: absolute;
    width: 2px;
    height: 2px;
    background: var(--secondary-cyan);
    border-radius: 50%;
    pointer-events: none;
    animation: float linear infinite;
}

/* ===== PRODUCT DETAILS ANIMATIONS ===== */

.quantity-btn {
    transition: all 0.2s ease;
}

.quantity-btn:active {
    transform: scale(0.9);
}

.wishlist-btn {
    transition: all 0.3s ease;
}

.wishlist-btn.active {
    animation: pulse 0.5s ease;
    color: #ff4444;
}

.wishlist-btn.active svg {
    fill: #ff4444;
    stroke: #ff4444;
}

/* ===== IMAGE GALLERY ANIMATIONS ===== */

.main-image img {
    transition: transform 0.5s ease;
}

.main-image:hover img {
    transform: scale(1.05);
}

/* ===== FORM ANIMATIONS ===== */

input, select, textarea {
    transition: all 0.3s ease;
}

input:focus, select:focus, textarea:focus {
    transform: scale(1.02);
}

/* ===== FOOTER ANIMATIONS ===== */

.footer-section a {
    position: relative;
    padding-left: 0;
    transition: all 0.3s ease;
}

.footer-section a:hover {
    padding-left: 10px;
}

.footer-section a::before {
    content: '▹';
    position: absolute;
    left: -20px;
    opacity: 0;
    transition: all 0.3s ease;
    color: var(--secondary-cyan);
}

.footer-section a:hover::before {
    left: -5px;
    opacity: 1;
}

/* ===== DELAY CLASSES ===== */

.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }
.delay-4 { animation-delay: 0.4s; }
.delay-5 { animation-delay: 0.5s; }
.delay-6 { animation-delay: 0.6s; }
.delay-7 { animation-delay: 0.7s; }
.delay-8 { animation-delay: 0.8s; }
.delay-9 { animation-delay: 0.9s; }
.delay-10 { animation-delay: 1s; }

/* ===== DURATION CLASSES ===== */

.duration-fast { animation-duration: 0.3s; }
.duration-normal { animation-duration: 0.6s; }
.duration-slow { animation-duration: 1s; }
.duration-slower { animation-duration: 2s; }

/* ===== INFINITE ANIMATIONS ===== */

.infinite-pulse {
    animation: pulse 2s infinite;
}

.infinite-glow {
    animation: glow 3s infinite;
}

.infinite-float {
    animation: float 6s infinite;
}

.infinite-spin {
    animation: spin 3s linear infinite;
}

/* ===== SCROLL ANIMATIONS ===== */

.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* ===== RESPONSIVE ANIMATIONS ===== */

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ===== PRINT ANIMATIONS ===== */

@media print {
    .animated-logo,
    .product-card::before,
    .particle {
        animation: none !important;
    }
}