/* Custom Styles Override - Futuristic Cyberpunk Theme */

/* Custom Animations */
@keyframes glow-pulse {
    0% {
        box-shadow: 0 0 20px rgba(139, 92, 246, 0.3), 0 0 40px rgba(16, 185, 129, 0.1);
    }
    100% {
        box-shadow: 0 0 30px rgba(139, 92, 246, 0.6), 0 0 60px rgba(16, 185, 129, 0.3);
    }
}

@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 0 10px rgba(139, 92, 246, 0.3);
    }
    50% {
        box-shadow: 0 0 20px rgba(139, 92, 246, 0.6), 0 0 30px rgba(16, 185, 129, 0.3);
    }
}

@keyframes text-glitch {
    0%, 100% {
        transform: translate(0);
        text-shadow: 0 0 10px rgba(139, 92, 246, 0.5);
    }
    10% {
        transform: translate(-2px, 2px);
    }
    20% {
        transform: translate(2px, -2px);
    }
    30% {
        transform: translate(-2px, -2px);
    }
    40% {
        transform: translate(2px, 2px);
    }
    50% {
        transform: translate(-2px, 2px);
    }
    60% {
        transform: translate(2px, -2px);
    }
    70% {
        transform: translate(-2px, -2px);
    }
    80% {
        transform: translate(2px, 2px);
    }
    90% {
        transform: translate(-2px, -2px);
    }
}

@keyframes icon-bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-3px);
        filter: drop-shadow(0 0 8px rgba(139, 92, 246, 0.8));
    }
}

@keyframes input-scan {
    0% {
        transform: translateX(-100%);
        opacity: 0;
    }
    50% {
        opacity: 1;
    }
    100% {
        transform: translateX(100%);
        opacity: 0;
    }
}

@keyframes error-shake {
    0%, 100% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-5px);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(5px);
    }
}

@keyframes bounce-gentle {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-5px);
    }
}

@keyframes scan-line {
    0% {
        top: -100%;
        opacity: 0;
    }
    50% {
        opacity: 1;
    }
    100% {
        top: 100%;
        opacity: 0;
    }
}

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

@keyframes cyber-flicker {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

/* Floating Navigation */
app-header {
    position: fixed !important;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    width: 95%;
    max-width: 1200px;
}

@media (min-width: 768px) {
    app-header {
        top: 20px;
        width: 90%;
    }
}

/* Mobile Menu Overlay */
#mobile-menu-overlay {
    backdrop-filter: blur(4px);
}

/* Mobile Menu Bottom Sheet */
#mobile-menu {
    background: linear-gradient(to top,
        rgba(10, 10, 10, 0.98) 0%,
        rgba(13, 27, 42, 0.98) 50%,
        rgba(26, 26, 26, 0.98) 100%);
}

#mobile-menu .overflow-y-auto {
    scrollbar-width: thin;
    scrollbar-color: rgba(139, 92, 246, 0.5) transparent;
}

#mobile-menu .overflow-y-auto::-webkit-scrollbar {
    width: 4px;
}

#mobile-menu .overflow-y-auto::-webkit-scrollbar-track {
    background: transparent;
}

#mobile-menu .overflow-y-auto::-webkit-scrollbar-thumb {
    background: rgba(139, 92, 246, 0.5);
    border-radius: 2px;
}

#mobile-menu .overflow-y-auto::-webkit-scrollbar-thumb:hover {
    background: rgba(139, 92, 246, 0.7);
}

/* Adjust body content to account for fixed header */
@media (max-width: 767px) {
    body > main,
    main {
        margin-top: 84px !important; /* h-16 (64px) + top (10px) + padding (10px) = 84px */
    }

    #banner-section {
        margin-top: 84px !important;
    }
}

/* Mobile Menu - Transform utilities */
.translate-y-full {
    transform: translateY(100%);
}

.opacity-0 {
    opacity: 0;
}

.invisible {
    visibility: hidden;
}

/* Ensure mobile menu has proper transition */
#mobile-menu {
    transition: transform 0.3s ease;
}

#mobile-menu-overlay {
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

