/* Custom CSS for Helios A-Med */

/* Hard Reset — outside @layer to guarantee specificity */
html, body {
    font-family: 'Inter', sans-serif;
    margin: 0;
    padding: 0;
    background-color: #0E1B2D;
}

/* Mobile Menu Slide Transition */
#mobileMenu {
    transition: transform 0.3s ease;
}

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

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

/* Global Button Font */
button, a.download-btn, [type="submit"], [type="button"] {
    font-family: 'Montserrat', sans-serif;
}

/* Tailwind Custom Configuration */
@layer base {
    html {
        scroll-behavior: smooth;
        width: 100%;
        overflow-x: hidden;
        margin: 0;
        padding: 0;
        background-color: #0E1B2D;
    }
    
    body {
        font-family: 'Inter', sans-serif;
        font-size: 16px;
        line-height: 1.6;
        font-weight: 400;
        width: 100%;
        margin: 0;
        padding: 0;
        overflow-x: hidden;
        background-color: #0E1B2D;
    }
    
    h1, h2 {
        font-family: 'Montserrat', sans-serif;
        font-weight: 700;
        letter-spacing: 0.02em;
        color: #1B365D;
    }

    h3, h4, h5, h6 {
        font-family: 'Montserrat', sans-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 {
    display: flex;
    align-items: center;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

header nav {
    width: 100%;
    transition: padding 0.3s ease;
    max-width: none !important;
    margin-left: auto !important;
    margin-right: auto !important;
    padding-left: 6rem !important;
    padding-right: 6rem !important;
}

/* Laptop (lg 1024px+): remove nav own padding */
@media (min-width: 1024px) {
    header nav {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }
}

/* Sticky Shrinking Header — .shrunk applied via JS when scroll > 50px */
header.shrunk {
    background-color: rgba(255, 255, 255, 0.97);
    box-shadow: 0 2px 16px rgba(27, 54, 93, 0.18);
}

header.shrunk nav {
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
}

header.shrunk .logo-img {
    max-height: 48px;
}

/* Nav Link Styling */
.nav-link {
    font-family: 'Montserrat', sans-serif;
    font-size: 20px;
    font-weight: 500;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: #1B365D;
    transition: color 0.2s ease;
    /* Reserve space for bold state to avoid layout shift */
    display: inline-block;
}

.nav-link:hover,
.nav-link.nav-active {
    font-weight: 600;
    color: #00A3AD;
}

/* Logo Container Styling - Responsive Alignment */
header nav > div:first-child {
    flex: 0 0 auto !important;  /* Prevent flex grow */
    display: flex !important;
    align-items: center !important;
    padding: 0 !important;
    width: auto !important;  /* Auto width based on logo content */
    min-width: 120px;  /* Minimum width for readability on small screens */
}

/* Laptop (lg 1024px+): align nav inner div with cards container (max-w-7xl + px-8) */
@media (min-width: 1024px) {
    #header nav > div {
        width: 100% !important;
        max-width: 80rem !important;
        margin-left: auto !important;
        margin-right: auto !important;
        padding-left: 2rem !important;
        padding-right: 2rem !important;
        box-sizing: border-box !important;
    }
    #header.shrunk nav > div {
        width: 100% !important;
        max-width: 80rem !important;
        margin-left: auto !important;
        margin-right: auto !important;
        padding-left: 2rem !important;
        padding-right: 2rem !important;
        box-sizing: border-box !important;
    }
}

/* Logo Styling - Responsive dimensions for all screen sizes */
.logo-img {
    /* Base sizing for all screens */
    height: auto;
    object-fit: contain;
    object-position: left center;
    transition: max-height 0.3s ease;
    display: block !important;
}

/* Small screens (mobile) */
@media (max-width: 639px) {
    .logo-img {
        max-height: 40px;
        max-width: 120px;
    }
}

/* Medium screens (tablet) */
@media (min-width: 640px) and (max-width: 1023px) {
    .logo-img {
        max-height: 60px;
        max-width: 160px;
    }
}

/* Large screens (desktop) */
@media (min-width: 1024px) {
    .logo-img {
        max-height: 80px;
        max-width: 240px;
    }
}

/* 图片加载优化 */
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;
}

