/*
 * Landing Page Styles
 * Mobile-first design for the Focaxis welcoming page.
 */

/* 確保 body 背景滾動 (原 body 是 100% fixed) */
body {
    overflow-x: hidden;
    overflow-y: auto;
}

/* 防止動畫期間捲動 */
.no-scroll {
    overflow-y: hidden !important;
    touch-action: none;
    /* 防止行動裝置觸控捲動 */
}


/* 隱藏 Map 控制器在首頁的干擾 (如果不需要顯示)，但因為 map 被包在 measurement-modal，
   所以不會被看到。 */

.landing-container {
    font-family: 'Outfit', 'Roboto', sans-serif;
    color: #333;
    max-width: 100%;
    /* 確保左右撐滿 */
    margin: 0;
    padding: 0;
    /* Hero 已移至 container 外，不需要預留 logo bar padding */
    padding-top: 0;
}

/* 桌機版/平板，為 Hero Section 增加上方 padding 以預留 Logo + Nav 空間 */
@media (min-width: 769px) {
    .hero-section {
        /* Logo (50) + Nav (60) + 安全間距 = 約 120px */
        padding-top: 120px;
    }
}

/* =========================================
   Hero Section - Full-Width Banner
   ========================================= */
.hero-section {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    width: 100%;
    /* 滿版寬度，不用 100vw 以免產生水平捲軸 */
    height: 100vh;
    /* 100vh 高度 */
    min-height: 400px;
    /* 最小高度保護 */
    /* 手機版 Logo Bar (50px) + 安全間距 */
    padding: 80px 20px 40px;
    position: relative;
    /* 深色遮罩 (約 40%) + 背景圖 */
    background: linear-gradient(rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.4)),
        url('https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjGPvwrUBB8A0rwB1gxe_n2MVCJJH7L7nrP5MQtVtgJk-1RqXsObxNB2YCFY9BU2dyTFiQq9jej61Na821zRODUopzB9azaisy5-pmPfcsjS-CshkjzHLK8bp0Tmti5UgZmwrqTGa9ZuUvf4354TWD9CDsITPF9SGEmfVnzH78syPqhfFjV3ENIKyJsNMs/s16000/IDG_20250831_175829_717.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: scroll;
    /* 移除圓角，讓底部為乾淨的水平直線 */
    border-radius: 0;
    overflow: hidden;
    margin: 0;
    box-sizing: border-box;
}

/* --- Hero Animation --- */
.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #fff;
    z-index: 1;
    animation: fadeOutWhiteOverlay 1.5s ease 2.2s forwards;
    pointer-events: none;
}

@keyframes fadeOutWhiteOverlay {
    0% {
        opacity: 1;
    }

    100% {
        opacity: 0;
    }
}

.hero-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: #000;
    z-index: 10;
    display: flex;
    justify-content: center;
    align-items: center;
    pointer-events: none;
    mix-blend-mode: multiply;
    animation: fadeOutLoader 0.9s ease-out 3.5s forwards;
}

/* loader-logo：作為整體 LOGO 組合的容器，flex row 排列 icon + text，整體置中 */
.loader-logo {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: auto;
    height: auto;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    /* 使用 both 確保動畫前後都保持 translate 置中 */
    animation: zoomIntoLogo 1.2s cubic-bezier(0.7, 0, 0.3, 1) 3.5s both;
}

/* loader-icon：flex item，只做縮放出現動畫 */
.loader-icon {
    flex-shrink: 0;
    width: auto;
    height: 10vw;
    max-height: 90px;
    min-height: 36px;
    transform: scale(0);
    opacity: 0;
    animation: animateIcon 2s ease-in-out forwards;
    shape-rendering: geometricPrecision;
}

/* loader-text：flex item，clip-path 從左刷入 */
.loader-text {
    /* 比例基於 viewBox(644/120 ≈ 5.367)，text 寬度 = height × 5.367 */
    height: 10vw;
    max-height: 90px;
    min-height: 36px;
    width: 53.67vw;
    max-width: 483px;
    min-width: 193px;
    clip-path: polygon(-20% -20%, -20% -20%, -20% 120%, -20% 120%);
    opacity: 0;
    animation: revealText 0.8s ease-in-out 1.2s forwards;
    fill: #ffffff;
    shape-rendering: geometricPrecision;
    overflow: visible;
}

.hero-content {
    opacity: 0;
    animation: fadeInContent 1.2s cubic-bezier(0.2, 0.8, 0.2, 1) 4.5s forwards;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 2;
}

@keyframes animateIcon {
    0% {
        transform: scale(0.3);
        opacity: 0;
    }

    15% {
        transform: scale(1.1);
        opacity: 1;
        filter: drop-shadow(0 0 15px rgba(255, 255, 255, 0.3));
    }

    30% {
        transform: scale(1);
        opacity: 1;
        filter: drop-shadow(0 0 0px transparent);
    }

    100% {
        transform: scale(1);
        opacity: 1;
        filter: drop-shadow(0 0 0px transparent);
    }
}

@keyframes revealText {
    0% {
        clip-path: polygon(-20% -20%, -20% -20%, -20% 120%, -20% 120%);
        opacity: 0;
    }

    1% {
        opacity: 1;
    }

    100% {
        clip-path: polygon(-20% -20%, 120% -20%, 120% 120%, -20% 120%);
        opacity: 1;
    }
}

@keyframes zoomIntoLogo {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }

    100% {
        transform: translate(-50%, -50%) scale(45);
        opacity: 1;
    }
}

@keyframes fadeOutLoader {
    0% {
        opacity: 1;
        visibility: visible;
    }

    100% {
        opacity: 0;
        visibility: hidden;
    }
}

