@tailwind base;
@tailwind components;
@tailwind utilities;

html {
    scroll-behavior: smooth;
}

body {
    background-color: #050505;
    color: #ffffff;
    overflow-x: hidden; /* 防止左右晃动 */
}

/* Custom Scrollbar - Dark Mode */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #1a1a1a;
}

::-webkit-scrollbar-thumb {
    background: #444;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #666;
}

.no-scrollbar::-webkit-scrollbar {
    display: none;
}

.no-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* 3D Transform for Hero Title */
.perspective-1000 {
    perspective: 1000px;
}

.transform-style-3d {
    transform-style: preserve-3d;
}

/* Will change hint for smoother performance */
.will-change-transform {
    will-change: transform;
    transition: transform 0.1s ease-out;
}

/* 动画关键帧 - 标语上下浮动 */
@keyframes slogan-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.animate-slogan-float {
    animation: slogan-float 3s ease-in-out infinite;
}

/* Twinkling Points Animation */
@keyframes twinkle {
    0%, 100% { 
        opacity: 0.2; 
        transform: scale(0.8);
    }
    50% { 
        opacity: 1; 
        transform: scale(1.2);
    }
}

.twinkle-point {
    width: 8px;
    height: 8px;
    background-color: #00F7FF;
    border-radius: 50%;
    box-shadow: 0 0 10px #00F7FF, 0 0 20px #00F7FF;
    animation: twinkle 2s ease-in-out infinite;
}

@keyframes float {
    0% { border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%; transform: rotate(0deg); }
    33% { border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%; transform: rotate(120deg); }
    66% { border-radius: 70% 30% 50% 50% / 30% 40% 60% 70%; transform: rotate(240deg); }
    100% { border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%; transform: rotate(360deg); }
}

@keyframes morph-blob-2 {
    0% { border-radius: 40% 60% 60% 40% / 60% 30% 70% 40%; transform: rotate(0deg); }
    33% { border-radius: 60% 40% 30% 70% / 40% 60% 30% 60%; transform: rotate(-120deg); }
    66% { border-radius: 30% 70% 50% 50% / 60% 40% 60% 30%; transform: rotate(-240deg); }
    100% { border-radius: 40% 60% 60% 40% / 60% 30% 70% 40%; transform: rotate(-360deg); }
}

.animate-blob {
    animation: float 20s infinite linear;
}

.animate-blob-reverse {
    animation: morph-blob-2 25s infinite linear;
}

.animation-delay-2000 {
    animation-delay: 2s;
}

.animation-delay-4000 {
    animation-delay: 4s;
}

/* Custom Cursor Placeholder - if needed in future */
/* body { cursor: none; } */

