/* ==========================================================================
   1. 基礎重設與全域樣式 (Minimal & Modern Style)
   ========================================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Sans TC', sans-serif;
    color: #333333;
    line-height: 1.6;
    background-color: #ffffff;
    scroll-behavior: smooth;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
}

/* 桌機版大留白，維持高階感 */
.section {
    padding: 100px 0;
    text-align: center;
}

/* 深色區塊全域設定 */
.section.dark {
    background-color: #0b1d33;
    color: #ffffff;
}

h2 {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 20px;
    letter-spacing: 2px;
}

.section.dark h2 {
    color: #ffffff;
}

.section-subtitle {
    color: #666666;
    margin-top: -10px;
    margin-bottom: 50px;
    font-size: 15px;
}

.section.dark .section-subtitle {
    color: #8da4be;
}

/* ==========================================================================
   2. 頁首導覽列 (Header - 支援動態隱藏)
   ========================================================================== */
header {
    background-color: rgba(255, 255, 255, 0.95);
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    /* 💡 核心：加入平滑的上下滑動動畫 */
    transition: transform 0.3s ease-in-out; 
}

/* 💡 當網頁往下滑時，JS 會幫 header 加上這個類別，把它往上推離螢幕範圍 */
header.header-hidden {
    transform: translateY(-100%);
}
.nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 80px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 15px;
    text-align: left;
}

.logo img {
    height: 45px;
}

.logo h2 {
    font-size: 18px;
    margin: 0;
    color: #0b1d33;
}

.logo p {
    font-size: 11px;
    color: #888888;
    margin: 0;
    letter-spacing: 2px;
}

nav a {
    text-decoration: none;
    color: #333333;
    margin-left: 25px;
    font-weight: 500;
    font-size: 15px;
    transition: color 0.3s;
}

nav a:hover {
    color: #1473e6;
}

/* ==========================================================================
   3. 主視覺橫幅 (Hero Section)
   ========================================================================== */
.hero {
    height: 100vh;
    background: url('img/hero.jpg') no-repeat center center/cover;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #ffffff;
    text-align: center;
}

.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(11, 29, 51, 0.5);
}

.hero-content {
    position: relative;
    z-index: 10;
    width: 90%;
}

.hero-content h1 {
    font-size: 48px;
    font-weight: 700;
    letter-spacing: 4px;
    margin-bottom: 15px;
}

.hero-content p {
    font-size: 18px;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: #d1e2f3;
    margin-bottom: 35px;
}

.buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
}

.btn {
    display: inline-block;
    padding: 12px 30px;
    background-color: #1473e6;
    color: #ffffff;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 500;
    transition: background 0.3s;
}

.btn:hover {
    background-color: #0b57b3;
}

.btn.outline {
    background-color: transparent;
    border: 2px solid #ffffff;
}

.btn.outline:hover {
    background-color: #ffffff;
    color: #0b1d33;
}

/* ==========================================================================
   4. 教練介紹區塊（桌機預設版）
   ========================================================================== */
.instructor-wrapper {
    display: flex;
    flex-direction: column;
    gap: 50px;
    align-items: center;
    margin-top: 40px;
    text-align: left;
}

.instructor-img {
    width: 220px;
    height: 220px;
    flex-shrink: 0;
}

.instructor-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.instructor-info {
    flex: 1;
    max-width: 650px;
}

.section.dark .instructor-info h3 {
    font-size: 28px;
    color: #ffffff;
    margin-bottom: 5px;
    font-weight: 700;
}

.section.dark .instructor-info h3 span {
    font-size: 16px;
    color: #a0aec0;
    font-weight: 400;
    margin-left: 10px;
}

.section.dark .instructor-title {
    font-size: 15px;
    color: #4ed0e6;
    font-weight: 500;
    margin-bottom: 25px;
}

.section.dark .instructor-bio {
    font-size: 15.5px;
    line-height: 1.8;
    color: #e2e8f0;
    margin-bottom: 30px;
}

.section.dark .credentials h4 {
    font-size: 16px;
    color: #ffffff;
    margin-bottom: 15px;
    font-weight: 700;
}

.credentials ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.section.dark .credentials li {
    font-size: 14.5px;
    color: #cbd5e1;
    margin-bottom: 10px;
    line-height: 1.6;
}

/* ==========================================================================
   5. 課程卡片佈局 (Course Cards)
   ========================================================================== */
.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 25px;
    margin-top: 20px;
}

