/**
 * MappCanada User Profiles & Favorites
 * Styles for user profile tabs, favorites button, verification badges,
 * profile stats, and saved items grid.
 *
 * Design tokens match MappCanada's existing CSS variable system.
 * Responsive: 1-col mobile → 2-col tablet → 3-col desktop.
 */

/* =========================================================================
   Verification Badges
   ========================================================================= */

.mc-verified-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.6;
    vertical-align: middle;
    white-space: nowrap;
}

.mc-verified-badge--seller {
    background: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #a5d6a7;
}

.mc-verified-badge--business {
    background: #e3f2fd;
    color: #1565c0;
    border: 1px solid #90caf9;
}

.mc-verified-badge__icon {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

/* =========================================================================
   Profile Stats Bar
   ========================================================================= */

.mc-profile-stats {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
    padding: 16px 0;
    border-top: 1px solid #e8e8e8;
    border-bottom: 1px solid #e8e8e8;
    margin: 16px 0;
}

.mc-profile-stats__item {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 60px;
}

.mc-profile-stats__num {
    font-size: 1.5rem;
    font-weight: 700;
    color: #c0392b;
    line-height: 1;
}

.mc-profile-stats__num--sm {
    font-size: 0.9rem;
}

.mc-profile-stats__label {
    font-size: 0.75rem;
    color: #666;
    margin-top: 2px;
    text-align: center;
}

/* =========================================================================
   Profile Tab Container
   ========================================================================= */

.mc-profile-tab {
    padding: 16px 0;
}

/* =========================================================================
   Profile Filter Bar (status filter on own posts)
   ========================================================================= */

.mc-profile-filter {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.mc-profile-filter__btn {
    display: inline-block;
    padding: 6px 16px;
    border: 1px solid #ddd;
    border-radius: 20px;
    font-size: 0.85rem;
    color: #333;
    text-decoration: none;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
    white-space: nowrap;
}

.mc-profile-filter__btn:hover {
    background: #f5f5f5;
    border-color: #bbb;
}

.mc-profile-filter__btn--active {
    background: #c0392b;
    border-color: #c0392b;
    color: #fff;
}

/* =========================================================================
   Profile Grid (3-up card layout)
   ========================================================================= */

.mc-profile-grid,
.mc-saved-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    margin-top: 8px;
}

@media (min-width: 600px) {
    .mc-profile-grid,
    .mc-saved-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .mc-profile-grid,
    .mc-saved-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* =========================================================================
   Post Card (My Listings / My Jobs / My Services)
   ========================================================================= */

.mc-post-card {
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

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

.mc-post-card__thumb-link {
    display: block;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    background: #f5f5f5;
}

.mc-post-card__thumb-link--placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
}

.mc-post-card__thumb-placeholder {
    font-size: 2.5rem;
    line-height: 1;
    opacity: 0.35;
}

.mc-post-card__thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.mc-post-card__thumb-link:hover .mc-post-card__thumb {
    transform: scale(1.04);
}

.mc-post-card__body {
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}

.mc-post-card__title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #1a1a1a;
    text-decoration: none;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.mc-post-card__title:hover {
    color: #c0392b;
}

.mc-post-card__meta {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    font-size: 0.8rem;
    color: #666;
}

.mc-post-card__price {
    font-weight: 700;
    color: #c0392b;
}

/* =========================================================================
   Status Badge
   ========================================================================= */

.mc-status {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    align-self: flex-start;
}

.mc-status--active {
    background: #e8f5e9;
    color: #2e7d32;
}

.mc-status--pending {
    background: #fff8e1;
    color: #f57f17;
}

.mc-status--draft {
    background: #f5f5f5;
    color: #757575;
}

/* =========================================================================
   Post Card Actions (Edit / Delete)
   ========================================================================= */

.mc-post-card__actions {
    display: flex;
    gap: 8px;
    margin-top: auto;
    padding-top: 10px;
    border-top: 1px solid #f0f0f0;
}

.mc-post-card__action-btn {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.15s ease;
}

.mc-post-card__action-btn--edit {
    background: #f0f4ff;
    color: #1565c0;
    border: 1px solid #bbdefb;
}

.mc-post-card__action-btn--edit:hover {
    background: #bbdefb;
}

.mc-post-card__action-btn--delete {
    background: #fdecea;
    color: #c0392b;
    border: 1px solid #ffcdd2;
}

.mc-post-card__action-btn--delete:hover {
    background: #ffcdd2;
}

/* =========================================================================
   Profile Empty / Private States
   ========================================================================= */

.mc-profile-empty,
.mc-profile-private,
.mc-saved-empty {
    padding: 32px;
    text-align: center;
    color: #999;
    font-size: 0.95rem;
    border: 1px dashed #ddd;
    border-radius: 10px;
    background: #fafafa;
}

/* =========================================================================
   Profile Pagination
   ========================================================================= */

.mc-profile-pagination {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 24px;
}

.mc-profile-pagination__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.85rem;
    color: #333;
    text-decoration: none;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.mc-profile-pagination__btn:hover {
    background: #f5f5f5;
}

.mc-profile-pagination__btn--active {
    background: #c0392b;
    border-color: #c0392b;
    color: #fff;
}

/* =========================================================================
   Saved Items Section Headings
   ========================================================================= */

.mc-saved-section {
    margin-bottom: 32px;
}

.mc-saved-section__title {
    font-size: 1rem;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0 0 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid #c0392b;
    display: inline-block;
}

/* =========================================================================
   Saved Card (mirrors post card but slightly simpler)
   ========================================================================= */

.mc-saved-card {
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

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

.mc-saved-card__thumb-link {
    display: block;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    background: #f5f5f5;
}

.mc-saved-card__thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.mc-saved-card__thumb-link:hover .mc-saved-card__thumb {
    transform: scale(1.04);
}

.mc-saved-card__body {
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mc-saved-card__title {
    font-size: 0.9rem;
    font-weight: 600;
    color: #1a1a1a;
    text-decoration: none;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.mc-saved-card__title:hover {
    color: #c0392b;
}

/* =========================================================================
   Favorite Button
   ========================================================================= */

.mc-favorite-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: none;
    border: 1px solid #ddd;
    border-radius: 20px;
    padding: 5px 12px;
    cursor: pointer;
    font-size: 0.82rem;
    color: #666;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
    line-height: 1;
}

.mc-favorite-btn:hover {
    background: #fdecea;
    border-color: #ffcdd2;
    color: #c0392b;
}

.mc-favorite-btn--active {
    background: #fdecea;
    border-color: #e57373;
    color: #c0392b;
}

.mc-favorite-btn__heart {
    width: 16px;
    height: 16px;
    fill: currentColor;
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    flex-shrink: 0;
}

/* Heart pop animation on toggle */
.mc-favorite-btn--animating .mc-favorite-btn__heart {
    transform: scale(1.4);
}

.mc-favorite-btn__count {
    font-variant-numeric: tabular-nums;
}

/* =========================================================================
   Toast Notifications
   ========================================================================= */

#mc-toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.mc-toast {
    padding: 10px 18px;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    color: #fff;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.25s ease, transform 0.25s ease;
    pointer-events: none;
    max-width: 320px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.mc-toast--visible {
    opacity: 1;
    transform: translateY(0);
}

.mc-toast--success { background: #2e7d32; }
.mc-toast--error   { background: #c0392b; }
.mc-toast--info    { background: #1565c0; }

/* =========================================================================
   Login Prompt Popup
   ========================================================================= */

.mc-login-prompt-popup {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 10px;
    padding: 16px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    min-width: 220px;
    max-width: 280px;
}

.mc-login-prompt-popup__msg {
    font-size: 0.875rem;
    color: #333;
    margin: 0 0 10px;
}

.mc-login-prompt-popup__btn {
    display: inline-block;
    padding: 7px 16px;
    background: #c0392b;
    color: #fff;
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    transition: background 0.15s ease;
}

.mc-login-prompt-popup__btn:hover {
    background: #a93226;
}

.mc-login-prompt-popup__close {
    position: absolute;
    top: 8px;
    right: 10px;
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: #999;
    line-height: 1;
    padding: 0;
}

.mc-login-prompt-popup__close:hover {
    color: #333;
}
