@charset "UTF-8";

/* ==========================================================================
   [PK自訂樣式]
   PK-Form.css - 共用表單元件樣式
   可重複使用於各頁面的表單樣式
   依賴：pk-style.css (提供 CSS 變數)
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. 區塊卡片 (.pk-section)
   適用場景：將表單內容分組成卡片區塊
   -------------------------------------------------------------------------- */
.pk-section {
    background: var(--pk-bg-white);
    border-radius: var(--pk-radius-lg);
    box-shadow: var(--pk-shadow);
    padding: 30px;
    margin-bottom: 30px;
    border: 1px solid var(--pk-border-light);
    position: relative;
    overflow: hidden;
    transition: box-shadow 0.3s;
}

.pk-section:hover {
    box-shadow: var(--pk-shadow-hover);
}

/* 左側裝飾線 */
.pk-section::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--pk-primary);
}

/* 無裝飾線版本 */
.pk-section--plain::before {
    display: none;
}

/* 區塊標題 */
.pk-section-title {
    font-size: 20px;
    color: var(--pk-text-main);
    margin: 0 0 25px 0;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--pk-border-light);
    font-weight: 600;
    display: flex;
    align-items: center;
}

.pk-section-title::before {
    content: "";
    display: inline-block;
    width: 8px;
    height: 8px;
    background: var(--pk-primary);
    border-radius: 50%;
    margin-right: 10px;
}

/* 無圓點版本 */
.pk-section-title--plain::before {
    display: none;
}

/* --------------------------------------------------------------------------
   2. 表單元素
   -------------------------------------------------------------------------- */

/* 表單行 - 水平排列 */
.pk-form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

/* 表單群組 */
.pk-form-group {
    flex: 1;
    margin-bottom: 20px;
}

/* 緊湊版型（公版預覽用） */
.pk-form-compact .pk-section {
    padding: 24px;
    margin-bottom: 20px;
}

.pk-form-compact .pk-form-row {
    gap: 14px;
    margin-bottom: 14px;
}

.pk-form-compact .pk-form-group {
    margin-bottom: 14px;
}

.pk-form-compact .pk-form-control {
    height: 36px;
    padding: 6px 10px;
    font-size: 14px;
}

.pk-form-compact textarea.pk-form-control {
    min-height: 96px;
}

.pk-form-body-compact {
    padding: 4px 6px 0;
}

.pk-form-links {
    margin-top: 12px;
    font-size: 14px;
    line-height: 1.7;
    text-align: center;
}

.pk-form-links a {
    color: var(--pk-primary);
    text-decoration: none;
    font-weight: 600;
}

.pk-form-links a:hover {
    text-decoration: underline;
}

.pk-form-links-divider {
    margin: 0 10px;
    color: var(--pk-text-muted);
}

/* Label 樣式 */
.pk-form-group label {
    display: block;
    font-size: 14px;
    color: var(--pk-text-secondary);
    margin-bottom: 8px;
    font-weight: 600;
}

/* 必填標記 */
.pk-form-group label .required,
.pk-form-group label .pk-required {
    color: var(--pk-danger);
    margin-left: 4px;
}

/* 表單控制項 */
.pk-form-control {
    width: 100%;
    height: 42px;
    padding: 8px 12px;
    font-size: 15px;
    color: var(--pk-text-main);
    background-color: var(--pk-bg-white);
    border: 1px solid var(--pk-border);
    border-radius: var(--pk-radius);
    transition: all 0.3s ease;
}

.pk-form-control:focus {
    border-color: var(--pk-primary);
    box-shadow: 0 0 0 3px var(--pk-primary-light);
    outline: none;
}

.pk-form-control:disabled {
    background-color: var(--pk-bg-light);
    cursor: not-allowed;
    color: var(--pk-text-muted);
}

/* Textarea 調整 */
textarea.pk-form-control {
    height: auto;
    min-height: 100px;
    resize: vertical;
}

/* Select 調整 */
select.pk-form-control {
    cursor: pointer;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23333333' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 12px;
    padding-right: 36px;
}

/* 錯誤訊息 */
.pk-error-message {
    color: var(--pk-danger);
    font-size: 13px;
    margin-top: 5px;
    display: block;
}

/* 輔助文字 */
.pk-form-help {
    color: var(--pk-text-muted);
    font-size: 12px;
    margin-top: 5px;
    display: block;
}

/* --------------------------------------------------------------------------
   3. 搜尋群組 (含圖示)
   -------------------------------------------------------------------------- */
.pk-search-group {
    position: relative;
}

.pk-search-group .pk-search-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--pk-text-muted);
    pointer-events: none;
}

