/* CSS Reset & Variables - Piovision Corporate Tech Style (White-based) */
html {
    scroll-behavior: smooth;
}
:root {
    /* Corporate Colors (Blue & Gray) with Tech Accents */
    --primary-blue: #00508f;
    /* Dassault/Corporate Blue */
    --secondary-blue: #0078d7;
    /* Tech Blue */
    --tech-cyan: #00d2ff;
    /* High-tech Cyan Accent */
    --accent-blue: #e6f2ff;

    /* Neutral Colors for White-based design */
    --bg-white: #ffffff;
    --bg-light: #f8f9fa;
    --bg-gray: #f1f3f5;

    /* Text Colors */
    --text-main: #212529;
    --text-muted: #6c757d;
    --text-light: #ffffff;

    /* UI Elements - Tech Vibe */
    --border-color: #dee2e6;
    --border-tech: rgba(0, 80, 143, 0.2);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 8px 24px rgba(0, 80, 143, 0.08);
    --glow-primary: 0 0 20px rgba(0, 120, 215, 0.3);
    --glow-cyan: 0 0 15px rgba(0, 210, 255, 0.4);

    /* Fonts */
    --font-heading: "Inter", "Noto Sans TC", sans-serif;
    --font-body: "Inter", "Noto Sans TC", sans-serif;

    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

body {
    background-color: var(--bg-white);
    color: var(--text-main);
    font-family: var(--font-body);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    background-image:
        linear-gradient(rgba(0, 80, 143, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 80, 143, 0.02) 1px, transparent 1px);
    background-size: 40px 40px;
    background-position: center center;
}

/* Global Utilities */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

h2,
h3,
h4,
h5 {
    font-family: var(--font-heading);
    color: var(--primary-blue);
    font-weight: 800;
    line-height: 1.3;
    letter-spacing: -0.5px;
}

a {
    text-decoration: none;
    color: var(--secondary-blue);
    transition: var(--transition);
}

a:hover {
    color: var(--tech-cyan);
}

.text-center {
    text-align: center;
}

.text-accent {
    background: linear-gradient(135deg,
            var(--primary-blue),
            var(--tech-cyan));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
}

/* Buttons */
.ag-btn-primary {
    display: inline-block;
    background: linear-gradient(135deg,
            var(--primary-blue),
            var(--secondary-blue));
    color: var(--text-light);
    font-weight: 600;
    letter-spacing: 1px;
    padding: 0.8rem 1.8rem;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255, 255, 255, 0.2);
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 80, 143, 0.2);
}

.ag-btn-primary::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,
            transparent,
            rgba(255, 255, 255, 0.3),
            transparent);
    transition: all 0.5s ease;
}

.ag-btn-primary:hover {
    box-shadow: var(--glow-primary);
    transform: translateY(-2px);
    color: var(--text-light);
}

.ag-btn-primary:hover::before {
    left: 100%;
}

.large {
    padding: 1rem 2.5rem;
    font-size: 1.1rem;
    border-radius: 30px;
}



/* Hero Section */
.hero-section {
    padding: 3rem 0 6rem;
    /* Adjusted for larger header */
    background:
        radial-gradient(circle at right top,
            rgba(0, 210, 255, 0.05),
            transparent 40%),
        radial-gradient(circle at left bottom,
            rgba(0, 80, 143, 0.05),
            transparent 40%);
    border-bottom: 1px solid var(--border-tech);
    position: relative;
}

.hero-content-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.badge {
    display: inline-block;
    padding: 0.4rem 1rem;
    background: linear-gradient(90deg,
            rgba(0, 80, 143, 0.1),
            rgba(0, 210, 255, 0.1));
    border: 1px solid var(--border-tech);
    color: var(--primary-blue);
    font-size: 0.85rem;
    font-weight: 700;
    border-radius: 30px;
    margin-bottom: 1.5rem;
    box-shadow: inset 0 0 10px rgba(255, 255, 255, 0.5);
}

.hero-title {
    font-size: 3rem;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg,
            var(--text-main) 0%,
            var(--primary-blue) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-subtitle {
    font-size: 1.6rem;
    color: var(--text-main);
    margin-bottom: 1.5rem;
    font-weight: 600;
}

.hero-description {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-bottom: 2.5rem;
}

/* Clickable Media Placeholders */
.clickable-media {
    cursor: pointer;
    transition: var(--transition);
}

.video-placeholder,
.image-placeholder {
    background-color: rgba(248, 249, 250, 0.8);
    backdrop-filter: blur(5px);
    border: 1px solid var(--border-tech);
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--primary-blue);
    font-size: 0.95rem;
    width: 100%;
    position: relative;
    overflow: hidden;
    box-shadow: inset 0 0 20px rgba(0, 80, 143, 0.05);
}

