/* Modern CSS Styles for 1C Migration Website - 2024 Edition */

/* CSS Reset and Base Styles */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --scroll-behavior: smooth;
    --font-feature-settings: "cv02", "cv03", "cv04", "cv11";
    --font-variation-settings: "opsz" 32;
}

html {
    scroll-behavior: var(--scroll-behavior);
    scroll-padding-top: 80px;
}

body {
    line-height: 1.6;
    font-feature-settings: var(--font-feature-settings);
    font-variation-settings: var(--font-variation-settings);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    overflow-x: hidden;
}

/* Modern Custom Scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    backdrop-filter: blur(10px);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #3b82f6, #2563eb);
    border-radius: 10px;
    border: 2px solid transparent;
    background-clip: padding-box;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #2563eb, #1d4ed8);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

/* Modern Selection Styles */
::selection {
    background: linear-gradient(90deg, #3b82f6, #f97316);
    color: white;
    text-shadow: none;
}

::-moz-selection {
    background: linear-gradient(90deg, #3b82f6, #f97316);
    color: white;
    text-shadow: none;
}

/* Modern Navigation with Glassmorphism */
#navbar {
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    background: linear-gradient(
        135deg, 
        rgba(255, 255, 255, 0.8) 0%, 
        rgba(255, 255, 255, 0.6) 100%
    );
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

#navbar::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

#navbar:hover::before {
    opacity: 1;
}

#navbar.scrolled {
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.1),
        0 1px 0 rgba(255, 255, 255, 0.8) inset;
    background: linear-gradient(
        135deg, 
        rgba(255, 255, 255, 0.95) 0%, 
        rgba(255, 255, 255, 0.85) 100%
    );
}

.nav-link {
    position: relative;
    transition: all 0.3s ease;
}

.nav-link:hover {
    transform: translateY(-2px);
}

.nav-link.active {
    color: #2563eb !important;
    font-weight: 600;
}

.nav-link.active::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 2px;
    bottom: 0;
    left: 0;
    background-color: #2563eb;
    transform: scaleX(1);
    transition: transform 0.3s ease;
}

.nav-link::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 2px;
    bottom: 0;
    left: 0;
    background-color: #2563eb;
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.nav-link:hover::after {
    transform: scaleX(1);
}

/* Mobile Menu Animation */
.mobile-menu {
    transition: all 0.3s ease;
    transform: translateY(-10px);
    opacity: 0;
}

.mobile-menu.show {
    transform: translateY(0);
    opacity: 1;
}

/* Hero Section Enhancements */
#hero {
    position: relative;
    overflow: hidden;
}

#hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.1) 0%, rgba(59, 130, 246, 0.05) 100%);
    z-index: 1;
}

#hero > * {
    position: relative;
    z-index: 2;
}

/* Modern Gradient Animations */
@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
        filter: hue-rotate(0deg);
    }
    25% {
        background-position: 100% 50%;
        filter: hue-rotate(90deg);
    }
    50% {
        background-position: 100% 100%;
        filter: hue-rotate(180deg);
    }
    75% {
        background-position: 0% 100%;
        filter: hue-rotate(270deg);
    }
    100% {
        background-position: 0% 50%;
        filter: hue-rotate(360deg);
    }
}

@keyframes pulseGlow {
    0%, 100% {
        box-shadow: 
            0 0 20px rgba(59, 130, 246, 0.4),
            0 0 40px rgba(59, 130, 246, 0.2),
            0 0 60px rgba(59, 130, 246, 0.1);
    }
    50% {
        box-shadow: 
            0 0 30px rgba(59, 130, 246, 0.6),
            0 0 60px rgba(59, 130, 246, 0.4),
            0 0 90px rgba(59, 130, 246, 0.2);
    }
}

@keyframes morphingBlob {
    0%, 100% {
        border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
        transform: rotate(0deg) scale(1);
    }
    25% {
        border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%;
        transform: rotate(90deg) scale(1.1);
    }
    50% {
        border-radius: 50% 60% 30% 60% / 30% 60% 70% 40%;
        transform: rotate(180deg) scale(0.9);
    }
    75% {
        border-radius: 60% 40% 60% 40% / 70% 30% 50% 60%;
        transform: rotate(270deg) scale(1.05);
    }
}

.gradient-animated {
    background: linear-gradient(
        270deg, 
        #2563eb, #3b82f6, #6366f1, #8b5cf6, #f97316, #f59e0b
    );
    background-size: 600% 600%;
    animation: gradientShift 20s ease infinite;
}

.pulse-glow {
    animation: pulseGlow 3s ease-in-out infinite;
}

.morphing-blob {
    animation: morphingBlob 8s ease-in-out infinite;
}