/* 左側圖示版本 */
.pk-search-group--left .pk-search-icon {
    left: 12px;
    right: auto;
}

.pk-search-group--left .pk-form-control {
    padding-left: 36px;
}

/* --------------------------------------------------------------------------
   4. 驗證摘要
   -------------------------------------------------------------------------- */
.pk-validation-summary {
    margin-top: 20px;
    color: var(--pk-danger);
    text-align: left;
    display: inline-block;
}

/* --------------------------------------------------------------------------
   5. 送出區域
   -------------------------------------------------------------------------- */
.pk-submit-area {
    text-align: center;
    margin-top: 40px;
}

/* 左對齊版本 */
.pk-submit-area--left {
    text-align: left;
}

/* 右對齊版本 */
.pk-submit-area--right {
    text-align: right;
}

/* --------------------------------------------------------------------------
   6. 頁面標題 (.pk-page-header)
   適用場景：頁面頂部標題區域
   -------------------------------------------------------------------------- */
.pk-page-header {
    text-align: center;
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--pk-border-light);
}

.pk-page-header h1,
.pk-page-header h2,
.pk-page-header h3 {
    font-size: 28px;
    color: var(--pk-primary);
    margin: 0 0 10px 0;
    font-weight: 700;
}

.pk-page-header p {
    font-size: 16px;
    color: var(--pk-text-secondary);
    margin: 0;
}

/* 左對齊版本 */
.pk-page-header--left {
    text-align: left;
}

/* --------------------------------------------------------------------------
   7. Checkbox & Radio 樣式
   -------------------------------------------------------------------------- */
/* ASP.NET CheckBoxList & RadioButtonList Support */
.pk-checkbox-list,
.pk-radio-list {
    width: 100%;
}

.pk-checkbox-list td,
.pk-radio-list td {
    padding: 8px 20px 8px 0;
    vertical-align: middle;
}

.pk-checkbox-list input[type="checkbox"],
.pk-radio-list input[type="radio"] {
    margin-right: 8px;
    vertical-align: middle;
    margin-top: -2px;
    cursor: pointer;
}

.pk-checkbox-list label,
.pk-radio-list label {
    display: inline-block;
    vertical-align: middle;
    font-weight: normal;
    margin-bottom: 0;
    cursor: pointer;
    color: var(--pk-text-main);
}

/* Flow Layout Support (span based) */
.pk-checkbox-list span,
.pk-radio-list span {
    display: inline-block;
    margin-right: 20px;
    margin-bottom: 10px;
}

/* Custom Checkbox/Radio (Single) */
.pk-checkbox,
.pk-radio {
    display: flex;
    align-items: flex-start;
    margin-bottom: 10px;
    cursor: pointer;
}

.pk-checkbox input[type="checkbox"],
.pk-radio input[type="radio"] {
    margin-right: 8px;
    margin-top: 3px;
    cursor: pointer;
}

.pk-checkbox label,
.pk-radio label {
    font-weight: normal;
    color: var(--pk-text-main);
    cursor: pointer;
    margin-bottom: 0;
}

/* 同意區塊 */
.pk-agree-area {
    padding: 15px 0;
    border-top: 1px solid var(--pk-border-light);
    margin-top: 20px;
}

.pk-agree-area label {
    font-weight: normal;
    color: var(--pk-text-secondary);
    font-size: 14px;
}

.pk-agree-area a {
    color: var(--pk-primary);
    text-decoration: underline;
}

/* --------------------------------------------------------------------------
   8. 驗證碼區域
   -------------------------------------------------------------------------- */
.pk-captcha-group {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.pk-captcha-group .pk-form-control {
    width: auto;
    max-width: 150px;
}

.pk-captcha-group img {
    border: 1px solid var(--pk-border);
    border-radius: var(--pk-radius);
    vertical-align: middle;
}

.pk-captcha-refresh {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: var(--pk-bg-white);
    border: 1px solid var(--pk-border);
    border-radius: var(--pk-radius);
    color: var(--pk-text-muted);
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.pk-captcha-refresh:hover {
    background: var(--pk-primary);
    border-color: var(--pk-primary);
    color: #fff;
}

/* --------------------------------------------------------------------------
   9. 表單容器
   -------------------------------------------------------------------------- */
.pk-form-container {
    padding-bottom: 60px;
    font-family: "Helvetica Neue", Helvetica, Arial, "Microsoft JhengHei", sans-serif;
}

/* --------------------------------------------------------------------------
   9b. 表單頁頭 / 表單主體 / 表單頁尾
   -------------------------------------------------------------------------- */
.pk-form-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--pk-border-light);
}

.pk-form-header h2 {
    font-size: 26px;
    font-weight: 700;
    color: var(--pk-primary);
    margin: 0;
}

