/* 教育訓練頁面樣式 */

/* Hero Section */
.training-hero {
    background: linear-gradient(135deg, 
        rgba(26, 26, 46, 0.95) 0%, 
        rgba(10, 10, 10, 0.9) 50%, 
        rgba(67, 56, 202, 0.8) 100%),
        url('../img/backgrounds/hero-background.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    padding: 120px 0;
    text-align: center;
    color: #fff;
    position: relative;
    overflow: hidden;
}

.training-hero::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 30% 20%, 
        rgba(99, 102, 241, 0.3) 0%, 
        transparent 50%),
        radial-gradient(circle at 70% 80%, 
        rgba(139, 92, 246, 0.2) 0%, 
        transparent 50%);
    z-index: 1;
    animation: shimmer 8s ease-in-out infinite;
}

.training-hero-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
    margin: 0 auto;
    padding: 0 2rem;
}

.training-icon {
    font-size: 4rem;
    margin-bottom: 2rem;
    animation: float 3s ease-in-out infinite;
}

.training-hero h1 {
    font-size: 4rem;
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, 
        #ffffff 0%, 
        #e0e7ff 50%, 
        #c7d2fe 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 800;
    letter-spacing: -0.02em;
    text-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.training-subtitle {
    font-size: 1.4rem;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 3rem;
    line-height: 1.7;
    font-weight: 300;
}

.training-stats {
    display: flex;
    justify-content: center;
    gap: 3rem;
    margin-top: 3rem;
}

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

.stat-number {
    display: block;
    font-size: 2.5rem;
    font-weight: 700;
    color: #ffffff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.stat-label {
    display: block;
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.8);
    margin-top: 0.5rem;
}

/* 課程列表 */
.courses-section {
    padding: 80px 0;
    background: #1a1a2e;
}

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

.section-header h2 {
    font-size: 2.5rem;
    color: #ffffff;
    margin-bottom: 1rem;
    font-weight: 700;
}

.section-header p {
    font-size: 1.2rem;
    color: #a0aec0;
    max-width: 600px;
    margin: 0 auto;
}

/* 類別區塊 */
.category-section {
    margin-bottom: 4rem;
}

.category-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #4a5568;
}

.category-title {
    font-size: 1.8rem;
    color: #ffffff;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.category-title i {
    color: #6366f1;
}

.category-count {
    background: #6366f1;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
}

/* 產品網格 */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.product-card {
    background: #2d3748;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    border: 1px solid #4a5568;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.4);
    border-color: #6366f1;
}

.product-header {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.product-icon {
    font-size: 2.5rem;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    border-radius: 12px;
    color: white;
    flex-shrink: 0;
}

.product-icon img {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

.product-info h3 {
    font-size: 1.5rem;
    color: #ffffff;
    margin: 0 0 0.5rem 0;
    font-weight: 700;
}

.product-description {
    color: #e2e8f0 !important;
    margin: 0;
    line-height: 1.6;
    font-weight: 500 !important;
    font-size: 1.1rem !important;
}

.course-stats {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: #4a5568;
    border-radius: 8px;
}

.stat {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #e2e8f0;
    font-size: 0.9rem;
    font-weight: 500;
}

.stat i {
    color: #6366f1;
}

.modules-list {
    margin-bottom: 2rem;
}

.module-item {
    margin-bottom: 1rem;
    padding: 1rem;
    background: #4a5568;
    border-radius: 8px;
    border-left: 4px solid #6366f1;
}

.module-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.module-header h4 {
    font-size: 1.1rem;
    color: #ffffff;
    margin: 0;
    font-weight: 600;
}

.lesson-count {
    background: #6366f1;
    color: white;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
}

.lessons-preview {
    margin-top: 0.5rem;
}

.lesson-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0;
    color: #e2e8f0;
    font-size: 0.9rem;
    font-weight: 500;
}

.lesson-item i {
    color: #6366f1;
    font-size: 0.8rem;
}

.lesson-title {
    flex: 1;
}

.lesson-duration {
    background: #4a5568;
    color: #e2e8f0;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
}

.more-lessons {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0;
    color: #a0aec0;
    font-size: 0.9rem;
    font-style: italic;
    font-weight: 500;
}

.product-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

/* 其他產品區塊 */
.other-products-section {
    padding: 60px 0;
    background: #1a1a2e;
}

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

.other-product-card {
    background: #2d3748;
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    border: 2px dashed #4a5568;
    transition: all 0.3s ease;
}

.other-product-card:hover {
    border-color: #6366f1;
    background: #4a5568;
}

.other-product-card .product-icon {
    margin: 0 auto 1rem;
    background: #4a5568;
    color: #a0aec0;
}

.other-product-card h3 {
    font-size: 1.3rem;
    color: #ffffff;
    margin: 0 0 1rem 0;
    font-weight: 600;
}

.other-product-card p {
    color: #e2e8f0 !important;
    margin: 0 0 1.5rem 0;
    line-height: 1.6;
    font-weight: 500 !important;
    font-size: 1.1rem !important;
}

.other-product-card .product-actions {
    justify-content: center;
}

/* 學習指南 */
.learning-guide {
    padding: 80px 0;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
}

.guide-content h2 {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 3rem;
    font-weight: 700;
}

.guide-steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    max-width: 1000px;
    margin: 0 auto;
}