@keyframes fadeInContent {
    0% {
        opacity: 0;
        transform: translateY(40px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- End Hero Animation --- */

.hero-section h1 {
    font-size: 2.2rem;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 20px;
    color: #fff;
    /* 在深背景上改為白色 */
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    background: linear-gradient(135deg, #fff, #f39c12);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-subtitle {
    font-size: 1.1rem;
    line-height: 1.6;
    color: #eee;
    /* 在深背景上改為淺色 */
    margin-bottom: 40px;
    max-width: 800px;
    /* 增加最大寬度以容納長句 */
    text-shadow: 0 1px 5px rgba(0, 0, 0, 0.5);
    padding: 0 20px;
}

/* 防止日文副標題在任何寬度下自動換行，確保視覺美感 */
body[data-lang="ja"] .hero-subtitle {
    white-space: nowrap;
    /* 如果螢幕真的太窄，自動縮小字體以盡量容納 */
    font-size: clamp(0.75rem, 3.5vw, 1.1rem);
}

/* CTA Button */
.cta-button {
    background-color: #e67e22;
    /* 橙色主調 */
    color: #fff;
    border: none;
    border-radius: 30px;
    padding: 15px 40px;
    font-size: 1.2rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(230, 126, 34, 0.4);
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.cta-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(230, 126, 34, 0.6);
    background-color: #d35400;
}

.cta-button span.material-symbols-outlined {
    font-size: 1.4rem;
}

/* =========================================
   Feature Intro Section
   ========================================= */
.feature-section {
    padding: 80px 20px 60px 20px;
    /* 增加左右 20px 邊距 */
    text-align: center;
    max-width: 1200px;
    /* 限制內容寬度 */
    margin: 0 auto;
}

.feature-section h2 {
    font-size: 1.8rem;
    margin-bottom: 30px;
    color: #d35400;
    /* 深橙色 */
}

.feature-description {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #666;
    max-width: 800px;
    margin: 0 auto;
    text-align: justify;
}

.feature-cards {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    margin-top: 40px;
}

.feature-card {
    background: #fff;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    flex: 1 1 250px;
    max-width: 350px;
    text-align: left;
    transition: transform 0.3s;
    border-bottom: 3px solid transparent;
}

.feature-card:hover {
    transform: translateY(-5px);
    border-color: #f39c12;
}

.feature-card .material-symbols-outlined {
    font-size: 2rem;
    color: #e67e22;
    /* 橙色圖示 */
    margin-bottom: 15px;
}

.feature-card h3 {
    font-size: 1.3rem;
    margin-bottom: 10px;
    color: #333;
}

.feature-card p {
    color: #666;
    line-height: 1.5;
    font-size: 0.95rem;
}


/* =========================================
   FAQ Section
   ========================================= */
.faq-section {
    padding: 60px 20px;
    /* 增加左右 20px 邊距 */
    max-width: 800px;
    margin: 0 auto;
}

.faq-section h2 {
    text-align: center;
    font-size: 1.8rem;
    margin-bottom: 40px;
    color: #d35400;
}

.faq-item {
    border-bottom: 1px solid #eee;
    margin-bottom: 15px;
}

.faq-question {
    padding: 15px 0;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: 500;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #333;
    transition: color 0.2s;
}

.faq-question:hover {
    color: #e67e22;
}

.faq-question .icon {
    font-size: 1.2rem;
    transition: transform 0.3s;
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
    color: #666;
    line-height: 1.6;
}

.faq-item.active .faq-answer {
    padding-bottom: 20px;
    max-height: 300px;
    /* 足夠高以顯示內容 */
}

.faq-item.active .faq-question .icon {
    transform: rotate(180deg);
}






/* =========================================
   Responsive Adjustments (Desktop)
   ========================================= */
@media (min-width: 1024px) {
    .landing-container {
        /* 左右移除預先留白，讓 Hero 滿版。內容區由內部元素各自控制。 */
        padding: 0;
    }

    .hero-section {
        /* Logo (50) + Nav (60) + 安全間距 */
        padding-top: 130px;
    }

    .hero-section h1 {
        font-size: 3.5rem;
    }

    .hero-subtitle {
        font-size: 1.3rem;
    }

    .feature-section h2,
    .faq-section h2 {
        font-size: 2.2rem;
    }


}

/* --- Global Initial Animations (Header & Nav) --- */
@keyframes initialSlideDownLogo {
    0% {
        top: -60px;
        opacity: 0;
    }

    100% {
        top: 0px;
        opacity: 1;
    }
}

@keyframes initialSlideDownNav {
    0% {
        top: -60px;
        opacity: 0;
    }

    100% {
        top: 50px;
        opacity: 1;
    }
}

@keyframes initialSlideDownMenu {
    0% {
        top: -50px;
        opacity: 0;
    }

    100% {
        top: 9px;
        opacity: 1;
    }
}

@media (min-width: 769px) {
    #logo-bar {
        animation: initialSlideDownLogo 1s cubic-bezier(0.2, 0.8, 0.2, 1) 4.4s both;
    }

    #horizontal-nav-bar {
        animation: initialSlideDownNav 1s cubic-bezier(0.2, 0.8, 0.2, 1) 4.6s both;
    }
}

@media (max-width: 768px) {
    #logo-bar {
        animation: initialSlideDownLogo 1s cubic-bezier(0.2, 0.8, 0.2, 1) 4.4s both;
    }

    #menu-button {
        animation: initialSlideDownMenu 1s cubic-bezier(0.2, 0.8, 0.2, 1) 4.6s both;
    }
}