/* ==========================================================================
   Unified Dashboard & Saved Listings Styles
   Merged from user-dashboard.css & saved-listings.css
   ========================================================================== */

/* ==========================================================================
   Page Layout & Containers
   ========================================================================== */

.user-listings-dashboard,
.nbf-saved-page {
    max-width: 1200px;
    margin: 0 auto;
}

/* ==========================================================================
   Dashboard Header
   ========================================================================== */

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 15px;
}

.dashboard-header h2,
.dashboard-header h5 {
    margin: 0;
    font-size: 24px;
    color: #2d3748;
}

.add-new-listing-btn {
    background: #222F52;
    color: white !important;
    padding: 10px 20px;
    border-radius: 25px;
    text-decoration: none;
    transition: background 0.3s;
    display: inline-block;
}

.add-new-listing-btn:hover {
    background: #A88757;
    color: white;
}

/* ==========================================================================
   Guest Banner (Saved Listings)
   ========================================================================== */

.nbf-guest-banner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px;
    background: #fef9ec;
    border-radius: 8px;
    padding: 16px 20px;
    margin-bottom: 28px;
}

.nbf-guest-text {
    flex: 1;
    margin: 0;
    font-size: 14px;
    color: #4a3700;
    line-height: 1.55;
}

/* ==========================================================================
   Buttons (Shared)
   ========================================================================== */

.nbf-btn,
.button,
.button-primary,
.button-small {
    display: inline-block;
    padding: 9px 20px;
    border-radius: 22px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
    border: none;
    line-height: 1.4;
    text-align: center;
}

.nbf-btn-primary,
.button-primary {
    background: #222F52;
    color: #fff !important;
}

.nbf-btn-primary:hover,
.button-primary:hover {
    background: #A88757;
    color: #fff !important;
}

.nbf-btn-secondary,
.button-secondary {
    background: #fff;
    color: #222F52 !important;
    border: 1.5px solid #222F52;
}

.nbf-btn-secondary:hover,
.button-secondary:hover {
    background: #222F52;
    color: #fff !important;
}

.button-small {
    padding: 5px 10px;
    font-size: 12px;
    border-radius: 4px;
}

/* ==========================================================================
   Toolbar (Saved Listings)
   ========================================================================== */

.nbf-saved-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
}

.nbf-saved-count {
    font-size: 14px;
    color: #718096;
    font-weight: 500;
}

.nbf-saved-controls {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.nbf-saved-select {
    padding: 7px 12px;
    border: 1px solid #cbd5e0;
    border-radius: 6px;
    font-size: 13px;
    background: #fff;
    color: #2d3748;
    cursor: pointer;
}

.nbf-saved-select:focus {
    outline: none;
    border-color: #222F52;
    box-shadow: 0 0 0 3px rgba(34, 47, 82, 0.1);
}

/* ==========================================================================
   Loading States (Shared)
   ========================================================================== */

.nbf-saved-loading,
.nbf-saved-loading {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 40px 20px;
    color: #718096;
    font-size: 15px;
    justify-content: center;
}

.nbf-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #e2e8f0;
    border-top-color: #222F52;
    border-radius: 50%;
    animation: nbf-spin 0.7s linear infinite;
    flex-shrink: 0;
}

@keyframes nbf-spin {
    to { transform: rotate(360deg); }
}

/* ==========================================================================
   Empty States (Shared)
   ========================================================================== */

.nbf-saved-empty,
.no-listings {
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.nbf-empty-heart {
    font-size: 56px;
    line-height: 1;
    margin-bottom: 16px;
    opacity: 0.35;
}

.nbf-empty-text {
    font-size: 15px;
    color: #718096;
    max-width: 380px;
    margin: 0 auto;
    line-height: 1.6;
}

.no-listings p {
    font-size: 15px;
    color: #333;
    margin-bottom: 10px;
}

/* ==========================================================================
   Cards Grid (Shared)
   ========================================================================== */

.listings-container,
.nbf-saved-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

/* ==========================================================================
   Listing Card (Dashboard)
   ========================================================================== */

.listing-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
}

.listing-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

.listing-card-header {
    display: flex;
    padding: 20px;
    gap: 20px;
    border-bottom: 1px solid #EDF3F8;
}

.listing-thumbnail {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 8px;
}

.listing-thumbnail.placeholder {
    background: #edf2f7;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    border-radius: 8px;
}

.listing-info {
    flex: 1;
}

.listing-info h3,
.listing-info h4 {
    margin: 0 0 8px 0;
    font-size: 20px;
    color: #2d3748;
}

