/* 深藍色主題配色 */
:root {
    --primary-dark: #0f172a;
    --secondary-dark: #1e293b;
    --accent-dark: #334155;
    --primary-blue: #3b82f6;
    --secondary-blue: #06b6d4;
    --accent-green: #10b981;
    --text-light: #e2e8f0;
    --text-muted: #94a3b8;
    --text-dark: #64748b;
}

body {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--secondary-dark) 50%, var(--accent-dark) 100%);
    background-attachment: fixed;
    color: var(--text-light);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'SF Pro Display', system-ui, sans-serif;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(59, 130, 246, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(59, 130, 246, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    pointer-events: none;
    z-index: 0;
}

/* Flow Hero - 重新設計，不影響文檔流 */
.flow-hero {
    position: relative;
    width: 100%;
    height: 100vh;
    min-height: 600px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    margin: 0;
    padding: 0;
}

/* 視頻背景 - 限制在flow-hero容器內 */
.video-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    overflow: hidden;
}

.video-background video {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    min-width: 100%;
    min-height: 100%;
    transform: translate(-50%, -50%);
    object-fit: cover;
    filter: blur(1.5px) brightness(0.7) saturate(1.2);
}

.video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.4);
    z-index: 2;
}

/* Flow 大字體效果 */
.flow-text-container {
    position: relative;
    z-index: 10;
    text-align: center;
    width: 100%;
    max-width: 1200px;
    padding: 0 2rem;
}

.flow-title {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
    font-size: clamp(6rem, 15vw, 12rem);
    font-weight: 900;
    letter-spacing: -0.05em;
    margin: 0;
    padding: 0;
    background: linear-gradient(135deg, #ffffff 0%, #e2e8f0 50%, #94a3b8 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 40px rgba(255, 255, 255, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: default;
    position: relative;
    line-height: 0.9;
    -webkit-text-stroke: 1px rgba(255, 255, 255, 0.1);
}

.flow-title::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at center, rgba(59, 130, 246, 0.1) 0%, transparent 70%);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -1;
}

.flow-title:hover::before {
    opacity: 1;
}

/* 新增：Flow 標題區塊子元素樣式 */
.subtitle-primary {
    font-weight: 700;
    color: var(--text-light);
    font-size: clamp(1.5rem, 4vw, 2.5rem);
    margin: clamp(1rem, 3vw, 2rem) 0 clamp(0.75rem, 2vw, 1.5rem) 0;
    line-height: 1.2;
    text-shadow: 0 0 15px rgba(255, 255, 255, 0.1);
    letter-spacing: 0.02em;
}

.flow-divider {
    border: none;
    height: 2px;
    background: linear-gradient(90deg, transparent 0%, var(--primary-blue) 20%, var(--secondary-blue) 50%, var(--primary-blue) 80%, transparent 100%);
    margin: clamp(1rem, 3vw, 2rem) auto;
    width: clamp(200px, 50%, 400px);
    opacity: 0.8;
    border-radius: 1px;
}

.subtitle-secondary {
    font-weight: 500;
    color: var(--text-muted);
    font-size: clamp(0.9rem, 2.5vw, 1.4rem);
    margin: clamp(0.75rem, 2vw, 1.5rem) 0 0 0;
    line-height: 1.4;
    text-shadow: 0 0 10px rgba(148, 163, 184, 0.1);
    letter-spacing: 0.01em;
    font-style: italic;
}

/* 導航欄 */
.navbar-dark {
    background: rgba(15, 23, 42, 0.1) !important;
    backdrop-filter: blur(15px);
    border-bottom: 1px solid rgba(59, 130, 246, 0.1);
    box-shadow: none;
    transition: all 0.3s ease;
}

.navbar-brand {
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-blue), var(--secondary-blue));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-size: 1.2rem;
    letter-spacing: 0.05em;
}

.nav-link {
    color: rgba(255, 255, 255, 0.9) !important;
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav-link:hover,
.nav-link.active {
    color: white !important;
}

/* Hero 區塊（協會介紹） */
.hero-section {
    background: rgba(15, 23, 42, 0.9);
    border-radius: 20px;
    border: 1px solid rgba(59, 130, 246, 0.2);
    backdrop-filter: blur(10px);
    position: relative;
    z-index: 1;
    overflow: hidden;
}

/* Hero 區塊背景圖片版本 */
.hero-section-with-bg {
    position: relative;
    overflow: hidden;
}

.hero-bg-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('assets/images/hero_pic.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    filter: blur(0px) brightness(0.3) saturate(0.8);
    transform: scale(1.1); /* 避免模糊邊緣顯示 */
    z-index: 1;
}

.hero-bg-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.7);
    z-index: 2;
}

