/* Custom Animations and Styles for AB-Labz Landing */

/* CSS Variables for fonts (from documentation) */
:root {
    --vp-font-family-base: "Inter", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Helvetica, Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
    --vp-font-family-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

/* Apply Inter font globally */
body {
    font-family: var(--vp-font-family-base);
    font-feature-settings: 'salt', 'ss01', 'ss02', 'ss03', 'ss04';
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Fade in animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

/* Gradient text animation */
@keyframes gradient {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.animate-gradient {
    background-size: 200% 200%;
    animation: gradient 3s ease infinite;
}

/* Hover effects for cards */
.hover-lift {
    transition: all 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Details/Summary custom styling */
details summary {
    list-style: none;
    position: relative;
    padding-right: 30px;
    transition: color 0.3s ease;
}

details summary:hover {
    color: #2563eb;
}

details summary::after {
    content: "+";
    position: absolute;
    right: 0;
    top: 0;
    font-size: 24px;
    font-weight: bold;
    color: #2563eb;
    transition: transform 0.3s ease;
}

details[open] summary::after {
    content: "−";
    transform: rotate(180deg);
}

details summary::-webkit-details-marker {
    display: none;
}

/* Modal animations */
@keyframes modalFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

#beta-modal {
    animation: modalFadeIn 0.2s ease;
}

#beta-modal > div {
    animation: modalSlideIn 0.3s ease;
}

/* Pulse effect for CTA buttons */
@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.7);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(37, 99, 235, 0);
    }
}

.pulse-on-hover:hover {
    animation: pulse 1.5s infinite;
}

/* Table responsive */
@media (max-width: 768px) {
    table {
        font-size: 0.875rem;
    }
    
    table th,
    table td {
        padding: 0.75rem 0.5rem;
    }
}

/* Badge styles */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 500;
}

/* Gradient backgrounds */
.gradient-blue-purple {
    background: linear-gradient(135deg, #2563eb 0%, #9333ea 100%);
}

.gradient-green-emerald {
    background: linear-gradient(135deg, #22c55e 0%, #10b981 100%);
}

/* Hero background - clean and simple */
.hero-gradient {
    background: #ffffff;
    position: relative;
}

/* Loading state */
.loading {
    position: relative;
    pointer-events: none;
    opacity: 0.6;
}

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

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

/* Intersection Observer animation classes */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* Staggered animation */
.reveal.delay-1 {
    transition-delay: 0.1s;
}

.reveal.delay-2 {
    transition-delay: 0.2s;
}

.reveal.delay-3 {
    transition-delay: 0.3s;
}

.reveal.delay-4 {
    transition-delay: 0.4s;
}

/* Mobile menu transition */
#mobile-menu {
    transition: max-height 0.3s ease-in-out;
    overflow: hidden;
}

/* Focus styles for accessibility - only for keyboard navigation */
button:focus,
a:focus {
    outline: none;
}

button:focus-visible,
a:focus-visible {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

/* Print styles */
@media print {
    nav,
    footer,
    button,
    #beta-modal {
        display: none !important;
    }
    
    section {
        page-break-inside: avoid;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .bg-gradient-to-r,
    .bg-gradient-to-br,
    .bg-gradient-to-b {
        background: #2563eb !important;
    }
}

/* 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;
    }
    
    html {
        scroll-behavior: auto;
    }
}

/* Dark mode support (optional) */
@media (prefers-color-scheme: dark) {
    /* Можно добавить темную тему в будущем */
}

/* Platform tabs styling - Amplitude style */
.platform-tab {
    background: transparent;
    border: 1px solid transparent;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.platform-tab:hover:not(.platform-tab-active) {
    background: #f9fafb;
}

.platform-tab-active {
    background: #f3f4f6;
    border: 1px solid #e5e7eb !important;
}

.platform-tab .tab-title {
    font-weight: 500;
    color: #6b7280;
    transition: all 0.2s ease;
}

.platform-tab-active .tab-title {
    font-weight: 600;
    color: #111827;
}

.platform-tab .tab-description {
    max-height: 0;
    transition: max-height 0.3s ease-out;
}

.platform-tab-active .tab-description {
    max-height: 200px;
    transition: max-height 0.3s ease-in;
}

.platform-screenshot {
    transition: opacity 0.3s ease-in-out;
}

/* Parallax improvements - плавное движение картинок */
section img {
    will-change: transform;
    transition: transform 0.1s ease-out;
}

/* Улучшенный smooth scroll с offset для навигации */
html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px; /* Учитываем высоту навигации */
}

/* Анимация появления секций при скролле */
@keyframes slideInFromBottom {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

section {
    animation: slideInFromBottom 0.8s ease-out both;
}

/* Стагерные задержки для секций - каждая следующая с небольшой задержкой */
section:nth-of-type(1) { animation-delay: 0s; }
section:nth-of-type(2) { animation-delay: 0.1s; }
section:nth-of-type(3) { animation-delay: 0.15s; }
section:nth-of-type(4) { animation-delay: 0.2s; }
section:nth-of-type(5) { animation-delay: 0.25s; }
section:nth-of-type(6) { animation-delay: 0.3s; }
section:nth-of-type(7) { animation-delay: 0.35s; }
section:nth-of-type(8) { animation-delay: 0.4s; }

/* Плавные тени для картинок */
section img {
    transition: transform 0.1s ease-out;
}

/* Глубина для наложенных картинок */
div[class*="z-10"] img {
    filter: drop-shadow(0 20px 25px rgba(0, 0, 0, 0.15));
}

div[class*="z-0"] img {
    filter: drop-shadow(0 10px 15px rgba(0, 0, 0, 0.1));
}

/* Плавные переходы для всех интерактивных элементов */
a, button {
    transition: all 0.2s ease;
}

/* Улучшенная анимация для navigation links */
nav a:not(#languageDropdown a):not(#languageDropdownMobile a) {
    transition: color 0.2s ease;
}

nav a:not(#languageDropdown a):not(#languageDropdownMobile a):hover,
nav a:not(#languageDropdown a):not(#languageDropdownMobile a).text-brand-blue {
    color: #9333ea !important;
}

/* External link icon color change on hover */
nav a:not(#languageDropdown a):not(#languageDropdownMobile a):hover svg {
    color: #9333ea;
}

/* Dropdown menu button hover */
nav button:hover {
    color: #9333ea !important;
}

/* Dropdown menu items hover */
nav .group .absolute a:hover {
    color: #9333ea !important;
    background-color: #f9fafb;
}

/* Parallax container optimization */
.relative {
    transform-style: preserve-3d;
}

/* Language Selector Styles */
#languageMenu {
    position: relative;
}

#languageDropdown {
    min-width: 144px;
    animation: dropdownFadeIn 0.2s ease;
}

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

#languageDropdown a {
    display: flex;
    align-items: center;
    white-space: nowrap;
}

/* Mobile language selector */
@media (max-width: 1023px) {
    #languageDropdown {
        right: auto;
        left: 0;
    }
}

/* Performance optimization - отключаем анимации на мобильных и планшетах для производительности */
@media (max-width: 1024px) {
    section img {
        transform: none !important;
    }
    
    html {
        scroll-padding-top: 60px;
    }
    
    /* Отключаем все анимации появления на мобилках */
    section {
        animation: none !important;
        opacity: 1 !important;
        transform: none !important;
    }
    
    .reveal {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }
}

/* Fade in для hero блока */
@keyframes heroFadeIn {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

section:first-of-type {
    animation: heroFadeIn 1s ease-out;
}

/* Smooth transitions для всех блоков */
section > div {
    transition: opacity 0.6s ease, transform 0.6s ease;
}