/* Real Image Styling */
.real-image {
    width: 100%;
    height: auto;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-tech);
    display: block;
}

.modal-enlarged-img {
    max-width: 100%;
    max-height: 85vh;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
    margin: 0 auto;
}

.video-placeholder::after,
.image-placeholder::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        linear-gradient(rgba(0, 210, 255, 0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 210, 255, 0.1) 1px, transparent 1px);
    background-size: 20px 20px;
    z-index: -1;
    opacity: 0.5;
}

.video-placeholder {
    height: 400px;
    box-shadow: var(--shadow-md);
}

.image-placeholder {
    height: 300px;
}

.clickable-media:hover {
    border-color: var(--tech-cyan);
    box-shadow: var(--glow-cyan);
    transform: translateY(-5px);
}


.video-placeholder:hover .play-icon {
    transform: scale(1.1);
    color: var(--tech-cyan);
}

/* Section Header */
.section-header {
    margin-bottom: 4rem;
}

.section-title {
    font-size: 2.2rem;
    margin-bottom: 0.5rem;
}

.section-subtitle {
    font-size: 1.1rem;
    color: var(--text-muted);
}

.title-underline {
    height: 4px;
    width: 60px;
    background: linear-gradient(90deg,
            var(--primary-blue),
            var(--tech-cyan));
    margin-top: 1rem;
    border-radius: 2px;
    box-shadow: var(--glow-cyan);
}

.title-underline.center {
    margin-left: auto;
    margin-right: auto;
}

/* Core Strengths */
.core-strengths {
    padding: 6rem 0;
    background-color: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
}

.feature-rows {
    display: flex;
    flex-direction: column;
    gap: 6rem;
}

.feature-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5rem;
    align-items: center;
}

.feature-row.reverse .feature-text {
    order: 2;
}

.feature-row.reverse .feature-image {
    order: 1;
}

.feature-text h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-main);
}

.feature-text p {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.feature-list {
    list-style: none;
}

.feature-list li {
    position: relative;
    padding-left: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-main);
    font-weight: 500;
}

.feature-list li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 8px;
    width: 8px;
    height: 8px;
    background-color: var(--tech-cyan);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--tech-cyan);
}

/* Comparison Section */
.comparison-section {
    padding: 6rem 0;
    background: linear-gradient(180deg, var(--bg-white), var(--bg-light));
    border-top: 1px solid var(--border-tech);
}

.ag-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin-bottom: 4rem;
}

.ag-compare-card {
    background-color: var(--bg-white);
    border-radius: var(--radius-md);
    padding: 2.5rem 2rem;
    border: 1px solid var(--border-tech);
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.ag-compare-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--border-color);
    transition: var(--transition);
}

.ag-compare-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
    border-color: var(--tech-cyan);
}

.ag-compare-card:hover::before {
    background: linear-gradient(90deg,
            var(--primary-blue),
            var(--tech-cyan));
    box-shadow: var(--glow-cyan);
}

.ag-compare-card.active-card {
    border: 1px solid var(--secondary-blue);
    box-shadow:
        var(--shadow-lg),
        0 0 0 1px var(--secondary-blue);
}

.ag-compare-card.active-card::before {
    background: linear-gradient(90deg,
            var(--primary-blue),
            var(--tech-cyan));
    box-shadow: var(--glow-cyan);
}

.ag-compare-card h4 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.compare-title {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    font-weight: 600;
}

.compare-list {
    list-style: none;
}

.compare-list li {
    margin-bottom: 0.8rem;
    font-size: 0.9rem;
    color: var(--text-main);
    line-height: 1.5;
    padding-left: 1.5rem;
    position: relative;
}

.compare-list li::before {
    content: "✓";
    color: var(--secondary-blue);
    position: absolute;
    left: 0;
    font-weight: 800;
}

.cta-bottom {
    text-align: center;
    background: linear-gradient(135deg,
            var(--bg-white),
            var(--accent-blue));
    padding: 4rem 3rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-tech);
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
}

.cta-bottom::before {
    content: "";
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: repeating-linear-gradient(45deg,
            transparent,
            transparent 10px,
            rgba(0, 210, 255, 0.03) 10px,
            rgba(0, 210, 255, 0.03) 20px);
    z-index: 0;
}

.cta-bottom>* {
    position: relative;
    z-index: 1;
}

.cta-bottom h3 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
}

.cta-bottom p {
    color: var(--text-muted);
    margin-bottom: 0;
    font-size: 1.1rem;
}

/* Piovision Footer */
.piovision-footer {
    background-color: #333333;
    /* Standard corporate dark gray */
    color: #ffffff;
    font-family: var(--font-body);
}

.footer-top {
    padding: 4rem 0;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1.5fr;
    gap: 3rem;
}

.footer-logo {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
}