/* Cyber Grid Background */
.cyber-grid-bg {
    background-image:
        linear-gradient(rgba(139, 92, 246, 0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(139, 92, 246, 0.1) 1px, transparent 1px);
    background-size: 50px 50px;
}

/* Neon Glow Effects */
.neon-border {
    border: 1px solid transparent;
    background: linear-gradient(#0A0A0A, #0A0A0A) padding-box,
                linear-gradient(135deg, #8B5CF6, #10B981) border-box;
}

.neon-text {
    text-shadow: 0 0 10px currentColor;
}

.glow-on-hover {
    transition: all 0.3s ease;
}

.glow-on-hover:hover {
    box-shadow: 0 0 25px rgba(139, 92, 246, 0.5), 0 0 50px rgba(16, 185, 129, 0.3);
    transform: translateY(-2px);
}

/* Asymmetrical Grid Layouts */
.asym-grid {
    display: grid;
    grid-template-columns: 1fr 2fr 1fr;
    gap: 2rem;
}

.asym-grid .main-card {
    grid-column: 2;
    grid-row: 1 / span 2;
}

.asym-grid .side-card:nth-child(1) {
    grid-column: 1;
    grid-row: 1;
}

.asym-grid .side-card:nth-child(2) {
    grid-column: 3;
    grid-row: 1;
}

.asym-grid .side-card:nth-child(3) {
    grid-column: 1;
    grid-row: 2;
}

.asym-grid .side-card:nth-child(4) {
    grid-column: 3;
    grid-row: 2;
}

/* High Contrast Buttons */
.cyber-button {
    background: linear-gradient(135deg, #8B5CF6 0%, #10B981 100%);
    color: white;
    font-weight: 600;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

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

.cyber-button:hover::before {
    left: 100%;
}

.cyber-button:hover {
    box-shadow: 0 0 30px rgba(139, 92, 246, 0.6);
    transform: scale(1.05);
}

/* Card Styling */
/* Card Styling with Enhanced Visual Connection */
.cyber-card {
    background:
        /* 渐变背景层 */
        linear-gradient(135deg,
            rgba(139, 92, 246, 0.05) 0%,
            rgba(16, 185, 129, 0.03) 50%,
            rgba(139, 92, 246, 0.05) 100%),
        /* 主背景层 */
        rgba(26, 26, 26, 0.85);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(139, 92, 246, 0.25);
    border-radius: 16px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    box-shadow:
        /* 内部微光 */
        inset 0 1px 0 rgba(255, 255, 255, 0.05),
        /* 主阴影 */
        0 4px 16px rgba(0, 0, 0, 0.3),
        /* 底部柔光 */
        0 2px 8px rgba(139, 92, 246, 0.1);
}

/* 添加内部渐变光晕背景 */
.cyber-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg,
        rgba(139, 92, 246, 0.08) 0%,
        rgba(16, 185, 129, 0.05) 50%,
        rgba(139, 92, 246, 0.08) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 0;
}

/* 添加外层光晕效果 */
.cyber-card::after {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(135deg,
        rgba(139, 92, 246, 0.15) 0%,
        rgba(16, 185, 129, 0.1) 50%,
        rgba(139, 92, 246, 0.15) 100%);
    border-radius: 18px;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
    filter: blur(8px);
}

/* 确保卡片内容在伪元素之上 */
.cyber-card > * {
    position: relative;
    z-index: 1;
}

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

.cyber-card:hover::after {
    opacity: 1;
}

.cyber-card:hover {
    border-color: rgba(139, 92, 246, 0.6);
    box-shadow:
        /* 内层阴影 */
        0 0 20px rgba(139, 92, 246, 0.15),
        /* 中层阴影 */
        0 8px 32px rgba(139, 92, 246, 0.25),
        /* 外层阴影 */
        0 16px 64px rgba(16, 185, 129, 0.15),
        /* 边框光晕 */
        0 0 0 1px rgba(139, 92, 246, 0.3);
    transform: translateY(-4px);
}

/* 装饰性选中效果 */
.cyber-card::selection {
    background: rgba(139, 92, 246, 0.3);
}

/* 添加边框脉冲动画 */
@keyframes border-pulse {
    0%, 100% {
        border-color: rgba(139, 92, 246, 0.25);
    }
    50% {
        border-color: rgba(139, 92, 246, 0.4);
    }
}

/* 为特定卡片添加脉冲效果（可选） */
.cyber-card.pulse {
    animation: border-pulse 2s ease-in-out infinite;
}

/* 特殊装饰卡片样式 */
.cyber-card.decorated {
    position: relative;
}

/* 添加角落装饰 */
.cyber-card.decorated::before {
    /* 使用 ::before 已经定义的渐变背景 */
}

.cyber-card.decorated::after {
    /* 使用 ::after 已经定义的外层光晕 */
}

/* 为装饰卡片添加四个角落的小装饰点 */
.cyber-card.decorated .corner-dots {
    position: absolute;
    top: 8px;
    left: 8px;
    right: 8px;
    bottom: 8px;
    pointer-events: none;
    z-index: 2;
}

.cyber-card.decorated .corner-dots::before,
.cyber-card.decorated .corner-dots::after {
    content: '';
    position: absolute;
    width: 6px;
    height: 6px;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.6) 0%, transparent 70%);
    border-radius: 50%;
}

.cyber-card.decorated .corner-dots::before {
    top: 0;
    left: 0;
}

.cyber-card.decorated .corner-dots::after {
    bottom: 0;
    right: 0;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.6) 0%, transparent 70%);
}

