/* 下載區塊樣式 */
.downloads-section {
    padding: 60px 0;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.downloads-section .section-title {
    text-align: center;
    font-size: 2.5rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 15px;
}

.downloads-section .section-subtitle {
    text-align: center;
    font-size: 1.2rem;
    color: #6c757d;
    margin-bottom: 40px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* 分類篩選 */
.downloads-categories {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 40px;
}

.downloads-categories .category-btn {
    padding: 10px 20px;
    border: 2px solid #dee2e6;
    background: white;
    color: #6c757d;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    font-size: 0.9rem;
}

.downloads-categories .category-btn:hover {
    border-color: #007bff;
    color: #007bff;
    transform: translateY(-2px);
}

.downloads-categories .category-btn.active {
    background: #007bff;
    border-color: #007bff;
    color: white;
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}

/* 下載容器 */
.downloads-container {
    display: grid;
    gap: 25px;
    margin-bottom: 40px;
}

.downloads-container.downloads-grid.columns-2 {
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
}

.downloads-container.downloads-grid.columns-3 {
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
}

.downloads-container.downloads-grid.columns-4 {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.downloads-container.downloads-list {
    grid-template-columns: 1fr;
    max-width: 800px;
    margin: 0 auto;
}

.downloads-container.downloads-card {
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

/* 下載項目 */
.download-item {
    transition: all 0.3s ease;
}

.download-card {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
    border: 1px solid #e9ecef;
}

.download-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    border-color: #007bff;
}

/* 下載標頭 */
.download-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
}

.download-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
    background: linear-gradient(135deg, #007bff, #0056b3);
}

.download-icon .fab.fa-google-drive {
    background: linear-gradient(135deg, #4285f4, #34a853);
}

.download-icon .fas.fa-external-link-alt {
    background: linear-gradient(135deg, #6f42c1, #495057);
}

.download-type {
    text-align: right;
}

.type-badge {
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.type-badge.type-local {
    background: #e3f2fd;
    color: #1976d2;
}

.type-badge.type-google_drive {
    background: #e8f5e8;
    color: #2e7d32;
}

.type-badge.type-external_url {
    background: #f3e5f5;
    color: #7b1fa2;
}

/* 下載內容 */
.download-content {
    flex-grow: 1;
    margin-bottom: 20px;
}

.download-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 10px;
    line-height: 1.3;
}

.download-description {
    color: #6c757d;
    line-height: 1.5;
    margin-bottom: 15px;
    font-size: 0.95rem;
}

.download-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    font-size: 0.85rem;
    color: #6c757d;
}

.download-meta span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.download-meta i {
    color: #007bff;
    width: 12px;
}

/* 下載操作 */
.download-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: flex-end;
}

.download-actions .btn {
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.download-actions .btn-primary {
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
}

.download-actions .btn-primary:hover {
    background: linear-gradient(135deg, #0056b3, #004085);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.4);
}

.download-actions .btn-outline-primary {
    background: transparent;
    color: #007bff;
    border: 1px solid #007bff;
}

.download-actions .btn-outline-primary:hover {
    background: #007bff;
    color: white;
}

.download-actions .btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
}

/* 下載提示 */
.downloads-note {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    border-left: 4px solid #007bff;
}

.downloads-note .note-content {
    display: flex;
    align-items: center;
    gap: 15px;
    color: #6c757d;
}

.downloads-note i {
    color: #007bff;
    font-size: 1.2rem;
}

/* 空狀態 */
.no-downloads {
    text-align: center;
    padding: 60px 20px;
}

.no-downloads .empty-state {
    max-width: 400px;
    margin: 0 auto;
}

.no-downloads .empty-state i {
    font-size: 4rem;
    color: #dee2e6;
    margin-bottom: 20px;
}

.no-downloads .empty-state h3 {
    color: #6c757d;
    margin-bottom: 15px;
}

.no-downloads .empty-state p {
    color: #adb5bd;
    margin-bottom: 25px;
    line-height: 1.6;
}

/* 列表佈局特殊樣式 */
.downloads-container.downloads-list .download-card {
    padding: 20px 25px;
}

.downloads-container.downloads-list .download-header {
    margin-bottom: 0;
}

.downloads-container.downloads-list .download-content {
    margin-bottom: 0;
}

.downloads-container.downloads-list .download-card {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 20px;
    align-items: center;
}

.downloads-container.downloads-list .download-title {
    font-size: 1.1rem;
    margin-bottom: 5px;
}

.downloads-container.downloads-list .download-description {
    margin-bottom: 0;
    font-size: 0.9rem;
}

.downloads-container.downloads-list .download-meta {
    margin-top: 8px;
}

/* 響應式設計 */
@media (max-width: 768px) {
    .downloads-section {
        padding: 40px 0;
    }
    
    .downloads-section .section-title {
        font-size: 2rem;
    }
    
    .downloads-container {
        grid-template-columns: 1fr !important;
        gap: 20px;
    }
    
    .downloads-categories {
        justify-content: flex-start;
        overflow-x: auto;
        padding-bottom: 10px;
    }
    
    .downloads-categories .category-btn {
        white-space: nowrap;
        flex-shrink: 0;
    }
    
    .download-header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }
    
    .download-type {
        text-align: left;
    }
    
    .download-actions {
        flex-direction: column;
        align-items: stretch;
    }
    
    .download-actions .btn {
        justify-content: center;
    }
    
    .downloads-container.downloads-list .download-card {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .downloads-container.downloads-list .download-actions {
        justify-content: flex-start;
    }
    
    .download-meta {
        flex-direction: column;
        gap: 8px;
    }
}

@media (max-width: 480px) {
    .download-card {
        padding: 20px;
    }
    
    .downloads-section .section-title {
        font-size: 1.8rem;
    }
    
    .downloads-section .section-subtitle {
        font-size: 1rem;
    }
    
    .download-title {
        font-size: 1.2rem;
    }
    
    .downloads-note {
        padding: 15px;
    }
    
    .downloads-note .note-content {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
}

/* 動畫效果 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.download-item {
    animation: fadeInUp 0.6s ease forwards;
}

.download-item:nth-child(1) { animation-delay: 0.1s; }
.download-item:nth-child(2) { animation-delay: 0.2s; }
.download-item:nth-child(3) { animation-delay: 0.3s; }
.download-item:nth-child(4) { animation-delay: 0.4s; }
.download-item:nth-child(5) { animation-delay: 0.5s; }
.download-item:nth-child(6) { animation-delay: 0.6s; }

/* 載入動畫 */
.download-card.loading {
    opacity: 0.7;
    pointer-events: none;
}

.download-card.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    transform: translate(-50%, -50%);
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
} 