/* Mamune Service - Animations CSS */
/* Smooth animations and transitions */

/* CSS Custom Properties for Animations */
:root {
    --ease-out-cubic: cubic-bezier(0.33, 1, 0.68, 1);
    --ease-in-out-cubic: cubic-bezier(0.65, 0, 0.35, 1);
    --ease-out-back: cubic-bezier(0.34, 1.56, 0.64, 1);
    --animation-duration-fast: 150ms;
    --animation-duration-normal: 300ms;
    --animation-duration-slow: 500ms;
    --animation-duration-extra-slow: 800ms;
}

/* Base Animation Classes */
.fade-up {
    opacity: 0;
    transform: translateY(30px);
    animation: fadeUp 0.6s ease-out forwards;
}

.fade-up.delay-1 {
    animation-delay: 0.1s;
}

.fade-up.delay-2 {
    animation-delay: 0.2s;
}

.fade-up.delay-3 {
    animation-delay: 0.3s;
}

.fade-up.delay-4 {
    animation-delay: 0.4s;
}

.fade-up.delay-5 {
    animation-delay: 0.5s;
}

.fade-in {
    opacity: 0;
    animation: fadeIn 0.6s ease-out forwards;
}

.fade-in.delay-1 {
    animation-delay: 0.2s;
}

.fade-in.delay-2 {
    animation-delay: 0.4s;
}

.fade-in.delay-3 {
    animation-delay: 0.6s;
}

.slide-in-left {
    opacity: 0;
    transform: translateX(-50px);
    animation: slideInLeft 0.6s var(--ease-out-cubic) forwards;
}

.slide-in-right {
    opacity: 0;
    transform: translateX(50px);
    animation: slideInRight 0.6s var(--ease-out-cubic) forwards;
}

.scale-in {
    opacity: 0;
    transform: scale(0.8);
    animation: scaleIn 0.5s var(--ease-out-cubic) forwards;
}

.scale-in.delay-1 {
    animation-delay: 0.2s;
}

.scale-in.delay-2 {
    animation-delay: 0.4s;
}

/* Staggered Animation for Lists */
.stagger-children > * {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeUp 0.6s var(--ease-out-cubic) forwards;
}

.stagger-children > *:nth-child(1) { animation-delay: 0.1s; }
.stagger-children > *:nth-child(2) { animation-delay: 0.2s; }
.stagger-children > *:nth-child(3) { animation-delay: 0.3s; }
.stagger-children > *:nth-child(4) { animation-delay: 0.4s; }
.stagger-children > *:nth-child(5) { animation-delay: 0.5s; }
.stagger-children > *:nth-child(6) { animation-delay: 0.6s; }
.stagger-children > *:nth-child(7) { animation-delay: 0.7s; }
.stagger-children > *:nth-child(8) { animation-delay: 0.8s; }
.stagger-children > *:nth-child(9) { animation-delay: 0.9s; }

/* Keyframe Animations */
@keyframes fadeUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    to {
        opacity: 1;
    }
}

@keyframes slideInLeft {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

@keyframes scaleIn {
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes bounce {
    0%, 20%, 53%, 80%, 100% {
        transform: translate3d(0, 0, 0);
    }
    40%, 43% {
        transform: translate3d(0, -8px, 0);
    }
    70% {
        transform: translate3d(0, -4px, 0);
    }
    90% {
        transform: translate3d(0, -2px, 0);
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-2px);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(2px);
    }
}

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

@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 5px rgba(0, 102, 255, 0.5);
    }
    50% {
        box-shadow: 0 0 20px rgba(0, 102, 255, 0.8);
    }
}

/* Hover Animations */
.hover-lift {
    transition: transform var(--animation-duration-normal) var(--ease-out-cubic),
                box-shadow var(--animation-duration-normal) var(--ease-out-cubic);
}

.hover-lift:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0, 102, 255, 0.16);
}

.hover-scale {
    transition: transform var(--animation-duration-normal) var(--ease-out-cubic);
}

.hover-scale:hover {
    transform: scale(1.02);
}