.card {
    background-color: #f8fafc; 
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 35px 20px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.card:hover {
    transform: translateY(-8px);
    background-color: #ffffff;
    border-color: #1473e6;
    box-shadow: 0 10px 25px rgba(20, 115, 230, 0.08);
}

.card-icon {
    font-size: 36px;
    margin-bottom: 15px;
}

.card h3 {
    font-size: 18px;
    font-weight: 700;
    color: #0b1d33;
    margin-bottom: 8px;
}

.card p {
    font-size: 13px;
    color: #64748b;
    margin-bottom: 20px;
}

.learn-more {
    font-size: 12px;
    color: #1473e6;
    font-weight: 500;
    text-transform: uppercase;
}

/* ==========================================================================
   6. 海外潛水區塊佈局 (Overseas Section)
   ========================================================================== */
.overseas-content {
    max-width: 850px;
    margin: 0 auto;
}

.overseas-content > p {
    font-size: 16px;
    line-height: 1.8;
    color: #e2e8f0;
    margin-bottom: 45px;
}

.overseas-features {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
    margin-bottom: 50px;
    text-align: left;
}

.feature-item {
    background-color: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.07);
    padding: 30px 25px;
    border-radius: 8px;
}

.feature-icon {
    font-size: 28px;
    display: block;
    margin-bottom: 15px;
}

.feature-item h4 {
    font-size: 18px;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 10px;
}

.feature-item p {
    font-size: 13.5px;
    color: #cbd5e1;
    line-height: 1.6;
}

/* ==========================================================================
   7. 課程詳情彈出視窗 (Modal)
   ========================================================================== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.active {
    opacity: 1;
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(5px);
}

.modal-wrapper {
    position: relative;
    background-color: #ffffff;
    width: 90%;
    max-width: 650px;
    max-height: 85vh;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
    z-index: 2001;
    overflow-y: auto;
    padding: 40px 30px;
    box-sizing: border-box;
    transform: translateY(30px);
    transition: transform 0.3s ease;
    text-align: left;
    color: #333333;
}

.modal.active .modal-wrapper {
    transform: translateY(0);
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    font-size: 32px;
    color: #999999;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s;
}

.modal-close:hover {
    color: #1473e6;
}

.modal-detail-title {
    font-size: 24px;
    font-weight: 700;
    color: #0b1d33;
    margin-bottom: 5px;
}

.modal-detail-subtitle {
    font-size: 14px;
    color: #666666;
    margin-bottom: 25px;
    border-bottom: 1px solid #eeeeee;
    padding-bottom: 15px;
}

.modal-section {
    margin-bottom: 25px;
}

.modal-section h4 {
    font-size: 16px;
    font-weight: 700;
    color: #0b1d33;
    margin-bottom: 10px;
    position: relative;
    padding-left: 12px;
}

.modal-section h4::before {
    content: '';
    position: absolute;
    left: 0;
    top: 3px;
    bottom: 3px;
    width: 3px;
    background-color: #1473e6;
}

.modal-section p {
    font-size: 14px;
    line-height: 1.6;
    color: #555555;
}

.modal-section ul {
    padding-left: 18px;
    margin: 0;
}

.modal-section ul li {
    font-size: 14px;
    line-height: 1.6;
    color: #555555;
    margin-bottom: 6px;
}

.info-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    background-color: #f8f9fa;
    padding: 15px 20px;
    border-radius: 8px;
}

.info-item {
    border-bottom: 1px dashed #e0e0e0;
    padding-bottom: 8px;
}

.info-item:last-child {
    border-bottom: none;
}

.info-item-label {
    font-size: 12px;
    color: #888888;
    margin-bottom: 3px;
}

.info-item-value {
    font-size: 14px;
    font-weight: 500;
    color: #333333;
}

.modal-action-btn {
    display: block;
    width: 100%;
    background-color: #1473e6;
    color: #ffffff;
    text-align: center;
    padding: 14px;
    border-radius: 8px;
    font-weight: 500;
    text-decoration: none;
    transition: background-color 0.2s;
    box-sizing: border-box;
    margin-top: 30px;
}

.modal-action-btn:hover {
    background-color: #0b57b3;
}

/* ==========================================================================
   8. 海底世界照片牆 (Gallery)
   ========================================================================== */
.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 15px;
    margin-top: 40px;
}

