/* =================================================================
   My Network Listings dashboard page
   Loaded by igniter.php's enqueue_additional_assets()
   (handle: bip-my-network-listings).

   Replaces:
   - Bootstrap 5 (.modal, .form-control, .btn, .mb-3, etc.)
   - 3 separate inline <style> blocks
   - 30+ inline style attributes
   ================================================================= */

/* =================================================================
   LISTINGS TABLE (top of page)
   ================================================================= */
.bip-wc-content span,
.bip-wc-content a,
.bip-wc-content button,
.bip-wc-content td {
    font-family: 'Outfit';
    font-size: 16px;
}
.bip-wc-content table th,
.bip-wc-content table td {
    padding: 10px 12px;
    border: none !important;
    border-bottom: 1px solid #d5d8dc !important;
    text-align: left;
    vertical-align: middle;
    /* Keep cell content on a single line by default — exceptions below. */
    white-space: nowrap;
}
.bip-wc-content table td a { color: #000 !important; }
.bip-wc-content table th {
    font-weight: 600;
    color: #000;
}

/* Title column (2nd col, after the # index): only column that wraps,
   capped at 250px so long business names don't blow the layout out. */
.bip-my-network-listings table th:nth-child(2),
.bip-my-network-listings table td:nth-child(2) {
    max-width: 250px;
    white-space: normal;
    word-break: break-word;
}

/* Actions column: stack the Links + Edit buttons in a row, not stacked. */
.bip-my-network-listings table td .bip-btn-sm + .bip-btn-sm {
    margin-left: 6px;
}
.bip-my-listings .draft,
.bip-my-network-listings .draft {
    color: #000;
    background: #00000020;
    padding: 2px 10px;
    border-radius: 50px;
}
.bip-my-listings .publish,
.bip-my-network-listings .publish {
    color: #00a72c;
    background: #00a72c20;
    padding: 2px 10px;
    border-radius: 50px;
}

/* =================================================================
   PENDING SUBMISSION FORMS
   ================================================================= */
.bip-pending-forms { margin-top: 100px; }
.bip-pending-forms-heading {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    flex-direction: column;
    gap: 12px;
    font-size: 20px;
    font-weight: 600 !important;
    color: #000;
    margin-bottom: 15px;
}
.bip-pending-forms-count {
    font-size: 14px;
    font-weight: 500 !important;
    background: #27a5dd;
    color: #fff;
    padding: 2px 12px;
    border-radius: 50px;
}
.bm-form-instance {
    position: relative;
    margin: 25px auto;
    padding: 15px;
    border: 1px dashed #ccc;
    border-radius: 6px;
    background: #fff;
    max-width: 800px;
}
.bm-form-instance-header {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}
.bm-form-instance-header h5 {
    display: inline-flex;
    align-items: self-start;
    gap: 10px;
    margin: 0;
}
.bm-form-instance-header h5 span {
    margin-top: 0;
    font-weight: 400 !important;
    font-size: 22px;
}
@media (max-width: 767px) {
    .bip-pending-forms-heading { font-size: 16px; }
}

/* Modal chrome (.bip-modal) — see assets/css/bip-modal.css.
   Buttons (.bip-btn-primary, .bip-btn-secondary, .bip-btn-success,
   .bip-btn-danger, .bip-btn-ghost) — see assets/css/bip-ui.css. */

/* Loading spinner overlay (used inside an open modal) */
.bm-loading-image {
    z-index: 9999;
    position: fixed;
    top: 30%;
    left: calc(50% - 50px);
    display: none;
}
.bm-loading-image img {
    width: 100px;
    height: 100px;
}

/* =================================================================
   EDIT LISTING FORM (#network-listing-edit-form)
   Visual treatment intentionally mirrors the main submission form
   (.bm-business-submisssion-form in business-form.css) — same label
   weight/size, same input border/radius/spacing, same focus color.
   ================================================================= */
.bm-edit-form .field { margin-bottom: 0; }

.bm-edit-form label {
    display: block;
    font-weight: 500 !important;
    margin-bottom: 10px;
    font-size: 20px;
    color: #1a1a1a;
}
.bm-edit-form label small {
    font-weight: 400;
    color: #888;
    font-size: 14px;
    margin-left: 4px;
}
.bm-edit-form .help-text {
    margin-bottom: 15px;
    display: block;
    font-size: 14px;
    color: #555;
}
.bm-edit-form .label-required::after {
    content: '*';
    color: red;
    margin-left: 4px;
}

.bm-edit-form input[type="text"],
.bm-edit-form input[type="tel"],
.bm-edit-form input[type="email"],
.bm-edit-form input[type="url"],
.bm-edit-form textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid lightgray !important;
    border-radius: 5px !important;
    background: #fff;
    font-size: 16px;
    color: #222;
    font-family: inherit;
    box-sizing: border-box;
    margin-bottom: 20px;
}
.bm-edit-form input::placeholder,
.bm-edit-form textarea::placeholder {
    color: #aaa;
}
.bm-edit-form input:focus,
.bm-edit-form textarea:focus {
    border-color: #1590C5 !important;
    outline: none;
}
.bm-edit-form input[readonly] {
    background: #f5f5f5;
    cursor: not-allowed;
}
.bm-edit-form textarea {
    resize: vertical;
    min-height: 140px;
}

/* "Content" field header: label text + AI button on the right */
.bm-edit-form .content-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-bottom: 10px;
}
.bm-edit-form .content-header > label { margin-bottom: 0; }
.bm-edit-form .content-header label small {
    font-size: 14px;
    font-weight: 400;
    color: #888;
}

