/**
 * 學經歷頁面專屬樣式
 * Background Page Specific Styles
 * 
 * 設計理念：
 * - 專業學術風格與現代設計結合
 * - 清晰的資訊層級架構
 * - 優雅的動畫效果
 * - 完整的響應式設計
 */

/* ========================================
   1. 頁面標題區域
   ======================================== */
.page-header {
    background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
    padding: 80px 0 60px;
    position: relative;
    overflow: hidden;
}

.page-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1440 320"><path fill="%23ffffff" fill-opacity="0.05" d="M0,96L48,112C96,128,192,160,288,165.3C384,171,480,149,576,144C672,139,768,149,864,165.3C960,181,1056,203,1152,197.3C1248,192,1344,160,1392,144L1440,128L1440,320L1392,320C1344,320,1248,320,1152,320C1056,320,960,320,864,320C768,320,672,320,576,320C480,320,384,320,288,320C192,320,96,320,48,320L0,320Z"></path></svg>') no-repeat bottom;
    background-size: cover;
}

.page-header .container {
    position: relative;
    z-index: 1;
}

.page-title {
    font-size: 3rem;
    font-weight: 700;
    color: white;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
    animation: fadeInUp 0.8s ease;
}

.page-subtitle {
    font-size: 1.25rem;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 300;
    animation: fadeInUp 1s ease;
}

/* ========================================
   2. 學歷區塊
   ======================================== */
.education-section {
    padding: 80px 0;
    background: #f8fafc;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: #1e293b;
    text-align: center;
    margin-bottom: 3rem;
    position: relative;
    padding-bottom: 1rem;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, #3b82f6 0%, #1e3a8a 100%);
    border-radius: 2px;
}

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

.education-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    position: relative;
}

.education-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #3b82f6 0%, #1e3a8a 100%);
}

.education-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