.listing-meta {
    display: flex;
    gap: 12px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.listing-type {
    background: #ebf8ff;
    color: #2b6cb0;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.listing-status {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.status-publish {
    background: #c6f6d5;
    color: #22543d;
}

.status-pending {
    background: #fefcbf;
    color: #744210;
}

.status-draft {
    background: #e2e8f0;
    color: #4a5568;
}

.listing-location,
.listing-whatsapp {
    font-size: 14px;
    color: #718096;
    margin-top: 4px;
}

/* Highlight cards that are pending payment */
.listing-card:has(.pay-listing) {
    border-left: 2px solid #A88757;
}

/* ==========================================================================
   Listing Stats (Dashboard)
   ========================================================================== */

.listing-stats {
    display: flex;
    gap: 30px;
    padding: 15px 20px;
    background: #EDF3F8;
    border-bottom: 1px solid #EDF3F8;
}

.stat {
    display: flex;
    gap: 8px;
    font-size: 14px;
}

.stat-label {
    color: #718096;
}

.stat-value {
    font-weight: 600;
    color: #2d3748;
}

/* ==========================================================================
   Listing Actions (Dashboard)
   ========================================================================== */

.listing-actions {
    display: flex;
    gap: 10px;
    padding: 15px 20px;
    flex-wrap: wrap;
}

.listing-actions .button,
.listing-actions .edit-listing,
.listing-actions .view-promotions,
.listing-actions .delete-listing,
.listing-actions .pay-listing {
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    border: none;
    transition: all 0.2s;
    background: #f0f0f0;
    color: #333;
}

.listing-actions .edit-listing {
    background: #222F52;
    color: white;
    font-weight: 600;
}

.listing-actions .edit-listing:hover {
    background: #A88757;
}

.listing-actions .view-promotions {
    background: white;
    color: #222F52;
    font-weight: 600;
}

.listing-actions .view-promotions:hover {
    background: #A88757;
    color: white;
}

.listing-actions .delete-listing {
    background: white;
    color: #222F52;
    font-weight: 600;
}

.listing-actions .delete-listing:hover {
    background: #000000;
    color: white;
}

.listing-actions .pay-listing {
    background: white;
    color: #222F52;
    font-weight: 600;
}

.listing-actions .pay-listing:hover {
    background: #A88757;
    color: white;
}

.listing-actions .pay-listing:disabled {
    background: #c9ab80;
    cursor: not-allowed;
}

/* ==========================================================================
   Saved Listings Card
   ========================================================================== */

.nbf-saved-card {
    position: relative;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s, box-shadow 0.2s;
}

.nbf-saved-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0,0,0,0.12);
}

.nbf-saved-body {
    padding: 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nbf-saved-name {
    margin: 0;
    font-size: 17px;
    font-weight: 700;
    color: #1a202c;
    line-height: 1.3;
}

.nbf-saved-badge {
    display: inline-block;
    background: #ebf8ff;
    color: #2b6cb0;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: capitalize;
    align-self: flex-start;
}

.nbf-saved-location {
    margin: 0;
    font-size: 13px;
    color: #718096;
    display: flex;
    align-items: center;
    gap: 4px;
    line-height: 1.4;
}

.nbf-icon-pin {
    width: 14px;
    height: 14px;
    fill: #A88757;
    flex-shrink: 0;
}

.nbf-saved-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: auto;
    padding-top: 8px;
}

.nbf-saved-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    font-weight: 600;
    padding: 5px 11px;
    border-radius: 20px;
    text-decoration: none;
    transition: background 0.18s, color 0.18s;
    line-height: 1.3;
}

.nbf-saved-link svg {
    width: 13px;
    height: 13px;
    flex-shrink: 0;
    fill: currentColor;
}

.nbf-saved-link--wa {
    background: #e8f5e9;
    color: #2e7d32 !important;
}

.nbf-saved-link--wa:hover {
    background: #25D366;
    color: #fff !important;
}

.nbf-saved-link--web {
    background: #e8eaf6;
    color: #3949ab !important;
}

.nbf-saved-link--web:hover {
    background: #3949ab;
    color: #fff !important;
}

.nbf-saved-link--dir {
    background: #fff3e0;
    color: #e65100 !important;
}

.nbf-saved-link--dir:hover {
    background: #e65100;
    color: #fff !important;
}

.nbf-saved-remove {
    position: absolute;
    top: 10px;
    right: 10px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: none !important;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    padding: 4px 12px;
    font-size: 11px !important;
    font-weight: 600 !important;
    color: #222f52 !important;
    cursor: pointer;
    line-height: 1.3;
    transition: background 0.18s, color 0.18s, border-color 0.18s;
    backdrop-filter: blur(4px);
}