.step {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.step-number {
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    flex-shrink: 0;
}

.step-content h3 {
    font-size: 1.3rem;
    margin: 0 0 0.5rem 0;
    font-weight: 600;
}

.step-content p {
    margin: 0;
    opacity: 0.9;
    line-height: 1.6;
}

/* 無課程狀態 */
.no-courses {
    text-align: center;
    padding: 4rem 2rem;
}

.no-courses-content {
    max-width: 500px;
    margin: 0 auto;
}

.no-courses-content i {
    font-size: 4rem;
    color: #cbd5e1;
    margin-bottom: 1.5rem;
}

.no-courses-content h3 {
    font-size: 1.8rem;
    color: #ffffff;
    margin: 0 0 1rem 0;
    font-weight: 600;
}

.no-courses-content p {
    color: #e2e8f0;
    margin: 0 0 2rem 0;
    line-height: 1.6;
    font-weight: 500;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 0;
    border-radius: 16px;
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.modal-header {
    padding: 2rem 2rem 1rem;
    border-bottom: 1px solid #e2e8f0;
}

.modal-header h2 {
    font-size: 1.8rem;
    color: #1a1a2e;
    margin: 0 0 0.5rem 0;
    font-weight: 700;
}

.modal-header p {
    color: #374151;
    margin: 0;
    font-weight: 500;
}

.modal-body {
    padding: 2rem;
}

.close-button {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    font-size: 2rem;
    font-weight: bold;
    color: #94a3b8;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close-button:hover {
    color: #64748b;
}

.modal-module {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: #f8fafc;
    border-radius: 12px;
    border-left: 4px solid #6366f1;
}

.modal-module h3 {
    font-size: 1.3rem;
    color: #1a1a2e;
    margin: 0 0 1rem 0;
    font-weight: 600;
}

.modal-lessons {
    display: grid;
    gap: 0.5rem;
}

.modal-lesson {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: white;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    transition: all 0.3s ease;
}

.modal-lesson:hover {
    border-color: #6366f1;
    background: #f8fafc;
}

.modal-lesson i {
    color: #6366f1;
    font-size: 1rem;
}

.modal-lesson .lesson-title {
    flex: 1;
    color: #1a1a2e;
    font-weight: 500;
}

.modal-lesson .lesson-duration {
    background: #e2e8f0;
    color: #374151;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
}

/* 響應式設計 */
@media (max-width: 768px) {
    .training-hero {
        padding: 80px 0;
        background-attachment: scroll;
    }
    
    .training-hero h1 {
        font-size: 2.5rem;
    }
    
    .training-subtitle {
        font-size: 1.2rem;
    }
    
    .training-stats {
        flex-direction: column;
        gap: 1.5rem;
    }
    
    .products-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .product-card {
        padding: 1.5rem;
    }
    
    .product-header {
        flex-direction: column;
        text-align: center;
    }
    
    .product-icon {
        margin: 0 auto;
    }
    
    .course-stats {
        justify-content: center;
    }
    
    .product-actions {
        flex-direction: column;
    }
    
    .other-products-grid {
        grid-template-columns: 1fr;
    }
    
    .guide-steps {
        grid-template-columns: 1fr;
    }
    
    .step {
        flex-direction: column;
        text-align: center;
    }
    
    .modal-content {
        width: 95%;
        margin: 10% auto;
    }
    
    .modal-header,
    .modal-body {
        padding: 1.5rem;
    }
}

@media (max-width: 480px) {
    .training-hero h1 {
        font-size: 2rem;
    }
    
    .section-header h2 {
        font-size: 2rem;
    }
    
    .category-title {
        font-size: 1.5rem;
    }
    
    .product-card {
        padding: 1rem;
    }
    
    .course-stats {
        flex-direction: column;
        gap: 0.5rem;
    }
}

/* 產品選擇區域 */
.product-selection-section {
    padding: 80px 0;
    background: #1a1a2e;
}

/* 麵包屑導航 */
.breadcrumb {
    margin-bottom: 40px;
}

.breadcrumb-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #a0aec0;
    text-decoration: none;
    font-size: 1rem;
    transition: color 0.3s ease;
}

.breadcrumb-link:hover {
    color: #6366f1;
}

.breadcrumb-link i {
    font-size: 0.9rem;
}

/* 選中產品標題區域 */
.selected-product-header {
    background: #2d3748;
    border-radius: 15px;
    padding: 40px;
    margin-bottom: 40px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    border: 1px solid #4a5568;
}

.selected-product-header .product-info {
    display: flex;
    align-items: center;
    gap: 30px;
}

.selected-product-header .product-icon {
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    font-size: 2.5rem;
    color: #fff;
    flex-shrink: 0;
}

.selected-product-header .product-icon img {
    width: 50px;
    height: 50px;
    object-fit: contain;
}

.selected-product-header .product-details h2 {
    font-size: 2.2rem;
    color: #ffffff;
    margin-bottom: 10px;
    font-weight: 700;
}

.selected-product-header .product-description {
    font-size: 1.2rem !important;
    color: #e2e8f0 !important;
    margin-bottom: 20px;
    line-height: 1.6;
    font-weight: 500 !important;
}

.course-summary {
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
}

.summary-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #e2e8f0;
    font-size: 1rem;
    font-weight: 500;
}

