/* ========================================
   BLACKBOX FORENSICS - CUTTING EDGE ENHANCEMENTS
   Inspired by SpaceX, NASA, Google design systems
   ======================================== */

/* ========================================
   ADVANCED ANIMATIONS & TRANSITIONS
   ======================================== */

/* Smooth scroll behavior */
html {
    scroll-behavior: smooth;
}

/* Enhanced page transitions */
body {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ========================================
   MICRO-INTERACTIONS
   ======================================== */

/* Enhanced button interactions */
.btn {
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateZ(0);
    backface-visibility: hidden;
}

/* Enhanced CTA Buttons */
.enhanced-cta {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #4299e1, #667eea);
    border: none;
    box-shadow: 0 4px 15px rgba(66, 153, 225, 0.3);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.enhanced-cta .btn-content {
    position: relative;
    z-index: 2;
    transition: all 0.3s ease;
}

.enhanced-cta .btn-glow {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2), rgba(66, 153, 225, 0.3));
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
}

.enhanced-cta:hover {
    /* transform: translateY(-1px) scale(1.005); */
    box-shadow: 0 8px 30px rgba(66, 153, 225, 0.4);
    background: linear-gradient(135deg, #667eea, #764ba2);
}

.enhanced-cta:hover .btn-glow {
    opacity: 1;
}

/* .enhanced-cta:hover .btn-content {
    transform: scale(1.01);
} */

/* .enhanced-cta:active {
    transform: translateY(-1px) scale(1.01);
} */

.enhanced-cta.btn-outline-light {
    background: transparent;
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: #fff;
}

.enhanced-cta.btn-outline-light:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.6);
    color: #fff;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn:hover::before {
    left: 100%;
}

.btn:hover {
    /* transform: translateY(-2px); */
    box-shadow: 0 8px 25px rgba(66, 153, 225, 0.3);
}

.btn:active {
    transform: translateY(0);
}

/* Enhanced card interactions */
.card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateZ(0);
}

.card:hover {
    /* transform: translateY(-1px) scale(1.005); */
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

/* ========================================
   PURCHASE TILES EXCLUSIVE TILT EFFECTS
   ======================================== */

/* ONLY allow tilt effects on purchase tiles ($200 and $800) */
.product-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 40px rgba(66, 153, 225, 0.3);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.product-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ========================================
   LOADING ANIMATIONS
   ======================================== */

/* Skeleton loading animation */
@keyframes skeleton-loading {
    0% {
        background-position: -200px 0;
    }
    100% {
        background-position: calc(200px + 100%) 0;
    }
}

.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200px 100%;
    animation: skeleton-loading 1.5s infinite;
}

/* Pulse animation for loading states */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* ========================================
   SCROLL REVEAL ANIMATIONS
   ======================================== */

/* Fade in from bottom */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translate3d(0, 40px, 0);
    }
    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

/* Fade in from left */
@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translate3d(-40px, 0, 0);
    }
    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

/* Fade in from right */
@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translate3d(40px, 0, 0);
    }
    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