.pk-form-body {
    max-width: 600px;
    margin: 0 auto;
}

.pk-form-footer {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid var(--pk-border-light);
}

/* 表單連結 */
.pk-link {
    color: var(--pk-primary);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
}

.pk-link:hover {
    color: var(--pk-primary-dark, #004440);
    text-decoration: underline;
}

/* Checkbox label (inline) */
.pk-checkbox-label {
    font-weight: normal;
    color: var(--pk-text-main);
    cursor: pointer;
}

.pk-checkbox-label input[type="checkbox"] {
    margin-right: 6px;
    vertical-align: middle;
}

/* 通用內容容器 */
.pk-content {
    padding-bottom: 60px;
}

/* 通用表單 class */
.pk-form .form-group {
    margin-bottom: 18px;
}

.pk-form .form-control {
    border-radius: var(--pk-radius);
    transition: border-color 0.3s, box-shadow 0.3s;
}

.pk-form .form-control:focus {
    border-color: var(--pk-primary);
    box-shadow: 0 0 0 3px var(--pk-primary-light);
}

/* --------------------------------------------------------------------------
   10. Banner 圖片區
   -------------------------------------------------------------------------- */
.pk-banner {
    margin-bottom: 30px;
    border-radius: var(--pk-radius-lg);
    overflow: hidden;
    box-shadow: var(--pk-shadow);
    transition: transform 0.3s ease;
}

.pk-banner:hover {
    transform: translateY(-2px);
}

.pk-banner img {
    width: 100%;
    height: auto;
    display: block;
}

/* 無 hover 效果版本 */
.pk-banner--static:hover {
    transform: none;
}

/* --------------------------------------------------------------------------
   11. 空狀態提示
   -------------------------------------------------------------------------- */
.pk-empty-state {
    text-align: center;
    padding: 40px 20px;
    background: var(--pk-bg-light);
    border-radius: var(--pk-radius-lg);
    border: 2px dashed var(--pk-border);
    color: var(--pk-text-muted);
}

.pk-empty-state p {
    margin: 5px 0;
    font-size: 15px;
}

.pk-empty-state .pk-empty-icon {
    font-size: 48px;
    color: var(--pk-border);
    margin-bottom: 15px;
}

.pk-empty-state .pk-empty-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--pk-text-secondary);
    margin-bottom: 10px;
    line-height: 1.6;
}

.pk-empty-state .pk-empty-desc {
    font-size: 15px;
    color: var(--pk-text-secondary);
    line-height: 1.6;
}

/* --------------------------------------------------------------------------
   12. 訊息卡片 (.pk-message-card)
   適用場景：操作結果訊息 (成功/失敗/錯誤)
   -------------------------------------------------------------------------- */
.pk-message-card {
    text-align: center;
    padding: 60px 30px;
    background: var(--pk-bg-white);
    border-radius: var(--pk-radius-lg);
    box-shadow: var(--pk-shadow);
    border: 1px solid var(--pk-border-light);
    margin-bottom: 30px;
}

.pk-message-icon {
    font-size: 64px;
    margin-bottom: 20px;
    line-height: 1;
}

.pk-message-icon.text-success { color: var(--pk-success); }
.pk-message-icon.text-danger { color: var(--pk-danger); }
.pk-message-icon.text-info { color: var(--pk-info); }
.pk-message-icon.text-primary { color: var(--pk-primary); }

.pk-message-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--pk-text-main);
    margin: 0 0 15px 0;
}

.pk-message-body {
    font-size: 16px;
    color: var(--pk-text-secondary);
    line-height: 1.6;
    margin-bottom: 30px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.pk-message-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

/* --------------------------------------------------------------------------
   13. 清單項目卡片 (.pk-card-item)
   適用場景：動態新增的清單項目 (如 ToyParts)
   -------------------------------------------------------------------------- */
.pk-list-container {
    min-height: 100px;
    margin-top: 15px;
}

/* 清單項目卡片 */
.pk-card-item {
    background: var(--pk-bg-white);
    border: 1px solid var(--pk-border);
    border-radius: var(--pk-radius-lg);
    padding: 20px;
    margin-bottom: 15px;
    transition: all 0.3s ease;
    position: relative;
    box-shadow: 0 2px 5px rgba(0,0,0,0.02);
}

.pk-card-item:hover {
    border-color: var(--pk-primary);
    box-shadow: var(--pk-shadow-hover);
    transform: translateY(-2px);
}

/* 項目標題區 */
.pk-card-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--pk-border-light);
}

.pk-card-item-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--pk-text-main);
    margin: 0;
    flex: 1;
}