/* Modern Glassmorphism Effect */
.glass {
    background: linear-gradient(
        135deg, 
        rgba(255, 255, 255, 0.1) 0%, 
        rgba(255, 255, 255, 0.05) 100%
    );
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.glass-dark {
    background: linear-gradient(
        135deg, 
        rgba(0, 0, 0, 0.1) 0%, 
        rgba(0, 0, 0, 0.05) 100%
    );
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Modern Card Effects with Advanced Interactions */
.card-hover {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
    transform-style: preserve-3d;
    perspective: 1000px;
}

.card-hover::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        135deg, 
        rgba(59, 130, 246, 0.1) 0%, 
        rgba(249, 115, 22, 0.1) 100%
    );
    opacity: 0;
    transition: opacity 0.4s ease;
    border-radius: inherit;
    z-index: -1;
}

.card-hover:hover {
    transform: translateY(-12px) scale(1.03) rotateX(2deg);
    box-shadow: 
        0 25px 50px rgba(0, 0, 0, 0.15),
        0 10px 20px rgba(59, 130, 246, 0.1),
        0 0 0 1px rgba(255, 255, 255, 0.5) inset;
}

.card-hover:hover::before {
    opacity: 1;
}

.card-hover:active {
    transform: translateY(-8px) scale(1.01);
    transition-duration: 0.1s;
}

/* Stage Cards Animation */
.stage-card {
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

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

.stage-card:hover::before {
    left: 100%;
}

.stage-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
}

/* Benefits Section Icons */
.benefit-icon {
    transition: all 0.3s ease;
}

.benefit-icon:hover {
    transform: rotate(360deg) scale(1.2);
}

/* Comparison Section Styles */
.comparison-card {
    position: relative;
    overflow: hidden;
}

.comparison-card::after {
    content: '';
    position: absolute;
    top: 0;
    right: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: right 0.8s ease;
}

.comparison-card:hover::after {
    right: 100%;
}

/* Loading Animation for Charts */
.chart-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 400px;
}

.chart-loading::after {
    content: '';
    width: 40px;
    height: 40px;
    border: 4px solid #f3f4f6;
    border-top: 4px solid #2563eb;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Pulse Animation */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.05);
    }
}

.pulse {
    animation: pulse 2s infinite;
}

/* Modern Intersection Animations */
@keyframes modernFadeIn {
    0% {
        opacity: 0;
        transform: translateY(40px) scale(0.95);
        filter: blur(5px);
    }
    50% {
        opacity: 0.5;
        transform: translateY(20px) scale(0.98);
        filter: blur(2px);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: blur(0);
    }
}

@keyframes slideInFromLeft {
    0% {
        opacity: 0;
        transform: translateX(-50px) rotateY(-10deg);
    }
    100% {
        opacity: 1;
        transform: translateX(0) rotateY(0);
    }
}

@keyframes slideInFromRight {
    0% {
        opacity: 0;
        transform: translateX(50px) rotateY(10deg);
    }
    100% {
        opacity: 1;
        transform: translateX(0) rotateY(0);
    }
}

@keyframes scaleInBounce {
    0% {
        opacity: 0;
        transform: scale(0.3) rotate(-10deg);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.05) rotate(2deg);
    }
    100% {
        opacity: 1;
        transform: scale(1) rotate(0);
    }
}

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

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

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

.scale-in-bounce {
    animation: scaleInBounce 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
}

.fade-in-delay-1 { animation-delay: 0.1s; }
.fade-in-delay-2 { animation-delay: 0.2s; }
.fade-in-delay-3 { animation-delay: 0.3s; }
.fade-in-delay-4 { animation-delay: 0.4s; }
.fade-in-delay-5 { animation-delay: 0.5s; }

/* Slide In Animation */
@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

.slide-in-left {
    animation: slideInLeft 0.8s ease forwards;
}

.slide-in-right {
    animation: slideInRight 0.8s ease forwards;
}

/* Modern Button Interactions */
.btn-primary {
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    background-size: 200% 100%;
    background-position: left center;
}

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

.btn-primary::after {
    content: '';
    position: absolute;
    inset: 0;
    background: inherit;
    filter: blur(20px) opacity(0.5);
    z-index: -1;
    transition: all 0.4s ease;
    transform: scale(0.8);
}

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

.btn-primary:hover::after {
    transform: scale(1.1);
    opacity: 0.8;
}

.btn-primary:hover {
    transform: translateY(-4px) scale(1.05);
    box-shadow: 
        0 20px 40px rgba(37, 99, 235, 0.3),
        0 0 0 1px rgba(255, 255, 255, 0.2) inset;
    background-position: right center;
}

.btn-primary:active {
    transform: translateY(-2px) scale(1.02);
    transition-duration: 0.1s;
}

/* Tooltip Styles */
.tooltip {
    position: relative;
    cursor: pointer;
}

.tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background-color: #1f2937;
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 14px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
}

.tooltip::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(8px);
    border: 6px solid transparent;
    border-top-color: #1f2937;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.tooltip:hover::after,
.tooltip:hover::before {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(-5px);
}

