/* Advanced Responsive Design and Animations */

/* Enhanced Hover Effects */
.feature-card:hover .feature-icon {
    transform: scale(1.1) rotate(5deg);
    transition: all 0.3s ease;
}

.problem-item:hover .problem-icon {
    transform: scale(1.1);
    transition: all 0.3s ease;
}

.plan-card:hover {
    transform: translateY(-10px) scale(1.02);
    transition: all 0.3s ease;
}

.plan-card.featured:hover {
    transform: scale(1.08) translateY(-10px);
}

/* Button Ripple Effect */
.btn {
    position: relative;
    overflow: hidden;
}

.btn::before {
    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.6s, height 0.6s;
    z-index: 0;
}

.btn:active::before {
    width: 300px;
    height: 300px;
}

.btn > * {
    position: relative;
    z-index: 1;
}

/* Advanced Card Animations */
.feature-card {
    background: linear-gradient(135deg, var(--white) 0%, var(--gray-50) 100%);
}

.feature-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(220, 38, 38, 0.05) 0%, transparent 50%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.feature-card:hover::after {
    opacity: 1;
}

/* Floating Animation */
@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

@keyframes dashboardFloat {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-8px);
    }
}

@keyframes floatCard {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.dashboard-image {
    animation: dashboardFloat 6s ease-in-out infinite;
}

/* Pulsing Effect for Important Elements */
@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(220, 38, 38, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(220, 38, 38, 0);
    }
}

.btn-primary:hover {
    animation: pulse 2s infinite;
}

/* Advanced Gradient Text */
.hero-title .highlight {
    background: linear-gradient(135deg, var(--primary-red) 0%, #FF6B6B 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Fade-in Effect for Hero Subtitle (typewriter disabled for responsiveness) */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-subtitle {
    animation: fadeInUp 1s ease-out 0.3s both;
}

/* Loading Skeleton for Cards */
.loading-skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Glassmorphism Effect */
.glass-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
}

/* 3D Card Effect */
.card-3d {
    transform-style: preserve-3d;
    transition: transform 0.6s;
}

.card-3d:hover {
    transform: rotateY(10deg) rotateX(10deg);
}

/* Advanced Statistics Counter Animation */
@keyframes countUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.stat-number {
    animation: countUp 1s ease-out forwards;
}

/* Particle Background Effect */
.particles-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: -1;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: rgba(220, 38, 38, 0.1);
    border-radius: 50%;
    animation: particleFloat 20s infinite linear;
}

@keyframes particleFloat {
    0% {
        transform: translateY(100vh) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-100vh) rotate(360deg);
        opacity: 0;
    }
}

/* Advanced Mobile Optimizations */
@media (max-width: 640px) {
    .hero-image .dashboard-image {
        animation: dashboardFloat 6s ease-in-out infinite;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 2rem;
        line-height: 1.2;
    }
    
    .hero-image .dashboard-image {
        animation: none;
    }
    
    .mockup-container {
        animation: none;
    }
    
    /* Simplify animations on mobile for better performance */
    .feature-card:hover,
    .problem-item:hover,
    .plan-card:hover {
        transform: translateY(-5px) !important;
    }
    
    .feature-card:hover .feature-icon,
    .problem-item:hover .problem-icon {
        transform: scale(1.05) !important;
    }
}

/* Print Styles */
@media print {
    .nav,
    .hero-buttons,
    .btn,
    .modal-overlay,
    .success-message,
    .preloader {
        display: none !important;
    }
    
    .hero {
        padding: 2rem 0;
        page-break-after: always;
    }
    
    .section-title {
        color: #000 !important;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.4;
    }
}

/* Accessibility Enhancements */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .hero-image .mockup-container {
        animation: none;
    }
    
    .hero-subtitle {
        animation: none;
        border-right: none;
        white-space: normal;
    }
}

/* Focus Styles for Accessibility */
.btn:focus,
input:focus,
select:focus,
textarea:focus {
    outline: 3px solid var(--primary-red);
    outline-offset: 2px;
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .btn-primary {
        background-color: #000;
        border: 2px solid #fff;
    }
    
    .btn-secondary {
        background-color: #fff;
        border: 2px solid #000;
        color: #000;
    }
    
    .section-title,
    .hero-title {
        color: #000;
    }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--gray-100);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-red);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-red-dark);
}

/* Selection Styles */
::selection {
    background: var(--primary-red);
    color: var(--white);
}

::-moz-selection {
    background: var(--primary-red);
    color: var(--white);
}

/* Advanced Grid Layouts for Larger Screens */
@media (min-width: 1400px) {
    .container {
        max-width: 1400px;
    }
    
    .features-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .hero-content {
        gap: 6rem;
    }
    
    .hero-title {
        font-size: 4rem;
    }
}

/* Ultra-wide Screen Support */
@media (min-width: 1920px) {
    .container {
        max-width: 1600px;
    }
    
    .section-title {
        font-size: 3.5rem;
    }
    
    .hero-title {
        font-size: 5rem;
    }
}

/* Enhanced Loading States */
.btn.loading {
    pointer-events: none;
    opacity: 0.7;
}

.btn.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    margin: -8px 0 0 -8px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Smooth Reveal Animations */
.reveal {
    opacity: 0;
    transform: translateY(50px);
    transition: all 0.8s ease;
}

.reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Background Patterns */
.pattern-dots {
    background-image: radial-gradient(circle, rgba(220, 38, 38, 0.1) 1px, transparent 1px);
    background-size: 20px 20px;
}

.pattern-grid {
    background-image: 
        linear-gradient(rgba(220, 38, 38, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(220, 38, 38, 0.05) 1px, transparent 1px);
    background-size: 50px 50px;
}

/* Advanced Transitions */
.smooth-transition {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.bounce-transition {
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}