/* Top Image Component Animation Styles */

/* Base styles for top-image component */
.top-image {
    position: relative;
    transition: all 0.3s ease;
    will-change: transform, opacity;
    transform-origin: center;
    overflow: hidden;
}

/* Ensure smooth animations for all child elements */
.top-image * {
    will-change: transform, opacity, color, background-color, box-shadow;
}

/* Background image enhancements */
.top-image .bg-cover {
    transition: all 0.8s ease;
    will-change: transform, opacity;
    transform-origin: center;
}

/* Gradient overlay */
.top-image .bg-gradient-to-r {
    transition: opacity 0.5s ease;
    will-change: opacity;
}

/* Badge styling */
.top-image .bg-red-600 {
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.top-image .bg-red-600::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.6s ease;
}

.top-image .bg-red-600:hover::before {
    left: 100%;
}

/* Heading styling */
.top-image h2 {
    transition: all 0.3s ease;
    cursor: pointer;
}

/* Text highlights */
.top-image .text-red-400 {
    transition: all 0.3s ease;
    position: relative;
    display: inline-block;
}

.top-image .text-red-400::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #f87171, #dc2626);
    transition: width 0.4s ease;
}

.top-image h2:hover .text-red-400::after {
    width: 100%;
}

/* Paragraph styling */
.top-image p {
    transition: all 0.3s ease;
}

/* Button enhancements */
.top-image a {
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.top-image a::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.top-image a:hover::before {
    width: 300px;
    height: 300px;
}

.top-image a:active::before {
    width: 0;
    height: 0;
    transition: width 0.2s ease, height 0.2s ease;
}

/* Icon animations */
.top-image a svg {
    transition: all 0.3s ease;
}

/* Container content */
.top-image .container {
    transition: all 0.5s ease;
    will-change: transform;
}

/* Floating animation keyframes */
@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

@keyframes glow {
    0%, 100% { text-shadow: 0 0 5px rgba(248, 113, 113, 0.5); }
    50% { text-shadow: 0 0 20px rgba(248, 113, 113, 0.8), 0 0 30px rgba(248, 113, 113, 0.6); }
}

/* Loading state */
.top-image:not(.animations-ready) {
    pointer-events: none;
}

.top-image.animations-ready .text-red-400 {
    animation: glow 3s ease-in-out infinite;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .top-image {
        transform-origin: center top;
    }
    
    .top-image a {
        touch-action: manipulation;
    }
    
    .top-image .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

@media (max-width: 640px) {
    .top-image h2 {
        font-size: 2.5rem;
        line-height: 1.1;
    }
    
    .top-image p {
        font-size: 1.125rem;
    }
    
    .top-image a {
        padding: 0.75rem 1.5rem;
        font-size: 1rem;
    }
}

/* Accessibility - Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .top-image,
    .top-image * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .top-image .bg-red-600::before,
    .top-image a::before,
    .top-image .text-red-400::after {
        display: none;
    }
    
    .top-image.animations-ready .text-red-400 {
        animation: none;
    }
}

/* Focus states for accessibility */
.top-image a:focus-visible {
    outline: 3px solid #f87171;
    outline-offset: 2px;
}

.top-image .bg-red-600:focus-visible {
    outline: 3px solid #f87171;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .top-image a {
        border: 2px solid currentColor;
    }
    
    .top-image .text-red-400 {
        text-decoration: underline;
    }
    
    .top-image .bg-red-600 {
        border: 2px solid #ffffff;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .top-image .bg-gradient-to-r {
        background: linear-gradient(to right, rgba(0,0,0,0.8), rgba(0,0,0,0.6));
    }
}

/* Print styles */
@media print {
    .top-image {
        transform: none !important;
        opacity: 1 !important;
    }
    
    .top-image::before,
    .top-image::after,
    .top-image *::before,
    .top-image *::after {
        display: none !important;
    }
    
    .top-image .bg-cover {
        opacity: 1 !important;
    }
    
    .top-image a {
        color: #000 !important;
        background: transparent !important;
        border: 2px solid #000 !important;
    }
}

/* Performance optimizations */
.top-image .bg-cover {
    backface-visibility: hidden;
    perspective: 1000px;
}

.top-image .container {
    backface-visibility: hidden;
    perspective: 1000px;
}

/* Custom scrollbar for webkit browsers */
.top-image::-webkit-scrollbar {
    display: none;
}

/* Smooth scrolling behavior */
.top-image {
    scroll-behavior: smooth;
}

/* Additional hover effects */
.top-image:hover .bg-cover {
    filter: brightness(1) contrast(1.05);
}

.top-image:hover .bg-gradient-to-r {
    background: linear-gradient(to right, rgba(0,0,0,0.4), rgba(0,0,0,0.2));
}

/* Text selection styling */
.top-image ::selection {
    background: rgba(248, 113, 113, 0.3);
    color: #ffffff;
}

.top-image ::-moz-selection {
    background: rgba(248, 113, 113, 0.3);
    color: #ffffff;
} 