/* Business hours grid */
.bm-edit-form .hours-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 12px;
}
.bm-edit-form .hours-row .day {
    min-width: 110px;
    font-weight: 500 !important;
    font-size: 16px;
    color: #333;
    margin: 0;
}
.bm-edit-form .hours-row input[type="text"] {
    width: 220px;
    flex: 0 0 auto;
    margin-bottom: 0;
}
.bm-edit-form .hours-row .closed-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 400 !important;
    font-size: 15px;
    margin: 0;
}
.bm-edit-form .hours-row .closed-label input[type="checkbox"] {
    margin: 0;
}

/* Services field: label + custom-heading input on the same row */
.bm-edit-form .services-label {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}
.bm-edit-form .services-label input[type="text"] {
    flex: 1 1 200px;
    width: auto;
    margin-top: 0;
    margin-bottom: 0;
    font-size: 15px;
    padding: 8px 10px;
}

/* Save button: full-width, brand-blue, larger to match the form weight */
.bm-edit-form #submit-edits-btn {
    margin-top: 10px;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 600;
}

/* =================================================================
   AI DESCRIPTION BUTTON (gradient border + text)
   Identical visual to the submission form's button — kept here so
   the edit modal still has the animation without depending on
   business-form.css being loaded on this page.
   ================================================================= */
.bm-generate-business-description-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 12px !important;
    font-weight: 600;
    font-size: 15px;
    color: #fff;
    background: rgba(255, 255, 255, 0.08) !important;
    backdrop-filter: blur(12px);
    border-radius: 12px;
    border: 1px solid transparent !important;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.3s ease;
    z-index: 1;
}
.bm-generate-business-description-btn::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 2px;
    background: linear-gradient(90deg, #27A5DD, #3BB6EA, #F472B6, #EC4899, #3BB6EA, #27A5DD);
    background-size: 400% 400%;
    animation: borderFlow 10s linear infinite;
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    z-index: -1;
}
.bm-generate-business-description-btn span,
.bm-generate-business-description-btn i {
    background: linear-gradient(90deg, #27A5DD, #3BB6EA, #F472B6, #EC4899, #3BB6EA);
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    animation: textFlow 10s ease infinite;
    background-size: 400% 400%;
}
.bm-generate-business-description-btn:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.08) !important;
}
.bm-generate-business-description-btn:active { transform: translateY(0); }
.bm-generate-business-description-btn.fast::before {
    animation: borderFlow 2s linear infinite !important;
}
.bm-generate-business-description-btn.fast span,
.bm-generate-business-description-btn.fast i {
    animation: textFlow 2s ease infinite !important;
}
@keyframes borderFlow {
    0%   { background-position: 0% 50%; }
    50%  { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}
@keyframes textFlow {
    0%   { background-position: 0% 50%; }
    50%  { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* =================================================================
   IMAGE UPLOAD GRID (was inline in <style>)
   ================================================================= */
.np-uploaded-images-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 10px 0;
}
.np-uploaded-image {
    position: relative;
    width: 100px;
    height: 100px;
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid #ddd;
    background: #f5f5f5;
}
.np-uploaded-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 4px;
}
.np-uploaded-image .np-img-preview-pill {
    position: absolute;
    top: 4px;
    left: 4px;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 3px;
    color: #b9bcbf;
    font-size: 14px;
    line-height: 1;
    padding: 0;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
    transition: none;
}
.np-uploaded-image.is-preview .np-img-preview-pill {
    color: #1590c5;
    cursor: default;
}
.np-uploaded-image .np-img-remove {
    position: absolute;
    top: 4px;
    right: 4px;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    background: red !important;
    color: #fff !important;
    font-size: 16px;
    font-weight: bold;
    line-height: 1;
    border: 0;
    padding: 0;
    border-radius: 3px;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
    transition: none;
}
.np-uploaded-image .np-img-remove:hover,
.np-uploaded-image .np-img-remove:focus,
.np-uploaded-image .np-img-remove:active {
    background: red !important;
    color: #fff !important;
}
.np-uploaded-image.np-uploading { opacity: 0.5; }
.np-uploaded-image.np-uploading::after {
    content: 'Uploading...';
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    background: rgba(0, 0, 0, 0.5);
    font-size: 13px;
}
.np-upload-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}
#np_uploaded_images_status {
    font-size: 14px;
    color: #666;
}
#np_uploaded_images_error {
    margin-top: 8px;
    color: #c00;
    font-size: 14px;
}

/* =================================================================
   SAVE NOTICE (top-right toast after edit save)
   ================================================================= */
#np_save_notice {
    display: none;
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 100000;
    padding: 12px 18px;
    background: #e6f7ee;
    color: #0e7a3a;
    border: 1px solid #b6e6c8;
    border-radius: 6px;
    font-weight: 500;
    font-size: 15px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
    pointer-events: none;
}
#np_save_notice i { margin-right: 8px; }

/* =================================================================
   NETWORK LINKS LIST (inside the Links modal)
   ================================================================= */
.network-links-group {
    list-style: decimal;
    margin: 0;
    padding-left: 22px;
    line-height: 1.8;
}
.network-links-group a {
    color: #1590C5;
    text-decoration: none;
    word-break: break-all;
}
.network-links-group a:hover { text-decoration: underline; }

/* =================================================================
   RESPONSIVE
   ================================================================= */
@media (max-width: 767px) {
    .bm-edit-form .hours-row input[type="text"] { width: 100%; }
}