.footer-logo span {
    font-weight: 400;
    color: var(--tech-cyan);
}

.footer-desc {
    color: #cccccc;
    font-size: 0.9rem;
    line-height: 1.8;
}

.footer-title {
    color: #ffffff;
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    position: relative;
    padding-bottom: 10px;
}

.footer-title::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 30px;
    height: 2px;
    background-color: var(--secondary-blue);
}

.footer-list,
.footer-contact-list {
    list-style: none;
}

.footer-list li,
.footer-contact-list li {
    margin-bottom: 1rem;
    font-size: 0.9rem;
    color: #cccccc;
}

.footer-list a {
    color: #cccccc;
    transition: color 0.3s ease;
}

.footer-list a:hover {
    color: var(--tech-cyan);
}

.footer-bottom {
    background-color: #222222;
    padding: 1.5rem 0;
    text-align: center;
    color: #888888;
    font-size: 0.85rem;
}

/* Modal (Lightbox) Styles */
.ag-modal {
    z-index: 99999;
    display: none; /* 平時隱藏 */
    position: fixed;
    left: 0;
    top: 0;
    width: 100vw; /* 強制視窗寬度 */
    height: 100vh; /* 強制視窗高度 */
    background-color: rgba(10, 15, 25, 0.9);
    backdrop-filter: blur(8px);

    /* 核心置中邏輯 */
    align-items: center;
    justify-content: center;
    padding: 20px; /* 避免手機版內容貼齊邊緣 */

    opacity: 0;
    transition: opacity 0.3s ease;
    box-sizing: border-box;
}

.ag-modal.active {
    display: flex; /* 啟動時轉為 flex 以置中 */
    opacity: 1;
}

.ag-modal-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: #ffffff;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
    z-index: 2001;
    line-height: 1;
}

.ag-modal-close:hover {
    color: var(--tech-cyan);
}

.ag-modal-content {
    position: relative;
    width: 100%;
    max-width: 1000px; /* PC 版最大寬度 */
    max-height: 90vh; /* 避免高度超過螢幕 */
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-lg), 0 0 40px rgba(0, 210, 255, 0.2);
    animation: zoomIn 0.3s ease;

    /* 確保內部元素置中 */
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
}

/* 針對圖片放大的特殊設定 */
.modal-enlarged-img {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
}
@media (max-width: 768px) {
    .ag-modal {
        padding: 10px; /* 手機版縮小邊距 */
    }

    .ag-modal-close {
        top: 15px;
        right: 15px;
        font-size: 35px;
    }

    .ag-modal-content {
        width: 100%;
        max-height: 80vh; /* 手機版預留更多空間給關閉按鈕 */
    }
}
@keyframes zoomIn {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}
/* Video Iframe Container */
.iframe-container {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
    /* 16:9 Aspect Ratio */
    background-color: #000;
}

.iframe-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Mock Enlarged Image for demonstration */
.mock-enlarged-image {
    background: linear-gradient(135deg,
            var(--bg-white),
            var(--accent-blue));
    padding: 6rem 2rem;
    text-align: center;
    border: 1px solid var(--border-tech);
    position: relative;
    overflow: hidden;
}

.mock-enlarged-image .tech-lines {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        linear-gradient(rgba(0, 80, 143, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 80, 143, 0.05) 1px, transparent 1px);
    background-size: 30px 30px;
    z-index: 0;
}

.mock-enlarged-image h3,
.mock-enlarged-image p {
    position: relative;
    z-index: 1;
}

.mock-enlarged-image h3 {
    font-size: 2rem;
    margin-bottom: 1rem;
}

/* Responsive */
@media (max-width: 992px) {
    .hero-content-wrapper {
        grid-template-columns: 1fr;
    }

    .feature-row {
        grid-template-columns: 1fr;
        gap: 2.5rem;
    }

    .feature-row.reverse .feature-text {
        order: 1;
    }

    .feature-row.reverse .feature-image {
        order: 2;
    }

    .ag-grid-3 {
        grid-template-columns: 1fr;
    }

    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {
    .top-bar-container {
        flex-direction: column;
        gap: 5px;
    }

    .nav-links {
        display: none;
    }

    .hero-title {
        font-size: 2.2rem;
    }

    .footer-grid {
        grid-template-columns: 1fr;
    }
}


.play-icon-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 3rem;
    color: rgba(255, 255, 255, 0.8); /* 半透明白色 */
    background: rgba(0, 0, 0, 0.5); /* 半透明黑色背景圈 */
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-shadow: 0 0 15px rgba(0, 210, 255, 0.4);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 2; /* 確保在圖片上方 */
}

.clickable-media:hover .play-icon-overlay {
    transform: translate(-50%, -50%) scale(1.1);
    background: rgba(0, 80, 143, 0.8); /* 懸停時變藍色 */
    color: #ffffff;
}