.summary-item i {
    color: #6366f1;
    font-size: 1.1rem;
}

/* 模組區域 */
.modules-section {
    margin-top: 40px;
}

.modules-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.module-controls {
    display: flex;
    gap: 1rem;
}

.btn-toggle-all {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: #6366f1;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-toggle-all:hover {
    background: #4f46e5;
    transform: translateY(-1px);
}

.btn-toggle-all i {
    transition: transform 0.3s ease;
}

.btn-toggle-all.collapsed i {
    transform: rotate(-90deg);
}

.modules-section h3 {
    font-size: 1.8rem;
    color: #ffffff;
    margin-bottom: 30px;
    font-weight: 600;
}

.modules-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 30px;
}

.module-card {
    background: #2d3748;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid #4a5568;
}

.module-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    border-color: #6366f1;
}

.module-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    cursor: pointer;
    user-select: none;
    padding: 10px;
    border-radius: 8px;
    transition: background-color 0.3s ease;
}

.module-header:hover {
    background-color: #4a5568;
}

.module-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.module-toggle {
    font-size: 1rem;
    color: #6366f1;
    transition: transform 0.3s ease;
}

.module-toggle.collapsed {
    transform: rotate(-90deg);
}

.module-lessons {
    display: block;
    margin-top: 15px;
}

.module-lessons.collapsed {
    display: none;
}

