/* Custom CSS for Helios A-Med */

/* Brand Colors */
:root {
    --brand-blue: #1A4F7C;      /* Helios A-Med 核心品牌蓝 */
    --brand-navy: #1B365D;      /* 深海军蓝 - 备用色 */
    --brand-teal: #00A3AD;      /* 青色强调色 */
    --brand-dark: #0E1B2D;      /* 深色背景 */
    --text-primary: #1A1A1A;    /* 主要文字颜色 */
}

/* Global Overflow Prevention */
* {
    box-sizing: border-box;
}

/* Tailwind Custom Configuration */
@layer base {
    html {
        scroll-behavior: smooth;
        width: 100%;
        overflow-x: hidden;
        margin: 0;
        padding: 0;
        background-color: #0E1B2D;
    }
    
    body {
        font-family: 'Roboto', 'Inter', sans-serif;
        font-weight: 300;
        width: 100%;
        margin: 0;
        padding: 0;
        overflow-x: hidden;
        background-color: #0E1B2D;
    }
    
    h1, h2, h3, h4, h5, h6 {
        font-family: 'Playfair Display', 'Inter Tight', serif;
        font-weight: 700;
    }
}

/* Typography */
.font-serif {
    font-family: 'Playfair Display', serif;
}

.font-sans {
    font-family: 'Roboto', 'Inter', sans-serif;
}

/* Glassmorphism Effect for Header */
header {
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

/* Logo Styling */
.logo-img {
    max-height: 80px;
    width: auto;
    height: auto;
    object-fit: contain;
}

@media (max-width: 640px) {
    .logo-img {
        max-height: 48px;
    }
}

/* 图片加载优化 */
img {
    content-visibility: auto; /* 告诉浏览器只渲染可见区域的图片，提升弱网加载速度 */
}

/* Fade-in Animation */
.fade-in {
    opacity: 0;
    animation: fadeIn 1s ease-in-out forwards;
}

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

/* Modal Animation */
.modal-content {
    animation: modalFadeIn 0.3s ease-out;
    transform-origin: center;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* 3D Flip Effect for Pillars */
.perspective-1000 {
    perspective: 1000px;
}

.preserve-3d {
    transform-style: preserve-3d;
}

.backface-hidden {
    backface-visibility: hidden;
}

.rotate-y-180 {
    transform: rotateY(180deg);
}

.pillar-card {
    min-height: 300px;
}

.pillar-card:hover .pillar-inner {
    transform: rotateY(180deg);
}

/* 移动端触屏设备优化：禁用悬停翻转 */
@media (hover: none) {
    .pillar-card:hover .pillar-inner {
        transform: none; /* 触屏端禁用悬停翻转，改为点击查看详情 */
    }
}

/* Mobile: Stacked Cards Effect */
@media (max-width: 768px) {
    .pillar-card {
        transform: translateZ(0);
    }
    
    .pillar-card:nth-child(1) {
        z-index: 4;
    }
    
    .pillar-card:nth-child(2) {
        z-index: 3;
        transform: translateY(-10px);
    }
    
    .pillar-card:nth-child(3) {
        z-index: 2;
        transform: translateY(-20px);
    }
    
    .pillar-card:nth-child(4) {
        z-index: 1;
        transform: translateY(-30px);
    }
}

/* Product Card Hover Effects */
.product-card {
    transition: all 0.3s ease;
}

.product-card:hover {
    border-color: var(--brand-blue);
    box-shadow: 0 10px 25px rgba(26, 79, 124, 0.1);
}

/* Skeleton Loader */
.skeleton-loader {
    background: linear-gradient(
        90deg,
        #F8FAFC 0%,
        #E2E8F0 50%,
        #F8FAFC 100%
    );
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Active State for Mobile */
@media (max-width: 768px) {
    .product-card:active,
    .solution-card:active,
    button:active {
        transform: scale(0.98);
    }
}

/* Intersection Observer Fade-in */
.fade-in-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-in-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Fallback: Force show after 2 seconds */
@keyframes forceShow {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-on-scroll {
    animation: forceShow 0.1s ease-out 2s forwards;
}

/* WhatsApp Floating Button */
.fixed.bottom-6.right-6 {
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.4);
}

/* Language Switcher Active State */
.lang-btn.active {
    background-color: var(--brand-blue);
    color: white;
}

/* Smooth Scroll */
html {
    scroll-behavior: smooth;
    width: 100%;
    overflow-x: hidden;
    margin: 0;
    padding: 0;
    background-color: #0E1B2D;
}

/* Mobile Menu Animation */
#mobileMenu {
    transition: max-height 0.3s ease-out, opacity 0.3s ease-out;
}

#mobileMenu.hidden {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
}

#mobileMenu:not(.hidden) {
    max-height: 500px;
    opacity: 1;
}

/* Custom Scrollbar - Modern Minimalist Style */
::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-track {
    background: #1F2937;
}

::-webkit-scrollbar-thumb {
    background: #4B5563;
    border-radius: 6px;
    transition: background-color 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: #6B7684;
}

/* Responsive Spacing Adjustments */
@media (max-width: 768px) {
    .hero-section {
        padding-top: 100px;
        padding-bottom: 60px;
    }
    
    .hero-section h1 {
        font-size: 2.5rem;
        line-height: 1.2;
    }
    
    .hero-section p {
        font-size: 1.125rem;
    }
}

/* Print Styles */
@media print {
    .fixed {
        display: none;
    }
    
    header {
        position: relative;
    }
}