/* Hero Button Dropdown Options */
.contact-fab-option {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    border-radius: 9999px;
    background: #ffffff;
    color: #1B365D;
    border: 1px solid rgba(27, 54, 93, 0.15);
    padding: 0.5rem 0.75rem;
    font-size: 0.8125rem;
    font-weight: 600;
    text-decoration: none;
    box-shadow: 0 8px 18px rgba(27, 54, 93, 0.12);
    transition: transform 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.contact-fab-option:hover {
    transform: translateX(-2px);
    border-color: rgba(0, 163, 173, 0.55);
    color: #00A3AD;
}

/* Lightweight Share Popover */
.share-lite {
    position: relative;
    display: inline-block;
}

.share-lite-trigger {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    border: 1px solid rgba(27, 54, 93, 0.15);
    background: #ffffff;
    color: #1B365D;
    border-radius: 9999px;
    padding: 0.45rem 0.9rem;
    font-size: 0.8125rem;
    font-weight: 600;
    line-height: 1;
    box-shadow: 0 4px 10px rgba(27, 54, 93, 0.08);
    transition: all 0.2s ease;
}

.share-lite-trigger:hover {
    border-color: rgba(0, 163, 173, 0.45);
    color: #00A3AD;
}

.share-lite-panel {
    position: absolute;
    top: calc(100% + 0.6rem);
    left: 0;
    width: min(300px, 78vw);
    background: #ffffff;
    border: 1px solid rgba(27, 54, 93, 0.12);
    border-radius: 14px;
    box-shadow: 0 14px 28px rgba(27, 54, 93, 0.14);
    padding: 0.75rem;
    opacity: 0;
    transform: translateY(8px);
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: 25;
}

.share-lite.is-open .share-lite-panel {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.share-lite-icons {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.65rem;
}

.share-lite-icon {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 9999px;
    border: 1px solid rgba(27, 54, 93, 0.12);
    background: #ffffff;
    color: #1B365D;
    box-shadow: 0 3px 8px rgba(27, 54, 93, 0.08);
    transition: all 0.2s ease;
}

.share-lite-icon:hover {
    color: #00A3AD;
    border-color: rgba(0, 163, 173, 0.45);
    box-shadow: 0 0 0 4px rgba(0, 163, 173, 0.12);
}

.share-lite-copy {
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.share-lite-copy-input {
    flex: 1;
    border: 1px solid rgba(27, 54, 93, 0.15);
    border-radius: 9999px;
    padding: 0.45rem 0.75rem;
    font-size: 0.75rem;
    color: rgba(26, 26, 26, 0.75);
    background: #F8FAFC;
}

.share-lite-copy-btn {
    border: 1px solid rgba(27, 54, 93, 0.15);
    border-radius: 9999px;
    background: #ffffff;
    color: #1B365D;
    padding: 0.4rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1;
    transition: all 0.2s ease;
}

.share-lite-copy-btn:hover {
    color: #00A3AD;
    border-color: rgba(0, 163, 173, 0.45);
}

.share-lite-toast {
    position: absolute;
    right: 0;
    top: calc(100% + 0.45rem);
    background: #1B365D;
    color: #ffffff;
    border-radius: 9999px;
    padding: 0.3rem 0.65rem;
    font-size: 0.6875rem;
    font-weight: 600;
    line-height: 1;
    box-shadow: 0 6px 14px rgba(27, 54, 93, 0.2);
    opacity: 0;
    transform: translateY(4px);
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.share-lite-toast.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* 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 - Full Screen Overlay */
#mobileMenu {
    transition: opacity 0.2s ease-out;
    background-color: #0E1B2D !important;
}

#mobileMenu:not(.hidden) {
    display: flex !important;
    opacity: 1;
    background-color: #0E1B2D !important;
}

/* Override .nav-link global styles inside mobile overlay */
#mobileMenu .nav-link {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.75);
    background: transparent;
    text-align: center;
}

#mobileMenu .nav-link:hover,
#mobileMenu .nav-link.nav-active {
    color: #00A3AD;
    font-weight: 500;
}

/* 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;
}

/* Hero Section Styling */
.hero-container {
    display: block;
    overflow: hidden;
    margin-top: -5.5rem; /* slide under fixed header */
}

/* Hero always true full-viewport height */
#home.hero-section {
    height: calc(100dvh + 5.5rem); /* compensate for .hero-container margin-top: -5.5rem */
    min-height: 560px;
    background-position: 65% bottom;
    margin-bottom: 0;
}

/* Top breathing gradient overlay */
#home.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 160px;
    background: linear-gradient(to bottom, rgba(216, 232, 240, 0.75) 0%, transparent 100%);
    z-index: 1;
    pointer-events: none;
}

/* Offset inner content below header */
#home.hero-section > div:nth-child(2) {
    padding-top: 2.5rem;
    padding-left: 6rem;
    padding-right: 6rem;
    padding-bottom: 2rem;
}

/* Laptop (lg 1024px+): align hero content with cards container */
@media (min-width: 1024px) {
    #home.hero-section > div:nth-child(2) {
        max-width: 80rem !important;
        margin-left: auto !important;
        margin-right: auto !important;
        padding-left: 2rem !important;
        padding-right: 2rem !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }
}

@media (min-width: 1536px) {
    #home.hero-section {
        background-position: 65% bottom;
    }

    #home .hero-copy {
        transform: none;
        max-width: 500px;
    }
}

/* Responsive Spacing Adjustments */
/* Laptop/Notebook - 1024px+ */
@media (min-width: 1024px) and (max-width: 1279px) {
    #home.hero-section {
        background-position: 65% bottom;
    }
}