/* Progress Bar */
.progress-bar {
    height: 4px;
    background-color: #e5e7eb;
    border-radius: 2px;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #2563eb, #3b82f6);
    border-radius: 2px;
    transition: width 0.3s ease;
    position: relative;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

/* Modern Responsive Design with Container Queries */
@container (max-width: 768px) {
    .nav-link {
        padding: 16px 20px;
        border-bottom: 1px solid rgba(229, 231, 235, 0.3);
        backdrop-filter: blur(10px);
        transition: all 0.3s ease;
    }
    
    .nav-link:hover {
        background: rgba(59, 130, 246, 0.1);
        border-color: rgba(59, 130, 246, 0.3);
    }
    
    .nav-link:last-child {
        border-bottom: none;
    }
}

@media (max-width: 768px) {
    .hero-stats {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .comparison-grid {
        grid-template-columns: 1fr;
        gap: 32px;
    }
    
    .stages-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    /* Mobile-first modern spacing */
    .px-4 { padding-left: 1rem; padding-right: 1rem; }
    .py-20 { padding-top: 3rem; padding-bottom: 3rem; }
}

@media (max-width: 480px) {
    .text-4xl { font-size: 2.25rem; line-height: 2.5rem; }
    .text-5xl { font-size: 2.5rem; line-height: 2.75rem; }
    .text-6xl { font-size: 3rem; line-height: 3.25rem; }
    .text-7xl { font-size: 3.5rem; line-height: 3.75rem; }
    
    .px-8 { padding-left: 1.25rem; padding-right: 1.25rem; }
    .py-4 { padding-top: 0.75rem; padding-bottom: 0.75rem; }
    
    /* Improved touch targets for mobile */
    button, .btn-primary {
        min-height: 44px;
        min-width: 44px;
    }
}

@media (max-width: 480px) {
    .text-4xl {
        font-size: 2.5rem;
    }
    
    .text-6xl {
        font-size: 3rem;
    }
    
    .px-8 {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }
    
    .py-3 {
        padding-top: 0.5rem;
        padding-bottom: 0.5rem;
    }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .bg-gradient-to-r {
        background: #1f2937 !important;
    }
    
    .text-blue-100 {
        color: #ffffff !important;
    }
    
    .border-opacity-20 {
        border-opacity: 1 !important;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Print Styles */
@media print {
    nav, footer, .cta-section {
        display: none !important;
    }
    
    .bg-gradient-to-r {
        background: #ffffff !important;
        color: #000000 !important;
    }
    
    .text-white {
        color: #000000 !important;
    }
    
    .shadow-lg, .shadow-xl {
        box-shadow: none !important;
        border: 1px solid #e5e7eb !important;
    }
}

/* Focus States for Accessibility */
button:focus,
.nav-link:focus {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

/* Modern Micro-interactions */
@keyframes magneticHover {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(var(--x, 0), var(--y, 0)) scale(1.05); }
}

@keyframes elasticScale {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

@keyframes textShimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

.magnetic {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.magnetic:hover {
    animation: magneticHover 0.3s ease-out forwards;
}

.elastic-scale:hover {
    animation: elasticScale 0.6s ease-in-out;
}

.text-shimmer {
    background: linear-gradient(
        90deg,
        currentColor 25%,
        rgba(255, 255, 255, 0.5) 50%,
        currentColor 75%
    );
    background-size: 200% 100%;
    background-clip: text;
    -webkit-background-clip: text;
    animation: textShimmer 2s ease-in-out infinite;
}

/* Focus States for Modern Accessibility */
button:focus-visible,
.nav-link:focus-visible {
    outline: 2px solid rgba(59, 130, 246, 0.8);
    outline-offset: 4px;
    box-shadow: 
        0 0 0 4px rgba(59, 130, 246, 0.2),
        0 0 20px rgba(59, 130, 246, 0.3);
    transition: all 0.2s ease;
}

/* Modern Form Elements */
input:focus,
textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 
        0 0 0 3px rgba(59, 130, 246, 0.1),
        0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Modern Loading States */
.loading {
    position: relative;
    pointer-events: none;
    opacity: 0.7;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

@keyframes ripple {
    0% {
        transform: scale(0);
        opacity: 1;
    }
    100% {
        transform: scale(2);
        opacity: 0;
    }
}

/* Modern Dark Mode Support */
@media (prefers-color-scheme: dark) {
    :root {
        --glass-bg: rgba(0, 0, 0, 0.1);
        --glass-border: rgba(255, 255, 255, 0.1);
        --text-primary: #f9fafb;
        --text-secondary: #d1d5db;
    }
    
    .glass {
        background: linear-gradient(
            135deg, 
            rgba(0, 0, 0, 0.1) 0%, 
            rgba(0, 0, 0, 0.05) 100%
        );
        border-color: rgba(255, 255, 255, 0.1);
    }
}

/* Modern CSS Grid Enhancements */
.grid-modern {
    display: grid;
    gap: clamp(1rem, 5vw, 2rem);
    grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
}

/* Container Query Support */
@supports (container-type: inline-size) {
    .card-container {
        container-type: inline-size;
    }
    
    @container (min-width: 300px) {
        .card-content {
            padding: 2rem;
        }
    }
    
    @container (min-width: 500px) {
        .card-content {
            padding: 3rem;
        }
    }
}

/* Modern Typography */
.text-balance {
    text-wrap: balance;
}

.text-pretty {
    text-wrap: pretty;
}