.nbf-saved-remove svg {
    width: 14px;
    height: 14px;
    fill: currentColor;
    flex-shrink: 0;
}

.nbf-saved-remove:hover {
    background: #fff;
    color: #e53e3e;
    border-color: #e53e3e;
}

/* ==========================================================================
   Dashboard Notices
   ========================================================================== */

.dashboard-notice {
    padding: 12px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    animation: slideDown 0.3s ease;
}

.notice-success {
    background: #c6f6d5;
    color: #22543d;
    border-left: 4px solid #38a169;
}

.notice-error {
    background: #fed7d7;
    color: #742a2a;
    border-left: 4px solid #e53e3e;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================================================
   Modal Styles (Dashboard)
   ========================================================================== */

.dashboard-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
}

.modal-container {
    position: relative;
    background: white;
    border-radius: 12px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    z-index: 1;
    animation: modalSlideUp 0.3s ease;
}

.promotions-modal-container {
    max-width: 900px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 0px solid #e2e8f0;
}

.modal-header h3 {
    margin: 0;
    font-size: 20px;
}

.modal-close {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #a0aec0;
    padding: 0;
    line-height: 1;
}

.modal-close:hover {
    color: #4a5568;
}

.modal-body {
    padding: 20px;
}

@keyframes modalSlideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================================================
   Form Styles (Modal)
   ========================================================================== */

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #2d3748;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #cbd5e0;
    border-radius: 6px;
    font-size: 14px;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #2b6cb0;
    box-shadow: 0 0 0 3px rgba(43,108,176,0.1);
}

.form-row {
    display: flex;
    gap: 15px;
}

.form-group.half {
    flex: 1;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
}

.char-count {
    font-size: 12px;
    color: #718096;
    margin-top: 4px;
}

.char-count .over-limit {
    color: #e53e3e;
}

/* ==========================================================================
   Promotions Table (Dashboard)
   ========================================================================== */

.promotions-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 30px;
}

.promotions-table th,
.promotions-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #EDF3F8;
}

.promotions-table th {
    background: #f7fafc;
    font-weight: 600;
    color: #4a5568;
}

.promotion-category-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    text-transform: capitalize;
}

.promotion-category-badge.rates {
    background: #bee3f8;
    color: #2c5282;
}

.promotion-category-badge.promotion {
    background: #fefcbf;
    color: #744210;
}

.promotion-category-badge.event {
    background: #e9d8fd;
    color: #553c9a;
}

.promotion-status {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.status-published {
    background: #c6f6d5;
    color: #22543d;
}

.status-pending {
    background: #fefcbf;
    color: #744210;
}

.delete-promotion {
    background: #e53e3e;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
}

.delete-promotion:hover {
    background: #c53030;
}

/* ==========================================================================
   Add Promotion Section
   ========================================================================== */

.add-promotion-section {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid #e2e8f0;
}

.add-promotion-section h4 {
    margin: 0 0 20px 0;
    font-size: 18px;
    color: #2d3748;
}

#quick-promotion-message {
    margin-top: 15px;
}

#quick-promotion-message .success-message {
    padding: 10px;
    background: #c6f6d5;
    color: #22543d;
    border-radius: 6px;
}

#quick-promotion-message .error-message {
    padding: 10px;
    background: #fed7d7;
    color: #742a2a;
    border-radius: 6px;
}

.no-promotions {
    text-align: center;
    padding: 40px;
    color: #718096;
}

/* ==========================================================================
   Login Required (Dashboard)
   ========================================================================== */

.user-dashboard-login-required {
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: 12px;
}

.user-dashboard-login-required p {
    font-size: 18px;
    color: #718096;
    margin-bottom: 20px;
}

/* ==========================================================================
   Responsive Styles
   ========================================================================== */

@media (max-width: 768px) {
    .listing-card-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .listing-stats {
        flex-direction: column;
        gap: 10px;
        align-items: center;
    }
    
    .listing-actions {
        flex-direction: column;
    }
    
    .listing-actions .button {
        width: 100%;
        text-align: center;
    }
    
    .form-row {
        flex-direction: column;
    }
    
    .promotions-table {
        display: block;
        overflow-x: auto;
    }
    
    .dashboard-header {
        flex-direction: column;
        text-align: center;
    }

    .nbf-saved-toolbar {
        flex-direction: column;
        align-items: flex-start;
    }

    .nbf-saved-controls {
        width: 100%;
    }

    .nbf-saved-select {
        flex: 1;
    }

    .nbf-guest-banner {
        flex-direction: column;
        align-items: flex-start;
    }

    .nbf-btn {
        flex: 1;
        text-align: center;
    }
}