.module-header h4 {
    font-size: 1.3rem;
    color: #ffffff;
    margin: 0;
    font-weight: 600;
}

.module-lesson-count {
    background: #e3f2fd;
    color: #1976d2;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
}

.module-description {
    color: #e2e8f0;
    margin-bottom: 20px;
    line-height: 1.6;
    font-weight: 500;
}

.lessons-list {
    space-y: 10px;
}

.lesson-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 15px 0;
    border-bottom: 1px solid #4a5568;
    width: 100%;
    min-height: 60px;
}

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

.lesson-info {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.lesson-info i {
    color: #28a745;
    font-size: 1rem;
    margin-top: 2px;
    flex-shrink: 0;
}

.lesson-content {
    flex: 1;
    min-width: 0;
}

.lesson-title {
    color: #ffffff;
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 4px;
    word-wrap: break-word;
    word-break: break-word;
    line-height: 1.4;
    flex: 1;
    min-width: 0;
}

.lesson-description {
    color: #a0aec0;
    font-size: 0.9rem;
    line-height: 1.4;
    margin-top: 4px;
    word-wrap: break-word;
    word-break: break-word;
    flex: 1;
    min-width: 0;
}

.lesson-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    min-width: 200px;
}

.lesson-duration {
    color: #e2e8f0;
    font-size: 0.85rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 4px;
}

.lesson-content-types {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: flex-end;
}

.content-type-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.content-type-badge.youtube {
    background: #ffebee;
    color: #c62828;
    border: 1px solid #ffcdd2;
}

.content-type-badge.attachment {
    background: #e3f2fd;
    color: #1565c0;
    border: 1px solid #bbdefb;
}

.content-type-badge.link {
    background: #f3e5f5;
    color: #7b1fa2;
    border: 1px solid #ce93d8;
}

.content-type-badge:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.content-link {
    color: inherit;
    text-decoration: none;
}

.content-link:hover {
    text-decoration: underline;
}

/* 附件和連結展開/收合樣式 */
.content-toggle {
    cursor: pointer;
    user-select: none;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: all 0.3s ease;
}

.content-toggle:hover {
    opacity: 0.8;
}

.toggle-icon {
    transition: transform 0.3s ease;
    font-size: 0.7rem;
}

.attachments-list,
.links-list {
    margin-top: 8px;
    padding: 8px 0;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
    }
    to {
        opacity: 1;
        max-height: 200px;
    }
}

.attachment-item,
.link-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    transition: background-color 0.2s ease;
}

.attachment-item:last-child,
.link-item:last-child {
    border-bottom: none;
}

.attachment-item:hover,
.link-item:hover {
    background-color: rgba(0, 0, 0, 0.02);
    border-radius: 4px;
    padding-left: 4px;
    padding-right: 4px;
}

.attachment-item i,
.link-item i {
    color: #6b7280;
    font-size: 0.9rem;
    width: 16px;
    text-align: center;
}

.attachment-link,
.link-url {
    color: #2563eb;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    transition: color 0.2s ease;
}

.attachment-link:hover,
.link-url:hover {
    color: #1d4ed8;
    text-decoration: underline;
}

.file-size {
    color: #6b7280;
    font-size: 0.8rem;
    font-weight: 400;
}

.link-description {
    color: #6b7280;
    font-size: 0.8rem;
    font-style: italic;
}

/* 產品卡片點擊效果 */
.product-card {
    cursor: pointer;
    user-select: none;
}

.product-card:active {
    transform: translateY(-2px);
}

/* 響應式設計 - 新增樣式 */
@media (max-width: 768px) {
    .selected-product-header .product-info {
        flex-direction: column;
        text-align: center;
        gap: 20px;
    }
    
    .selected-product-header .product-icon {
        margin: 0 auto;
    }
    
    .course-summary {
        justify-content: center;
    }
    
    .modules-grid {
        grid-template-columns: 1fr;
    }
    
    .module-card {
        padding: 20px;
    }
    
    .lesson-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .lesson-meta {
        width: 100%;
        justify-content: space-between;
    }
}