/* 刪除按鈕 */
.pk-btn-delete {
    background: var(--pk-bg-white);
    border: 1px solid var(--pk-border);
    color: var(--pk-text-secondary);
    padding: 6px 12px;
    border-radius: var(--pk-radius);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 13px;
    margin-left: 10px;
    flex-shrink: 0;
}

.pk-btn-delete:hover {
    background: var(--pk-danger);
    border-color: var(--pk-danger);
    color: #fff;
}

/* 項目詳情 */
.pk-card-item-body {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 15px;
}

.pk-field-group {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.pk-field-label {
    font-size: 11px;
    color: var(--pk-text-secondary);
    margin-bottom: 4px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.pk-field-value {
    font-size: 14px;
    color: var(--pk-text-main);
    font-weight: 600;
}

/* Badge 樣式 */
.pk-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 14px;
    border-radius: var(--pk-radius);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: 1px solid;
    min-width: 80px;
}

.pk-badge-info {
    background: var(--pk-info);
    color: #fff;
    border-color: #46b8da;
}

.pk-badge-success {
    background: var(--pk-success);
    color: #fff;
    border-color: #4cae4c;
}

/* 數量控制 */
.pk-quantity-group {
    display: flex;
    align-items: center;
    padding-top: 10px;
    border-top: 1px solid var(--pk-border-light);
}

.pk-quantity-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--pk-text-secondary);
    margin-right: 12px;
}

.pk-quantity-control {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pk-quantity-input {
    width: 80px;
    padding: 8px 12px;
    font-size: 16px;
    font-weight: 700;
    color: var(--pk-primary);
    text-align: center;
    border: 1px solid var(--pk-border);
    border-radius: var(--pk-radius);
    transition: all 0.3s ease;
}

.pk-quantity-input:focus {
    outline: none;
    border-color: var(--pk-primary);
    box-shadow: 0 0 0 3px var(--pk-primary-light);
}

/* --------------------------------------------------------------------------
   14. 響應式設計
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
    .pk-form-row {
        flex-direction: column;
        gap: 0;
    }

    .pk-section {
        padding: 20px;
    }

    /* Card Item Responsive */
    .pk-card-item {
        padding: 15px;
    }

    .pk-card-item-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .pk-btn-delete {
        margin-left: 0;
        margin-top: 10px;
        width: 100%;
        text-align: center;
    }

    .pk-card-item-body {
        flex-direction: column;
        gap: 10px;
    }

    .pk-quantity-group {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .pk-quantity-control {
        width: 100%;
    }

    .pk-quantity-input {
        flex: 1;
    }
}

@media (max-width: 480px) {
    .pk-section {
        padding: 15px;
        border-radius: var(--pk-radius);
    }

    .pk-section-title {
        font-size: 18px;
    }
}

/* --------------------------------------------------------------------------
   16. 自訂 Modal (.pk-modal)
   -------------------------------------------------------------------------- */
.pk-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1050;
    align-items: center;
    justify-content: center;
}

.pk-modal-overlay.show {
    display: flex !important;
}

/* 覆蓋 #pkdv .show { display:block !important; }，確保 Modal 開啟時維持置中 */
#pkdv .pk-modal-overlay.show {
    display: flex !important;
}

.pk-modal-container {
    background: #fff;
    width: 90%;
    max-width: 500px;
    border-radius: var(--pk-radius-lg);
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    animation: pkFadeInUp 0.3s ease;
    display: flex;
    flex-direction: column;
    max-height: 90vh;
}

@keyframes pkFadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.pk-modal-header {
    padding: 20px;
    border-bottom: 1px solid var(--pk-border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.pk-modal-title {
    font-size: 18px;
    font-weight: 700;
    margin: 0;
    color: var(--pk-text-main);
}

.pk-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--pk-text-muted);
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.pk-modal-body {
    padding: 20px;
    overflow-y: auto;
}

.pk-modal-footer {
    padding: 20px;
    border-top: 1px solid var(--pk-border-light);
    text-align: right;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* --------------------------------------------------------------------------
   17. 特色清單 (.pk-feature-list)
   -------------------------------------------------------------------------- */
.pk-feature-list {
    text-align: left;
    margin: 20px auto;
    max-width: 600px;
    padding: 0;
    list-style: none;
}

.pk-feature-list li {
    position: relative;
    padding-left: 25px;
    margin-bottom: 12px;
    color: var(--pk-text-secondary);
    line-height: 1.5;
    font-size: 15px;
}

.pk-feature-list li::before {
    content: "\F26A"; /* Bootstrap Icons check-lg */
    font-family: "bootstrap-icons";
    position: absolute;
    left: 0;
    top: 2px;
    color: var(--pk-success);
}
