/* ==========================================================================
   WCMascotas - Achievements (Insignias de Logros)
   Estilo visual moderno basado en tarjetas
   ========================================================================== */

.wcm-achievements-wrapper {
    max-width: 1100px;
    margin: 0 auto;
    padding: 2rem 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}

.wcm-achievements-wrapper h2 {
    font-size: 2.2rem;
    text-align: center;
    margin-bottom: 0;
    color: #1f1f1f;
}

/* === Barra de Progreso General === */
.wcm-achievements-progress-wrapper {
    width: 100%;
    max-width: 600px;
    text-align: center;
}

.wcm-achievements-progress-bar {
    width: 100%;
    height: 16px;
    background-color: #eee;
    border-radius: 30px;
    overflow: hidden;
    position: relative;
}

.wcm-achievements-progress-fill {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, #42ba96, #2f8f83);
    transition: width 1.2s ease;
}

.wcm-achievements-progress-text {
    font-size: 0.9rem;
    font-weight: 500;
    color: #444;
    margin-top: 0.5rem;
}

/* === Grid de Insignias === */
.wcm-achievements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 2rem;
    width: 100%;
}

/* === Tarjeta de Logro === */
.wcm-achievement-item {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
    text-align: center;
    padding: 1.2rem 1rem;
    position: relative;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    cursor: default;
    opacity: 0;
    transform: scale(0.95);
}

.wcm-achievement-item.wcm-achievement-visible {
    opacity: 1;
    transform: scale(1);
    transition: all 0.4s ease;
}

.wcm-achievement-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}

.wcm-achievement-item img {
    width: 60px;
    height: 60px;
    object-fit: contain;
    margin-bottom: 0.8rem;
}

.wcm-achievement-item h4 {
    font-size: 1rem;
    font-weight: 600;
    color: #222;
    margin: 0 0 0.25rem;
}

.wcm-achievement-item .wcm-achievement-date {
    font-size: 0.8rem;
    color: #666;
    margin-top: 0.2rem;
}

/* === Tooltip moderno === */
.wcm-achievement-item[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: -40px;
    left: 50%;
    transform: translateX(-50%);
    background: #1e1e1e;
    color: #fff;
    padding: 6px 10px;
    font-size: 0.75rem;
    border-radius: 6px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 10;
}

.wcm-achievement-item[data-tooltip]:hover::after {
    opacity: 1;
}

.wcm-achievement-item[data-tooltip]::before {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #1e1e1e;
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 10;
}

.wcm-achievement-item[data-tooltip]:hover::before {
    opacity: 1;
}

/* === Estados === */
.wcm-achievement-item.obtenido {
    border: 2px solid #4CAF50;
}

.wcm-achievement-item.bloqueado {
    filter: grayscale(100%);
    opacity: 0.5;
    border: 2px solid #ccc;
}

/* ==========================================================================
   🏆 POPUP DE LOGRO DESBLOQUEADO EN VIVO
   ========================================================================== */
#wcm-achievement-popup {
    position: fixed;
    top: -200px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    padding: 30px 40px;
    text-align: center;
    opacity: 0;
    transition: all 0.5s ease;
    pointer-events: none;
    width: 90%;
    max-width: 350px;
}

#wcm-achievement-popup.visible {
    top: 80px;
    opacity: 1;
    pointer-events: auto;
}

/* Contenido */
.wcm-popup-contenido {
    position: relative;
}

.wcm-popup-icono {
    width: 70px;
    height: 70px;
    margin: 0 auto 15px;
    background: url("/wp-content/uploads/2025/03/icono-badge-logro.svg") no-repeat center;
    background-size: contain;
    animation: giroBadge 1.2s ease-out forwards;
    filter: drop-shadow(0 0 12px #FFD700);
}

.wcm-popup-titulo {
    font-size: 1.5rem;
    color: #4D2DCE;
    margin-bottom: 8px;
    animation: entradaTexto 0.6s ease-out;
}

.wcm-popup-texto {
    font-size: 1rem;
    color: #333;
    font-weight: 500;
    animation: entradaTexto 0.6s ease-out;
}

/* Animaciones */
@keyframes giroBadge {
    0% { transform: rotate(0deg) scale(0.6); opacity: 0; }
    50% { transform: rotate(180deg) scale(1.1); opacity: 1; }
    100% { transform: rotate(360deg) scale(1); }
}

@keyframes entradaTexto {
    0% { opacity: 0; transform: translateY(20px); }
    100% { opacity: 1; transform: translateY(0); }
}
/* ==========================================================================
   🎉 POPUP DINÁMICO DE LOGROS DESBLOQUEADOS POR QUERY (?logro=)
   ========================================================================== */
.wcm-achievement-popup {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 99999;
    background: #ffffff;
    border-radius: 18px;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.25);
    padding: 30px 25px;
    width: 90%;
    max-width: 340px;
    text-align: center;
    animation: wcmLogroSlideIn 0.5s ease-out;
}

.wcm-achievement-popup .wcm-achievement-icon {
    font-size: 50px;
    margin-bottom: 15px;
    animation: wcmIconBounce 1.2s ease;
}

.wcm-achievement-popup h3 {
    font-size: 1.5rem;
    color: #3b0f94;
    margin-bottom: 6px;
    font-weight: 700;
}

.wcm-achievement-popup p {
    font-size: 1rem;
    color: #444;
    font-weight: 500;
    margin: 0;
}

