/* GamiPress Rewards Manager - Frontend Styles */

/* Botón de canje */
.grm-redeem-button {
    display: inline-block;
    border: none;
    cursor: pointer;
}

.grm-redeem-button:hover {
    border-color: var(--e-global-color-primary);
    ;
}

.grm-redeem-button:disabled {
    background: #ccc;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.grm-redeem-button.processing {
    position: relative;
    color: transparent;
}

.grm-redeem-button.processing::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: grm-spin 0.8s linear infinite;
}

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

/* Información de stock */
.grm-stock-info {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 4px;
    margin: 10px 0;
    font-size: 14px;
    font-weight: 600;
}

.grm-stock-available {
    color: #4caf50;
    background: #e8f5e9;
    padding: 4px 12px;
    border-radius: 4px;
    display: inline-block;
}

.grm-stock-unavailable {
    color: #f44336;
    background: #ffebee;
    padding: 4px 12px;
    border-radius: 4px;
    display: inline-block;
}

.grm-stock-info::before {
    content: '📦';
    margin-right: 5px;
}

/* Información de puntos */
.grm-points-info {
    display: inline-block;
    padding: 8px 16px;
    background: #f5f5f5;
    border-radius: 4px;
    margin: 10px 0;
    font-size: 14px;
    color: #666;
}

.grm-points-info strong {
    color: #333;
    font-weight: 600;
}

.grm-points-cost {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 4px;
    color: #856404;
    font-weight: 600;
    margin: 5px 0;
}

.grm-points-cost::before {
    content: '★';
    margin-right: 5px;
    font-size: 16px;
}

/* Contenido del premio (ACF award field) */
.grm-reward-award-content {
    background: #f8f9fa;
    border-left: 4px solid #667eea;
    padding: 15px;
    margin: 15px 0;
    border-radius: 4px;
}

.grm-reward-award-content strong {
    color: #667eea;
    display: block;
    margin-bottom: 10px;
}

/* Lista de premios del usuario */
.grm-user-rewards {
    margin: 20px 0;
}

.grm-reward-item {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.grm-reward-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.grm-reward-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.grm-reward-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.grm-reward-status {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.grm-reward-status.pending {
    background: #ff9800;
    color: #fff;
}

.grm-reward-status.approved {
    background: #4caf50;
    color: #fff;
}

.grm-reward-status.delivered {
    background: #2196f3;
    color: #fff;
}

.grm-reward-status.cancelled {
    background: #f44336;
    color: #fff;
}

.grm-reward-body {
    color: #666;
    line-height: 1.6;
}

.grm-reward-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
    margin-top: 15px;
}

.grm-reward-meta-item {
    display: flex;
    align-items: center;
    font-size: 14px;
}

.grm-reward-meta-item strong {
    margin-right: 5px;
    color: #333;
}

.grm-reward-meta-item span {
    color: #666;
}

/* Notificaciones */
.grm-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    max-width: 400px;
    padding: 16px 20px;
    background: #fff;
    border-left: 4px solid;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    animation: grm-slide-in 0.3s ease;
}

@keyframes grm-slide-in {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.grm-notification.success {
    border-left-color: #4caf50;
}

.grm-notification.error {
    border-left-color: #f44336;
}

.grm-notification.warning {
    border-left-color: #ff9800;
}

.grm-notification.info {
    border-left-color: #2196f3;
}

.grm-notification-close {
    position: absolute;
    top: 8px;
    right: 8px;
    background: none;
    border: none;
    font-size: 20px;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    line-height: 1;
}

.grm-notification-close:hover {
    color: #333;
}

/* Filtros de estado */
.grm-status-filters {
    display: flex;
    gap: 10px;
    margin: 20px 0;
    flex-wrap: wrap;
}

.grm-status-filter {
    padding: 8px 16px;
    background: #f5f5f5;
    border: 2px solid transparent;
    border-radius: 4px;
    color: #666;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    font-weight: 500;
}

.grm-status-filter:hover {
    background: #e9e9e9;
}

.grm-status-filter.active {
    background: #fff;
    border-color: #667eea;
    color: #667eea;
}

/* Mensaje vacío */
.grm-empty-message {
    text-align: center;
    padding: 40px 20px;
    color: #999;
    font-size: 16px;
}

.grm-empty-message::before {
    content: '🎁';
    display: block;
    font-size: 48px;
    margin-bottom: 15px;
}

/* Widget de awarts del usuario */

.grm-user-rewards-list .date {

    padding: 0 20px;
    border-left: 1px solid var(--e-global-color-primary);
    border-right: 1px solid var(--e-global-color-primary);

}

.grm-user-rewards-list .points-status {

    color: var(--e-global-color-primary);
    text-align: end;
    font-weight: 600;
    font-size: 24px;
    line-height: 1;

}


/* Widget de puntos del usuario */
.grm-user-points-widget {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    margin: 20px 0;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.grm-user-points-widget h3 {
    margin: 0 0 10px 0;
    font-size: 16px;
    opacity: 0.9;
}

.grm-user-points-widget .points {
    font-size: 36px;
    font-weight: bold;
    margin: 10px 0;
}

/* Responsive */
@media screen and (max-width: 768px) {
    .grm-reward-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .grm-reward-meta {
        grid-template-columns: 1fr;
    }

    .grm-notification {
        left: 20px;
        right: 20px;
        max-width: none;
    }

    .grm-status-filters {
        justify-content: center;
    }
}

/* Animaciones de carga */
.grm-loading {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid rgba(102, 126, 234, 0.3);
    border-top-color: #667eea;
    border-radius: 50%;
    animation: grm-spin 1s linear infinite;
    margin: 20px auto;
}

.grm-loading-container {
    text-align: center;
    padding: 40px;
}

/* Shortcode container */
.grm-rewards-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Badge de nuevo */
.grm-new-badge {
    display: inline-block;
    padding: 2px 8px;
    background: #f44336;
    color: #fff;
    font-size: 10px;
    font-weight: bold;
    border-radius: 3px;
    text-transform: uppercase;
    margin-left: 8px;
    letter-spacing: 0.5px;
}