/* 增强阴影效果 - 深度层次 */
.cyber-card.deep-shadow {
    box-shadow:
        /* 内部微光 */
        inset 0 1px 0 rgba(255, 255, 255, 0.05),
        /* 第一层阴影 - 最近 */
        0 2px 8px rgba(0, 0, 0, 0.4),
        /* 第二层阴影 - 中等距离 */
        0 8px 24px rgba(0, 0, 0, 0.3),
        /* 第三层阴影 - 远距离 */
        0 16px 48px rgba(0, 0, 0, 0.2),
        /* 彩色阴影 */
        0 4px 16px rgba(139, 92, 246, 0.15);
}

/* 悬停时的深度增强 */
.cyber-card.deep-shadow:hover {
    box-shadow:
        /* 内层阴影 */
        0 0 20px rgba(139, 92, 246, 0.2),
        /* 多层阴影创造深度 */
        0 4px 16px rgba(0, 0, 0, 0.4),
        0 12px 32px rgba(0, 0, 0, 0.3),
        0 24px 64px rgba(0, 0, 0, 0.2),
        /* 彩色阴影 */
        0 8px 32px rgba(139, 92, 246, 0.25),
        0 16px 48px rgba(16, 185, 129, 0.15);
}

/* 底部发光效果 */
.cyber-card.glow-bottom {
    position: relative;
}

.cyber-card.glow-bottom::before {
    /* 使用已有的 ::before 定义 */
}

.cyber-card.glow-bottom::after {
    /* 使用已有的 ::after 定义 */
}

/* 添加底部额外光晕 */
.cyber-card.glow-bottom {
    position: relative;
}

.cyber-card.glow-bottom::before {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 10%;
    right: 10%;
    height: 2px;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(139, 92, 246, 0.6) 50%,
        transparent 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
}

.cyber-card.glow-bottom:hover::before {
    opacity: 1;
}

/* 边缘高光效果 */
.cyber-card.edge-glow {
    position: relative;
}

.cyber-card.edge-glow::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        /* 顶部高光 */
        linear-gradient(to bottom,
            rgba(255, 255, 255, 0.1) 0%,
            transparent 20%),
        /* 底部阴影 */
        linear-gradient(to top,
            rgba(0, 0, 0, 0.2) 0%,
            transparent 30%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.cyber-card.edge-glow:hover::before {
    opacity: 1;
}

/* 背景连接效果 - 让卡片看起来从背景中浮现 */
.cyber-card.connected {
    position: relative;
    overflow: visible;
}

.cyber-card.connected::before {
    /* 使用基础的 ::before 效果 */
}

.cyber-card.connected::after {
    /* 使用基础的 ::after 效果 */
}

/* 添加背景连接线 */
.cyber-card.connected {
    position: relative;
}

.cyber-card.connected::before {
    content: '';
    position: absolute;
    top: -1px;
    left: -1px;
    right: -1px;
    bottom: -1px;
    background: linear-gradient(135deg,
        rgba(139, 92, 246, 0.3) 0%,
        rgba(16, 185, 129, 0.2) 50%,
        rgba(139, 92, 246, 0.3) 100%);
    border-radius: 18px;
    z-index: -2;
    opacity: 0;
    transition: all 0.3s ease;
    filter: blur(4px);
}

/* 添加连接线动画 */
@keyframes connection-pulse {
    0%, 100% {
        opacity: 0.3;
        transform: scale(1);
    }
    50% {
        opacity: 0.6;
        transform: scale(1.02);
    }
}

.cyber-card.connected {
    /* 使用基础的 ::before 效果 */
}

.cyber-card.connected:hover::before {
    opacity: 1;
    animation: connection-pulse 2s ease-in-out infinite;
}

/* 微妙边框闪烁效果 */
.cyber-card.border-flash {
    position: relative;
}

.cyber-card.border-flash::before {
    /* 移除现有的 ::before 渐变，改为边框闪烁 */
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border: 1px solid transparent;
    background: linear-gradient(135deg,
        rgba(139, 92, 246, 0.3) 0%,
        rgba(16, 185, 129, 0.2) 50%,
        rgba(139, 92, 246, 0.3) 100%) border-box;
    -webkit-mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: exclude;
    mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0);
    mask-composite: exclude;
    border-radius: 16px;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 2;
    pointer-events: none;
}

.cyber-card.border-flash:hover::before {
    opacity: 1;
}

/* 立体阴影效果 - 创造悬浮感 */
.cyber-card.floating {
    position: relative;
    transform-style: preserve-3d;
}