.gallery img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 6px;
    transition: all 0.3s ease;
    filter: grayscale(100%);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.gallery img:hover {
    filter: grayscale(0%);
    transform: scale(1.02);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.banner {
    background-color: #06111f;
    color: #ffffff;
    padding: 80px 0;
    text-align: center;
}

.banner h2 {
    font-style: italic;
    font-size: 24px;
    font-weight: 300;
    margin: 0;
    letter-spacing: 1px;
}

/* ==========================================================================
   9. 頁尾 (Footer)
   ========================================================================== */
footer {
    background-color: #06111f;
    color: #ffffff;
    padding: 60px 0;
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.footer-logo {
    height: 60px;
    margin-bottom: 20px;
}

footer h3 {
    margin-bottom: 5px;
    font-weight: 500;
    letter-spacing: 1px;
}

footer p {
    font-size: 14px;
    color: #8da4be;
}

/* ==========================================================================
   10. 中大螢幕裝置彈性排版（平板與電腦）
   ========================================================================== */
@media (min-width: 768px) {
    .instructor-wrapper {
        flex-direction: row;
        align-items: center;
        justify-content: center;
    }
    
    .overseas-features {
        grid-template-columns: repeat(3, 1fr);
    }

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

/* ==========================================================================
   11. 💡 核心新增：全面優化行動端手機體驗 (RWD Mobile Styles)
   ========================================================================== */
@media (max-width: 767px) {
    /* 縮減全網頁區塊間距，避免手機上滑不到底 */
    .section {
        padding: 60px 0;
    }

    /* 網頁標題縮小自適應 */
    h2 {
        font-size: 26px;
        margin-bottom: 15px;
    }

    .section-subtitle {
        margin-bottom: 35px;
        font-size: 14px;
        padding: 0 10px;
    }

    /* 頁首選單改為乾淨的水平置中換行結構 */
    .nav {
        flex-direction: column;
        height: auto;
        padding: 15px 0;
        gap: 12px;
    }

    .logo {
        text-align: center;
        flex-direction: column;
        gap: 5px;
    }

    nav {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px 15px;
    }

    nav a {
        margin-left: 0;
        font-size: 14px;
    }

    /* 主視覺 Hero 縮小字體 */
    .hero-content h1 {
        font-size: 32px;
        letter-spacing: 2px;
    }

    .hero-content p {
        font-size: 14px;
        margin-bottom: 25px;
    }

    .buttons {
        flex-direction: column;
        gap: 12px;
        width: 100%;
        max-width: 280px;
        margin: 0 auto;
    }

    .btn {
        width: 100%;
        padding: 10px 0;
    }

    /* 關於我們內文縮小，易於手機閱讀 */
    #about p {
        font-size: 15px;
        text-align: justify;
    }

    /* 教練介紹手機版完全置中，照片尺寸修得更精緻 */
    .instructor-wrapper {
        text-align: center;
        gap: 25px;
    }

    .instructor-img {
        width: 180px;  /* 💡 手機版縮小至精緻的 180px */
        height: 180px;
    }

    .section.dark .instructor-info h3 span {
        display: block;
        margin-left: 0;
        margin-top: 4px;
    }

    .section.dark .instructor-title {
        margin-bottom: 15px;
    }

    .section.dark .instructor-bio {
        font-size: 14.5px;
        text-align: justify;
    }

    .section.dark .credentials h4 {
        text-align: center;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        padding-bottom: 8px;
    }

    .credentials ul {
        text-align: left; /* 資歷清單保持靠左好閱讀 */
        display: inline-block;
    }

    /* 課程卡片在手機改為精緻的單欄排列 */
    .cards {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .card {
        padding: 25px 20px;
    }

    /* 海外潛水活動文字調整 */
    .overseas-content > p {
        font-size: 14.5px;
        text-align: justify;
        margin-bottom: 30px;
    }

    .overseas-features {
        gap: 15px;
    }

    /* 彈出視窗手機版優化（防止被螢幕切掉，加強滾動體驗） */
    .modal-wrapper {
        padding: 30px 20px;
        width: 92%;
    }

    .modal-detail-title {
        font-size: 20px;
    }

    /* 照片牆在手機上改為雙欄並排，看起來像 Instagram 牆一樣精緻 */
    .gallery {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .gallery img {
        height: 140px;
        filter: grayscale(0%); /* 行動裝置上直接顯示彩色，體驗更好 */
    }

    .banner h2 {
        font-size: 18px;
        padding: 0 15px;
    }
}