.education-card.phd::before {
    background: linear-gradient(90deg, #dc2626 0%, #991b1b 100%);
}

.education-card.masters::before {
    background: linear-gradient(90deg, #f59e0b 0%, #d97706 100%);
}

.education-card.bachelors::before {
    background: linear-gradient(90deg, #10b981 0%, #059669 100%);
}

.card-header {
    padding: 2rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
}

.degree-icon {
    font-size: 3rem;
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.degree-info h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 0.5rem;
}

.degree-info .institution {
    font-size: 1rem;
    color: #64748b;
    font-weight: 500;
}

.card-content {
    padding: 2rem;
}

.degree-detail {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e2e8f0;
}

.degree-detail:last-child {
    border-bottom: none;
}

.degree-detail strong {
    color: #475569;
    font-weight: 600;
    display: inline-block;
    margin-bottom: 0.5rem;
}

.research-focus,
.academic-achievements,
.undergraduate-highlights {
    margin-top: 1.5rem;
}

.research-focus h4,
.academic-achievements h4,
.undergraduate-highlights h4 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 1rem;
}

.research-focus ul,
.academic-achievements ul,
.undergraduate-highlights ul {
    list-style: none;
    padding: 0;
}

.research-focus li,
.academic-achievements li,
.undergraduate-highlights li {
    position: relative;
    padding-left: 2rem;
    margin-bottom: 0.75rem;
    color: #475569;
    line-height: 1.6;
}

.research-focus li::before,
.academic-achievements li::before,
.undergraduate-highlights li::before {
    content: '✓';
    position: absolute;
    left: 0;
    top: 0;
    color: #3b82f6;
    font-weight: bold;
    font-size: 1.2rem;
}

/* ========================================
   3. 現職區塊
   ======================================== */
.current-position {
    padding: 80px 0;
    background: white;
}

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

.position-card {
    background: linear-gradient(135deg, #f8fafc 0%, white 100%);
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 2rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.position-card.primary-position {
    border: 2px solid #3b82f6;
    background: linear-gradient(135deg, #eff6ff 0%, white 100%);
}

.position-card::before {
    content: '';
    position: absolute;
    top: -100%;
    left: -100%;
    width: 300%;
    height: 300%;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.1) 0%, transparent 70%);
    transition: all 0.5s ease;
}

.position-card:hover::before {
    top: -150%;
    left: -150%;
}

.position-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
}

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

.position-icon {
    font-size: 2.5rem;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.position-info h3 {
    font-size: 1.4rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 0.5rem;
}

.position-info .organization {
    font-size: 1rem;
    color: #64748b;
    font-weight: 500;
}

.position-responsibilities h4 {
    font-size: 1rem;
    font-weight: 600;
    color: #475569;
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.position-responsibilities p {
    color: #64748b;
    line-height: 1.8;
    margin-bottom: 1rem;
}

/* 專業組織職位 */
.professional-roles {
    margin-top: 4rem;
    padding: 3rem;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border-radius: 20px;
}

.professional-roles h3 {
    font-size: 1.8rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 2rem;
    text-align: center;
}

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

.role-item {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1.5rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.role-item:hover {
    transform: translateX(8px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
}

.role-icon {
    font-size: 2rem;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #3b82f6 0%, #1e3a8a 100%);
    border-radius: 10px;
    flex-shrink: 0;
}

.role-content h4 {
    font-size: 1.2rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.25rem;
}

.role-content p {
    font-size: 0.95rem;
    color: #64748b;
}

/* ========================================
   4. 經歷時間軸
   ======================================== */
.career-timeline {
    padding: 80px 0;
    background: linear-gradient(180deg, #f8fafc 0%, white 100%);
}

.timeline-container {
    position: relative;
    max-width: 1000px;
    margin: 0 auto;
    padding: 2rem 0;
}

.timeline-line {
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(180deg, #3b82f6 0%, #1e3a8a 100%);
    transform: translateX(-50%);
}

.timeline-item {
    position: relative;
    margin-bottom: 4rem;
    opacity: 0;
    animation: fadeInScale 0.6s ease forwards;
}

.timeline-item:nth-child(odd) {
    padding-right: calc(50% + 40px);
    text-align: right;
}

.timeline-item:nth-child(even) {
    padding-left: calc(50% + 40px);
    text-align: left;
}

.timeline-item:nth-child(2) { animation-delay: 0.2s; }
.timeline-item:nth-child(3) { animation-delay: 0.4s; }
.timeline-item:nth-child(4) { animation-delay: 0.6s; }
.timeline-item:nth-child(5) { animation-delay: 0.8s; }
.timeline-item:nth-child(6) { animation-delay: 1s; }

.timeline-marker {
    position: absolute;
    left: 50%;
    top: 0;
    transform: translateX(-50%);
    width: 50px;
    height: 50px;
    background: white;
    border: 4px solid #3b82f6;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.timeline-item.current .timeline-marker {
    background: #3b82f6;
    border-color: #1e3a8a;
    animation: pulse 2s infinite;
}

.timeline-item.highlight .timeline-marker {
    background: #fbbf24 !important;
    border-color: #f59e0b !important;
    box-shadow: 0 0 15px rgba(251, 191, 36, 0.5) !important;
}

.timeline-marker .year {
    font-size: 0.85rem;
    font-weight: 700;
    color: #1e293b;
}

.timeline-item.current .timeline-marker .year {
    color: white;
}

.timeline-content {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    position: relative;
    transition: all 0.3s ease;
}

.timeline-content:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

.timeline-item:nth-child(odd) .timeline-content::after {
    content: '';
    position: absolute;
    right: -20px;
    top: 15px;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 10px 0 10px 20px;
    border-color: transparent transparent transparent white;
}

.timeline-item:nth-child(even) .timeline-content::after {
    content: '';
    position: absolute;
    left: -20px;
    top: 15px;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 10px 20px 10px 0;
    border-color: transparent white transparent transparent;
}

.timeline-content h3 {
    font-size: 1.4rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 0.5rem;
}

.timeline-content .position {
    font-size: 1.1rem;
    color: #3b82f6;
    font-weight: 500;
    margin-bottom: 1rem;
}

.timeline-details {
    color: #64748b;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.timeline-details .achievements {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e2e8f0;
}

.timeline-details .achievements h4 {
    font-size: 1rem;
    font-weight: 600;
    color: #475569;
    margin-bottom: 0.5rem;
}

.timeline-duration {
    font-size: 0.9rem;
    color: #94a3b8;
    font-weight: 500;
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: #f1f5f9;
    border-radius: 20px;
    margin-top: 0.5rem;
}

/* ========================================
   5. 專業認證區塊
   ======================================== */
.certifications-section {
    padding: 80px 0;
    background: white;
}

.certifications-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 3rem;
    margin-top: 3rem;
}

.cert-category {
    background: linear-gradient(135deg, #f8fafc 0%, white 100%);
    border-radius: 16px;
    padding: 2.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.cert-category:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.cert-category h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e2e8f0;
    position: relative;
}

.cert-category h3::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 60px;
    height: 2px;
    background: linear-gradient(90deg, #3b82f6 0%, #1e3a8a 100%);
}

.cert-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.cert-item {
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
    padding: 1.5rem;
    background: white;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    transition: all 0.3s ease;
}

.cert-item:hover {
    border-color: #3b82f6;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
    transform: translateX(4px);
}

.cert-icon {
    font-size: 1.8rem;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border-radius: 10px;
    flex-shrink: 0;
}

.cert-content h4 {
    font-size: 1.15rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.5rem;
}

.cert-content p {
    font-size: 0.95rem;
    color: #64748b;
    line-height: 1.5;
}

/* ========================================
   6. 動畫效果
   ======================================== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.7);
    }
    50% {
        box-shadow: 0 0 0 15px rgba(59, 130, 246, 0);
    }
}

/* 滾動觸發動畫 */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease;
}

.animate-on-scroll.animated {
    opacity: 1;
    transform: translateY(0);
}

/* ========================================
   7. 響應式設計
   ======================================== */
@media (max-width: 1024px) {
    .education-grid,
    .positions-grid {
        grid-template-columns: 1fr;
    }
    
    .timeline-container {
        padding-left: 40px;
    }
    
    .timeline-line {
        left: 20px;
    }
    
    .timeline-item {
        padding-left: 80px !important;
        padding-right: 0 !important;
        text-align: left !important;
    }
    
    .timeline-marker {
        left: 20px !important;
    }
    
    .timeline-item .timeline-content::after {
        left: -20px !important;
        right: auto !important;
        border-width: 10px 20px 10px 0 !important;
        border-color: transparent white transparent transparent !important;
    }
}

@media (max-width: 768px) {
    .page-title {
        font-size: 2rem;
    }
    
    .section-title {
        font-size: 1.8rem;
    }
    
    .education-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .card-header {
        flex-direction: column;
        text-align: center;
    }
    
    .professional-roles {
        padding: 2rem 1.5rem;
    }
    
    .roles-grid {
        grid-template-columns: 1fr;
    }
    
    .certifications-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .timeline-container {
        padding-left: 30px;
    }
    
    .timeline-item {
        padding-left: 60px !important;
        margin-bottom: 3rem;
    }
    
    .timeline-content {
        padding: 1.5rem;
    }
}

@media (max-width: 480px) {
    .page-header {
        padding: 60px 0 40px;
    }
    
    .page-title {
        font-size: 1.5rem;
    }
    
    .page-subtitle {
        font-size: 1rem;
    }
    
    .section-title {
        font-size: 1.5rem;
        margin-bottom: 2rem;
    }
    
    .education-section,
    .current-position,
    .career-timeline,
    .certifications-section {
        padding: 60px 0;
    }
    
    .degree-icon {
        width: 60px;
        height: 60px;
        font-size: 2rem;
    }
    
    .position-card {
        padding: 1.5rem;
    }
    
    .timeline-marker {
        width: 40px;
        height: 40px;
    }
    
    .timeline-marker .year {
        font-size: 0.75rem;
    }
    
    .cert-category {
        padding: 1.5rem;
    }
}

/* ========================================
   8. 列印樣式
   ======================================== */
@media print {
    .page-header {
        background: none;
        padding: 20px 0;
    }
    
    .page-title,
    .page-subtitle {
        color: #1e293b;
    }
    
    .education-card,
    .position-card,
    .timeline-content,
    .cert-category {
        box-shadow: none;
        border: 1px solid #e2e8f0;
    }
    
    .timeline-line {
        background: #e2e8f0;
    }
    
    @page {
        margin: 2cm;
    }
}

/* ========================================
   9. 深色模式支援（預留）
   ======================================== */
@media (prefers-color-scheme: dark) {
    /* 深色模式樣式可在此處添加 */
}

/* ========================================
   10. 無障礙優化
   ======================================== */
.education-card:focus-within,
.position-card:focus-within,
.timeline-content:focus-within,
.cert-item:focus-within {
    outline: 3px solid #3b82f6;
    outline-offset: 2px;
}

/* 高對比度模式 */
@media (prefers-contrast: high) {
    .page-header {
        background: #1e293b;
    }
    
    .education-card,
    .position-card,
    .timeline-content {
        border: 2px solid #1e293b;
    }
}

/* 減少動畫模式 */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ========================================
   11. 職涯時間軸附件樣式
   ======================================== */
.timeline-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    gap: 1rem;
}

.timeline-header h3 {
    flex: 1;
    margin: 0;
}

.timeline-attachments-count {
    flex-shrink: 0;
    align-self: center;
}

.attachments-count {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.attachment-count-item {
    display: inline-flex;
    align-items: center;
    background: #e3f2fd;
    color: #1976d2;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    white-space: nowrap;
    border: 1px solid #bbdefb;
}

.attachment-count-item:hover {
    background: #bbdefb;
    cursor: default;
}

/* 附件區塊樣式 */
.timeline-details .attachments,
.position-responsibilities .attachments {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e5e7eb;
}

.attachment-links {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.attachment-item {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.attachment-item:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.attachment-link {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    text-decoration: none;
    color: #374151;
    gap: 0.75rem;
}

.attachment-link:hover {
    color: #1f2937;
}

.attachment-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.attachment-title {
    font-weight: 500;
    flex: 1;
}

.attachment-size,
.external-indicator {
    font-size: 0.875rem;
    color: #6b7280;
    flex-shrink: 0;
}

/* 響應式設計 - 附件部分 */
@media (max-width: 768px) {
    .timeline-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .timeline-attachments-count {
        align-self: flex-start;
    }
    
    .attachments-count {
        flex-wrap: wrap;
    }
    
    .attachment-link {
        padding: 0.5rem;
        gap: 0.5rem;
    }
    
    .attachment-title {
        font-size: 0.875rem;
    }
}