/* --- 1. CSS 變數設定 (主題色) --- */
:root {
    --bg-dark: #0f172a;       /* 深藍背景 */
    --bg-card: #1e293b;       /* 卡片背景 */
    --bg-hover: #334155;      /* 懸停背景 */
    --text-main: #cbd5e1;     /* 主要文字 */
    --text-title: #ffffff;    /* 標題文字 */
    --accent-cyan: #06b6d4;   /* 亮青色 */
    --accent-blue: #2563eb;   /* 藍色 */
    --border-color: #334155;  /* 邊框色 */
    
    --spacing-container: 1280px;
    --nav-height: 80px;
    --whatsapp-green: #25D366;
}

/* --- 2. 基礎重置與全域樣式 --- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, "Microsoft JhengHei", "微軟正黑體", sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    line-height: 1.6;
    scroll-behavior: smooth; /* 平滑滾動 */
    
    /* --- 防抄襲保護：禁止選取文字 --- */
    -webkit-user-select: none; /* Safari */
    -moz-user-select: none;    /* Firefox */
    -ms-user-select: none;     /* IE10+/Edge */
    user-select: none;         /* Standard */
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.3s;
}

ul {
    list-style: none;
}

/* 允許表單輸入框被選取，否則用戶無法輸入 */
input, textarea {
    -webkit-user-select: auto;
    user-select: auto;
}

/* --- 3. 通用工具類 (Utilities) --- */
.container {
    max-width: var(--spacing-container);
    margin: 0 auto;
    padding: 0 1.5rem;
}

.hidden {
    display: none !important;
}

.flex {
    display: flex;
}

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

.justify-between {
    justify-content: space-between;
}

.justify-center {
    justify-content: center;
}

.grid {
    display: grid;
    gap: 2rem;
}

/* 標題樣式 */
h1, h2, h3, h4 {
    color: var(--text-title);
    font-weight: 700;
}

.section-title {
    text-align: center;
    margin-bottom: 4rem;
}

.section-subtitle {
    color: var(--accent-cyan);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.875rem;
    font-weight: 600;
    display: block;
    margin-bottom: 0.5rem;
}

.section-heading {
    font-size: 2.25rem;
    margin-bottom: 1rem;
}

.divider {
    width: 5rem;
    height: 0.25rem;
    background: linear-gradient(to right, var(--accent-cyan), var(--accent-blue));
    margin: 0 auto;
    border-radius: 9999px;
}

/* 按鈕樣式 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border-radius: 9999px; /* 藥丸形狀 */
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    font-size: 1rem;
}

.btn-primary {
    background: var(--accent-cyan);
    color: white;
    box-shadow: 0 4px 14px 0 rgba(6, 182, 212, 0.39);
}

.btn-primary:hover {
    background: #0891b2;
    transform: translateY(-2px);
}

.btn-outline {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-main);
}

.btn-outline:hover {
    background: var(--bg-hover);
    color: white;
}

.btn-gradient {
    background: linear-gradient(to right, var(--accent-cyan), var(--accent-blue));
    color: white;
    box-shadow: 0 4px 14px 0 rgba(37, 99, 235, 0.3);
}

.btn-gradient:hover {
    opacity: 0.9;
    transform: translateY(-2px);
}

.btn-block {
    width: 100%;
    border-radius: 0.5rem;
    padding: 1rem;
}

/* --- 4. 導航欄 (Navigation) --- */
.navbar {
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 50;
    background-color: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    height: var(--nav-height);
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
}

.logo {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(to top right, var(--accent-cyan), var(--accent-blue));
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    margin-right: 0.75rem;
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(to right, #fff, #94a3b8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.desktop-menu {
    display: none;
}

.desktop-menu a {
    margin-left: 2rem;
    font-size: 0.95rem;
    font-weight: 500;
}

.desktop-menu a:hover {
    color: var(--accent-cyan);
}

.mobile-menu-btn {
    background: none;
    border: none;
    color: var(--text-main);
    cursor: pointer;
    display: block;
}

/* 手機選單 */
#mobile-menu {
    background-color: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem;
}

