/* Procederai - Main Styles */

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px; /* Account for fixed header */
}

body {
    font-family: 'Satoshi', sans-serif;
}
* {
    box-sizing: border-box;
}

/* Cookie Banner Styles */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(13, 95, 137, 0.95);
    backdrop-filter: blur(10px);
    z-index: 9999;
    transform: translateY(100%);
    transition: transform 0.3s ease;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
}
.cookie-banner.show {
    transform: translateY(0);
}
@media (max-width: 640px) {
    .cookie-banner {
        padding: 1rem;
    }
    .cookie-banner button {
        font-size: 0.75rem;
        padding: 0.5rem 1rem;
    }
}
.hero-background {
    background-image: url('../../background.webp');
    background-size: cover;
    background-position: center;
    min-height: 100vh;
}
/* Fallback for browsers that don't support WebP */
.no-webp .hero-background {
    background-image: url('../../background.png');
}
.section-background {
    background-image: url('../../background.webp');
    background-size: cover;
    background-position: center;
}
/* Fallback for browsers that don't support WebP */
.no-webp .section-background {
    background-image: url('../../background.png');
}
.number-counter {
    font-size: 6rem;
    font-weight: 900;
    line-height: 1;
}
@media (max-width: 768px) {
    .number-counter {
        font-size: 4rem;
    }
}
/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: #f1f1f1;
}
::-webkit-scrollbar-thumb {
    background: #0D5F89;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #094968;
}
/* Enhanced Preloader with Draw + Glow Animation */
#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    /* Use the tiny background image */
    background-image: url('../background-preloader.jpg');
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    transition: opacity 0.5s ease-out;
}
#preloader::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    /* Dark overlay for better contrast */
    background: rgba(0, 0, 0, 0.3);
    z-index: 1;
}
.loader {
    position: relative;
    z-index: 2;
    width: 200px; /* Same size as enhanced version */
    height: 235px;
}
.loader svg {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 0 0 rgba(255, 255, 255, 0));
    animation: glowPulse 2s ease-in-out 1.8s infinite;
}
.loader path {
    stroke: white;
    stroke-width: 2; /* Same as enhanced */
    fill: none;
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.loader path:nth-child(1) {
    animation: drawPath 3s ease-in-out forwards;
}
.loader path:nth-child(2) {
    animation: drawPath 3s ease-in-out 0.5s forwards,
               centerGlow 2s ease-in-out 3.5s infinite;
}
.loader path:nth-child(3) {
    animation: drawPath 3s ease-in-out 1s forwards;
}
@keyframes drawPath {
    0% { 
        stroke-dashoffset: 1000; 
        fill: none; 
    }
    80% { 
        stroke-dashoffset: 0; 
        fill: none; 
    }
    100% { 
        stroke-dashoffset: 0; 
        fill: white; 
    }
}
@keyframes glowPulse {
    0%, 100% { 
        filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.3));
    }
    50% { 
        filter: drop-shadow(0 0 20px rgba(255, 255, 255, 0.5));
    }
}
@keyframes centerGlow {
    0%, 100% { 
        filter: drop-shadow(0 0 15px rgba(255, 255, 255, 0.8))
                drop-shadow(0 0 20px rgba(255, 255, 255, 0.4));
    }
    50% { 
        filter: drop-shadow(0 0 40px rgba(255, 255, 255, 1))
                drop-shadow(0 0 60px rgba(13, 95, 137, 0.8))
                drop-shadow(0 0 30px rgba(255, 255, 255, 0.6));
    }
}
#preloader.fade-out {
    opacity: 0;
    pointer-events: none;
}
/* Loading text from enhanced version */
.loading-text {
    position: absolute;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    font-family: 'Satoshi', sans-serif;
    font-size: 14px;
    letter-spacing: 2px;
    text-transform: uppercase;
    opacity: 0;
    animation: fadeIn 1s ease-in-out 1.5s forwards;
    z-index: 2;
}
@keyframes fadeIn {
    to { opacity: 0.8; }
}
/* Feature card hover effects */
.feature-card {
    transition: all 0.3s ease;
}
.feature-card:hover {
    transform: translateY(-5px);
}
.feature-card:hover .feature-icon {
    transform: scale(1.1) rotate(5deg);
}
.feature-icon {
    transition: transform 0.3s ease;
}
/* Mobile menu styles */
.mobile-menu-overlay {
    backdrop-filter: blur(10px);
}
/* Mobile menu animation */
.mobile-menu-panel {
    transform: translateX(100%);
    transition: transform 0.3s ease-in-out;
}
.mobile-menu-panel.active {
    transform: translateX(0);
}
/* Language toggle */
.lang-toggle {
    cursor: pointer;
    user-select: none;
}
/* Feature showcase styles */
.feature-dot {
    cursor: pointer;
    transition: all 0.3s ease;
}
.feature-dot:hover {
    transform: scale(1.2);
}
.feature-visual {
    min-height: 400px;
}
@media (max-width: 768px) {
    .feature-visual {
        min-height: 300px;
    }
}

