/* ============================================================================
   Dashboard 分頁標題統一樣式 - 最終修正版
   ============================================================================ */

/* ============================================================================
   1. 主要標題樣式 - .u-card__header--gradient
   ============================================================================ */

.u-card__header--gradient {
    display: flex !important;
    align-items: center !important;
    gap: 0.75rem !important;
    background: linear-gradient(135deg, #e8f4f8 0%, #f5f9fc 100%) !important;
    padding: 1rem 1.25rem !important;
    border-bottom: 2px solid #d0e8f2 !important;
    border-radius: 12px 12px 0 0 !important;
    margin: 0 !important;
}

.u-card__header--gradient i,
.u-card__header--gradient .u-card__icon {
    font-size: 1.5rem !important;
    color: #2C5F8D !important;
    flex-shrink: 0 !important;
}

.u-card__header--gradient h3,
.u-card__header--gradient .u-card__title {
    margin: 0 !important;
    font-size: 1.25rem !important;
    font-weight: 600 !important;
    color: #2C5F8D !important;
    flex: 1 !important;
}

/* ============================================================================
   2. 子區塊標題 - .u-section-header--gradient
   ============================================================================ */

.u-section-header--gradient {
    display: flex !important;
    align-items: center !important;
    gap: 0.75rem !important;
    background: linear-gradient(135deg, #e8f4f8 0%, #f5f9fc 100%) !important;
    padding: 0.875rem 1.25rem !important;
    border-bottom: 2px solid #d0e8f2 !important;
    margin: 0 !important;
}

.u-section-header--gradient i,
.u-section-header--gradient .u-section-icon {
    font-size: 1.25rem !important;
    color: #2C5F8D !important;
}

.u-section-header--gradient h3,
.u-section-header--gradient h4,
.u-section-header--gradient .u-section-title {
    margin: 0 !important;
    font-size: 1.1rem !important;
    font-weight: 600 !important;
    color: #2C5F8D !important;
}

/* ============================================================================
   3. 上方卡片統一樣式（基本資訊、個人照片）- 標題置中、圓角
   ============================================================================ */

/* 頂部區塊卡片 */
.top-section .card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* 基本資訊和個人照片卡片標題 - 置中 */
.top-section .profile-info-box .u-card__header--gradient,
.top-section .avatar-upload-box .u-card__header--gradient,
.avatar-upload-box .avatar-header {
    justify-content: center !important;
    border-radius: 12px 12px 0 0 !important;
}

/* ============================================================================
   4. 個人照片區域 - 圖片放大、垂直置中
   ============================================================================ */

.avatar-upload-box {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 0 !important;
}

/* 頭像預覽區域 - 放大、垂直置中 */
.avatar-preview-centered {
    width: 180px !important;
    height: 180px !important;
    margin: auto !important;
}

/* 讓照片區域佔滿剩餘空間並垂直置中 */
.avatar-upload-box .avatar-form {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    justify-content: center;
    padding: 1.5rem 1rem;
}

.avatar-upload-box .avatar-hint {
    text-align: center;
    padding: 0.75rem 1rem 1rem;
    color: #6c757d;
    font-size: 0.875rem;
}

/* ============================================================================
   5. 編輯資料按鈕 - 圖示顏色與文字相同
   ============================================================================ */

.btn-edit-profile {
    display: flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
    padding: 0.6rem 1.25rem !important;
    background: #2C5F8D !important;
    color: white !important;
    border: none !important;
    border-radius: 6px !important;
    font-weight: 600 !important;
    font-size: 0.9rem !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    margin-left: auto !important;
}

.btn-edit-profile i {
    color: white !important;
    font-size: 0.9rem !important;
}

.btn-edit-profile:hover {
    background: #1e4a6e !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 12px rgba(44, 95, 141, 0.3) !important;
}

/* ============================================================================
   6. 個人資料分頁 - 主標題與子區塊間距
   ============================================================================ */

/* 主標題下方內容區域 */
.profile-edit-section #viewMode,
.profile-edit-section .view-mode-container {
    padding: 1.25rem !important;
}

/* 子區塊卡片間距 */
.profile-edit-section .profile-section-card,
.profile-edit-section .u-card--bordered {
    background: #f8f9fa !important;
    border-radius: 12px !important;
    overflow: hidden !important;
    margin-bottom: 1rem !important;
    border: 1px solid #e9ecef !important;
}

.profile-edit-section .profile-section-card:last-child,
.profile-edit-section .u-card--bordered:last-child {
    margin-bottom: 0 !important;
}

/* 子區塊標題樣式 */
.profile-edit-section .u-section-header--gradient {
    border-radius: 0 !important;
}

/* ============================================================================
   7. 各分頁容器背景
   ============================================================================ */

.system-file-download,
.course-files-viewer,
.profile-edit-section,
.profile-info-box,
.course-history-box,
.student-list-box,
.create-course,
.create-exchange-box,
.exchange-schedule-box,
.course-records-box,
.course-plan-box {
    background: #f8f9fa;
    border-radius: 12px;
    overflow: hidden;
    padding: 0;
}

/* 表單內容區域 padding */
.create-course form,
.create-exchange-box form {
    padding: 1.25rem;
}

/* ============================================================================
   8. 響應式調整
   ============================================================================ */

@media (max-width: 768px) {
    .u-card__header--gradient {
        padding: 0.875rem 1rem !important;
    }
    
    .u-card__header--gradient i {
        font-size: 1.25rem !important;
    }
    
    .u-card__header--gradient h3 {
        font-size: 1.1rem !important;
    }
    
    .u-section-header--gradient {
        padding: 0.75rem 1rem !important;
    }
    
    .u-section-header--gradient i {
        font-size: 1.1rem !important;
    }
    
    .u-section-header--gradient h4 {
        font-size: 1rem !important;
    }
    
    .avatar-preview-centered {
        width: 140px !important;
        height: 140px !important;
    }
    
    .btn-edit-profile {
        padding: 0.5rem 1rem !important;
        font-size: 0.85rem !important;
    }
    
    .profile-edit-section #viewMode,
    .profile-edit-section .view-mode-container {
        padding: 1rem !important;
    }
}

/* ============================================================================
   9. 頂部區塊（基本資訊、個人照片）- 追加修正
   ============================================================================ */

/* 頂部區塊卡片 - 移除內部 padding，讓組件控制 */
.top-section.desktop-only .card {
    padding: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    min-height: 320px !important;
}

/* 基本資訊卡片內容區域 */
.top-section .profile-info-box {
    display: flex !important;
    flex-direction: column !important;
    height: 100% !important;
}

.top-section .profile-info-box .profile-info-list {
    flex: 1 !important;
}

.top-section .profile-info-box .profile-actions {
    margin-top: auto !important;
}

/* 個人照片卡片內容區域 - 垂直置中 */
.top-section .avatar-upload-box {
    display: flex !important;
    flex-direction: column !important;
    height: 100% !important;
}

.top-section .avatar-upload-box .avatar-form {
    flex: 1 !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
    padding: 1.5rem !important;
}

.top-section .avatar-upload-box .avatar-preview-centered {
    margin-bottom: 1rem !important;
}

.top-section .avatar-upload-box .avatar-hint {
    margin-top: auto !important;
}