#mobile-menu a {
    display: block;
    padding: 1rem;
    border-radius: 0.375rem;
}

#mobile-menu a:hover {
    background-color: var(--bg-hover);
    color: white;
}

/* --- 5. 首頁 (Hero Section) --- */
.hero {
    position: relative;
    min-height: 100vh;
    padding-top: var(--nav-height);
    display: flex;
    align-items: center;
    overflow: hidden;
}

/* 背景動畫 Blob */
.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.2;
    z-index: -1;
    animation: blob-bounce 7s infinite;
}

.blob-1 { top: -10%; right: -10%; width: 400px; height: 400px; background: var(--accent-blue); }
.blob-2 { top: 10%; left: -5%; width: 400px; height: 400px; background: var(--accent-cyan); animation-delay: 2s; }
.blob-3 { bottom: -5%; left: 10%; width: 400px; height: 400px; background: #9333ea; animation-delay: 4s; }

@keyframes blob-bounce {
    0% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(30px, -50px) scale(1.1); }
    66% { transform: translate(-20px, 20px) scale(0.9); }
    100% { transform: translate(0, 0) scale(1); }
}

.hero-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.hero-text {
    width: 100%;
    text-align: center;
    margin-bottom: 3rem;
}

.badge {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 9999px;
    color: var(--accent-cyan);
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
}

.hero-title {
    font-size: 2.5rem;
    line-height: 1.2;
    margin-bottom: 1.5rem;
}

.gradient-text {
    background: linear-gradient(to right, var(--accent-cyan), var(--accent-blue));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-desc {
    color: #94a3b8;
    font-size: 1.125rem;
    max-width: 600px;
    margin: 0 auto 2rem auto;
}

.hero-buttons {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    justify-content: center;
}

.hero-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-top: 3rem;
    border-top: 1px solid var(--border-color);
    padding-top: 2rem;
}

.stat-value { font-size: 1.875rem; font-weight: 700; color: white; }
.stat-label { font-size: 0.875rem; color: #64748b; }

/* 無人機動畫區塊 (圖片版) */
.hero-visual {
    width: 100%;
    position: relative;
    display: flex;
    justify-content: center;
}

.hero-image-container {
    position: relative;
    width: 100%;
    max-width: 550px;
    perspective: 1000px;
}

.hero-img {
    width: 100%;
    height: auto;
    border-radius: 1.5rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    z-index: 10;
    transition: transform 0.3s;
}

.floating-drone {
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(1deg); }
    100% { transform: translateY(0px) rotate(0deg); }
}

/* --- 6. 課程區塊 (Courses) --- */
.section-padding {
    padding: 5rem 0;
}

.courses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.course-card {
    background: var(--bg-card);
    border-radius: 1rem;
    overflow: hidden;
    border: 1px solid var(--border-color);
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
}

.course-card:hover {
    border-color: var(--accent-cyan);
    transform: translateY(-5px);
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
}

.card-header {
    height: 14rem;
    position: relative;
    overflow: hidden;
}

.card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
    transition: transform 0.5s ease;
}

.course-card:hover .card-img {
    transform: scale(1.05);
}

.card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(15, 23, 42, 0.95), rgba(15, 23, 42, 0.1));
    z-index: 1;
}

.card-title-content {
    position: relative;
    z-index: 10;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 1.5rem;
}

.tag {
    background: rgba(6, 182, 212, 0.9);
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    display: inline-block;
    margin-bottom: 0.5rem;
    align-self: flex-start;
}

.course-title {
    font-size: 1.5rem;
    color: white;
    text-shadow: 0 2px 4px rgba(0,0,0,0.8);
}

.card-body {
    padding: 2rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.price-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 1.5rem;
}