/* Animaciones */
@keyframes wcmLogroSlideIn {
    0% {
        opacity: 0;
        transform: translateX(-50%) translateY(-40px);
    }
    100% {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

@keyframes wcmIconBounce {
    0% {
        transform: scale(0.7);
        opacity: 0;
    }
    50% {
        transform: scale(1.3);
        opacity: 1;
    }
    100% {
        transform: scale(1);
    }
}
/* ==========================================================================
   🎁 RECOMPENSAS DESBLOQUEADAS (VISUAL DE CUPONES)
   ========================================================================== */
.wcm-achievements-coupons {
    width: 100%;
    max-width: 600px;
    background: #f9f9ff;
    border: 2px dashed #cfcaf1;
    border-radius: 14px;
    padding: 1.5rem;
    margin-top: 1rem;
    text-align: center;
    position: relative;
}

.wcm-achievements-coupons h3 {
    font-size: 1.4rem;
    color: #3a2c87;
    margin-bottom: 1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

/* === Elemento individual de cupón === */
.wcm-coupon-item {
    background: #ffffff;
    border: 1px solid #ddd;
    border-left: 4px solid #4CAF50;
    padding: 0.75rem 1rem 0.6rem 2rem;
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
    color: #333;
    font-weight: 500;
    text-align: left;
    border-radius: 8px;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

/* Parte superior del cupón (texto + código) */
.wcm-coupon-top {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.wcm-coupon-code {
    background: #f1f1f1;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: bold;
    font-family: monospace;
    color: #111;
    display: inline-block;
}

/* Condiciones del cupón */
.wcm-coupon-conditions {
    font-size: 11px;
    color: #777;
    margin-top: 2px;
    padding-left: 2px;
}

/* Si no hay cupones disponibles */
.wcm-achievements-coupons p {
    margin-top: 0.5rem;
    font-size: 0.9rem;
    color: #888;
}

/* Responsive para cupones */
@media screen and (max-width: 600px) {
    .wcm-coupon-item {
        font-size: 0.9rem;
        padding: 0.7rem;
    }

    .wcm-coupon-code {
        font-size: 0.9rem;
    }
}
/* === Ajustes para botón de copiar al costado derecho === */
.wcm-coupon-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.wcm-coupon-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.wcm-coupon-right {
    display: flex;
    align-items: center;
    position: relative;
}

/* Botón copiado mejorado */
.wcm-copy-btn {
    background: #4d2dce;
    color: #fff;
    border: none;
    padding: 6px 16px;
    font-size: 0.8rem;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.3s ease;
    font-weight: 500;
    line-height: 1.2;
    min-width: 85px;
    text-align: center;
}

.wcm-copy-btn:hover {
    background: #3b1bb2;
}

/* Confirmación */
.wcm-copy-confirm {
    position: absolute;
    top: -22px;
    right: 0;
    font-size: 0.7rem;
    color: #4CAF50;
    background: #e7f9ee;
    border-radius: 4px;
    padding: 2px 6px;
    display: none;
    box-shadow: 0 0 4px rgba(0,0,0,0.1);
    white-space: nowrap;
    animation: fadeInOut 2s ease-out;
}

@keyframes fadeInOut {
    0% { opacity: 0; transform: translateY(-5px); }
    20% { opacity: 1; transform: translateY(0); }
    80% { opacity: 1; }
    100% { opacity: 0; transform: translateY(-5px); }
}

/* ==========================================================================
   🎯 Estilos para Elección de Recompensa Final (100%)
   ========================================================================== */
.wcm-achievements-100rewards h3 {
    text-align: center!important;
}
.wcm-100reward-options {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 24px;
    margin-bottom: 30px;
}

.wcm-100reward-card {
    flex: 1 1 220px;
    max-width: 260px;
    background: #fff;
    border: 2px solid #dcd6f7;
    border-radius: 12px;
    padding: 16px;
    text-align: center;
    box-shadow: 0 0 6px rgba(0,0,0,0.06);
    transition: transform 0.2s;
    font-size: 14px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 350px;
}

.wcm-100reward-card:hover {
    transform: translateY(-4px);
}

.wcm-100reward-card h4 {
    font-size: 1rem;
    color: #3b2a7f;
    margin-bottom: 0.4rem;
}

.wcm-100reward-card p {
    font-size: 0.85rem;
    color: #555;
    margin-bottom: 1rem;
}

/* Botón de selección */
.wcm-reward-select-btn {
    background: #4CAF50;
    color: white;
    border: none;
    padding: 0.5rem 1.1rem;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.wcm-reward-select-btn:hover {
    background: #45a049;
}

.wcm-reward-disabled {
    opacity: 0.6;
    pointer-events: none;
    filter: grayscale(100%);
}

.wcm-reward-selected {
    background: #3b2a7f !important;
    color: #fff;
    font-weight: bold;
    cursor: default;
}

/* 💡 Estilo visual para cupón mostrado */
.wcm-coupon-preview {
    display: none;
    margin-top: 14px;
    padding: 12px;
    background: #fdfaff;
    border: 2px dashed #7a4ddd;
    color: #3b2a7f;
    border-radius: 10px;
    font-size: 0.85rem;
    text-align: center;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    line-height: 1.4;
    position: relative;
    box-shadow: 0 0 0 2px #fdfaff inset;
}

.wcm-coupon-preview span {
    font-weight: bold;
    font-size: 1.1rem;
    display: block;
    margin-bottom: 6px;
    letter-spacing: 1px;
}

.wcm-coupon-preview button {
    margin-top: 5px;
    font-size: 0.75rem;
    background: #7a4ddd;
    color: white;
    border: none;
    padding: 5px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.wcm-coupon-preview button:hover {
    background: #6842c2;
}