.cyber-card.floating::before {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 10%;
    right: 10%;
    height: 10px;
    background: radial-gradient(ellipse,
        rgba(0, 0, 0, 0.4) 0%,
        rgba(0, 0, 0, 0.2) 50%,
        transparent 70%);
    border-radius: 50%;
    z-index: -1;
    opacity: 0.6;
    filter: blur(2px);
}

.cyber-card.floating:hover {
    transform: translateY(-6px) rotateX(2deg);
}

.cyber-card.floating:hover::before {
    opacity: 0.8;
    transform: scale(1.1);
}

/* 边缘彩虹效果 */
.cyber-card.rainbow-edge {
    position: relative;
}

.cyber-card.rainbow-edge::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: conic-gradient(
        from 0deg,
        rgba(139, 92, 246, 0.4),
        rgba(16, 185, 129, 0.3),
        rgba(139, 92, 246, 0.4)
    );
    border-radius: 18px;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
    filter: blur(6px);
}

.cyber-card.rainbow-edge:hover::before {
    opacity: 1;
    animation: rainbow-rotate 3s linear infinite;
}

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

/* Swiper Customization */
.swiper-button-next, .swiper-button-prev {
    color: #8B5CF6 !important;
    filter: drop-shadow(0 0 8px rgba(139, 92, 246, 0.6));
}

.swiper-pagination-bullet-active {
    background: linear-gradient(135deg, #8B5CF6, #10B981) !important;
    box-shadow: 0 0 10px rgba(139, 92, 246, 0.6);
}

/* Scrollbar Customization */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #0A0A0A;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #8B5CF6, #10B981);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #7C3AED, #059669);
}

/* Banner Section Enhancement */
.banner-enhanced {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.1) 0%, rgba(16, 185, 129, 0.1) 100%);
    border: 1px solid rgba(139, 92, 246, 0.3);
    backdrop-filter: blur(10px);
}

/* Service Cards */
.service-card {
    background: rgba(13, 27, 42, 0.6);
    border: 1px solid rgba(16, 185, 129, 0.3);
    backdrop-filter: blur(15px);
    transition: all 0.3s ease;
}

.service-card:hover {
    border-color: rgba(16, 185, 129, 0.6);
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.3);
}

/* Text Effects */
.gradient-text {
    background: linear-gradient(135deg, #8B5CF6 0%, #10B981 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Responsive Design Optimizations */
@media (max-width: 768px) {
    .asym-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .asym-grid .main-card {
        grid-column: 1;
        grid-row: 1;
    }

    .asym-grid .side-card:nth-child(1),
    .asym-grid .side-card:nth-child(2),
    .asym-grid .side-card:nth-child(3),
    .asym-grid .side-card:nth-child(4) {
        grid-column: 1;
    }

    /* Mobile header adjustments */
    app-header .container {
        padding: 0 0.75rem;
    }

    app-header .text-3xl {
        font-size: 1.5rem;
    }

    /* Mobile banner adjustments */
    #banner-section h2 {
        font-size: 2.5rem;
    }

    /* Mobile service cards */
    #services .service-card {
        padding: 1.5rem;
    }

    /* Mobile section spacing */
    section {
        margin-top: 3rem !important;
        margin-bottom: 3rem !important;
    }
}

@media (max-width: 640px) {
    .cyber-button {
        padding: 10px 20px;
        font-size: 0.875rem;
    }

    .cyber-card {
        padding: 1rem;
    }

    .service-card {
        padding: 1.25rem;
    }

    .service-card .w-16 {
        width: 3rem;
        height: 3rem;
        font-size: 1.125rem;
    }
}

/* Performance optimizations */
.cyber-card,
.service-card,
.cyber-button {
    will-change: transform;
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
    .animate-float,
    .glow-pulse,
    .animate-pulse-glow,
    .animate-text-glitch,
    .animate-icon,
    .animate-error-shake,
    .animate-bounce-gentle {
        animation: none;
    }

    .glow-on-hover:hover {
        transform: none;
    }
}

/* Animation Classes */
.animate-pulse-glow {
    animation: pulse-glow 2s ease-in-out infinite;
}

.animate-text-glitch {
    animation: text-glitch 3s ease-in-out infinite;
}

.animate-icon {
    animation: icon-bounce 2s ease-in-out infinite;
}

.animate-error-shake {
    animation: error-shake 0.5s ease-in-out;
}

.animate-bounce-gentle {
    animation: bounce-gentle 2s ease-in-out infinite;
}

/* Checkout Form Input Styles */
input[type="text"],
input[type="tel"],
input[type="email"],
textarea,
select {
    transition: all 0.3s ease;
}

input[type="text"]:focus,
input[type="tel"]:focus,
input[type="email"]:focus,
textarea:focus,
select:focus {
    box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.2);
}

/* Error State Styles */
input.border-red-500,
textarea.border-red-500 {
    border-color: #EF4444 !important;
}

.text-red-400 {
    color: #EF4444;
}