.hover-rotate {
    transition: transform var(--animation-duration-normal) var(--ease-out-cubic);
}

.hover-rotate:hover {
    transform: rotate(2deg);
}

.hover-brighten {
    transition: filter var(--animation-duration-normal) var(--ease-out-cubic);
}

.hover-brighten:hover {
    filter: brightness(1.1);
}

/* Button Animations */
.btn-primary {
    position: relative;
    overflow: hidden;
}

.btn-primary::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-primary:hover::before {
    left: 100%;
}

.btn-secondary {
    position: relative;
    transition: all var(--animation-duration-normal) var(--ease-out-cubic);
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0, 102, 255, 0.3);
}

/* Navigation Animations */
.nav-link {
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--primary-blue);
    transition: all var(--animation-duration-normal) var(--ease-out-cubic);
    transform: translateX(-50%);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

/* Card Animations */
.service-card {
    transition: all var(--animation-duration-slow) var(--ease-out-cubic);
    animation: fadeInUp 0.6s var(--ease-out-cubic) forwards;
}

.service-card:nth-child(1) {
    animation-delay: 0.1s;
}

.service-card:nth-child(2) {
    animation-delay: 0.2s;
}

.service-card:nth-child(3) {
    animation-delay: 0.3s;
}

.service-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 16px 40px rgba(0, 102, 255, 0.2);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Icon Animations */
.service-icon,
.advantage-icon,
.mv-icon,
.contact-icon {
    transition: all var(--animation-duration-normal) var(--ease-out-cubic);
}

.service-card:hover .service-icon,
.advantage-card:hover .advantage-icon,
.mv-card:hover .mv-icon,
.contact-card:hover .contact-icon {
    transform: scale(1.1) rotate(5deg);
    background: var(--primary-blue);
    color: var(--white);
}

/* Form Animations */
.form-group input,
.form-group select,
.form-group textarea {
    transition: all var(--animation-duration-fast) var(--ease-out-cubic);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    transform: scale(1.01);
    box-shadow: 0 0 0 3px rgba(0, 102, 255, 0.15);
}

.form-group label {
    transition: color var(--animation-duration-fast) var(--ease-out-cubic);
}

.form-group input:focus + label,
.form-group select:focus + label,
.form-group textarea:focus + label {
    color: var(--primary-blue);
}

/* Tab System Animations */
.tab-btn {
    transition: all var(--animation-duration-normal) var(--ease-out-cubic);
    position: relative;
    overflow: hidden;
}

.tab-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: var(--primary-blue);
    transition: left var(--animation-duration-normal) var(--ease-out-cubic);
    z-index: -1;
}

.tab-btn:hover::before,
.tab-btn.active::before {
    left: 0;
}

.tab-content {
    animation: fadeIn 0.4s ease-out forwards;
}

/* FAQ Animations */
.faq-item {
    transition: all var(--animation-duration-normal) var(--ease-out-cubic);
}

.faq-item:hover {
    transform: translateX(4px);
    box-shadow: var(--shadow-primary);
}

.faq-question {
    transition: all var(--animation-duration-normal) var(--ease-out-cubic);
}

.faq-item.active .faq-question {
    background: var(--primary-blue-light);
    transform: scale(1.01);
}

.faq-toggle {
    transition: transform var(--animation-duration-normal) var(--ease-out-cubic);
}

.faq-item.active .faq-toggle {
    transform: rotate(45deg) scale(1.2);
}

/* Loading Animations */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-dots::after {
    content: '';
    animation: loadingDots 1.5s infinite;
}

@keyframes loadingDots {
    0%, 20% {
        content: '';
    }
    40% {
        content: '.';
    }
    60% {
        content: '..';
    }
    80%, 100% {
        content: '...';
    }
}

/* Hero Section Animations */
.hero-title {
    animation: fadeInUp 0.8s var(--ease-out-cubic) forwards;
}

.hero-subtitle {
    animation: fadeInUp 0.8s var(--ease-out-cubic) 0.2s forwards;
    opacity: 0;
}

.hero-buttons {
    animation: fadeInUp 0.8s var(--ease-out-cubic) 0.4s forwards;
    opacity: 0;
}