/* Smooth animations for interactive elements */
.video-progress-bar {
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.search-input {
    transition: all 0.3s ease;
}

.search-result-item {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.doc-change-item {
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.chat-message {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.detection-box {
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 4px;
}

.detection-box div {
    transition: all 0.3s ease;
}

.play-button-container {
    transition: all 0.3s ease;
}

.recording-dot {
    animation: pulse 1.5s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

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

.steps-counter-text {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.steps-timeline {
    backdrop-filter: blur(8px);
}

.step-item {
    border-left: 2px solid transparent;
    padding-left: 8px;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.step-item.active {
    border-left-color: #3B82F6;
    background-color: rgba(59, 130, 246, 0.1);
}

@keyframes pulse {
    0%, 100% { 
        opacity: 1;
        transform: scale(1);
    }
    50% { 
        opacity: 0.5;
        transform: scale(1.1);
    }
}

.typing-cursor::after {
    content: '|';
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}
/* Fix loading animation */
#loadingScreen svg {
    animation: spin 2s linear infinite;
}


/* Mobile Layout */
@media (max-width: 768px) {
    /* Remove shadows */
    .lang-toggle,
    #mobile-menu-btn {
        box-shadow: none !important;
        -webkit-box-shadow: none !important;
    }
    
    /* Prevent horizontal scroll */
    html, body {
        overflow-x: hidden !important;
        max-width: 100% !important;
    }
    
    section {
        overflow-x: hidden !important;
        max-width: 100vw !important;
    }
    
    /* Lighter animations for mobile team section */
    #team [data-aos] {
        animation-duration: 0.3s !important;
    }
    
    #team [data-aos-delay="300"],
    #team [data-aos-delay="400"],
    #team [data-aos-delay="500"],
    #team [data-aos-delay="600"],
    #team [data-aos-delay="700"],
    #team [data-aos-delay="800"],
    #team [data-aos-delay="900"] {
        animation-delay: 0.1s !important;
    }
}


/* Apple-Style Scroll Features */
.features-scroll-container {
    position: relative;
}

/* Fixed viewport */
.feature-viewport {
    position: sticky;
    top: 80px; /* Account for header height */
    height: calc(100vh - 80px);
    background: white;
    z-index: 1;
    display: flex;
    align-items: center;
}

.feature-viewport > div {
    width: 100%;
}

/* Scroll trigger sections */
.feature-scroll-trigger {
    height: 100vh;
    position: relative;
}

/* Content and visual wrappers */
.feature-content-wrapper {
    position: relative;
    min-height: 500px;
    height: auto;
}

.feature-visual-wrapper {
    position: relative;
    min-height: 500px;
    height: auto;
}

/* Make visual panel scrollable on short screens */
@media (max-height: 800px) and (min-width: 1024px) {
    .feature-visual-wrapper {
        max-height: calc(100vh - 200px);
        overflow-y: auto;
        overflow-x: hidden;
    }
    
    /* Hide scrollbar but keep scrollability */
    .feature-visual-wrapper::-webkit-scrollbar {
        width: 0px;
        background: transparent;
    }
}

/* Individual feature content - HIDDEN BY DEFAULT */
.feature-content {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease-out, visibility 0.4s ease-out;
    padding: 2rem;
    will-change: opacity;
}

.feature-content.active {
    opacity: 1;
    visibility: visible;
}

/* Individual feature visuals - HIDDEN BY DEFAULT */
.feature-visual {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease-out, visibility 0.4s ease-out;
    will-change: opacity;
}

.feature-visual.active {
    opacity: 1;
    visibility: visible;
}

.feature-visual:not(.active) {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

/* Staggered animations for list items */
.feature-content.active li {
    opacity: 0;
    transform: translateX(-20px);
    animation: slideIn 0.6s ease forwards;
}

.feature-content.active li:nth-child(1) { animation-delay: 0.1s; }
.feature-content.active li:nth-child(2) { animation-delay: 0.2s; }
.feature-content.active li:nth-child(3) { animation-delay: 0.3s; }
.feature-content.active li:nth-child(4) { animation-delay: 0.4s; }

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

/* Visual element animations */
.feature-visual .animate-pulse > div {
    opacity: 0;
    transform: scale(0.8);
}

.feature-visual.active .animate-pulse > div {
    opacity: 1;
    transform: scale(1);
    transition: all 0.6s ease;
}

.feature-visual.active .animate-pulse > div:nth-child(1) { transition-delay: 0.1s; }
.feature-visual.active .animate-pulse > div:nth-child(2) { transition-delay: 0.2s; }
.feature-visual.active .animate-pulse > div:nth-child(3) { transition-delay: 0.3s; }

/* Analytics Dashboard Cycling Tabs */
.analytics-tab {
    opacity: 0;
    visibility: hidden;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    transition: all 0.5s ease;
    transform: translateY(10px);
}

.analytics-tab.active {
    opacity: 1;
    visibility: visible;
    position: relative;
    transform: translateY(0);
}

.analytics-tab-content {
    position: relative;
    min-height: 120px;
}

.analytics-tab-indicator.active {
    background-color: #0D5F89 !important;
    transform: scale(1.2);
}

/* Custom Feature Animations */

/* Feature 1: Video Analysis Style Animation */

/* Tab Buttons */
.tab-btn {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.tab-btn:hover:not(.active) {
    background-color: rgba(0, 0, 0, 0.05);
}

.tab-btn.active {
    background-color: white;
    color: #2563eb;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
    transform: scale(1.02);
}

/* Tab Content - Prevent layout shift */
.tab-content {
    min-height: 400px;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateY(10px);
}

.tab-content.active {
    position: relative;
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Video Progress Bar Animation */
.video-progress-bar {
    width: 0;
    animation: progressFill 10s linear forwards;
    animation-delay: 0s;
}

/* Recording Dot */
.recording-dot {
    animation: pulse 1.5s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Step Detection Animation */
.step-detection-text {
    position: relative;
}

.step-detection-text::after {
    content: '|';
    animation: blink 1s infinite;
    color: #2563eb;
}

/* Steps List Animation */
.steps-list .step-item {
    opacity: 0;
    transform: translateY(10px);
}

.feature-visual.active .step-item:nth-child(1) {
    animation: stepAppear 0.5s ease forwards;
    animation-delay: 3s; /* Appears at 30% progress */
}

.feature-visual.active .step-item:nth-child(2) {
    animation: stepAppear 0.5s ease forwards;
    animation-delay: 6s; /* Appears at 60% progress */
}

.feature-visual.active .step-item:nth-child(3) {
    animation: stepAppear 0.5s ease forwards;
    animation-delay: 9s; /* Appears at 90% progress */
}

/* Play Button Hover */
.play-button-container {
    transition: all 0.3s ease;
}

.play-button-container:hover {
    transform: scale(1.05);
}

/* Steps List - No scrollbar needed */

/* Step Item Hover Effect */
.step-item {
    transition: all 0.2s ease;
}

.step-item:hover {
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    border-color: #e5e7eb;
}

/* Documents Tab Animations */
.tab-content[data-tab="document"] .step-item {
    opacity: 0;
    transform: translateY(20px);
    animation: none;
}

.tab-content[data-tab="document"].active .step-item {
    animation: documentItemAppear 0.6s ease forwards;
}

.tab-content[data-tab="document"].active .step-item:nth-child(1) {
    animation-delay: 0.2s;
}

.tab-content[data-tab="document"].active .step-item:nth-child(2) {
    animation-delay: 0.4s;
}

.tab-content[data-tab="document"].active .step-item:nth-child(3) {
    animation-delay: 0.6s;
}

/* Document cards rotation animation */
.tab-content[data-tab="document"] .flex > div {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
    transform: scale(0.8);
}

.tab-content[data-tab="document"].active .flex > div:nth-child(1) {
    animation: documentRotateIn 0.8s ease forwards;
    animation-delay: 0.1s;
}

.tab-content[data-tab="document"].active .flex > div:nth-child(2) {
    animation: documentScaleIn 0.8s ease forwards;
    animation-delay: 0.2s;
}

.tab-content[data-tab="document"].active .flex > div:nth-child(3) {
    animation: documentRotateIn 0.8s ease forwards;
    animation-delay: 0.3s;
}

/* Processing pulse effect */
.tab-content[data-tab="document"] .animate-pulse {
    animation: none;
}

.tab-content[data-tab="document"].active .animate-pulse {
    animation: documentPulse 2s ease-in-out infinite;
    animation-delay: 1s;
}

/* Extracting procedures animation */
.tab-content[data-tab="document"] .bg-purple-50 {
    opacity: 0;
    transform: translateX(-20px);
}

.tab-content[data-tab="document"].active .bg-purple-50 {
    animation: slideInFromLeft 0.6s ease forwards;
    animation-delay: 0.5s;
}

/* Feature 2: Dynamic Catalog Animation */
.feature-visual[data-feature="2"] .catalog-search {
    opacity: 0;
    transform: translateY(-10px);
}

.feature-visual[data-feature="2"].active .catalog-search {
    animation: fadeInDown 0.6s ease forwards;
    animation-delay: 0.2s;
}

/* Initial view should be visible when feature is active */
.feature-visual[data-feature="2"].active .catalog-initial-view {
    opacity: 1;
    display: block;
}

.feature-visual[data-feature="2"] .sync-indicator {
    opacity: 0;
    transform: scale(0.8);
}

.feature-visual[data-feature="2"].active .sync-indicator {
    animation: syncPulse 0.8s ease forwards;
    animation-delay: 0.3s;
}

.feature-visual[data-feature="2"] .catalog-item {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
}

.feature-visual[data-feature="2"].active .catalog-item:nth-child(1) {
    animation: catalogItemSlide 0.6s ease forwards;
    animation-delay: 0.4s;
}

.feature-visual[data-feature="2"].active .catalog-item:nth-child(2) {
    animation: catalogItemSlide 0.6s ease forwards;
    animation-delay: 0.5s;
}

.feature-visual[data-feature="2"].active .catalog-item:nth-child(3) {
    animation: catalogItemSlide 0.6s ease forwards;
    animation-delay: 0.6s;
}

.feature-visual[data-feature="2"].active .catalog-item:nth-child(4) {
    animation: catalogItemSlide 0.6s ease forwards;
    animation-delay: 0.7s;
}

/* Catalog item hover effects */
.catalog-item {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.catalog-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

.catalog-item:hover .w-8 {
    transform: scale(1.1);
}

/* Catalog counter animation */
.feature-visual[data-feature="2"] .catalog-counter {
    opacity: 0;
}

.feature-visual[data-feature="2"].active .catalog-counter {
    animation: counterCount 1.5s ease forwards;
    animation-delay: 0.8s;
}

/* Upload status animation */
.feature-visual[data-feature="2"] .upload-status {
    opacity: 0;
    transform: translateX(10px);
}

.feature-visual[data-feature="2"].active .upload-status {
    animation: slideInFromRight 0.6s ease forwards;
    animation-delay: 1s;
}

/* Catalog container - No scrollbar needed */

/* Search Results Animations */
.catalog-initial-view {
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 1;
    transform: scale(1);
}

.catalog-initial-view.fade-out {
    opacity: 0;
    transform: scale(0.95);
}

.search-results-view {
    opacity: 0;
    transform: scale(1.05);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.search-results-view.active {
    opacity: 1;
    transform: scale(1);
}

.search-result-item {
    opacity: 0;
    transform: translateY(20px);
}

.search-results-view.active .search-result-item:nth-child(1) {
    animation: searchResultSlide 0.6s ease forwards;
    animation-delay: 0.1s;
}

.search-results-view.active .search-result-item:nth-child(2) {
    animation: searchResultSlide 0.6s ease forwards;
    animation-delay: 0.2s;
}

.search-results-view.active .search-result-item:nth-child(3) {
    animation: searchResultSlide 0.6s ease forwards;
    animation-delay: 0.3s;
}

.search-results-view.active .search-result-item:nth-child(4) {
    animation: searchResultSlide 0.6s ease forwards;
    animation-delay: 0.4s;
}

/* Accuracy badge animation */
.accuracy-badge {
    transform: scale(0);
}

.search-results-view.active .accuracy-badge {
    animation: badgePop 0.4s ease forwards;
    animation-delay: 0.6s;
}

.search-results-view.active .search-result-item:nth-child(2) .accuracy-badge {
    animation-delay: 0.7s;
}

.search-results-view.active .search-result-item:nth-child(3) .accuracy-badge {
    animation-delay: 0.8s;
}

.search-results-view.active .search-result-item:nth-child(4) .accuracy-badge {
    animation-delay: 0.9s;
}

/* Search typing animation */
.search-typing {
    overflow: hidden;
    white-space: nowrap;
    width: 0;
    animation: typing 1.5s steps(11, end) forwards;
    animation-delay: 1.5s;
}

/* Feature 3: Support Chat Animation */
.feature-visual[data-feature="3"] .language-selector {
    opacity: 0;
    transform: scale(0.8);
}

.feature-visual[data-feature="3"].active .language-selector {
    animation: fadeInScale 0.6s ease forwards;
    animation-delay: 0.3s;
}

.feature-visual[data-feature="3"] .chat-message {
    opacity: 0;
    transform: translateY(20px);
}

.feature-visual[data-feature="3"].active .chat-message[data-message="1"] {
    animation: chatMessageSlide 0.6s ease forwards;
    animation-delay: 0.5s;
}

.feature-visual[data-feature="3"].active .chat-message[data-message="2"] {
    animation: chatMessageSlide 0.6s ease forwards;
    animation-delay: 2s;
}

.feature-visual[data-feature="3"].active .chat-message[data-message="3"] {
    animation: chatMessageSlide 0.6s ease forwards;
    animation-delay: 4s;
}

.feature-visual[data-feature="3"].active .chat-message[data-message="4"] {
    animation: chatMessageSlide 0.6s ease forwards;
    animation-delay: 5s;
}

.feature-visual[data-feature="3"] .typing-indicator {
    opacity: 0;
}

.feature-visual[data-feature="3"].active .typing-indicator {
    animation: fadeIn 0.4s ease forwards;
    animation-delay: 6s;
}

/* Procedure steps animation */
.feature-visual[data-feature="3"] .procedure-step {
    opacity: 0;
    transform: translateX(-10px);
}

.feature-visual[data-feature="3"].active .procedure-step:nth-child(1) {
    animation: slideInFromLeft 0.4s ease forwards;
    animation-delay: 2.4s;
}

.feature-visual[data-feature="3"].active .procedure-step:nth-child(2) {
    animation: slideInFromLeft 0.4s ease forwards;
    animation-delay: 2.6s;
}

.feature-visual[data-feature="3"].active .procedure-step:nth-child(3) {
    animation: slideInFromLeft 0.4s ease forwards;
    animation-delay: 2.8s;
}

/* Response time counter */
.feature-visual[data-feature="3"] .response-time {
    opacity: 0;
}

.feature-visual[data-feature="3"].active .response-time {
    animation: responseTimeCount 1s ease forwards;
    animation-delay: 3.5s;
}

/* Ticket status animation */
.feature-visual[data-feature="3"] .ticket-status {
    opacity: 0;
    transform: translateX(10px);
}

.feature-visual[data-feature="3"].active .ticket-status {
    animation: slideInFromRight 0.6s ease forwards;
    animation-delay: 3.8s;
}

/* Chat container scrollbar */
.chat-container::-webkit-scrollbar {
    width: 6px;
}

.chat-container::-webkit-scrollbar-track {
    background: #f3f4f6;
    border-radius: 10px;
}

.chat-container::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 10px;
    transition: background 0.2s;
}

.chat-container::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* Feature 4: Analytics Animation */
.feature-visual[data-feature="4"] .performance-chart {
    opacity: 0;
    transform: translateY(10px);
}

.feature-visual[data-feature="4"].active .performance-chart {
    animation: fadeInUp 0.6s ease forwards;
    animation-delay: 0.2s;
}

/* Chart container styling */
.feature-visual[data-feature="4"] .performance-chart .chart-bar-container {
    position: relative;
}

/* Add subtle shadow to bars */
.feature-visual[data-feature="4"] .chart-bar {
    box-shadow: 0 -2px 4px rgba(0, 0, 0, 0.1);
}

/* Chart bars animation */
.feature-visual[data-feature="4"] .chart-bar {
    transform: scaleY(0);
    transform-origin: bottom;
    transition: transform 1s cubic-bezier(0.4, 0, 0.2, 1);
}

.feature-visual[data-feature="4"].active .chart-bar {
    transform: scaleY(1);
}

.feature-visual[data-feature="4"].active .chart-bar-container:nth-child(1) .chart-bar {
    transition-delay: 0.3s;
}

.feature-visual[data-feature="4"].active .chart-bar-container:nth-child(2) .chart-bar {
    transition-delay: 0.4s;
}

.feature-visual[data-feature="4"].active .chart-bar-container:nth-child(3) .chart-bar {
    transition-delay: 0.5s;
}

.feature-visual[data-feature="4"].active .chart-bar-container:nth-child(4) .chart-bar {
    transition-delay: 0.6s;
}

.feature-visual[data-feature="4"].active .chart-bar-container:nth-child(5) .chart-bar {
    transition-delay: 0.7s;
}

.feature-visual[data-feature="4"].active .chart-bar-container:nth-child(6) .chart-bar {
    transition-delay: 0.8s;
}

.feature-visual[data-feature="4"].active .chart-bar-container:nth-child(7) .chart-bar {
    transition-delay: 0.9s;
}

/* Metrics tiles animation */
.feature-visual[data-feature="4"] .metric-tile {
    opacity: 0;
    transform: translateY(20px) scale(0.9);
}

.feature-visual[data-feature="4"].active .metric-tile:nth-child(1) {
    animation: metricTilePopIn 0.6s ease forwards;
    animation-delay: 1.2s;
}

.feature-visual[data-feature="4"].active .metric-tile:nth-child(2) {
    animation: metricTilePopIn 0.6s ease forwards;
    animation-delay: 1.3s;
}

.feature-visual[data-feature="4"].active .metric-tile:nth-child(3) {
    animation: metricTilePopIn 0.6s ease forwards;
    animation-delay: 1.4s;
}

/* Metric values counter animation */
.metric-value {
    display: inline-block;
}

/* Trending procedures animation */
.feature-visual[data-feature="4"] .trending-section {
    opacity: 0;
    transform: translateX(-20px);
}

.feature-visual[data-feature="4"].active .trending-section {
    animation: slideInFromLeft 0.6s ease forwards;
    animation-delay: 1.6s;
}

.feature-visual[data-feature="4"] .procedure-trend-item {
    opacity: 0;
    transform: translateX(-10px);
}

.feature-visual[data-feature="4"].active .procedure-trend-item:nth-child(1) {
    animation: trendItemSlide 0.5s ease forwards;
    animation-delay: 1.8s;
}

.feature-visual[data-feature="4"].active .procedure-trend-item:nth-child(2) {
    animation: trendItemSlide 0.5s ease forwards;
    animation-delay: 1.9s;
}

.feature-visual[data-feature="4"].active .procedure-trend-item:nth-child(3) {
    animation: trendItemSlide 0.5s ease forwards;
    animation-delay: 2.0s;
}

/* Alert banner animation */
.feature-visual[data-feature="4"] .alert-banner {
    opacity: 0;
    transform: scale(0.95);
}

.feature-visual[data-feature="4"].active .alert-banner {
    animation: alertPulseIn 0.8s ease forwards;
    animation-delay: 2.2s;
}

/* Live indicator pulse */
.feature-visual[data-feature="4"] .live-indicator {
    opacity: 0;
}

.feature-visual[data-feature="4"].active .live-indicator {
    animation: fadeIn 0.4s ease forwards;
    animation-delay: 0.5s;
}

/* Sparkline animation for trends */
.trend-spark-container::after {
    content: '';
    display: block;
    width: 100%;
    height: 100%;
    background: url("data:image/svg+xml,%3Csvg width='64' height='32' viewBox='0 0 64 32' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M2 22L12 18L22 24L32 14L42 20L52 12L62 16' stroke='%2310b981' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/contain no-repeat;
    opacity: 0;
}

.feature-visual[data-feature="4"].active .trend-spark-container::after {
    animation: fadeIn 0.6s ease forwards;
    animation-delay: 2.4s;
}

/* Keyframe Animations */

/* Feature 1 Video Analysis Animations */
@keyframes progressFill {
    0% { 
        width: 0%; 
    }
    100% { 
        width: 100%; 
    }
}

@keyframes stepAppear {
    0% { 
        opacity: 0; 
        transform: translateY(10px); 
    }
    100% { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

/* Legacy animations */
@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
    60% { transform: translateY(-5px); }
}

@keyframes slideRight {
    0% { transform: translateX(0); opacity: 1; }
    50% { transform: translateX(30px); opacity: 0.7; }
    100% { transform: translateX(60px); opacity: 0; }
}

@keyframes stepAppear {
    0% { opacity: 0; transform: translateX(-20px); }
    100% { opacity: 1; transform: translateX(0); }
}

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

@keyframes arrowFlow {
    0% { opacity: 0.3; transform: translateY(0); }
    50% { opacity: 1; transform: translateY(-5px); }
    100% { opacity: 0.3; transform: translateY(0); }
}

@keyframes messageAppear {
    0% { opacity: 0; transform: translateY(20px) scale(0.9); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes ping {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.2); opacity: 0.7; }
    100% { transform: scale(1); opacity: 1; }
}

@keyframes typing {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

@keyframes barGrow {
    0% { transform: scaleY(0); }
    100% { transform: scaleY(1); }
}

@keyframes metricSlideUp {
    0% { opacity: 0; transform: translateY(20px); }
    100% { opacity: 1; transform: translateY(0); }
}

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

/* Documents Tab Keyframes */
@keyframes documentItemAppear {
    0% { 
        opacity: 0; 
        transform: translateY(20px); 
    }
    100% { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

@keyframes documentRotateIn {
    0% { 
        opacity: 0; 
        transform: rotate(-12deg) scale(0.8); 
    }
    50% {
        transform: rotate(-6deg) scale(0.9);
    }
    100% { 
        opacity: 1; 
        transform: rotate(-3deg) scale(1); 
    }
}

@keyframes documentScaleIn {
    0% { 
        opacity: 0; 
        transform: scale(0.7); 
    }
    50% {
        transform: scale(1.1);
    }
    100% { 
        opacity: 1; 
        transform: scale(1.05); 
    }
}

@keyframes documentPulse {
    0%, 100% { 
        opacity: 0.5; 
    }
    50% { 
        opacity: 1; 
    }
}

@keyframes slideInFromLeft {
    0% { 
        opacity: 0; 
        transform: translateX(-20px); 
    }
    100% { 
        opacity: 1; 
        transform: translateX(0); 
    }
}

/* Catalog Feature Keyframes */
@keyframes fadeInDown {
    0% { 
        opacity: 0; 
        transform: translateY(-10px); 
    }
    100% { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

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

@keyframes catalogItemSlide {
    0% { 
        opacity: 0; 
        transform: translateY(20px) scale(0.95); 
    }
    100% { 
        opacity: 1; 
        transform: translateY(0) scale(1); 
    }
}

@keyframes counterCount {
    0% { 
        opacity: 0; 
        transform: scale(0.5); 
    }
    50% {
        transform: scale(1.2);
    }
    100% { 
        opacity: 1; 
        transform: scale(1); 
    }
}

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

@keyframes searchResultSlide {
    0% { 
        opacity: 0; 
        transform: translateY(20px); 
    }
    100% { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

@keyframes badgePop {
    0% { 
        transform: scale(0); 
    }
    50% {
        transform: scale(1.2);
    }
    100% { 
        transform: scale(1); 
    }
}

@keyframes typing {
    from { 
        width: 0; 
    }
    to { 
        width: 100%; 
    }
}

@keyframes fadeInScale {
    0% { 
        opacity: 0; 
        transform: scale(0.8); 
    }
    100% { 
        opacity: 1; 
        transform: scale(1); 
    }
}

@keyframes chatMessageSlide {
    0% { 
        opacity: 0; 
        transform: translateY(20px); 
    }
    100% { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

@keyframes fadeIn {
    0% { 
        opacity: 0; 
    }
    100% { 
        opacity: 1; 
    }
}

@keyframes responseTimeCount {
    0% { 
        opacity: 0; 
        transform: scale(0.5); 
    }
    100% { 
        opacity: 1; 
        transform: scale(1); 
    }
}

@keyframes fadeInUp {
    0% { 
        opacity: 0; 
        transform: translateY(10px); 
    }
    100% { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

@keyframes metricTilePopIn {
    0% { 
        opacity: 0; 
        transform: translateY(20px) scale(0.9); 
    }
    50% {
        transform: translateY(-5px) scale(1.05);
    }
    100% { 
        opacity: 1; 
        transform: translateY(0) scale(1); 
    }
}

@keyframes trendItemSlide {
    0% { 
        opacity: 0; 
        transform: translateX(-10px); 
    }
    100% { 
        opacity: 1; 
        transform: translateX(0); 
    }
}

@keyframes alertPulseIn {
    0% { 
        opacity: 0; 
        transform: scale(0.95); 
    }
    50% {
        transform: scale(1.02);
    }
    100% { 
        opacity: 1; 
        transform: scale(1); 
    }
}

/* Mobile adjustments */
@media (max-width: 768px) {
    html {
        scroll-padding-top: 70px; /* Smaller header on mobile */
    }
    /* Remove all scroll-triggered behavior on mobile */
    .features-scroll-container {
        position: relative;
    }
    
    .feature-scroll-trigger {
        display: none;
    }
    
    .feature-viewport {
        position: relative;
        height: auto;
        top: auto;
    }
    
    /* Simple vertical layout */
    .feature-viewport .grid {
        display: block !important;
        gap: 0 !important;
    }
    
    .feature-content-wrapper,
    .feature-visual-wrapper {
        position: relative;
        height: auto;
        min-height: auto;
        width: 100% !important;
    }
    
    /* Show all features in a vertical list */
    .feature-content,
    .feature-visual {
        position: relative !important;
        opacity: 1 !important;
        visibility: visible !important;
        transform: none !important;
        display: block !important;
    }
    
    /* Group each feature's content and visual together */
    .feature-content {
        padding: 1.5rem;
        margin-bottom: 1rem;
        background: #f9fafb;
        border-radius: 1rem;
        margin-left: 1rem;
        margin-right: 1rem;
    }
    
    .feature-visual {
        padding: 0 1rem;
        margin-bottom: 3rem;
    }
    
    /* Add visual separator after each feature pair */
    .feature-visual:not([data-feature="4"])::after {
        content: '';
        display: block;
        height: 1px;
        background: #e5e7eb;
        margin: 3rem 1rem 0;
    }
    
    /* Hide desktop features on mobile */
    .feature-viewport {
        display: none !important;
    }
    
    /* Mobile feature wrapper styles */
    .mobile-feature-wrapper {
        margin-bottom: 2rem;
        padding-bottom: 2rem;
        border-bottom: 1px solid #e5e7eb;
    }
    
    .mobile-feature-wrapper:last-child {
        border-bottom: none;
    }
    
    /* Adjust feature visuals for mobile */
    .feature-visual .bg-white {
        padding: 1rem;
    }
    
    /* Reduce chat container height on mobile */
    .chat-container {
        height: 300px !important;
    }
    
    /* Adjust tab buttons for mobile */
    .tab-btn {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }
    
    /* Enable animations on mobile when triggered */
    .feature-visual:not(.mobile-animated) .chart-bar {
        transform: scaleY(0) !important;
    }
    
    .feature-visual.mobile-animated .chart-bar {
        transform: scaleY(1) !important;
        transition: transform 0.8s ease !important;
    }
    
    .feature-visual.mobile-animated .chart-bar-container:nth-child(1) .chart-bar {
        transition-delay: 0.1s !important;
    }
    
    .feature-visual.mobile-animated .chart-bar-container:nth-child(2) .chart-bar {
        transition-delay: 0.2s !important;
    }
    
    .feature-visual.mobile-animated .chart-bar-container:nth-child(3) .chart-bar {
        transition-delay: 0.3s !important;
    }
    
    .feature-visual.mobile-animated .chart-bar-container:nth-child(4) .chart-bar {
        transition-delay: 0.4s !important;
    }
    
    .feature-visual.mobile-animated .chart-bar-container:nth-child(5) .chart-bar {
        transition-delay: 0.5s !important;
    }
    
    .feature-visual.mobile-animated .chart-bar-container:nth-child(6) .chart-bar {
        transition-delay: 0.6s !important;
    }
    
    .feature-visual.mobile-animated .chart-bar-container:nth-child(7) .chart-bar {
        transition-delay: 0.7s !important;
    }
    
    /* Metric tiles animation */
    .feature-visual:not(.mobile-animated) .metric-tile {
        opacity: 0;
        transform: translateY(20px);
    }
    
    .feature-visual.mobile-animated .metric-tile {
        opacity: 1;
        transform: translateY(0);
        transition: all 0.6s ease;
    }
    
    .feature-visual.mobile-animated .metric-tile:nth-child(1) {
        transition-delay: 0.2s;
    }
    
    .feature-visual.mobile-animated .metric-tile:nth-child(2) {
        transition-delay: 0.3s;
    }
    
    .feature-visual.mobile-animated .metric-tile:nth-child(3) {
        transition-delay: 0.4s;
    }
    
    /* Keep other elements visible on mobile */
    .feature-visual .step-item,
    .feature-visual .procedure-trend-item {
        opacity: 1 !important;
        transform: none !important;
    }
    
    /* Catalog items - start hidden on mobile */
    .feature-visual-mobile[data-feature="2"] .catalog-item {
        opacity: 1 !important;
        transform: none !important;
    }
    
    /* Search input visible on mobile */
    .feature-visual-mobile[data-feature="2"] .catalog-search {
        opacity: 1 !important;
        display: block !important;
    }
    
    /* Search results - start hidden */
    .feature-visual-mobile[data-feature="2"] .search-results-view {
        display: none;
    }
    
    .feature-visual-mobile[data-feature="2"] .search-results-view.active {
        display: block;
    }
    
    /* Chat messages animation for mobile */
    .feature-visual-mobile[data-feature="3"]:not(.mobile-animated) .chat-message {
        opacity: 0 !important;
    }
    
    .feature-visual-mobile[data-feature="3"].mobile-animated .chat-message {
        opacity: 0;
        animation: fadeIn 0.5s ease forwards;
    }
    
    .feature-visual-mobile[data-feature="3"].mobile-animated .chat-message[data-message="1"] {
        animation-delay: 0.5s;
    }
    
    .feature-visual-mobile[data-feature="3"].mobile-animated .chat-message[data-message="2"] {
        animation-delay: 2s;
    }
    
    .feature-visual-mobile[data-feature="3"].mobile-animated .chat-message[data-message="3"] {
        animation-delay: 3.5s;
    }
    
    .feature-visual-mobile[data-feature="3"].mobile-animated .chat-message[data-message="4"] {
        animation-delay: 5s;
    }
    
    .feature-visual-mobile[data-feature="3"].mobile-animated .chat-message[data-message="5"] {
        animation-delay: 6.5s;
    }
    
    /* Make performance chart responsive */
    .performance-chart {
        opacity: 1 !important;
        transform: none !important;
    }
    
    /* Adjust metric tiles for mobile */
    .metric-tile {
        padding: 0.75rem;
    }
    
    /* Make trending section more compact */
    .trending-section {
        opacity: 1 !important;
        transform: none !important;
    }
    
    .procedure-trend-item {
        padding: 0.75rem;
    }
}