.hero-section-with-bg .m-4 {
    position: relative;
    z-index: 3;
}

/* 手機版優化 */
@media (max-width: 768px) {
    .hero-bg-image {
        filter: blur(0px) brightness(0.25) saturate(0.7);
    }

    .hero-bg-overlay {
        background: rgba(15, 23, 42, 0.8);
    }
}

.hero-tagline {
    color: #f59e0b;
    font-weight: 600;
    font-size: 2.0rem;
    margin-bottom: 2rem;
    text-shadow: 0 0 10px rgba(245, 158, 11, 0.3);
}

/* 按鈕 - 保留光波效果 */
.btn-primary {
    background: linear-gradient(135deg, var(--primary-blue), var(--secondary-blue));
    border: none;
    padding: 0.75rem 2rem;
    font-weight: 600;
    border-radius: 12px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn-primary::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 ease;
}

.btn-primary:hover {
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.3);
    background: linear-gradient(135deg, #2563eb, #0891b2);
}

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

/* 功能卡片 */
.feature-card {
    background: linear-gradient(145deg, rgba(30, 41, 59, 0.9), rgba(15, 23, 42, 0.9));
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 16px;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    position: relative;
    overflow: visible;
    height: 100%;
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-blue), var(--secondary-blue), var(--accent-green));
}

.feature-card:hover {
    box-shadow: 0 12px 35px rgba(59, 130, 246, 0.2);
    border-color: rgba(59, 130, 246, 0.4);
}

.feature-icon {
    background: linear-gradient(135deg, var(--primary-blue), var(--secondary-blue));
    color: white;
    width: 4rem;
    height: 4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    font-size: 1.5rem;
    margin: 1rem auto 1.5rem;
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.3);
}

.feature-title {
    color: var(--text-light);
    font-weight: 600;
    margin-bottom: 1rem;
}

.feature-text {
    color: var(--text-muted);
    line-height: 1.6;
}

/* 內容區塊 */
.content-section {
    background: rgba(30, 41, 59, 0.8);
    border-radius: 16px;
    border: 1px solid rgba(59, 130, 246, 0.1);
    padding: 2rem;
    margin-bottom: 2rem;
    position: relative;
    z-index: 1;
    transition: all 0.3s ease;
}

.content-section:hover {
    border-color: rgba(59, 130, 246, 0.3);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.1);
}

/* 圖片 - 移除hover抖動效果 */
.section-image {
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    transition: box-shadow 0.3s ease;
}

.section-image:hover {
    box-shadow: 0 12px 35px rgba(59, 130, 246, 0.3);
}

.hero-section .section-image {
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.3);
    margin-bottom: 2rem;
}

/* 頁尾樣式 */
.footer {
    margin-top: clamp(3rem, 6vw, 5rem);
    position: relative;
}

.footer-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, rgba(59, 130, 246, 0.3) 20%, rgba(59, 130, 246, 0.5) 50%, rgba(59, 130, 246, 0.3) 80%, transparent 100%);
    margin: 0 clamp(1rem, 3vw, 3rem);
}

.footer-content {
    padding: clamp(2rem, 4vw, 3rem) clamp(1rem, 2vw, 2rem) clamp(1.5rem, 3vw, 2rem);
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(5px);
}

.footer-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: clamp(2rem, 4vw, 3rem);
    margin-bottom: clamp(2rem, 4vw, 2.5rem);
}

.footer-section h4 {
    color: #3b82f6;
    font-size: clamp(1.1rem, 2vw, 1.25rem);
    font-weight: 600;
    margin-bottom: clamp(0.75rem, 1.5vw, 1rem);
    line-height: 1.2;
}

.footer-section p {
    color: #cbd5e1;
    font-size: clamp(0.875rem, 1.3vw, 0.95rem);
    line-height: 1.4;
    margin-bottom: clamp(0.5rem, 1vw, 0.75rem);
}

.footer-section p a {
    color: #e2e8f0;
    text-decoration: none;
    transition: all 0.3s ease;
}

.footer-section p a:hover {
    color: #3b82f6;
}

.footer-bottom {
    text-align: center;
    padding-top: clamp(1.5rem, 3vw, 2rem);
    border-top: 1px solid rgba(59, 130, 246, 0.15);
}

.footer-bottom p {
    color: #94a3b8;
    font-size: clamp(0.8125rem, 1.2vw, 0.875rem);
    margin-bottom: clamp(0.25rem, 0.5vw, 0.5rem);
    line-height: 1.3;
}

.footer-brand {
    color: var(--primary-blue);
    font-weight: 600;
}

/* 聯絡方式圖示樣式 */
.contact-icon {
    vertical-align: middle;
    margin-right: 10px;
    font-size: 1.2em;
}