.hero-badge {
    animation: scaleIn 0.6s var(--ease-out-cubic) 0.6s forwards;
    opacity: 0;
}

.badge-item {
    animation: bounce 2s infinite;
}

.badge-item:nth-child(1) {
    animation-delay: 0.8s;
}

.badge-item:nth-child(2) {
    animation-delay: 1s;
}

.badge-item:nth-child(3) {
    animation-delay: 1.2s;
}

/* Counter Animation */
.counter {
    animation: countUp 2s var(--ease-out-cubic) forwards;
}

@keyframes countUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Scroll Reveal Animation */
.scroll-reveal {
    opacity: 0;
    transform: translateY(50px);
    transition: all 0.8s var(--ease-out-cubic);
}

.scroll-reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Parallax Effect */
.parallax {
    transform: translateY(0);
    transition: transform 0.1s ease-out;
}

/* Text Gradient Animation */
.text-gradient {
    background: linear-gradient(45deg, var(--primary-blue), var(--primary-blue-dark), var(--primary-blue));
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 3s ease-in-out infinite;
}

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

/* Typing Effect */
.typing-effect {
    overflow: hidden;
    border-right: 2px solid var(--primary-blue);
    white-space: nowrap;
    animation: typing 3s 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: var(--primary-blue);
    }
}

/* Interactive Elements */
.interactive-card {
    transition: all var(--animation-duration-normal) var(--ease-out-cubic);
    cursor: pointer;
}

.interactive-card:active {
    transform: scale(0.98);
}

.interactive-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

/* Success Animation */
.success-animation {
    animation: successPulse 0.6s var(--ease-out-cubic) forwards;
}

@keyframes successPulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(40, 167, 69, 0.7);
    }
    70% {
        transform: scale(1.05);
        box-shadow: 0 0 0 10px rgba(40, 167, 69, 0);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(40, 167, 69, 0);
    }
}

/* Error Animation */
.error-animation {
    animation: errorShake 0.6s var(--ease-out-cubic) forwards;
}

@keyframes errorShake {
    0%, 100% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-4px);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(4px);
    }
}

/* Notification Animations */
.notification {
    animation: slideInRight 0.3s var(--ease-out-cubic) forwards;
}

.notification.hide {
    animation: slideOutRight 0.3s var(--ease-in-out-cubic) forwards;
}

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

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* Page Transition Animations */
.page-enter {
    animation: pageEnter 0.5s var(--ease-out-cubic) forwards;
}

.page-exit {
    animation: pageExit 0.5s var(--ease-in-out-cubic) forwards;
}

@keyframes pageEnter {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pageExit {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-20px);
    }
}

/* Mobile Optimizations */
@media (max-width: 768px) {
    .fade-up,
    .fade-in,
    .slide-in-left,
    .slide-in-right,
    .scale-in {
        animation-duration: 0.4s;
    }
    
    .stagger-children > * {
        animation-duration: 0.4s;
    }
    
    .stagger-children > *:nth-child(n) {
        animation-delay: calc(var(--stagger-delay, 0.1s) * var(--i, 0));
    }
    
    .service-card:hover,
    .advantage-card:hover {
        transform: translateY(-4px) scale(1.01);
    }
    
    .hover-lift:hover {
        transform: translateY(-2px);
    }
}

/* 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;
        scroll-behavior: auto !important;
    }
    
    .fade-up,
    .fade-in,
    .slide-in-left,
    .slide-in-right,
    .scale-in {
        animation: none;
        opacity: 1;
        transform: none;
    }
    
    .stagger-children > * {
        animation: none;
        opacity: 1;
        transform: none;
    }
    
    .hover-lift:hover,
    .hover-scale:hover,
    .hover-rotate:hover {
        transform: none;
    }
}

/* Print Media - Disable Animations */
@media print {
    *,
    *::before,
    *::after {
        animation: none !important;
        transition: none !important;
    }
    
    .fade-up,
    .fade-in,
    .slide-in-left,
    .slide-in-right,
    .scale-in {
        opacity: 1;
        transform: none;
    }
}