.price-label { font-size: 0.875rem; color: #94a3b8; }
.duration { font-weight: 500; color: white; }
.price { font-size: 1.5rem; font-weight: 700; color: var(--accent-cyan); }

.description { font-size: 0.875rem; color: #94a3b8; margin-bottom: 1.5rem; line-height: 1.6; }

.feature-list { margin-bottom: 2rem; flex: 1; }
.feature-item {
    display: flex;
    align-items: center;
    font-size: 0.875rem;
    color: #cbd5e1;
    margin-bottom: 0.75rem;
}

.feature-item svg { margin-right: 0.75rem; color: var(--accent-cyan); }

/* --- 7. Timeline (課程大綱) --- */
.timeline-container {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
}

.timeline-line {
    position: absolute;
    left: 24px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border-color);
}

.timeline-item {
    position: relative;
    padding-left: 60px;
    margin-bottom: 2.5rem;
}

.timeline-marker {
    position: absolute;
    left: 16px;
    top: 0;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--accent-cyan);
    border: 4px solid var(--bg-dark);
    box-shadow: 0 0 0 2px var(--accent-cyan);
}

.timeline-content {
    background: var(--bg-card);
    padding: 1.5rem;
    border-radius: 0.75rem;
    border: 1px solid var(--border-color);
}

.timeline-title {
    font-size: 1.125rem;
    margin-bottom: 0.5rem;
    color: white;
    font-weight: 600;
}

.timeline-desc {
    font-size: 0.9rem;
    color: #94a3b8;
}

/* --- 8. Clients & Cases (合作夥伴) --- */
.clients-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 2rem;
    align-items: center;
    justify-items: center;
    opacity: 0.7;
}

.client-logo {
    font-size: 1.1rem;
    color: white;
    font-weight: 600;
    border: 1px solid var(--border-color);
    padding: 1rem 2rem;
    border-radius: 0.5rem;
    width: 100%;
    text-align: center;
    background: var(--bg-card);
}

/* --- 9. News & Blog (行業資訊) --- */
.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.news-card {
    background: var(--bg-card);
    border-radius: 0.75rem;
    overflow: hidden;
    border: 1px solid var(--border-color);
    transition: all 0.3s;
}

.news-card:hover {
    border-color: var(--accent-cyan);
    transform: translateY(-3px);
}

.news-content {
    padding: 1.5rem;
}

.news-date {
    font-size: 0.75rem;
    color: var(--accent-cyan);
    margin-bottom: 0.5rem;
    display: block;
}

.news-title {
    font-size: 1.1rem;
    color: white;
    margin-bottom: 0.75rem;
    line-height: 1.4;
}

.news-excerpt {
    font-size: 0.875rem;
    color: #94a3b8;
}

/* --- 10. FAQ (常見問題) --- */
.faq-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    max-width: 900px;
    margin: 0 auto;
}

.faq-item {
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    background: var(--bg-card);
    overflow: hidden;
    transition: all 0.3s;
}

.faq-item:hover {
    border-color: var(--accent-cyan);
}

.faq-summary {
    padding: 1.5rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    list-style: none;
    font-weight: 600;
    color: white;
}

.faq-summary::-webkit-details-marker {
    display: none;
}

.faq-summary:after {
    content: '+';
    font-size: 1.5rem;
    color: var(--accent-cyan);
    transition: transform 0.3s;
}

details[open] .faq-summary:after {
    transform: rotate(45deg);
}

.faq-content {
    padding: 0 1.5rem 1.5rem 1.5rem;
    color: #94a3b8;
    line-height: 1.6;
    border-top: 1px solid transparent;
}

details[open] .faq-content {
    border-top-color: var(--border-color);
    padding-top: 1rem;
}

/* --- 12. 關於我們 (About) --- */
.about-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 4rem;
    align-items: center;
}

.info-card {
    background: #334155;
    padding: 0.75rem;
    border-radius: 0.5rem;
    margin-right: 1rem;
}

.feature-box {
    display: flex;
    align-items: flex-start;
    margin-bottom: 1.5rem;
}

.reviews-container {
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    padding: 2rem;
    position: relative;
}

.review-card {
    background: var(--bg-card);
    padding: 1rem;
    border-radius: 0.5rem;
    border: 1px solid var(--border-color);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
}