.fa-envelope {
    color: #ffc107;
}
.fa-globe {
    color: #4299e1;
}
.fa-line {
    color: #00B900;
}

/* 技術展示區塊 */
.tech-showcase {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(16, 185, 129, 0.1));
    border-radius: 16px;
    border: 1px solid rgba(59, 130, 246, 0.2);
    padding: 2rem;
    margin: 2rem 0;
    transition: all 0.3s ease;
}

.tech-showcase:hover {
    border-color: rgba(59, 130, 246, 0.4);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.15);
}

.tech-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.tech-item {
    background: rgba(30, 41, 59, 0.8);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    border: 1px solid rgba(59, 130, 246, 0.1);
    transition: all 0.3s ease;
}

.tech-item:hover {
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.2);
    border-color: rgba(59, 130, 246, 0.3);
}

.tech-item img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 1rem;
}

/* 響應式調整 */
@media (max-width: 768px) {
    /* 手機版視頻背景 */
    .flow-hero {
        height: 100vh;
        min-height: 500px;
    }
    
    .video-background video {
        min-width: 110%;
        min-height: 110%;
        filter: blur(2px) brightness(0.8) saturate(1.1);
    }
    
    /* 手機版Flow文字容器 */
    .flow-text-container {
        padding: 0 1.5rem;
    }

    .flow-title {
        font-size: clamp(4rem, 18vw, 8rem);
        -webkit-text-stroke: 2px rgba(255, 255, 255, 0.2);
        text-shadow: 
            0 0 20px rgba(255, 255, 255, 0.3),
            0 0 40px rgba(59, 130, 246, 0.2),
            2px 2px 4px rgba(0, 0, 0, 0.3);
        background: linear-gradient(135deg, #ffffff 0%, #f8fafc 50%, #e2e8f0 100%);
        -webkit-background-clip: text;
        background-clip: text;
        -webkit-text-fill-color: transparent;
    }
    
    /* 手機版新增元素優化 */
    .subtitle-primary {
        margin: 1.5rem 0 1rem 0;
        text-align: center;
    }
    
    .flow-divider {
        width: clamp(150px, 70%, 250px);
        margin: 1rem auto;
    }
    
    .subtitle-secondary {
        margin: 1rem auto 0 auto;
        text-align: center;
        line-height: 1.5;
        max-width: 90%;
    }
    
    .feature-icon {
        width: 3rem;
        height: 3rem;
        font-size: 1.2rem;
        margin: 1rem auto 1rem;
    }
    
    .feature-card {
        margin-bottom: 2rem;
    }

    .footer-row {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .footer-section h4 {
        font-size: 1.2rem;
    }
    
    .footer-section p {
        font-size: 1rem;
    }
}

/* 平板版優化 */
@media (min-width: 769px) and (max-width: 1024px) {
    .subtitle-primary {
        font-size: clamp(1.8rem, 3.5vw, 2.2rem);
    }
    
    .subtitle-secondary {
        font-size: clamp(1.1rem, 2.2vw, 1.3rem);
    }
}

/* 動態高度匹配樣式 - 用於協會宗旨區塊 */
.height-match-container {
    display: flex !important;
    align-items: stretch !important; /* 讓兩邊高度一致 */
    min-height: fit-content;
}

.height-match-text {
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    padding-right: 2rem; /* 增加與圖片的間距 */
}

.height-match-image {
    display: flex !important;
    align-items: stretch !important; /* 改為stretch讓圖片填滿整個高度 */
    min-height: 100%;
}

.height-match-image img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important; /* 圖片填滿容器並保持比例 */
    object-position: center !important;
    border-radius: 12px !important;
    min-height: 200px !important; /* 增加最小高度 */
    max-height: none !important; /* 移除高度限制 */
}

/* 針對Bootstrap的col類別進行覆蓋 */
.height-match-container .col-lg-8,
.height-match-container .col-lg-4 {
    display: flex !important;
    flex-direction: column !important;
}

.height-match-container .col-lg-4 {
    align-items: stretch !important;
}

/* 手機版優化 */
@media (max-width: 991px) {
    .height-match-container {
        flex-direction: column !important;
    }

    .height-match-text {
        padding-right: 0;
        margin-bottom: 2rem;
    }

    .height-match-image {
        margin-top: 0;
        align-items: center !important;
    }

    .height-match-image img {
        height: 250px !important; /* 手機版固定高度 */
        min-height: 250px !important;
        max-height: 250px !important;
    }
}

/* LI項目間距調整 */
.height-match-text li {
    margin-bottom: 1rem !important;
}

.height-match-text li:last-child {
    margin-bottom: 0 !important;
}