/* Desktop Large - 1280px+ */
@media (min-width: 1280px) {
    #home.hero-section {
        background-position: 65% bottom;
    }
}

/* Tablet - 768px to 1023px */
@media (min-width: 768px) and (max-width: 1023px) {
    #home.hero-section {
        background-position: 65% bottom;
    }
}

/* Mobile - below 768px */
@media (max-width: 767px) {
    /* Header: logo left-aligned (matches card padding), hamburger stays right */
    header nav {
        justify-content: space-between !important;
        position: relative;
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }
    header nav > div:last-child {
        position: static;
        transform: none;
    }

    /* Hero: mobile — image top, text below, buttons below text */
    #home.hero-section {
        background-image: none !important;
        background-color: #ffffff !important;
        height: auto !important;
        min-height: auto !important;
        padding-top: 0 !important;
        align-items: flex-start;
    }

    #home.hero-section > div:nth-child(2) {
        padding-top: 0;
        padding-bottom: 0;
    }

    .hero-copy {
        padding-top: 1.25rem;
        padding-bottom: 1.5rem;
    }

    /* Hero wrapper: reduce 6rem inline padding so button fits full-width */
    .hero-container .relative.z-10.w-full {
        padding-left: 1.5rem !important;
        padding-right: 1.5rem !important;
    }
}

.hero-img {
    margin-top: -1px;
    display: block;
    width: 100%;
    height: auto;
}

@media print {
    .fixed {
        display: none;
    }
    
    header {
        position: relative;
    }
}

/* Footer accordion — mobile only */
@media (max-width: 767px) {
    .footer-acc-body {
        max-height: 0 !important;
        overflow: hidden;
        padding-top: 0 !important;
        padding-bottom: 0 !important;
        margin-top: 0 !important;
        transition: max-height 0.35s ease, padding 0.3s ease;
    }
    .footer-acc-body.open {
        max-height: 400px !important;
        padding-bottom: 1rem !important;
    }
    .footer-acc-btn svg.acc-chev {
        transition: transform 0.3s ease;
        stroke-width: 2.5;
    }
    .footer-acc-btn[aria-expanded="true"] svg.acc-chev {
        transform: rotate(180deg);
    }
}

/* Key specs card — collapsed on mobile by default */
@media (max-width: 767px) {
    /* Toggle button: full-width pill background, looks tappable */
    .specs-card-btn {
        background: #F8F9FA;
        border-radius: 0.625rem;
        padding: 0.625rem 0.875rem;
        -webkit-tap-highlight-color: transparent;
    }
    .specs-card-btn:active {
        background: #EAEDF0;
    }
    /* Panel: collapsed by default. No transition here — prevents animated collapse on initial page load.
       The 'will-transition' class is added by JS on first user tap to enable smooth animations. */
    .specs-card-panel {
        overflow: hidden;
        max-height: 0;
        opacity: 0;
        padding: 0 !important;
        border-color: transparent !important;
    }
    .specs-card-panel.will-transition {
        transition: max-height 0.38s ease, opacity 0.28s ease, padding 0.3s ease;
    }
    .specs-card-panel.open {
        max-height: 720px;
        opacity: 1;
        padding: 1rem !important;
        border-color: rgba(27,54,93,0.1) !important;
    }
    /* Chevron: thicker, navy, animated */
    .specs-card-btn svg.specs-chev {
        transition: transform 0.32s ease;
        color: #1B365D;
        flex-shrink: 0;
    }
    .specs-card-btn[aria-expanded="true"] svg.specs-chev {
        transform: rotate(180deg);
    }
    /* Legacy */
    .specs-secondary { }
}

/* Dark placeholder text for inquiry form inputs */
input::placeholder,
textarea::placeholder {
    color: #555;
    opacity: 1;
}

/* Mobile footer: social icon touch targets & layout */
@media (max-width: 767px) {
    .footer-socials {
        justify-content: flex-start;
        gap: 20px;
        margin-top: 14px;
    }
    .footer-social-item {
        width: 44px !important;
        height: 44px !important;
    }
    .footer-social-item svg {
        width: 28px !important;
        height: 28px !important;
    }
}

/* Alt-config card spec grid: 2-col layout, label/value typography */
.alt-cfg-spec > div {
    display: flex;
    flex-direction: column;
    gap: 1px;
}
.alt-cfg-spec > div > span:first-child {
    font-size: 11px;
    color: #777;
    font-weight: normal;
}
.alt-cfg-spec > div > span:last-child {
    font-size: 14px;
    font-weight: 700;
    color: #1a1a1a;
}

/* Laptop (1024px–1535px): header logo size & nav padding — matches index.html */
@media (min-width: 1024px) and (max-width: 1535px) {
    #header nav { padding-top: 0.5rem !important; padding-bottom: 0.5rem !important; }
    #header nav a[aria-label] > div { width: 9rem !important; }
}
