/* ==========================================================================
   NCP SUBMIT ENGINE - STYLES F6 (MODERN UI)
   ========================================================================== */

:root {
    --ncp-primary: #007cba;
    --ncp-bg: #f9f9f9;
    --ncp-border: #ccd0d4;
    --ncp-error: #d63638;
    --ncp-success: #00a32a;
}

#ncp-submit-wrapper {
    max-width: 800px;
    margin: 0 auto;
    background: #fff;
    padding: 30px;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

/* --- FORM LAYOUT --- */
.ncp-form-header h2 { margin-top: 0; color: #333; }
.ncp-meta-info { font-size: 0.9em; color: #666; background: #eee; display: inline-block; padding: 2px 8px; border-radius: 4px; }

.ncp-section-header {
    font-size: 1.1em;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--ncp-primary);
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 10px;
    margin: 25px 0 15px 0;
}

.ncp-tax-grid, .ncp-basic-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

@media (max-width: 600px) {
    .ncp-tax-grid, .ncp-basic-grid { grid-template-columns: 1fr; }
}

.ncp-field-wrap, .ncp-field { display: flex; flex-direction: column; margin-bottom: 5px; }
.ncp-field.full-width { grid-column: 1 / -1; }

label { font-weight: 600; margin-bottom: 6px; font-size: 0.95em; color: #444; }
.req { color: var(--ncp-error); margin-left: 3px; }

input[type="text"], input[type="number"], select, textarea {
    padding: 10px;
    border: 1px solid var(--ncp-border);
    border-radius: 4px;
    width: 100%;
    font-size: 14px;
    transition: border-color 0.2s;
}
input:focus, select:focus, textarea:focus { border-color: var(--ncp-primary); outline: none; box-shadow: 0 0 0 1px var(--ncp-primary); }

/* --- CASCADE SELECTS --- */
.ncp-cascade-select { margin-bottom: 10px; background-color: #f8fbfd; }

/* --- TOGGLE UI --- */
.ncp-toggle-wrapper {
    display: flex; gap: 15px; background: #f5f5f5; padding: 12px; border-radius: 6px; margin-bottom: 20px;
}
.ncp-radio-box {
    display: flex; align-items: center; cursor: pointer; font-weight: 500; background: #fff; padding: 8px 12px; border-radius: 4px; border: 1px solid #ddd; flex: 1;
}
.ncp-radio-box input { margin-right: 8px; }
.ncp-radio-box:hover { border-color: var(--ncp-primary); }

/* Ghost State */
.ncp-muted { opacity: 0.5; pointer-events: none; filter: grayscale(100%); transition: all 0.3s ease; }

/* --- GALLERY (DRAG & DROP) --- */
.ncp-gallery-area { margin-top: 10px; }
.ncp-gallery-actions { margin-bottom: 10px; display: flex; justify-content: space-between; align-items: center; }
.ncp-hint { font-size: 0.85em; color: #888; font-style: italic; }

.ncp-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 12px;
    padding: 12px;
    background: #fafafa;
    border: 2px dashed #ccc;
    border-radius: 6px;
    min-height: 120px;
}

.ncp-gal-item {
    position: relative;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
    background: #fff;
    cursor: grab; /* Con trỏ kéo thả */
    aspect-ratio: 1;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
    transition: transform 0.2s;
}
.ncp-gal-item:active { cursor: grabbing; transform: scale(1.05); z-index: 10; }

.ncp-gal-item img { width: 100%; height: 100%; object-fit: cover; pointer-events: none; /* Tránh kéo ảnh thay vì kéo box */ }

.ncp-gal-remove {
    position: absolute; top: 4px; right: 4px;
    background: rgba(255, 0, 0, 0.8); color: white;
    width: 22px; height: 22px; border-radius: 50%;
    text-align: center; line-height: 20px; font-weight: bold;
    cursor: pointer; font-size: 16px;
}
.ncp-gal-remove:hover { background: red; }

/* --- MESSAGE & AUTOSAVE --- */
#ncp-message { margin-top: 20px; padding: 12px; border-radius: 4px; display: none; }
.ncp-alert.ncp-success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.ncp-alert.ncp-error { background: #f8d7da; color: #721c24; border: 1px solid #f5c2c7; }

/* Auto-save notification */
.ncp-autosave-notify {
    position: fixed; bottom: 20px; right: 20px;
    background: #333; color: #fff;
    padding: 10px 20px; border-radius: 30px;
    font-size: 13px; opacity: 0; transition: opacity 0.5s;
    pointer-events: none; z-index: 9999;
}
.ncp-autosave-notify.show { opacity: 0.9; }

/* ==========================================================================
   DASHBOARD STYLES (F7 ADDON)
   ========================================================================== */

#ncp-dashboard-wrapper {
    max-width: 1000px; margin: 0 auto; background: #fff; padding: 20px; border-radius: 8px; box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.ncp-dash-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; border-bottom: 1px solid #eee; padding-bottom: 15px; }
.ncp-dash-title h2 { margin: 0; color: #333; }
.ncp-dash-filter { margin-bottom: 20px; display: flex; gap: 10px; }
.ncp-dash-filter a { text-decoration: none; padding: 5px 12px; border-radius: 20px; background: #f0f0f0; color: #555; font-size: 0.9em; transition: 0.2s; }
.ncp-dash-filter a.active, .ncp-dash-filter a:hover { background: var(--ncp-primary); color: #fff; }

/* Table Styles */
.ncp-dash-table { width: 100%; border-collapse: collapse; }
.ncp-dash-table th { text-align: left; padding: 12px; background: #f9f9f9; color: #666; font-weight: 600; border-bottom: 2px solid #eee; }
.ncp-dash-table td { padding: 15px 12px; border-bottom: 1px solid #eee; vertical-align: middle; }

/* Thumb */
.ncp-thumb-box { width: 60px; height: 60px; border-radius: 4px; overflow: hidden; border: 1px solid #ddd; }
.ncp-thumb-box img { width: 100%; height: 100%; object-fit: cover; }

/* Info */
.ncp-item-title { margin: 0 0 5px 0; font-size: 1em; }
.ncp-item-title a { text-decoration: none; color: #333; font-weight: 600; }
.ncp-item-meta { font-size: 0.85em; color: #888; display: flex; gap: 10px; }

/* Price */
.ncp-price { color: var(--ncp-error); font-weight: bold; }
.ncp-area { font-size: 0.9em; color: #666; }

/* Badges */
.ncp-badge { padding: 4px 8px; border-radius: 4px; font-size: 0.8em; font-weight: bold; text-transform: uppercase; display: inline-block; }
.ncp-badge-success { background: #d4edda; color: #155724; } /* Publish */
.ncp-badge-warning { background: #fff3cd; color: #856404; } /* Pending */
.ncp-badge-sold { background: #333; color: #fff; } /* Sold */
.ncp-badge-draft { background: #e2e3e5; color: #383d41; }

/* Action Buttons */
/*.ncp-action-group { display: flex; gap: 8px; }*/

/* ============================
 * PATCH_BLOCK_ID: CS_F7_DASH_TEXTLINK_ACTIONS_01
 * FILE: assets/ncp-submit.css
 * PURPOSE: Make dashboard actions look like plain text links (no button background)
 * ============================ */

.ncp-action-group {
    gap: 12px; /* nới khoảng cách cho đẹp */
}

.ncp-btn-text,
.ncp-action-group a.ncp-dash-action {
    background: transparent !important;
    border: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    box-shadow: none !important;
    display: inline !important;
    width: auto !important;
    height: auto !important;

    color: inherit !important;
    font: inherit !important;
    line-height: inherit !important;
    text-decoration: none !important;

    cursor: pointer !important;
}

.ncp-btn-text:hover,
.ncp-action-group a.ncp-dash-action:hover {
    text-decoration: underline !important;
}

.ncp-btn-text.is-delete {
    color: #d63638 !important; /* đỏ nhẹ cho Xóa */
}


.ncp-btn-icon {
    width: 32px; height: 32px; border: 1px solid #ddd; background: #fff;
    border-radius: 4px; cursor: pointer; display: flex; align-items: center; justify-content: center;
    transition: 0.2s; text-decoration: none; font-size: 16px;
    color: #000 !important;
}
.ncp-btn-icon:hover { background: #f0f0f0; transform: translateY(-2px); }
.ncp-btn-delete:hover { border-color: red; background: #fff5f5; }

/* Notification */
#ncp-dash-notify {
    position: fixed; top: 20px; right: 20px; z-index: 9999;
    padding: 15px 25px; border-radius: 5px; background: #333; color: #fff;
    display: none; box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}
#ncp-dash-notify.success { background: var(--ncp-success); }
#ncp-dash-notify.error { background: var(--ncp-error); }


/*Nghĩa thêm 7:09 CH 15/01/2026 */
/* ============================
 * PATCH_BLOCK_ID: CS_NCP_SINGLE_REVIEW_BAR_STYLE_F7
 * FILE: assets/ncp-submit.css
 * PURPOSE: Minimal fixed review bar on single listing for admins (text links, no background)
 * ============================ */
.ncp-single-reviewbar{
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 99999;
    background: rgba(255,255,255,0.95);
    border-top: 1px solid #e6e6e6;
    padding: 10px 0;
}
.ncp-single-reviewbar__inner{
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 16px;
    display: flex;
    gap: 12px;
    align-items: center;
}
.ncp-btn-text{
    background: transparent !important;
    border: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    color: inherit;
    text-decoration: none;
    cursor: pointer;
    font: inherit;
}
.ncp-btn-text:hover{
    text-decoration: underline;
}

/* ----kết thúc khối 7:09 CH 15/01/2026 ----*/
/* RESPONSIVE (Mobile Card View) */
@media (max-width: 768px) {
    .ncp-dash-table, .ncp-dash-table thead, .ncp-dash-table tbody, .ncp-dash-table th, .ncp-dash-table td, .ncp-dash-table tr { display: block; }
    .ncp-dash-table thead { display: none; }
    .ncp-dash-table tr { margin-bottom: 15px; border: 1px solid #eee; border-radius: 8px; padding: 10px; box-shadow: 0 2px 5px rgba(0,0,0,0.02); }
    .ncp-dash-table td { padding: 8px 0; border: none; display: flex; justify-content: space-between; align-items: center; }
    .ncp-td-img { justify-content: center; margin-bottom: 10px; }
    .ncp-thumb-box { width: 100%; height: 150px; }
    .ncp-action-group { justify-content: flex-end; width: 100%; border-top: 1px solid #f0f0f0; padding-top: 10px; margin-top: 5px; }
}

/* MAP STYLES (F7) */
.ncp-map-wrapper {
    margin-top: 20px;
    padding: 15px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
}

#ncp-map {
    width: 100%;
    height: 350px; /* Bắt buộc phải có chiều cao */
    border-radius: 4px;
    border: 1px solid #ccc;
    margin-bottom: 10px;
    z-index: 1; /* Tránh đè lên menu admin bar */
}

/* --- FIX LỖI BẢN ĐỒ --- */
.ncp-map-wrapper { margin-top: 20px; padding: 15px; background: #fff; border: 1px solid #ddd; }
#ncp-map {
    width: 100%;
    height: 400px !important; /* Bắt buộc có chiều cao */
    background: #eee; /* Màu nền khi map chưa load */
    z-index: 1;
}

/* --- FORM AUTH (ĐĂNG NHẬP/ĐĂNG KÝ) --- */
.ncp-auth-wrap { max-width: 400px; margin: 0 auto; padding: 30px; background: #fff; border: 1px solid #ddd; border-radius: 8px; box-shadow: 0 4px 10px rgba(0,0,0,0.05); }
.ncp-auth-wrap h3 { text-align: center; margin-bottom: 20px; color: var(--ncp-primary); }
.ncp-form-group { margin-bottom: 15px; }
.ncp-form-group label { display: block; margin-bottom: 5px; font-weight: 600; }
.ncp-form-control { width: 100%; padding: 10px; border: 1px solid #ccc; border-radius: 4px; }
.ncp-btn-full { width: 100%; padding: 12px; background: var(--ncp-primary); color: #fff; border: none; border-radius: 4px; cursor: pointer; font-weight: bold; }
.ncp-btn-full:hover { background: #005a8c; }
.ncp-auth-links { margin-top: 15px; text-align: center; font-size: 0.9em; }
.ncp-auth-links a { text-decoration: none; color: #666; }

/* =========================================
   WIZARD STYLES (PATCH 3)
   ========================================= */
/* Ẩn tất cả các bước mặc định */
.ncp-step-content {
    display: none;
    animation: fadeIn 0.5s;
}
/* Chỉ hiện bước đang Active */
.ncp-step-content.active {
    display: block;
}

/* Thanh tiến trình */
.ncp-progress-bar {
    display: flex;
    justify-content: space-between;
    margin-bottom: 25px;
    background: #f0f0f1;
    border-radius: 50px;
    padding: 5px;
}
.ncp-progress-step {
    flex: 1;
    text-align: center;
    padding: 8px 5px;
    font-size: 13px;
    font-weight: 600;
    color: #888;
    border-radius: 40px;
    cursor: default;
}
.ncp-progress-step.active {
    background: #007cba;
    color: #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

/* Các trường tiền tệ & tài chính */
.ncp-money-mask {
    font-family: monospace;
    font-weight: bold;
    color: #2271b1;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* =========================================
   PATCH 10: VALIDATION & TOGGLE UI
   ========================================= */

/* 1. Toggle Switch (Giá thỏa thuận) */
.ncp-toggle-switch {
    position: relative;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    margin-left: 15px;
    vertical-align: middle;
}
.ncp-toggle-switch input { 
    opacity: 0; 
    width: 0; 
    height: 0; 
}
.ncp-slider {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 22px;
    background-color: #ccc;
    border-radius: 34px;
    transition: .4s;
    margin-right: 8px;
}
.ncp-slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}
/* Trạng thái ON */
.ncp-toggle-switch input:checked + .ncp-slider {
    background-color: #2196F3;
}
.ncp-toggle-switch input:checked + .ncp-slider:before {
    transform: translateX(18px);
}
.ncp-toggle-label {
    font-size: 14px;
    font-weight: 600;
    color: #555;
    user-select: none;
}

/* 2. Validation Error Styles */
.ncp-error-field {
    border: 1px solid #d63638 !important;
    background-color: #fdf2f2 !important;
}
.ncp-error-msg {
    color: #d63638;
    font-size: 12px;
    margin-top: 4px;
    display: block;
    font-style: italic;
}

/* =========================================
   MODULE 4: DASHBOARD RESPONSIVE & UI
   ========================================= */

/* 1. Responsive Table (Mobile Card View) */
@media screen and (max-width: 768px) {
    .ncp-dash-table thead { display: none; }
    .ncp-dash-table, .ncp-dash-table tbody, .ncp-dash-table tr, .ncp-dash-table td {
        display: block; width: 100%; box-sizing: border-box;
    }
    .ncp-dash-table tr {
        margin-bottom: 15px; border: 1px solid #ddd; border-radius: 8px;
        background: #fff; overflow: hidden; box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    }
    .ncp-dash-table td {
        padding: 10px 15px; border-bottom: 1px solid #eee;
        display: flex; justify-content: space-between; align-items: center;
        text-align: right;
    }
    .ncp-dash-table td:last-child { border-bottom: 0; }
    
    /* Fake Header using data-label */
    .ncp-dash-table td::before {
        content: attr(data-label); font-weight: 600; color: #555; text-transform: uppercase; font-size: 11px;
        margin-right: 15px; text-align: left;
    }
    
    /* Special Handling for Image & Action */
    .ncp-dash-table .ncp-td-img { text-align: center; display: block; padding: 0; }
    .ncp-dash-table .ncp-td-img::before { display: none; }
    .ncp-thumb-box img { width: 100%; height: 180px; border-radius: 0; }
    
    .ncp-dash-table .ncp-td-action, .ncp-dash-table .ncp-td-approve {
        display: block; text-align: center;
    }
    .ncp-dash-table .ncp-td-action::before, .ncp-dash-table .ncp-td-approve::before { display: none; }
    .ncp-action-group { justify-content: center; }
}

/* 2. Custom Delete Modal */
.ncp-modal-overlay {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.6); z-index: 99999;
    display: none; align-items: center; justify-content: center;
}
.ncp-modal-overlay.active { display: flex; animation: fadeIn 0.2s; }
.ncp-modal {
    background: #fff; width: 90%; max-width: 400px; padding: 25px;
    border-radius: 12px; text-align: center; box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}
.ncp-modal h3 { margin-top: 0; color: #d63638; }
.ncp-modal-actions { margin-top: 20px; display: flex; gap: 10px; justify-content: center; }
.ncp-btn-confirm-del { background: #d63638; color: #fff; border: none; padding: 8px 20px; border-radius: 4px; cursor: pointer; }
.ncp-btn-cancel { background: #eee; color: #333; border: none; padding: 8px 20px; border-radius: 4px; cursor: pointer; }

/* 3. View Count Badge */
.ncp-view-count {
    display: inline-flex; align-items: center; gap: 4px;
    font-size: 13px; color: #666; background: #f0f0f1;
    padding: 4px 8px; border-radius: 20px; font-weight: 500;
}