/*
 * NaghleHaml Business Dashboard Styles
 * Version: 3.1.0 (Refactor and Stability Patch)
 * Colors:
 * Dark Navy: #1c2d4f
 * Light Navy: #0d2149
 * Yellow: #e6b02c
 * Gray: #f5f4ef
*/

/* --- Main Layout --- */
.nh-dashboard-container { 
    display: flex; 
    align-items: flex-start; 
    gap: 30px; 
    margin-top: 20px; 
    /* *** FIX for Background Color *** */
    background-color: #f5f4ef;
    padding: 20px;
    border-radius: 12px;
}
.nh-sidebar { width: 260px; flex-shrink: 0; background-color: #1c2d4f; color: #fff; padding: 30px 20px; border-radius: 12px; height: calc(100vh - 120px); position: sticky; top: 40px; display: flex; flex-direction: column; }
.nh-main-content { flex-grow: 1; width: 100%; background-color: transparent; }

@media (max-width: 960px) {
    .nh-dashboard-container { flex-direction: column; padding: 15px; }
    .nh-sidebar { width: 100%; height: auto; position: relative; top: 0; }
}

/* --- Sidebar --- */
.nh-sidebar-header { text-align: center; margin-bottom: 30px; flex-shrink: 0; }
.nh-logo-frame { width: 120px; height: 120px; margin: 0 auto 15px; background-size: contain; background-position: center; background-repeat: no-repeat; display: flex; align-items: center; justify-content: center; }
.nh-logo-frame img { width: 70%; height: 70%; object-fit: contain; border-radius: 50%; }
.nh-business-name { color: #fff; font-size: 20px; margin: 0; }
.nh-welcome-message { font-size: 14px; color: #f5f4ef; opacity: 0.8; margin-top: 5px; }
.nh-sidebar-nav { flex-grow: 1; overflow-y: auto; }
.nh-sidebar-nav ul { list-style: none; padding: 0; margin: 0; }
.nh-sidebar-nav li a { display: block; color: #fff; text-decoration: none; padding: 12px 15px; border-radius: 6px; margin-bottom: 5px; transition: background-color 0.3s ease, color 0.3s ease; }
.nh-sidebar-nav li a:hover { background-color: #0d2149; }
.nh-sidebar-nav li.nh-active a { background-color: #e6b02c; color: #1c2d4f; font-weight: bold; }
.nh-sidebar-footer { margin-top: 20px; flex-shrink: 0; }
.nh-logout-button { display: block; text-align: center; background-color: rgba(255, 255, 255, 0.1); color: #fff; padding: 10px; border-radius: 6px; text-decoration: none; transition: background-color 0.3s ease; }
.nh-logout-button:hover { background-color: #e6b02c; color: #1c2d4f; }

/* --- Content Area --- */
.nh-dashboard-section { background-color: #ffffff; padding: 25px 30px; border-radius: 8px; box-shadow: 0 4px 15px rgba(0,0,0,0.07); margin-bottom: 30px; }
.nh-section-title { font-size: 24px; color: #1c2d4f; margin-top: 0; margin-bottom: 25px; padding-bottom: 15px; border-bottom: 1px solid #f5f4ef; }
.nh-list-header, .nh-form-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 25px; }
.nh-list-header h3, .nh-form-header h3 { margin: 0; font-size: 20px; }

/* --- Stat Cards --- */
.nh-grid-container { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 20px; }
.nh-stat-card { background: #f5f4ef; border-radius: 8px; padding: 20px; text-align: center; border: 1px solid #e0e0e0; }
.nh-card-header { font-size: 14px; color: #555; margin-bottom: 10px; }
.nh-card-body { font-size: 32px; font-weight: bold; color: #1c2d4f; }

/* --- Forms & Inputs Styling --- */
.nh-dashboard-form p, .acf-field { margin-bottom: 20px !important; padding: 0 !important; }
.nh-dashboard-form label, .acf-label label { display: block; font-weight: bold; margin-bottom: 8px; color: #1c2d4f; }
.nh-dashboard-form input[type="text"], .nh-dashboard-form input[type="url"], .nh-dashboard-form input[type="email"], .acf-text-input input, .acf-input input[type="text"] { width: 100%; padding: 10px !important; border: 1px solid #ccc !important; border-radius: 4px !important; background-color: #fff !important; height: auto !important; box-shadow: none !important; }
.acf-field .acf-label { margin-bottom: 8px; }
.acf-field .acf-input { border: none; padding: 0; }
.acf-button.button.button-primary { background-color: #1c2d4f !important; border-color: #1c2d4f !important; color: #fff !important; font-weight: bold; padding: 10px 20px !important; height: auto !important; line-height: normal !important; transition: background-color 0.3s; }
.acf-button.button.button-primary:hover { background-color: #e6b02c !important; border-color: #e6b02c !important; }
.wp-editor-wrap { border: 1px solid #ccc !important; border-radius: 4px; }
.wp-editor-tools { background-color: #f5f4ef !important; padding: 0 !important; border-bottom: 1px solid #ccc !important; }
.wp-editor-container { border: 0 !important; }
.mce-tinymce { border-radius: 4px !important; }

/* --- ACF Featured Image --- */
.acf-field-featured-image .acf-label label {
    display: block;
    font-weight: bold;
    margin-bottom: 8px;
    color: #1c2d4f;
}
.acf-field-featured-image .acf-input .image-wrap {
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 10px;
    background-color: #f5f4ef;
}
.acf-field-featured-image .acf-input .acf-button {
    background-color: #1c2d4f !important;
    border-color: #1c2d4f !important;
    color: #fff !important;
    font-weight: bold;
    padding: 8px 15px !important;
    height: auto !important;
    line-height: normal !important;
    transition: background-color 0.3s;
}
.acf-field-featured-image .acf-input .acf-button:hover {
    background-color: #e6b02c !important;
    border-color: #e6b02c !important;
}

/* --- News Card View --- */
.nh-list-subsection-title { font-size: 18px; color: #1c2d4f; padding-bottom: 10px; margin-top: 30px; margin-bottom: 20px; border-bottom: 2px solid #f5f4ef; }
.nh-news-cards-container { display: flex; flex-direction: column; gap: 15px; }
.nh-news-card-item { display: flex; align-items: center; background-color: #fff; border: 1px solid #e0e0e0; border-radius: 8px; padding: 15px; gap: 15px; transition: box-shadow 0.3s ease; }
.nh-news-card-item:hover { box-shadow: 0 4px 15px rgba(0,0,0,0.07); }
.nh-news-card-thumb { flex-shrink: 0; width: 80px; height: 80px; }
.nh-news-card-thumb img, .nh-placeholder-thumb { width: 100%; height: 100%; object-fit: cover; border-radius: 6px; }
.nh-placeholder-thumb { background-color: #f5f4ef; }
.nh-news-card-details { flex-grow: 1; }
.nh-news-card-title { font-size: 16px; font-weight: bold; color: #1c2d4f; margin: 0 0 10px 0; }
.nh-news-card-meta { display: flex; align-items: center; gap: 20px; font-size: 13px; color: #555; }
.nh-meta-item { display: flex; align-items: center; gap: 5px; }
.nh-news-card-actions { flex-shrink: 0; display: flex; gap: 10px; }
.nh-news-card-actions .button.button-small { padding: 5px 12px; font-size: 12px; }

/* --- Table Styling --- */
.nh-table-wrapper { overflow-x: auto; }
.wp-list-table { margin-top: 0; }

/* --- Messages & Notices --- */
.nh-message, #nh-person-form-feedback > div, #nh-news-form-feedback > div, #nh-job-form-feedback > div, #nh-application-form-feedback > div, .acf-notice { padding: 15px; border-radius: 5px; margin: 20px 0 !important; border: 1px solid; }
.nh-message.success, .acf-notice.updated { color: #155724 !important; background-color: #d4edda !important; border-color: #c3e6cb !important; }
.nh-message.error, .acf-notice.error { color: #721c24 !important; background-color: #f8d7da !important; border-color: #f5c6cb !important; }
.nh-message.warning { color: #856404; background-color: #fff3cd; border-color: #ffeeba; }

/* --- Status Badges --- */
.nh-status-badge { padding: 5px 10px; border-radius: 15px; font-size: 12px; font-weight: bold; }
.nh-status-badge.status-publish, .nh-status-badge.status-payment_successful { background-color: #28a745; color: #fff; }
.nh-status-badge.status-pending { background-color: #e6b02c; color: #333; }
.nh-status-badge.status-draft { background-color: #6c757d; color: #fff; }
.nh-status-badge.status-future { background-color: #17a2b8; color: #fff; }
.nh-status-badge { background-color: #888; color: #fff; }

/* --- Modal --- */
.nh-modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(28, 45, 79, 0.8); z-index: 10000; display: none; align-items: center; justify-content: center; opacity: 0; transition: opacity 0.3s ease; }
.nh-modal-overlay.is-visible { display: flex; opacity: 1; }
.nh-modal-content { background: #fff; border-radius: 8px; z-index: 10001; width: 90%; max-width: 600px; max-height: 85vh; display: flex; flex-direction: column; box-shadow: 0 5px 25px rgba(0,0,0,0.2); transform: scale(0.9); transition: transform 0.3s ease; }
.nh-modal-overlay.is-visible .nh-modal-content { transform: scale(1); }
.nh-modal-header { display: flex; justify-content: space-between; align-items: center; padding: 15px 25px; border-bottom: 1px solid #f5f4ef; }
.nh-modal-header h2 { margin: 0; font-size: 18px; color: #1c2d4f; }
.nh-modal-close-button { background: none; border: none; font-size: 28px; font-weight: bold; line-height: 1; color: #888; cursor: pointer; }
.nh-modal-body { padding: 25px; overflow-y: auto; }
.nh-modal-body h4 { color: #1c2d4f; margin: 15px 0 10px; padding-bottom: 5px; border-bottom: 1px solid #eee;}
.nh-modal-body p { margin: 0 0 10px; }
.nh-modal-footer { display: flex; justify-content: space-between; align-items: center; padding: 15px 25px; background-color: #f5f4ef; border-top: 1px solid #e0e0e0; border-bottom-left-radius: 8px; border-bottom-right-radius: 8px; }
.nh-total-price strong { color: #1c2d4f; font-size: 16px; }
#nh-proceed-to-payment { background-color: #1c2d4f; border-color: #1c2d4f; color: #fff; transition: all 0.3s; }
#nh-proceed-to-payment:hover:not(:disabled) { background-color: #e6b02c; border-color: #e6b02c; }

/* --- NEW: Chart Container --- */
.nh-chart-container {
    width: 100%;
    padding: 20px;
    background-color: #f5f4ef;
    border-radius: 8px;
    margin-top: 15px;
}
.nh-chart-container img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* --- NEW: Status Filter & Table Footer --- */
.nh-status-filter-form {
    display: inline-block;
}
.nh-status-filter-form select {
    padding: 5px;
    border-radius: 4px;
    border: 1px solid #ccc;
}
.nh-table-footer {
    text-align: center;
    margin-top: 20px;
}

/* --- NEW: Order Cards View --- */
.nh-order-cards-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 20px;
    margin-top: 20px;
}
.nh-order-card-item {
    background-color: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.3s ease;
}
.nh-order-card-item:hover {
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
}
.nh-order-card-header {
    display: flex;
    justify-content: space-between;
    padding: 15px 20px;
    background-color: #f5f4ef;
    border-bottom: 1px solid #e0e0e0;
    font-size: 13px;
    color: #555;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
}
.nh-order-card-body {
    padding: 20px;
    flex-grow: 1;
}
.nh-order-news-title {
    font-size: 16px;
    font-weight: bold;
    margin: 0 0 20px 0;
}
.nh-order-news-title a {
    color: #1c2d4f;
    text-decoration: none;
}
.nh-order-news-title a:hover {
    color: #e6b02c;
}
.nh-order-progress-wrapper {
    width: 100%;
}
.nh-progress-bar-info {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: #555;
    margin-bottom: 8px;
}
.nh-progress-bar {
    width: 100%;
    height: 8px;
    background-color: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
}
.nh-progress-bar-fill {
    height: 100%;
    background-color: #1c2d4f; /* Dark Navy */
    width: 0%;
    border-radius: 4px;
    transition: width 0.5s ease-in-out;
}
.nh-order-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-top: 1px solid #e0e0e0;
    font-size: 14px;
}
.nh-order-card-footer strong {
    font-size: 16px;
    color: #1c2d4f;
}

/* --- NEW: Pagination Styling --- */
.nh-pagination {
    margin-top: 30px;
    text-align: center;
}
.nh-pagination .page-numbers {
    display: inline-block;
    padding: 8px 15px;
    margin: 0 3px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    text-decoration: none;
    color: #1c2d4f;
    background-color: #fff;
    transition: all 0.3s ease;
}
.nh-pagination .page-numbers:hover {
    background-color: #f5f4ef;
    border-color: #ccc;
}
.nh-pagination .page-numbers.current {
    background-color: #1c2d4f;
    border-color: #1c2d4f;
    color: #fff;
    font-weight: bold;
}
.nh-pagination .page-numbers.dots {
    border: none;
    background: none;
}

/* --- UPDATED: Stat Cards --- */
.nh-stat-card .nh-card-body {
    font-size: 36px;
    font-weight: 700;
}
.nh-card-gauge {
    position: relative;
    max-width: 150px;
    margin: 10px auto 0;
}
.nh-card-gauge canvas {
    width: 100%;
    height: auto;
}
.nh-gauge-label {
    position: absolute;
    top: 65%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 24px;
    font-weight: bold;
    color: #1c2d4f;
}

/* --- UPDATED: Order Card View --- */
.nh-order-card-item {
    display: flex;
    flex-direction: row; /* Changed to row */
    align-items: stretch; /* New */
    gap: 20px;
}
.nh-order-card-thumb {
    flex-shrink: 0;
    width: 100px;
    height: 100px;
}
.nh-order-card-details-wrapper {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

/* --- UPDATED: Progress Bar Colors --- */
.nh-progress-bar-fill.progress-low { background: #e6b02c; } /* Yellow */
.nh-progress-bar-fill.progress-mid { background: #1c2d4f; } /* Dark Navy */
.nh-progress-bar-fill.progress-high { background: #28a745; } /* Green */

/* --- NEW: Application Submission Styles --- */
.nh-open-apply-modal {
    margin-top: 20px;
}
#nh-application-form label .required {
    color: #d9534f;
    font-weight: bold;
    margin-right: 2px;
}
#nh-application-form input[type="file"] {
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    width: 100%;
}
#nh-submit-application-btn {
    width: 100%;
    padding: 12px;
    font-size: 16px;
    background-color: #1c2d4f;
    border-color: #1c2d4f;
}
#nh-submit-application-btn:hover:not(:disabled) {
    background-color: #e6b02c;
    border-color: #e6b02c;
}
.nh-modal-footer {
    display: block; /* Change for single button */
}