/* Glassmorphism Utilities */
.glass-panel {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

/* Notification Pop Animation */
@keyframes notification-pop {
    0% { transform: scale(0.8) translateY(20px); opacity: 0; }
    10% { transform: scale(1.05) translateY(0); opacity: 1; }
    20% { transform: scale(1) translateY(0); opacity: 1; }
    90% { transform: scale(1) translateY(0); opacity: 1; }
    100% { transform: scale(0.9) translateY(-10px); opacity: 0; }
}

.animate-notification {
    animation: notification-pop 5s ease-out forwards;
}

/* Typing Indicator Animation */
@keyframes typing-dot {
    0%, 100% { opacity: 0.3; transform: scale(0.8); }
    50% { opacity: 1; transform: scale(1.2); }
}

.typing-dot {
    animation: typing-dot 1.4s infinite ease-in-out;
}

.typing-dot:nth-child(1) {
    animation-delay: 0s;
}

.typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing-bounce {
    0%, 100% { transform: translateY(0); opacity: 0.5; }
    50% { transform: translateY(-4px); opacity: 1; }
}

/* Mini Chat Vertical Infinite Scroll Animation (Inside card) */
@keyframes chat-vertical-scroll {
    0% { transform: translateY(0); }
    100% { transform: translateY(-50%); }
}

.animate-chat-scroll {
    animation: chat-vertical-scroll 10s linear infinite;
}

.mini-chat-mask {
    mask-image: linear-gradient(to bottom, transparent, black 15%, black 85%, transparent);
    -webkit-mask-image: linear-gradient(to bottom, transparent, black 15%, black 85%, transparent);
}

/* Horizontal Marquee Animation (For the section) */
@keyframes marquee-scroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

.animate-marquee {
    animation: marquee-scroll 40s linear infinite;
}

/* .marquee-track:hover {
    animation-play-state: paused;
} */

/* Mask for horizontal fade edges */
.mask-horizontal-fade {
    mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
    -webkit-mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
}

.card-chat {
    position: relative;
    overflow: visible;
    transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.4s ease;
}

/* .card-chat:hover {
    transform: translateY(-6px) scale(1.08);
    box-shadow: 0 30px 40px rgba(15, 23, 42, 0.12);
} */

.card-chat-placeholder {
    position: relative;
    z-index: 1;
    transition: opacity 0.35s ease;
    background: inherit;
}

.card-chat-real {
    position: absolute;
    inset: 0.6rem;
    z-index: 2;
    background: rgba(255, 255, 255, 0.96);
    border-radius: 0.75rem;
    border: 1px solid rgba(148, 163, 184, 0.35);
    box-shadow: 0 18px 30px rgba(15, 23, 42, 0.08);
    padding: 0.6rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    justify-content: flex-start;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s ease;
    overflow: hidden;
}

.dark .card-chat-real {
    background: rgba(17, 24, 39, 0.94);
    border-color: rgba(148, 163, 184, 0.25);
    box-shadow: 0 18px 30px rgba(0, 0, 0, 0.35);
    color: #e5e7eb;
}

.card-chat:hover .card-chat-placeholder {
    /* opacity: 0; */
}

.card-chat:hover .card-chat-real {
    /* opacity: 1; */
    /* pointer-events: auto; */
}

@keyframes chat-line-flow {
    0% { opacity: 0; transform: translateY(18px); }
    10% { opacity: 1; transform: translateY(6px); }
    40% { opacity: 1; transform: translateY(0); }
    70% { opacity: 0.9; transform: translateY(-12px); }
    100% { opacity: 0; transform: translateY(-28px); }
}

.chat-line {
    animation: chat-line-flow 7.5s linear infinite;
    border-radius: 0.75rem;
    padding: 0.4rem 0.75rem;
}

.chat-line.chat-user {
    align-self: flex-start;
    background: rgba(59, 130, 246, 0.12);
    color: #1d4ed8;
}

.chat-line.chat-ai {
    align-self: flex-end;
    background: rgba(15, 23, 42, 0.08);
    color: #0f172a;
}

.dark .chat-line.chat-user {
    background: rgba(37, 99, 235, 0.25);
    color: #bfdbfe;
}

/* Success Check Animation */
@keyframes drawCheck {
    to { stroke-dashoffset: 0; }
}

.animate-draw-check {
    stroke-dasharray: 24;
    stroke-dashoffset: 24;
    animation: drawCheck 0.6s ease-out 0.2s forwards;
}

.completed-view {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    animation: fade-in-up 0.5s ease-out;
}

@keyframes fade-in-up {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Tech Core Animations */
@keyframes scan {
    0% { top: -10%; opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { top: 110%; opacity: 0; }
}
.animate-scan {
    animation: scan 3s linear infinite;
}

@keyframes flow-left {
    0% { transform: translateX(0); opacity: 0; }
    20% { opacity: 1; }
    80% { opacity: 1; }
    100% { transform: translateX(-100px); opacity: 0; }
}
@keyframes flow-right {
    0% { transform: translateX(0); opacity: 0; }
    20% { opacity: 1; }
    80% { opacity: 1; }
    100% { transform: translateX(100px); opacity: 0; }
}
.animate-flow-left {
    animation: flow-left 2s linear infinite;
}
.animate-flow-right {
    animation: flow-right 2s linear infinite;
}

/* Ripple Animation */
@keyframes ripple {
    0% { transform: scale(1); opacity: 0.6; }
    100% { transform: scale(2.5); opacity: 0; }
}
.animate-ripple-1 { animation: ripple 3s infinite ease-out; animation-delay: 0s; }
.animate-ripple-2 { animation: ripple 3s infinite ease-out; animation-delay: 1s; }
.animate-ripple-3 { animation: ripple 3s infinite ease-out; animation-delay: 2s; }

/* Data Visualization Animations */
/* 1. Bar Width Growth (Audio) */
@keyframes bar-width-grow {
    0% { width: 10%; }
    50% { width: 90%; }
    100% { width: 40%; }
}
.animate-bar-width {
    animation: bar-width-grow 2s ease-in-out infinite alternate;
}

/* 2. Bar Height Fluctuation (Rhythm) */
@keyframes bar-height-fluctuate {
    0% { height: 20%; }
    50% { height: 100%; }
    100% { height: 20%; }
}
.animate-bar-height {
    animation: bar-height-fluctuate 3s ease-in-out infinite;
}

/* 3. Number Changing (Content Replacement) - In-place */
@keyframes change-content-pleasure {
    0%, 100% { content: "85%"; }
    25% { content: "87%"; }
    50% { content: "82%"; }
    75% { content: "89%"; }
}

@keyframes change-content-focus {
    0%, 100% { content: "92%"; }
    25% { content: "94%"; }
    50% { content: "90%"; }
    75% { content: "95%"; }
}

.animate-content-pleasure::after {
    content: "85%";
    animation: change-content-pleasure 4s step-end infinite;
}

.animate-content-focus::after {
    content: "92%";
    animation: change-content-focus 6s step-end infinite;
}

/* Glassmorphism Slogan Cards */
.glass-card-slogan {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3),
                inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.glass-card-slogan-premium {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 12px 40px 0 rgba(0, 0, 0, 0.4),
                inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

/* Enhanced Button Styles */
.btn-primary-glow {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.btn-primary-glow:hover {
    box-shadow: 0 0 20px rgba(24, 63, 186, 0.6);
    transform: translateY(-2px);
}

.btn-primary-glow::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.2), transparent);
    transform: rotate(45deg);
    transition: 0.5s;
    opacity: 0;
}

.btn-primary-glow:hover::after {
    left: 100%;
    opacity: 1;
    transition: 0.5s;
}

.btn-secondary-hover {
    transition: all 0.3s ease;
}

.btn-secondary-hover:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-2px);
}

/* Text Gradient Flow Animation */
@keyframes text-flow {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.text-gradient-flow {
    background-size: 200% auto;
    animation: text-flow 5s linear infinite;
}