/* Scale in animation */
@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Animation classes */
.animate-fade-in-up {
    animation: fadeInUp 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.animate-fade-in-left {
    animation: fadeInLeft 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.animate-fade-in-right {
    animation: fadeInRight 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.animate-scale-in {
    animation: scaleIn 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* Stagger animation delays */
.animate-delay-100 { animation-delay: 0.1s; }
.animate-delay-200 { animation-delay: 0.2s; }
.animate-delay-300 { animation-delay: 0.3s; }
.animate-delay-400 { animation-delay: 0.4s; }
.animate-delay-500 { animation-delay: 0.5s; }

/* ========================================
   ENHANCED FORM INTERACTIONS
   ======================================== */

/* Floating label effect */
.form-floating {
    position: relative;
}

.form-floating input,
.form-floating textarea {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 2px solid #e2e8f0;
    background: rgba(255, 255, 255, 0.05);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

.form-floating input:focus,
.form-floating textarea:focus {
    border-color: #4299e1;
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.1);
    /* transform: translateY(-2px); */
}

.form-floating label {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Enhanced checkbox and radio styles */
.form-check-input {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* .form-check-input:checked {
    transform: scale(1.1);
} */

/* ========================================
   PROGRESS INDICATORS
   ======================================== */

/* Animated progress bar */
@keyframes progress-animation {
    0% {
        width: 0%;
    }
}

.progress-bar {
    animation: progress-animation 2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Circular progress indicator */
@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #4299e1;
    border-radius: 50%;
    animation: rotate 1s linear infinite;
}

/* ========================================
   ENHANCED NAVIGATION
   ======================================== */

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

.sidebar-nav a {
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-nav a::after {
    content: '';
    position: absolute;
    left: 1.5rem;
    bottom: 0.5rem;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #4299e1, #63b3ed);
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 1px;
}

.sidebar-nav a:hover::after,
.sidebar-nav a.active::after {
    width: calc(100% - 3rem);
}

.sidebar-nav a:hover {
    transform: translateX(8px);
    color: #4299e1;
}

/* ========================================
   GLASSMORPHISM EFFECTS
   ======================================== */

.glass {
    background: rgba(255, 255, 255, 0.1);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.glass:hover {
    background: rgba(255, 255, 255, 0.15);
    -webkit-backdrop-filter: blur(15px);
    backdrop-filter: blur(15px);
}

/* ========================================
   PARTICLE EFFECTS (CSS-only)
   ======================================== */

.particles {
    position: relative;
    overflow: hidden;
}

.particles::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(2px 2px at 20px 30px, rgba(66, 153, 225, 0.3), transparent),
        radial-gradient(2px 2px at 40px 70px, rgba(66, 153, 225, 0.2), transparent),
        radial-gradient(1px 1px at 90px 40px, rgba(66, 153, 225, 0.4), transparent),
        radial-gradient(1px 1px at 130px 80px, rgba(66, 153, 225, 0.2), transparent);
    background-repeat: repeat;
    background-size: 150px 100px;
    animation: particle-float 20s linear infinite;
    pointer-events: none;
}

@keyframes particle-float {
    0% {
        transform: translateY(0px);
    }
    100% {
        transform: translateY(-100px);
    }
}

/* ========================================
   ENHANCED TYPOGRAPHY
   ======================================== */

/* Gradient text effect */
.gradient-text {
    background: linear-gradient(135deg, #4299e1, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradient-shift 3s ease-in-out infinite;
}

@keyframes gradient-shift {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

/* Typewriter effect */
.typewriter {
    overflow: hidden;
    border-right: 2px solid #4299e1;
    white-space: nowrap;
    animation: 
        typing 3.5s steps(40, end),
        blink-caret 0.75s step-end infinite;
}

@keyframes typing {
    from { width: 0; }
    to { width: 100%; }
}

@keyframes blink-caret {
    from, to { border-color: transparent; }
    50% { border-color: #4299e1; }
}

/* ========================================
   MOBILE OPTIMIZATIONS
   ======================================== */

@media (max-width: 768px) {
    /* Reduce motion for mobile performance */
    .btn:hover {
        transform: none;
    }
    
    /* .card:hover {
        transform: translateY(-4px) scale(1.01);
    } */
    
    /* Touch-friendly interactions */
    .btn, .card, .form-control {
        min-height: 44px; /* iOS recommended touch target */
    }
    
    /* Optimize animations for mobile */
    .animate-fade-in-up,
    .animate-fade-in-left,
    .animate-fade-in-right,
    .animate-scale-in {
        animation-duration: 0.5s;
    }
}

/* ========================================
   ACCESSIBILITY ENHANCEMENTS
   ======================================== */

/* Respect user's motion preferences */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Enhanced focus indicators */
*:focus {
    outline: 2px solid #4299e1;
    outline-offset: 2px;
}

/* Skip to content link */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: #4299e1;
    color: white;
    padding: 8px;
    text-decoration: none;
    transition: top 0.3s;
    z-index: 9999;
}

.skip-link:focus {
    top: 6px;
}

/* ========================================
   HIGH CONTRAST MODE SUPPORT
   ======================================== */

@media (prefers-contrast: high) {
    .btn {
        border: 2px solid currentColor;
    }
    
    .card {
        border: 2px solid currentColor;
    }
    
    .glass {
        background: rgba(0, 0, 0, 0.8);
        -webkit-backdrop-filter: none;
        backdrop-filter: none;
    }
}
