/* ============================================
   Poké HUB – Profils & codes d’ami (codes ami / Vivillon)
   Reprend `me5rine-lab-*` du thème (forms, profile, cards, variables).
   Chargé après menu / UM (voir style.css) pour garder la grille + flex des tuiles.
   ============================================ */

/* Empêche .me5rine-lab-card (cartes.css) d’écraser la mise en page code + QR */
.friend-codes-dashboard .user-profiles-friend-code-card.me5rine-lab-card,
.vivillon-dashboard .user-profiles-friend-code-card.me5rine-lab-card,
.um-profile-main-content .user-profiles-friend-code-card.me5rine-lab-card {
    display: flex !important;
    flex-direction: row;
    align-items: flex-start;
    flex-wrap: nowrap;
    gap: 32px;
    box-sizing: border-box;
}

.user-profiles-friend-code-card.me5rine-lab-card:hover {
    transform: none; /* ne pas superposer le translateY des cartes génériques */
}

.friend-codes-dashboard .me5rine-lab-card-list,
.vivillon-dashboard .me5rine-lab-card-list {
    display: grid;
    gap: 20px;
}

.user-profiles-friend-codes-empty {
    text-align: center;
    padding: 40px;
    color: var(--me5rine-lab-text-light, #5D697D);
    font-style: italic;
}

.user-profiles-friend-code-card {
    display: flex;
    gap: 32px;
    align-items: flex-start;
}

.user-profiles-friend-code-content {
    flex: 1;
    min-width: 0;
    padding-right: 8px;
}

@media (min-width: 480px) {
    .user-profiles-friend-code-content {
        padding-right: 16px;
    }
}

.user-profiles-friend-code-header {
    margin-bottom: 10px;
}

.poke-hub-friend-code-value {
    font-family: monospace !important;
    font-size: 1.2em;
    font-weight: 600;
    color: var(--me5rine-lab-secondary, #0485C8);
    margin: 0 10px;
}

.user-profiles-friend-code-username {
    margin-bottom: 10px;
    font-size: 1.1em;
}

.user-profiles-friend-code-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    font-size: 0.9em;
    color: var(--me5rine-lab-text-light, #5D697D);
}

/*
 * Ligne label + (icône + texte) : alignement avec icônes 20px.
 */
.user-profiles-friend-code-meta-item--inline-icon {
    display: inline-flex;
    align-items: stretch;
    flex-wrap: wrap;
    gap: 6px;
}

.user-profiles-friend-code-meta-item--inline-icon > strong {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    min-height: 20px;
    line-height: 1.2;
}

.user-profiles-friend-code-meta-item--inline-icon .user-profiles-friend-code-meta-value {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 20px;
}

.user-profiles-friend-code-meta-item--inline-icon .user-profiles-friend-code-meta-raster {
    display: block;
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    object-fit: contain;
}

.user-profiles-friend-code-meta-item--inline-icon .user-profiles-friend-code-meta-text {
    line-height: 1.25;
}

.user-profiles-friend-code-time {
    margin-top: 10px;
    font-size: 0.85em;
    color: var(--me5rine-lab-text-light, #5D697D);
    font-style: italic;
}

.user-profiles-friend-code-footer {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--me5rine-lab-border, #DEE5EC);
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
}

.user-profiles-friend-code-footer-row {
    display: block;
}

.user-profiles-friend-code-footer-meta {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 8px;
    max-width: 100%;
}

.user-profiles-friend-code-footer .user-profiles-friend-code-time {
    margin-top: 0;
}

.user-profiles-friend-code-footer-sep {
    color: var(--me5rine-lab-text-light, #5D697D);
    font-size: 0.85em;
    opacity: 0.75;
    user-select: none;
}

.user-profiles-friend-code-report-link {
    appearance: none;
    -webkit-appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 5px 12px;
    border: 1px solid var(--me5rine-lab-border, #DEE5EC);
    border-radius: 10px;
    max-width: min(100%, 300px);
    text-align: center;
    white-space: normal;
    background: var(--me5rine-lab-bg-light, #f4f6f8);
    box-shadow: none;
    font-family: inherit;
    font-size: 12px;
    font-weight: 500;
    font-style: normal;
    line-height: 1.25;
    color: var(--me5rine-lab-text, #3d4a5c);
    cursor: pointer;
    text-decoration: none;
    vertical-align: middle;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.user-profiles-friend-code-report-link:hover:not(:disabled):not(.user-profiles-friend-code-report-link--already-reported),
.user-profiles-friend-code-report-link:active:not(:disabled):not(.user-profiles-friend-code-report-link--already-reported),
.user-profiles-friend-code-report-link:focus:not(:disabled):not(.user-profiles-friend-code-report-link--already-reported) {
    color: #fff;
    background: #343a40;
    border-color: #343a40;
    outline: none;
}

.user-profiles-friend-code-report-link:focus-visible:not(:disabled):not(.user-profiles-friend-code-report-link--already-reported) {
    box-shadow: 0 0 0 2px var(--me5rine-lab-bg, #fff), 0 0 0 4px rgba(52, 58, 64, 0.45);
}

.user-profiles-friend-code-report-link:focus:not(:focus-visible):not(:disabled):not(.user-profiles-friend-code-report-link--already-reported) {
    box-shadow: none;
}

.user-profiles-friend-code-report-link:disabled,
.user-profiles-friend-code-report-link.user-profiles-friend-code-report-link--already-reported {
    color: #868e96;
    background: #e9ecef;
    border-color: #ced4da;
    cursor: not-allowed;
    pointer-events: none;
    opacity: 1;
    box-shadow: none;
}

.user-profiles-friend-code-report-link.is-loading:not(.user-profiles-friend-code-report-link--already-reported) {
    opacity: 0.55;
    cursor: wait;
    pointer-events: none;
}

.user-profiles-friend-code-card .poke-hub-friend-code-report-feedback {
    display: block;
    margin: 2px 0 0;
    font-size: 0.8em;
    line-height: 1.35;
    text-align: left;
    max-width: 100%;
}

.poke-hub-friend-code-report-feedback.is-success {
    color: #198754;
}

.poke-hub-friend-code-report-feedback.is-error {
    color: #dc3545;
}

.poke-hub-friend-code-report-feedback.is-info {
    color: var(--me5rine-lab-text-light, #5D697D);
    font-style: italic;
}

.user-profiles-friend-code-hidden-notice {
    margin-bottom: 12px;
}

.user-profiles-friend-code-qr {
    text-align: center;
    flex-shrink: 0;
}

.user-profiles-friend-code-qr-image {
    width: 150px;
    height: 150px;
    border: 1px solid var(--me5rine-lab-border, #DEE5EC);
    border-radius: 4px;
    padding: 10px;
    background: var(--me5rine-lab-bg, #ffffff);
}

.user-profiles-friend-code-qr-caption {
    display: block;
    margin-top: 5px;
    color: var(--me5rine-lab-text-light, #5D697D);
    font-size: 11px;
}

.poke-hub-friend-code-copy {
    background: none !important;
    border: none !important;
    padding: 4px 6px !important;
    margin-left: 8px !important;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--me5rine-lab-text-light, #5D697D);
    transition: color 0.2s ease;
    vertical-align: middle;
    border-radius: 3px;
}

.poke-hub-friend-code-copy:hover {
    color: var(--me5rine-lab-secondary, #0485C8);
    background: var(--me5rine-lab-bg-light, #f8f9fa) !important;
}

.poke-hub-friend-code-copy svg {
    width: 16px;
    height: 16px;
    display: block;
}

.poke-hub-friend-code-copy.copied {
    color: #28a745 !important;
    background: rgba(40, 167, 69, 0.1) !important;
}

.poke-hub-friend-code-copy.copied svg {
    opacity: 1;
}

.user-profiles-friend-code-form-link-confirmation {
    margin-top: 10px;
}

.user-profiles-friend-code-form-link-confirmation .me5rine-lab-form-button {
    display: inline-block;
    margin-top: 0;
    padding: 6px 12px;
    font-size: 13px;
}

.user-profiles-friend-code-form-link-confirmation .me5rine-lab-form-button + .me5rine-lab-form-button {
    margin-left: 10px;
}

.user-profiles-friend-code-form-login-link {
    display: inline-block;
    margin-left: 10px;
    padding: 6px 12px;
    font-size: 13px;
    margin-top: 0;
    text-decoration: none;
}

.user-profiles-friend-code-form-required {
    color: #dc3545;
}

#country.error,
#scatterbug_pattern.error {
    border-color: #dc3545 !important;
    background-color: #fff5f5 !important;
}

.vivillon-validation-error {
    margin-top: 15px;
    margin-bottom: 15px;
}

.user-profiles-friend-code-form-profile-link {
    margin-top: 15px;
    font-size: 0.9em;
    color: var(--me5rine-lab-text-light, #5D697D);
}

.user-profiles-friend-code-form-profile-link a {
    color: var(--me5rine-lab-secondary, #0485C8);
    text-decoration: underline;
}

.country-auto-detected-indicator {
    font-size: 0.85em !important;
}

@media (max-width: 768px) {
    .friend-codes-dashboard .user-profiles-friend-code-card,
    .vivillon-dashboard .user-profiles-friend-code-card {
        flex-direction: column !important;
    }

    .friend-codes-dashboard .user-profiles-friend-code-card > .user-profiles-friend-code-qr,
    .vivillon-dashboard .user-profiles-friend-code-card > .user-profiles-friend-code-qr {
        align-self: center;
    }
}
