/* Tailwind CSS Configuration */
@tailwind base;
@tailwind components;
@tailwind utilities;

/* Custom Tailwind Config - Note: This should be in a tailwind.config.js file for production */
/* For now, keeping inline script in HTML for Tailwind CDN compatibility */

/* 開始使用流程：icon 在白色方塊內置中（Lucide SVG 預設會偏左上） */
.workflow-step-icon-box {
    align-items: center;
    justify-content: center;
}
.workflow-step-icon-box > svg,
.workflow-step-icon-box > i {
    display: block !important;
    margin: auto !important;
}

/* Custom Styles */
html, body {
    overflow-x: hidden;
    width: 100%;
    max-width: 100%;
}

body { 
    font-family: 'Inter', 'Noto Sans TC', sans-serif; 
    background-color: #FFFFFF;
    color: #1A1A1A;
    -webkit-font-smoothing: antialiased;
    position: relative;
}

.apple-blur {
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

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

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

.gradient-text {
    background: linear-gradient(135deg, #1A1A1A 0%, #8E44AD 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Glassmorphism */
.glass {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.glass-premium {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.lilac-glow-hover:hover {
    box-shadow: 0 0 20px rgba(175, 122, 197, 0.4);
    transform: translateY(-2px);
}

/* Flow Line Animation */
.flow-line {
    position: relative;
}

.flow-line::after {
    content: '';
    position: absolute;
    background: linear-gradient(90deg, transparent, #AF7AC5, transparent);
    height: 2px;
    width: 100%;
    top: 50%;
    left: 0;
    animation: flowLine 3s infinite linear;
}

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

/* Floating Background Elements Animation */
@keyframes float1 {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    25% {
        transform: translate(30px, -20px) scale(1.05);
    }
    50% {
        transform: translate(-20px, 30px) scale(0.95);
    }
    75% {
        transform: translate(20px, 20px) scale(1.02);
    }
}

@keyframes float2 {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    33% {
        transform: translate(-40px, 25px) scale(1.08);
    }
    66% {
        transform: translate(35px, -30px) scale(0.92);
    }
}

@keyframes float3 {
    0%, 100% {
        transform: translate(calc(-50% + 0px), calc(-50% + 0px)) scale(1);
    }
    25% {
        transform: translate(calc(-50% + 25px), calc(-50% + -30px)) scale(1.1);
    }
    50% {
        transform: translate(calc(-50% + -30px), calc(-50% + 25px)) scale(0.9);
    }
    75% {
        transform: translate(calc(-50% + 20px), calc(-50% + 20px)) scale(1.05);
    }
}

.float-1 {
    animation: float1 20s ease-in-out infinite;
}

.float-2 {
    animation: float2 25s ease-in-out infinite;
    animation-delay: -5s;
}

.float-3 {
    animation: float3 30s ease-in-out infinite;
    animation-delay: -10s;
}

/* Respect reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    .float-1,
    .float-2,
    .float-3 {
        animation: none;
    }
}

/* Feature Tabs Styles */
.feature-tab {
    transition: all 0.3s ease;
}

.feature-tab.active {
    border-color: #AF7AC5;
    background-color: #F5EEF8;
}

#feature-video {
    transition: opacity 0.3s ease;
}

#feature-video-container {
    position: relative;
    min-height: 400px;
}

@media (max-width: 1024px) {
    #feature-video-container {
        min-height: 250px;
    }
}

@media (max-width: 640px) {
    #feature-video-container {
        min-height: 200px;
        aspect-ratio: 16/9 !important;
    }
    
    /* Ensure video container doesn't overflow on mobile */
    .feature-tab {
        max-width: 100%;
        box-sizing: border-box;
    }
    
    /* Prevent horizontal scroll on mobile */
    * {
        max-width: 100%;
    }
    
    /* Ensure all containers respect viewport width */
    section {
        overflow-x: hidden;
        overflow-y: visible;
        width: 100%;
        max-width: 100%;
    }
    
    /* Fix features section scrolling issue on mobile */
    #features {
        overflow: visible !important;
    }
    
    #features-container {
        overflow: visible !important;
        position: relative !important;
    }
    
    #features-container .grid {
        overflow: visible !important;
    }
    
    #features-container .space-y-3,
    #features-container .space-y-4 {
        overflow: visible !important;
        position: relative !important;
    }
    
    #feature-video-wrapper {
        position: relative !important;
    }
    
    @media (max-width: 1023px) {
        #feature-video-wrapper {
            position: relative !important;
            top: auto !important;
            z-index: auto !important;
            margin-bottom: 2rem !important;
            margin-top: 1.5rem !important;
        }
        
        /* Ensure video container doesn't overlap content below */
        #feature-video-wrapper + * {
            margin-top: 0 !important;
        }
    }
    
    
    /* Fix any elements that might overflow */
    .max-w-7xl,
    .max-w-5xl,
    .max-w-4xl,
    .max-w-6xl,
    .max-w-3xl,
    .max-w-2xl {
        width: 100%;
        max-width: 100%;
        padding-left: 1rem;
        padding-right: 1rem;
        box-sizing: border-box;
    }
}

/* Excel Table Styles */
.excel-data-container {
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
}

.excel-data-container::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

.excel-data-container {
    mask-image: linear-gradient(to bottom, black 0%, black 85%, transparent 100%);
    -webkit-mask-image: linear-gradient(to bottom, black 0%, black 85%, transparent 100%);
}

/* Demo Table Scroll Styles */
.demo-table-scroll {
    scrollbar-width: thin;
    scrollbar-color: rgba(175, 122, 197, 0.3) transparent;
}

.demo-table-scroll::-webkit-scrollbar {
    height: 4px;
}

.demo-table-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.demo-table-scroll::-webkit-scrollbar-thumb {
    background: rgba(175, 122, 197, 0.3);
    border-radius: 2px;
}

.demo-table-scroll::-webkit-scrollbar-thumb:hover {
    background: rgba(175, 122, 197, 0.5);
}

/* Hide scroll hint after user scrolls */
.demo-table-scroll:has(:scroll) ~ .md\\:hidden {
    opacity: 0;
    transition: opacity 0.3s;
}

@media (max-width: 640px) {
    /* Make first column sticky on mobile */
    .demo-table-scroll table th:first-child,
    .demo-table-scroll table td:first-child {
        position: sticky;
        left: 0;
        z-index: 10;
    }
    
    /* Ensure sticky column has background */
    .demo-table-scroll table thead th:first-child {
        background: #F8F9F9;
    }
    
    .demo-table-scroll table tbody td:first-child {
        background: white;
    }
    
    /* Add shadow to sticky column for depth */
    .demo-table-scroll table th:first-child,
    .demo-table-scroll table td:first-child {
        box-shadow: 2px 0 4px rgba(0, 0, 0, 0.05);
    }
    
    /* Ensure sticky column doesn't get cut off */
    .demo-table-scroll {
        padding-left: 0;
    }
    
    .demo-table-scroll table th:first-child,
    .demo-table-scroll table td:first-child {
        min-width: 80px;
    }
}