/* --- 13. 聯絡表單 (Contact) --- */
.contact-wrapper {
    background: var(--bg-card);
    border-radius: 1.5rem;
    border: 1px solid var(--border-color);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.contact-info {
    background: linear-gradient(to bottom right, #0891b2, #1d4ed8);
    padding: 2.5rem;
    color: white;
}

.contact-item {
    display: flex;
    align-items: center;
    margin-bottom: 1.5rem;
}

.contact-item svg {
    margin-right: 1rem;
    opacity: 0.8;
}

.social-links {
    display: flex;
    gap: 1rem;
    margin-top: 3rem;
}

.social-btn {
    background: rgba(255,255,255,0.1);
    padding: 0.5rem;
    border-radius: 50%;
    display: flex;
    transition: background 0.3s;
}

.social-btn:hover {
    background: rgba(255,255,255,0.2);
}

.form-container {
    padding: 2.5rem;
    flex: 1;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: #94a3b8;
    margin-bottom: 0.5rem;
}

.form-input, .form-select, .form-textarea {
    width: 100%;
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    color: white;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.3s;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
    border-color: var(--accent-cyan);
}

.form-textarea {
    height: 8rem;
    resize: none;
}

/* 支付方式選擇 */
.payment-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.payment-radio {
    display: none; /* 隱藏原生 radio */
}

.payment-card {
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    border-radius: 0.5rem;
    padding: 1rem;
    cursor: pointer;
    text-align: center;
    transition: all 0.3s;
}

.payment-card:hover {
    background: var(--bg-hover);
}

/* 選中狀態 - 利用 :checked + label 的技巧 */
.payment-radio:checked + .payment-card {
    border-color: var(--accent-cyan);
    background: rgba(51, 65, 85, 0.5);
}

.payment-title {
    font-weight: 500;
    color: white;
    margin-bottom: 0.25rem;
}

.payment-desc {
    font-size: 0.75rem;
    color: #94a3b8;
}

/* PayPal 模擬按鈕 */
.mock-paypal-btn {
    background-color: #FFC439;
    color: #003087;
    font-weight: bold;
    font-style: italic;
    width: 100%;
    padding: 0.75rem;
    border-radius: 9999px;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.mock-paypal-btn:hover {
    background-color: #F4BB37;
}

/* --- 14. 頁腳 (Footer) --- */
.footer {
    background-color: #020617;
    padding: 3rem 0;
    border-top: 1px solid var(--border-color);
    font-size: 0.875rem;
    color: #94a3b8;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-links li {
    margin-bottom: 0.5rem;
}

.footer-links a:hover {
    color: var(--accent-cyan);
}

.footer-bottom {
    border-top: 1px solid #1e293b;
    padding-top: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
}

/* WhatsApp Button */
.whatsapp-float {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 60px;
    height: 60px;
    background-color: var(--whatsapp-green);
    color: #fff;
    border-radius: 50%;
    text-align: center;
    font-size: 30px;
    box-shadow: 2px 2px 3px #999;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.whatsapp-float:hover {
    transform: scale(1.1);
    box-shadow: 2px 2px 10px #666;
}

/* --- 15. 響應式設計 (Responsive) --- */
@media (min-width: 768px) {
    .mobile-menu-btn {
        display: none;
    }
    .desktop-menu {
        display: flex;
    }
    
    .hero-content {
        flex-direction: row;
        text-align: left;
    }
    .hero-text {
        text-align: left;
        width: 50%;
        margin-bottom: 0;
        padding-right: 2rem;
    }
    .hero-buttons {
        flex-direction: row;
        justify-content: flex-start;
    }
    .md-w-half {
        width: 50%;
    }
    
    .courses-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .about-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .contact-wrapper {
        flex-direction: row;
    }
    .contact-info {
        width: 40%;
    }
    
    .footer-grid {
        grid-template-columns: 2fr 1fr 1fr;
    }
    .footer-bottom {
        flex-direction: row;
        justify-content: space-between;
    }
}